query_id
string
corpus_id
string
query
string
code
string
label
int64
e1011c058bc54d2ddd08b2928ccab65a
60182eae4eff9954c65cfc7c5c63860b
Delete ProductUnit from database.
class UnitsController extends Controller public function destroy(Unit $unit) { Unit::destroy($unit->id_unit); return redirect('/products')->with('status', 'Data berhasil dihapus'); }
0
ba4dd2a39e70d014c13dd1312822a3a9
5f4710dc62219cae9485546221c9383c
Computes the table that maps ids to their words.
rows = open(str(wordid_path)).read().strip().split("\n") labelMappings = {} for row in rows: (wordId, label, hrLabel) = row.split(" ") labelMappings[wordId] = int(label)-1 return labelMappings
0
bfefd544990676176398f57c9341adab
d82766b2651a3dbc73a5cc40db423fc4
增加批量上传记录
$record = [ 'member_id' => !empty($this->member['id'])?$this->member['id']:0, 'admin_id' => !empty($this->administrator['id'])?$this->administrator['id']:0, 'extension' => !empty($info['type'])?str_replace('.','',$info['type']):'', 'original_name' => !empty($info[...
0
8247766a996b4af344acb23fb37947b6
ebe72cdce5f2c2996f96484a6bae8b4e
Function to apply a body frame transformation to a 6D pose.
body_mapping_pose = np.array([body_pose[2], body_pose[7], body_pose[8], eye, body_pose[9], body_pose[10], eye, body_pose[11], body_pose[12], body_pose[1], eye, eye , eye, eye, eye, body_pose[0], body_pose[3], body...
0
8fe15adf271019cf2e2a2f1466364c3b
1c4cb33e3b2b2632bf960603c85c0137
Dash radiobuttons object wrapper
export class DWRadioButton extends DwFormElement(LitElement) static get properties() { return { checked: { type: Boolean }, disabled: { type: Boolean }, name: { type: String }, value: { type: String }, global: { type: Boolean }, reducedTouchTarget: { t...
1
6a3538feed8e8750dee9a2ceb51e1855
ee48faaaaf394a04793167e087f6f102
mp_pigdxm 목록을 조회한다. (pageing)
List selectMpPigkxmList(MpPigkxmDefaultVO searchVO) throws Exception;
0
7b515d94cd06c23daa3fb495c2166f0c
328c10b34c7caa0a930aa45c532888c6
Creates a new Permission object. Note that the newly created permission is not added to the RBAC system yet. You must fill in the needed data and call [[add()]] to add it to the system.
class Role implements RoleInterface public function __construct($name, $perms = []) { $this->setName($name); foreach($perms as $perm) { $this->addPerm($perm); } }
0
17e256dd8f19746148d54af852ae636a
188b4ec6c3b90d810b1d5e1ae92862e0
Create expression to add instance to disposal scope
internal class DisposalTrackingMiddleware : IResolveMiddleware public void Execute(ResolveRequestContext context, Action<ResolveRequestContext> next) { next(context); if (context.Registration.Ownership == InstanceOwnership.OwnedByLifetimeScope) { if (context.Instance is IDisposab...
1
c2b3d347ae49457bfda0781f65fdbc8e
a3aa1172d7a6e516238cf679f7a08da9
Retrieves all values of a dynamic module entry instance as a compiled array.
public function getValueAsArray($resource_locator);
1
aef1169428acf6e2f69a97f821ac8259
199028f428e2f2de86ffc954fd2a5e05
Получение записей гостевой книги Получение из БД записей гостевой книги по параметрам Параметры могут быть all,row,count
$bo = $this->getBlockObject(); $c = Page::getCurrentPage(); return GuestBookBlockEntry::getAll($this->bID, $c->getCollectionID(), $order); }
1
3fb46af9890a5123a2affcea64e6758c
0d7eb617fc3d7bc222d92bb795bea09f
Unicode representation of the credit provider.
class CreditCardIdentificationCreditCard(object): def __repr__(self): return self.to_str()
0
91794c5c806b313251efa402c71d7220
9317f1f1c1b071dd2a2f3a28b6aba6de
数据持久化的方法基类。
abstract class AbstractPersistence public function save (DataClass $dataObj, ClassDesc $clsDesc = null) { if (null == $clsDesc) { $clsDesc = DescFactory::Instance()->getDesc(get_class($dataObj)); } $status = $this->getPropertyVal($dataObj, 'mDataObjectExistingStatus'); $oldExistingStatus = $dataObj->mDataObj...
1
ed8903d9fdcd4bf766cbd0aa1ceb647e
cdc5831e41e27c76128f88ddedd61e69
Return the number of ten-pairs within positive integer n.
def count_num(n, x): if n <= 0: return 0 return (n%10 == x) + count_num(n//10, x) if n < 10: return 0 return ten_pairs(n//10)+count_num(n//10, 10-(n%10))
1
d1644b2ef40bcfef995b83aedca3c36a
a4be5611f9edb4124dbf647fe68d20b8
maps azimuthal angle to led number, based on the MAtrix Creator LED allignment
if ( (x >= kMatrixWidth) || (y >= kMatrixHeight) ) { return (LAST_VISIBLE_LED + 1); } const uint8_t XYTable[] = { 245, 244, 243, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 242, 241, 240, 246, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 247, 39, 38, 37, 36, 35, 3...
1
3aae2ccaaeb49f380f10af7b5010224f
72948197a884f2eff6619d5f8dcc5aee
Функция открытия всех мин на карте
public class MinesweeperGameState public void openAllMines(){ board.openAllMines(); }
1
c88bce498f5be0450d04683ffb46ad22
264f0ee5b599763a6511e670ad1b6949
Get step priority
public function getPriority(): int { return $this->priority; }
1
e5117ff4c726114a4e2c9abe8eb2445c
ee9f6a39fa00651e993ae90ca7489a2d
<p> Tests whether the specified event pattern matches the provided event. </p> <p> Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns s...
int result = NEUTRAL; if (keyToMatch != null && valueToMatch != null) { if (event.getMDC(keyToMatch)==null) { if (this.includeEmpty==true) { result = ACCEPT; } else { result = NEUTRAL; } } else { boolean anyMatch = false; if (this.valueToMatch.contains((Char...
1
5331a3a6d34a555b1b294846976a97f3
323452fbcfc5fe30eb2f49aa00df6ff3
r"""Select the periods with peak powers above the cutoff power.
def _select_by_property(peak_properties, pmin, pmax): keep = np.ones(peak_properties.size, dtype=bool) if pmin is not None: keep &= (pmin <= peak_properties) if pmax is not None: keep &= (peak_properties <= pmax) return keep
0
b129340f5079ab14948e3b3557dc730b
01cf78fb6ee0e54377716943e4bf98ff
================================= Plot Function ==============================
def plot(x, y, X): fn = "Times New Roman" plt.xlabel("$x [m]$", fontsize=20, fontname=fn) plt.ylabel("$y [m]$", fontsize=20, fontname=fn) plt.plot(x, y,"-g",lw=5,label="link") plt.plot(x, y,"or",lw=5, ms=10,label="joint") plt.plot(X[0], X[1],"ob",lw=5, ms=10) plt.xlim(-1.2,1...
1
cf10b0e395377b6697000b68197aa38f
fa3e4d9830b093ee2481616cf7ea8e47
Agrega un pasajero al vector pasaj
if (name === undefined) { console.info('Por favor indica un nombre de pasajero'); return; } var found = false, count = 0; do { found = passengers[count].name === name; count++; } while(!found || count - 1 > passengers.le...
0
0d608d642a70ad521c1aae19f98f7a74
33787cbc6c9716dcd4f1a6b5d4642b36
ラスターデータを地図サーバからダウンロードする
vela_url = "http://portal.navocean.com/data/VELA_log.json" if DEBUG: print("get_url()...") out_dir = "/data/gandalf/deployments/geojson" response = wget.download(vela_url, out=out_dir)
0
905c0c721aee8a2b2010a9e782df9a08
b03be8d95309921d9a407be997622a91
根据id获取相应领导联系人
namespace SiteServer.Customize.Core.Data OrgLeaderInfo GetOrgLeaderInfo(int id);
1
11d734c4993da993856bbdbff0fa8b5b
a8eeccfbb1f322d4ec494c7932bb830a
Termine le tracking des changements de l'entité
namespace Prototype.Entities [Serializable] public class DependentCollection : ObservableCollection<Dependent>, IEditableObject public void StartTracking() { this.trackChanges = true; }
0
dba25f4c2fb14edaaf3d8e5beaf70f64
9cfec0424b35524aeb4e9e033d55f27a
根据委托书号,结算ID 查询明细中LIST
{ Doc_WfdddrsBLL bll = new Doc_WfdddrsBLL(); return bll.GetCYQZTZSList(wfsaid, ddid); }
1
892ab31a2d8ba3b315332d68b185a858
175c7980cb0da6a533eed48918ae3cec
创建X、Y、Z方向的箭头,作为参考坐标系。
Geometry xAxis = createGeometry(new Arrow(Vector3f.UNIT_X), ColorRGBA.Red, false); xAxis.setName("X-axis"); Geometry yAxis = createGeometry(new Arrow(Vector3f.UNIT_Y), ColorRGBA.Green, false); xAxis.setName("Y-axis"); Geometry zAxis = createGeometry(new Arrow(Vector3f.UNIT_Z), Co...
1
28871e8587552691f18e2a8f4800f5f9
64fea02e1da42b29d48b797d53a9a7e3
ignore tags
class IpParser(HTMLParser): def __init__(self): self.handledtags = ['td'] self.processing = None self.found_td = 0 self.outt = "" HTMLParser.__init__(self)
1
b199ef911577fc467b78fb4871cb7704
8f5b900acbf26399b340599a601cea65
Checks if NetworkManager is currently opening a network connection.
public class NetworkManager public boolean isNetworkingEnabled() { return mContinueNetworking; }
0
68957773b1661de0db5c5f85b349ba0c
af7d3501ccf0e5c17043d3fe4baaa70c
从满减中移除商品
function removeUnderGooods() { $(".fh-btn").click(function() { var me = this; var cart_id = $(me).parents(".container").attr("cart_id"); $.ajax({ type: 'get', url: WapSiteUrl + "/api/index.php?act=buyer_cart&op=del", data: { ...
0
7151d63f77a3a86e4af1f3f722745d5c
c20413d2c91210fef508149387c7364e
! Filter users down to those that are part of the specified tenant. Then add them to the `userHashes` array
this.tenantsWithDetails = []; if(tenantIds && tenantIds.length){ tenantIds.forEach(tenInTierItem => { this.allTenants.forEach(element => { if(tenInTierItem == element['value']){ this.tenantsWithDetails.push(element); ...
0
7ad0f6745a2c830fbdadb9b04e5a5738
d07d9f9ee2a61b179b5cc8536e3f0cbe
Replaces the current character with the next character typed.
namespace PSConsoleUtilities public class PSConsoleReadLine public static void ForwardChar(ConsoleKeyInfo? key = null, object arg = null) { if (_singleton._current < _singleton._buffer.Length) { _singleton._current += 1; _singleton.PlaceCursor(); ...
0
79f81689379ce267f4471c916af2c637
657e86af7375eda09bfc933885d0a8b6
Получение полей записей из таблицы с указанием имени нужного поля записи, значения которого будут получены, массива c 2-мя именами полей, по которым должен производиться поиск и массива соответствующих им значений для поиска
final class GenericDao implements IGenericDao public function getItemsLike(string $search, array $filds): array { $sql = "SELECT * FROM $this->tableInUse WHERE "; $data = array(); foreach ($filds as $fild) { $data[] = $fild . " LIKE '%" . $search . "%'"; } $sql = ...
0
188b46d0c402ae43cf7f71f7ecace5f7
b721630c414f0149840d3973d2826ef6
Si on stocke un doublon, il n'apparaît pas, seul le premier est renvoyé
public class MainActivity extends AppCompatActivity implements AsyncReponse public void SuppressionDoublons(){ HashSet<String> hashSet = new HashSet<String>(); hashSet.addAll(AlistHistorique); AlistHistorique.clear(); AlistHistorique.addAll(hashSet); }
1
2627e5f73db9744722e70f0fe524696f
17903434934ee82521b19309f037c0bb
Swaps the clicked piece with the empty spot, if it's movable (see isMovable)
namespace PuzzleWindows internal class PuzzleGameEngine internal void Change(int touchedIndex) { if(GetEmptyIndex()/4==touchedIndex/4&& (GetEmptyIndex() == touchedIndex - 1 || GetEmptyIndex() == touchedIndex + 1) || GetEmptyIndex() == touchedIndex ...
1
cbab9f9813adac01bb20f2cd9262b2c5
3eb60c2fcc81323026cbd7eec46c4d5a
load saved stories of user from server
isDataChanged = true viewModel.fetchStoryDetails(userId).observe(viewLifecycleOwner, { when (it.status) { Status.statusSuccess -> { story_loader.visibility = View.GONE mStoryList.clear() if (it.data != null) { ...
1
d9ba60ef21da1981c95ee8707a644d04
0d1450aaaa836dd0d3a380f3bcc1ba4f
返回一些在填写卫生检疫表时需要自动显示的数据
{ if (!string.IsNullOrWhiteSpace(lbChubuzhenduan.Text)) { PanelrdAcuteST.Visible = true; } if (string.IsNullOrWhiteSpace(txtUrokinaseOther.Text)) { this.qitaNiaoJiMei.Visible = false; } else { this.qitaNiaoJiMei.Visible = true; } if (rblCPR.Text == "有") { this.panetxtC...
1
37b7dc7d9709764d4845766ac7db4957
4c88a4f96d609dbd150f5fe19aae59d2
Get the standartized central moment
class Collection def central_moment(k) n = @array.size sum(differences_power_n(k)).fdiv(n-1) end
0
0371723fd4c6c59e40681a67feebe7c5
47139586fc0274fae5b4b76e2dd119c5
싱글턴* 인스턴스를 복제할 수 없도록 복제 메소드를 private으로 제한
class DB final public function __clone() { throw new Exception("this instance is singleton class."); }
1
6d15c25989f517d191d5433ad63d9729
0624950c92e58e02153809fb8e47fe9c
use insertion sort to sort the pixels in the picture array
function setup() { createCanvas(can.w, can.h/2) frameRate(10) background(0) stroke(255) strokeWeight(1) sorted = createImage(img.width, img.height) sorted.loadPixels() img.loadPixels() for (let i = 0; i < sorted.pixels.length; i++) { sorted.pixels[i] = img.pixels[i] } ...
0
30b549042001e30f6454fb5cd40ead98
8c9e2d78753d2e32b425309921b820e5
编辑套餐,同时需要更新和检查组的关联关系
@RestController @RequestMapping("/setmeal") public class SetmealController @RequestMapping("/edit") public Result edit(@RequestBody Setmeal setmeal ,Integer[] checkgroupIds){ try { setmealService.edit(setmeal,checkgroupIds); } catch (Exception e) { e.printStackTrace(); ...
1
74782d78bcd659736b1709d0f3c4a99b
cc83689637375ace87fa499a7310bb81
指定したパーツのTipsのテキストを変更する
public class Progress : IProgress public void SetTips(string text) { if (tipsLabel != null) tipsLabel.text = text; }
1
ea89aca435b7eb94a31c9992888d2eab
a694aa8ac7bbf4cd6c6e11fb9526a835
4.d Calculate the average monthly average temperature
class Thertometer double averageTemperatureForMonth(int month, int year) { double sum = 0; int count = 0; if (referenceDay.month == month && referenceDay.year == year) { for (int d = referenceDay.day; d <= sizeMonth[month - 1];) { if (count == 0) { for (int k = referenceDay.hour; k <= 24...
1
0c35f4ae9b277fbc9a811473b6e8da84
f5d08aaa3946208617cce0d65362a2b7
添加View依附、解除依附监听
{ byte ret=EarthView_World_Spatial_Atlas_ISpatialControl_addViewListener_ev_bool_IViewListener_NoVirtual(this.NativeObject, object.Equals(ref_externalListener, null) ? IntPtr.Zero : ref_externalListener.NativeObject); return Convert.ToBoolean(ret); }
1
3c318990f8d47a9458b4b546694e6c27
8b8d91f7ec5deb0aea79b7bc6ff3eddd
get fanin cone size of idx-th PO
{ int x = (idx & 1) ? (idx ^ 1) : idx; if (value[x] == -1) return -1; return (idx & 1) ? !value[x] : value[x]; }
0
4d5a663f33abf01e85d57bf57ab90b2d
2b3f2fca18af3c90e387e80ac0c32949
Builds real room outside wall corners around floor.
public class Room extends GridObject public void buildWalls(){ Point topLeft = new Point(getTopLeftPoint()); for (int i = topLeft.x; i < topLeft.x + getWidth(); i++) { Board.getBoard().getSquare(i, topLeft.y - 1).setOutDown(false); Board.getBoard().getSquare(i, topLeft.y).setOutUp(false); Board.getBoar...
1
23418686f6601fa7887bfccd08cf4d8b
650614a5fb39b829fa01087a4c105f2e
Get the IP address and the host name of the system running this webUI. The IP may not be the same if webui runs behind a web server, which would likely use localhost.
@Controller @SelectedTab(value= SelectedTab.Tabs.Settings) public class AdminController extends AbstractUiController private Map<String,String> getServerIPAndHost(HttpServletRequest request) { Map<String,String> hostAddressModel = new HashMap<String,String>(); try { InetAddress addr = InetAddres...
1
3f203d7796d25ac2decfe9e5a48e1149
4212a2278f7c9427cbacbd84e732bf2b
# -------------------- # prints the name of the user given the id. also makes it an email link.
$c_user_id = db_prepare_int( $p_user_id ); if ( NO_USER == $p_user_id ) { return; } $t_username = user_get_name( $p_user_id ); if ( user_exists( $p_user_id ) && user_get_field( $p_user_id, 'enabled' ) ) { $t_email = user_get_field( $p_user_id, 'email' ); print_email_link_with_subject( $t_email, $t_us...
1
241f6843315a8b70b0520698d7e0fef1
e4741cb12749eb3393880679b7275627
Download multiple files from your Bucket.
$downloaded_files = []; foreach ($files as $filepath => $filename) { $local_path = $this->localDir . '/' . $filepath; if (dirname($local_path) != '.') { $this->prepareLocalDir(dirname($local_path)); } try { $this->client->getObject([ 'Bucket' => $this->bucket, ...
1
b157186acfaf27cb9634582690181a9d
896a52200d8acc75110bce3ecd415ced
Find an option by label from OptionStatement
Symbol mname = new Symbol(name, ":"); Object obj = get(mname); return (obj instanceof LabeledStatementNode) ? (LabeledStatementNode) obj : null; }
0
1492fbf83e9557f390a19e5ffd9695db
644588864ae4c9e781fe8070f9853745
Setting head of linked list to NULL
LinkedList::LinkedList() { head = NULL; }
1
486fd761f82576df5330637917dd9af6
82ce292a92eb7c2cc9e76588306b87c8
32-bit floating point signal divided by constant.
VR4300DIVd(struct VR4300 *vr4300) { const struct VR4300RFEXLatch *rfexLatch = &vr4300->pipeline.rfexLatch; struct VR4300CP1 *cp1 = &vr4300->cp1; const union VR4300CP1Register *fs = &cp1->regs[GET_FS(rfexLatch->iw)]; const union VR4300CP1Register *ft = &cp1->regs[GET_FT(rfexLatch->iw)]; union VR4300CP1Register...
0
b0cecfb94451b34ee537d0bc827133fc
707f2fae61a5f104f6b896dd121e4a91
用起始經緯度以及長寬方格數來建立方格
function grid(lat,lng,level=1){ var g = []; var unit_x = 0.01; var unit_y = (50/60)/100; if(level==1){ unit_x = unit_x * 100; unit_y = unit_y * 100; }else if(level==2){ unit_x = unit_x * 10; unit_y = unit_y * 10; }else if(level==3){ unit_x = unit_x * 5; ...
0
63a5e151a79226742af53624f0ddf19b
b4963dbfd08c35b59a0c4f3ef73e3000
Mutator method for Hall Number
public class Hall public void setId(int id) { this.id = id; }
1
5eb8b37b8d5e128944bb9efaa23dd992
edfb5933d95438e0d4209fa0689db98a
Adding objects to interactions list. Base Add To Interactions Function. Can be overriden.
[RequireComponent(typeof(InteractableBase))] public class Burner : MonoBehaviour void Start() { interactableComponent = GetComponent<InteractableBase>(); interactableComponent.AddInteractionToList("Place On Burner", PlacedOnBurner); }
1
7dd2e81fd0db11ca036a63f6e39ed02b
a72ebde262075942f76d23d2fcee78ec
Sets the player text (i.e. PLAYER 1 or PLAYER 2)
{ if(newID == P1) { player1.setText(String.format("%10s",newName)); } else if(newID == P2) { player2.setText(String.format("%10s",newName)); } }
1
33eb47fc3d013eea690c6a5d285f4b7a
e90f314f6959be2082f00ea06b4c60e2
@brief 点point关于点center的对称点
public class PointUtil public static Point getCentralSymmetry(double px, double py, double cx, double cy) { double x = 2 * cx - px; double y = 2 * cy - py; return new Point(x, y); }
1
eadf9e657d923d6f20f63313b66737d4
c976cb157b9a4880b7c17d9e02fb2d86
Возвращает url на страницу просмотра проекта
class Project(models.Model): def get_absolute_url(self): return reverse("projects:projects_detail", kwargs={"id": self.id})
1
1e6ed54f054de0aac3f50791dffa43da
61fc941833631c83caa4d8b05c3e74ae
Either read straight from an analog pin or off the multiplexer
int Mooglesp_Pin::analogRead() { if (m_mode == INPUT || m_mode == INPUT_PULLDOWN || m_mode == INPUT_PULLUP) { m_analogIO.setPinNumber(m_pinNumber); m_value = m_analogIO.analogRead(); return m_value; } return -1; }
1
cc2b4568aeb5fe9f39d7eda44d406bd1
f5617ba7986fcf5dc71947c9c3db9a11
Parse and build all persistence unit infos defined in the specified XML file(s).
persistence_load() { xmlDocPtr doc; gchar *filename = dia_config_filename("persistence"); persistence_init(); if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { g_free (filename); return; } doc = xmlDiaParseFile(filename); if (doc != NULL) { if (doc->xmlRootNode != NULL) { xmlNsPtr na...
1
bae12aa4fe73436948166fe7f9a7f007
c2842d9fc2a7c29f0a9271f7acffb959
Calculates the CH index for the clusters.
{ float s = 0.0; vector<float> S(Samples.size()); for (size_t i = 0; i < Samples.size(); i++) { float a = 0.0; float b = 0.0; vector<float> B(m_k, 0); vector<float> C(m_k, 0); for (Sample other : Samples) { B[other.cluster] += m_dissimilarityRule->calculateDissi...
1
45089eef5272572bdfef582a488bf27a
51f85ea49445c023f73a19e9eca42220
This method scores the angles and chooses the best one. The angle that is the best allows the user to walk the furthest. could be facing after the reset. that the user will now face.
public class Scanner public void scanTo(int limitAngle) { _maxLight = 0; int angle; motor.rotateTo(limitAngle, true); int Light = _eye.getLightValue(); while (motor.isMoving()) { int newLight = _eye.getLightValue(); angle = motor.getTachoCount(); if (newL...
1
f5bce7322a2d550d9dd6df5ba62562f2
1c292c60fcaf8c5087e64cedfbf820c9
Set 日志保留时长。
public class ModifyBackupConfigRequest extends AbstractModel{ public void setBinlogExpireDays(Long BinlogExpireDays) { this.BinlogExpireDays = BinlogExpireDays; }
1
2196af49cd5b7da8a45f93f87211be66
425435b4b11d14e5ef4b9e52da2f6659
Set-up the I2C device as master and configure it to a baudrate of 100.000
{ fd = fopen (MQX_I2C_DEV, NULL); if (fd == NULL) { return I2C_FALSE; } ioctl (fd, IO_IOCTL_I2C_SET_MASTER_MODE, NULL); return I2C_OK; }
0
0eb562c3c92058b06f25690b44607476
22939f71972409b74b078382c255a946
Customized project process preparation that results in an <see cref="ProcessStartInfo"/> instance.
{ return new Process { StartInfo = { FileName = executablePath, WorkingDirectory = workingDirectory, CreateNoWindow = true, RedirectStandardOutput = true, } ...
1
6bcd3a1b98b3a2e65b3306e8647e3219
95ecf582d822f011b553b67d60988a64
根据templete获得指定原子, 返回计算二面角用的四个原子.
@Component("tMtyAtomService") @SuppressWarnings("rawtypes") public class TMtyAtomService extends CommonService public List listAll(String templetId) { return mapper.listAll(templetId); }
0
c24b3ef8547c8a22d6b91d4a70aa4f32
6b65f763090b05d20bf045f15f2f0df3
cria Accordion (menu com as cidades e filiais)
{ var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i < acc.length; i++) { acc[i].onclick = function() { this.classList.toggle("active"); var panel = this.nextElementSibling; if (panel.style.display === "block") { panel.style.display = "none"; ...
1
2c8efaf4149480e161c5335f9291a179
9d70155bba7f4bb433ffe764d2ef64f1
function to brighten images with an inputted brightness coefficient
def brightnessEnhancement(root_path, img_name): image = Image.open(os.path.join(root_path, img_name)) enh_bri = ImageEnhance.Brightness(image) brightness = 1.5 image_brightened = enh_bri.enhance(brightness) return image_brightened
1
e577a487d919eca472bc7059b27499b1
0461bbb92b55c74e02c7e64609655e29
增加多本书籍
void Administrator::addBook() { int num; cout << "请问您想添加几种图书?"; cin >> num; if (num >= 1) { for (int i = 1; i <= num; i++) { auto book = new Book(i); string Book = book->IntoString(1); ofstream ofs; ofs.open("books.txt", ios::out); ofs ...
1
3718b968b859d3a0bd03521ecfaee8c4
781f0cc86f77229b640fbf39fd20e37c
Waits asynchronously for the process to exit.
namespace Microsoft.VisualStudioTools.Infrastructure sealed class ProcessOutput : IDisposable public void Wait() { if (_process != null) { _process.WaitForExit(); OnExited(this, EventArgs.Empty); } }
0
b2c84bb3b967bacc52fa0a7195fe10bf
f146b4c0b726a8f71070f8ae9a56fe64
Intercepts and returns the next key the user enter.
public class TextGame public void getInput() { System.out.println("Next"); System.out.print(">"); String output = scanner.nextLine(); updateKeys(output); }
0
5598743e74e558a9c59b760e5c378557
e3b9e3483a5004e2cfc45f027baef16d
能耗趋势ajax数据获取
function initEnergyTypeData(){ var data = $("#searchTools").serialize()+"&orgId="+$("#orgId").val(); $.ajax({ url: _web + '/third/fgs/energyDetail', type: 'post', async: true, data:data, dataType: "json", success: function(result) { if(result.flag){ ...
1
3e1f5fbb6100d24ce650266c9cf49dbb
e26af4ac18015ce3afdaaf1a3ce6ff0b
returns 0 if k not in m, 1 if k in m
{ for (int i=0; i<size && x[i] == k; i++) return i; return 0; }
0
26b13a3022fb1623905918918a064cd2
51b2cd3996afca256152beea2512c090
从本地加载分享图片
public class CaseDetailFragment extends Fragment implements OnClickListener private void loadLocalPic() { Drawable d = Drawable.createFromPath(CaseData.current().picPath); if (d != null) { pic.setImageDrawable(d); } int w = CommonUtils.dip2px(getActivity(), 100); RelativeLayout.LayoutParams lp = new Layout...
1
07dcf56604a765b3afb1dccf7bc99649
eeba43a7e81a634fe8a2b650c4860065
Récupération des itérations avec les livraisons, utilisateurs, profils et liaisons permettant de savoir si ces dernières sont actives ou non
global $DB; $result=0; $today=time(); $users_id=self::getUsersForActivation($today); $activated=self::toggleUserAccounts($users_id,true); $schedules_id=self::getSchedulesIdForExpiration($today); $expired=self::markScheduleAsExpired($schedules_id); $users_id=self::getUsersIdForDeactivation($today); $de...
0
3330d2fd9c17d4bd115bf43d3a80a479
127ed9d679a7734829cd444c731fc708
Selects item and shows pop-up dialog to choose quantity of selected goods
namespace CaloryCalculator class ViewModel : INotifyPropertyChanged private void CallQuantityWindow() { View.DishQuantity dishQuantity = new View.DishQuantity(); dishQuantity.ShowDialog(); }
1
58f7f15ead1402a200c36e694d7edf47
3652f05ee912ec1011869206c4d55c61
Factory method that returns OS-dependent LCU polling code.
isdnctlpoll (dev_t dev, int events, struct lwp *l) { return (ENODEV); }
0
e15f4a615350563484c8af241d5e6a57
764961e03490a526e77c4caca11b231a
according to pin number calculate the corresponding port to toggle
uint8_t pinMask(int pinOut) { uint8_t pinMaskVal=1; pinMaskVal=pinMaskVal<<pinOut; return pinMaskVal; }
0
a8cb961851ac3ec3596caa1b5cd03bb6
434a5f5bdf9fa6c6ef49b8ddcd656298
Creates a new vector containing "length" number of random bits
static bool cmd_rng_vector_generate(nrf_cli_t const * p_cli, size_t argc, char ** argv) { ret_code_t ret; char * p_arg_end; size_t output_size; var_t * p_vector_var; UNUSED_PARAMETER(p_cli); CLI_ARGS_CHECK(argc == 3); p_arg_end = NULL; output_size = (size_t)strtol(argv...
1
e346eba0f92db9e70dc3d9626a7e5cd5
23653ac56d7b106829fdddae32cd0680
This function is used to remove elements from circular buffer
int cbuffer_remove(cbuffer f, CBUFFER_ELEMENTTYPE *px) { assert(f); assert(f->area); if( cbuffer_empty(f) ) return -1; f->size--; #ifdef CBUFFER_USEPOINTERS *px = *(f->front++); #elif defined(CBUFFER_USEINTEGERS) *px = f->area[f->front++]; #endif ADJUST_LIMITS(front,f); return 0;...
1
bfd7e7614bf87f3b5a566d5d3f09952a
b7a71001f0c5e94db80c9a2b4a9f5cfe
Group shap values into feature category groups
def _s2group(s_cf, group_defs, n_treatments): group_assignments = [] for t_id in range(n_treatments): assigment_vec = tf.zeros_like(s_cf[:, 0]) for i, gd in enumerate(group_defs): if t_id == gd.t: l1 = tf.greater(s_cf[:, gd.t], gd.lower) u1 = tf.less...
1
de5a2142c4f588c6dcf95a57d7afa2d4
e71b4ce4d6320a0250737b518a88e669
Check if torpedo is ready to lunch
{ if (timeToNextShot <= 0) return true; else return false; }
1
a4c703362d24b7c097521e48515f1977
dd12b684338213dc1a615112a0dcc7e6
backward iteration: compute new control policy around nominal beliefs and control inputs
xs, ts, u_noms, u_perts, V_dot_rs = data m = u_noms.shape[1] a_hats = [a_hat(x_train, t_train) for x_train, t_train in zip(xs, ts)] b_hats = [b_hat(x_train, t_train) for x_train, t_train in zip(xs, ts)] grad_Vs = [grad_V(x_train, t_train) for x_train, t_train in zip(xs, ts)] eta_jacs = [eta_jac(x_train, t_train...
1
0a099411a5d7f310a074678518541c50
d4d0a065df7a8ccb3843d059f7c86d4c
Signs a message with an RSA PrivateKey and hash method
def sign(message, priv_key, hash): if hash not in HASH_ASN1: raise ValueError('Invalid hash method: %s' % hash) asn1code = HASH_ASN1[hash] hash = _hash(message, hash) cleartext = asn1code + hash keylength = common.byte_size(priv_key.n) padded = _pad_for_signing(cleartext, keylength) ...
1
e9c2c6edcdb15b4007ced5d340d4e771
e56e938e036bebc58b5ad964640d1b8e
Finds a node with minimum weight in collection.
t = [None, float('inf')] for node in nodes: if G[node]['seen']==0 and G[node]['weight'] < t[1]: t[0] = node t[1] = G[node]['weight'] return(t[0])
1
bd8ea826b72c316c0784c1e6834ff4f5
e3065cd333f9c1bbb64de58dfb9d1947
GoogleMaps drag ended event handler. Updates the associated trackevent after the drag has ended.
class MapboxMap : MapTransformDelegate, MapProjectionDelegate, MapFeatureQueryDelegate, MapListenerDelegate, MapPluginExtensionsDelegate, MapCameraManagerDelegate override fun dragEnd() { checkNativeMap("dragEnd") nativeMap.dragEnd() }
0
f3e866c1ad4977e5e87fc7c92924ac2f
15bd53ed0e666eabe2bb3f1e281224ae
use of function without use of return command
def print_fun(): print("Geeks","For","Geeks")
1
945ef0f0c701764e2690ba2fdd475aaa
9a3cb0bd0f7f1fc51732c66cf884ea38
Sets that the changes are present.
public class Page public void setModified(boolean presence) { this.presenceBit = presence; }
1
c71a265f0e229e26a18a48f0bfd80d19
a4fc05606320b901af9474d81b54ca9a
Get the CDN contents.
class CdnDecrypter: def get_file(self): if self.cdn_file_hashes: cdn_hash = self.cdn_file_hashes.pop(0) cdn_file = self.client(GetCdnFileRequest( self.file_token, cdn_hash.offset, cdn_hash.limit )) cdn_file.bytes = self.cdn_aes.encrypt(cdn_file.byt...
1
258804c7b0c0f3f569a2aaa7abec8702
27ec2246c58547a0bc022e7808414c7e
when new question is here, set the current answer as nonexistent
$now = new \DateTime(); $question->setCurrent($now); foreach($question->getAnswers() as $answer) { $answer->setQuestion($question); } parent::prePersist($question); }
0
c450a25fec83de8df8ba9f4978c3e5cf
18a69d8a2de9e03524801f3e2e0fa7a3
Notifies clients that an item was deleted.
class ItemDeleted implements ShouldBroadcast public function __construct($oldItem) { $this->oldItem = $oldItem; }
1
12610a81d3211dde39710cd063d4c548
52625a8312e55580f1f1cd1a7db801dc
Frees up any unused space in the list by reducing the capacity of the list to its size but never less than the DEFAULT_CAPACITY. This method takes advantage of the fact that the Java Garbage Collector will reclaim any memory that is no longer in use - we love the Garbage Collector!
public void trimToSize();
1
0dd87675df4e1f5be2b1748608562824
638d72805054100361c7de68589ff02b
Creates and returns the reprojection module model. Outputs: reprojection_module: Reprojection module model.
options = { 'kernel_size' : 3, 'strides' : 1, 'padding' : 'same', 'kernel_initializer' : keras.initializers.normal(mean=0.0, stddev=0.01, seed=None), 'bias_initializer' : 'zeros' } inputs = keras.layers.Input(shape=(None, None, pyramid_...
1
40cf5eed5bc94b013429906084e94750
abe40af5628462adcd31e775e0910874
Returns the type of data as a Java primitive type if possible, or {@code null} if the data type is unknown to this method.
Class<?> getDataType();
0
f13e379c389c748f973218d982f4dd16
a31214f591a45e1a30059d41c11ce92e
Calculate swapped NDCG score in Lambda Rank for full/top k ranking positions
$computedTopArtists = $this->getBestItems($computedRatings, $at); $dcg = $this->getDCG($computedTopArtists, $originalRatings); $originalTopItems = $this->getBestItems($originalRatings, $at); $idcg = $this->getDCG($originalTopItems, $originalRatings); return $dcg / $idcg; }
1
f00352d6e547a43017624e59c74c7b7f
19e36cc1b06adee3cda932ec0f71ab07
生成某个图片单个类型的缩略图任务
class Upload extends Component public function getThumbnail($params = array()) { $type = isset($params['type']) ? $params['type'] : 'crop'; $source = isset($params['source']) ? $params['source'] : ''; $dest = isset($params['desc']) ? $params['desc'] : ''; ...
1
0a07c1f12d7e74f18a5cf4414f33468c
0673b244da3eb7e7fd0bfdf6a0337737
Set the SFX volume to the variable to be passed on
sfxVolume = newVol; if(sfxSlider != null){ sfxSlider.value = newVol; } }
1
207cb4b4fa3541e3ddad16c5bde736ab
7072a2954616454b9ee87f4007b6af8f
当默认的解码器配置无法提供的时候,根据上下文解析新的解码器 可以进行重写
public Exception decode(String methodKey, Response response) { Collection<String> contentType = response.headers().get("Content-Type"); HttpExceptionResolver resolver = null; for (String type : contentType) { type = getContentType(type); resolver = HttpExceptionResolv...
1
b2558b50b44a24cbb20a9daea5f122ce
94bbe2c9a88568679ee343d7f7021662
保存校友及相关联信息
Long id = model.get("ID"); Boolean bool = false; @SuppressWarnings("unchecked") List<JSONObject> list = (List<JSONObject>) objs[0]; Long priId = IDKeyUtil.getIDKey(); if(CommonUtil.isEmpty(id)){ if(!isExist){ long accountId = IDKeyUtil.getIDKey(); AccountPojo accountPojo = new AccountPojo(accoun...
1
0b97b12434085ce5c70f39a979ee7176
ec7bff9107de71ebcc5a85ab344ce772
Show the change that's curently selected by this view.
{ $change = $watcher->changes()->with('object')->findOrFail($changeId); $before = (new AttributeTransformer( [$change->attribute => $change->before] ))->transform(); $after = (new AttributeTransformer( [$change->attribute => $change->after]) )->transfo...
1
d3b5beb47f5b43275a8baf66998a97b4
f7afbdaee955d86b8e2d1d778edbac23
@brief Function to update the list which contains the index of each selected mesh in the GUI
{ if(mtpMeshes.SelectedIndex== -1) { mtpbtns[4].Enabled= false; mtpbtns[5].Enabled= false; mtpbtns[6].Enabled= false; mtpLabels[3].Text= "Mesh Triangles: None Selected"; return; } BaseMesh mesh= (BaseMesh)(mtpMeshes.SelectedItem); mtpbtns[4].Enabled= true; mtpbtns[5].Enabled= tru...
0
3970b78e6b0441505c3f531c3bd2943e
18fa20358dd8a47d88320ce2071ca497
Генерирует случайную организацию.
namespace GcmShared public class RandomCreator public Organization CreateEmptyDivision(int side) { var org = new Organization(); org.Data.Level = Levels.Division; org.Data.Side = side; return org; }
0