query_id
string
corpus_id
string
query
string
code
string
label
int64
6c1b8be976cad8c3f35367f7c49f94e6
7d4ce9ee0bf780da64622f529844caa1
A class to connect to the broker and stream prices
self.api = None self.connection_status = False self.strategy = strategy self.connect()
1
9148e7903bc4365a0ed50381437782b5
aae624bb003b1acf94db2c0812ea0584
通过FCB获取文件
def search_file_FCB(path:str, start_block:int = -1) -> list: search_path = 'C:' temp_path = '' position = -1 target_FCB = {} dir_list = [] empty_list = bytes([0]*8) new_path = path.split('/')[0:-1][-1] print(new_path) if start_block != -1: target_FCB = { 'File_nam...
1
b64baa824f9dab04d80f92a09cd6e87d
48c1682a3a71e05a2dbbeb032c32927f
Offsets the cameras orientation. The verticle angle is constrained between 85deg and -85deg to avoid gimbal lock.
{ float dot; Vector3.Dot(ref _viewDirection, ref lockedUp, out dot); float currentPitch = (float)Math.Acos(MathHelper.Clamp(-dot, -1, 1)) - MathHelper.PiOver2; float newPitch = MathHelper.Clamp(currentPitch + radians, -maximumPitch, maximumPitch); floa...
1
27b5766046fa1b2e175d58cf3084d09b
5a455233ac557eba2251cd336c3edac7
Write tab-separated data with column names in the first row.
def write_dataframe(outfname, dframe, header=True): with tabio.safe_write(outfname or sys.stdout) as handle: dframe.to_csv(handle, header=header, index=False, sep="\t", float_format="%.6g")
1
7e94f5c61d62d745384e9aedd316e311
cd4181035982095097de72d39956059b
加载图片控件
public class SinglePictureDisplayActivity extends BaseActivity private void initViews() { setContentLayout(R.layout.item_pager_image); ImageView imageView = (ImageView) findViewById(R.id.imageView); spinner = (ProgressBar) findViewById(R.id.loading); photoPath = "file://" + photoPath; ImageLoader.getInstance(...
1
bc4e47a78608ff1a8efb27927193c290
0f08c3492365b92f642a62d48dba96dc
绑定线索和市场活动
var objActivity = objActivity, actHtml = '', keywords = ''; actHtml += '<div class="bgrightjt activity" data-activity_id="' + objActivity.id + '">'; actHtml += '<p class="f16 mb05 b text-ellipsis">' + objActivity.subject + '</p>'; actHtml += '<p class="color999 mb...
0
b432796e0c9cdd0d661f5529a4b3c025
52e9537529d51f99ef15c688d9d709a2
앱을 백그라운드로 보냄(화면에서 사라짐)
class MainActivity : AppCompatActivity() fun onClickButton_close(view: View) { LogUtils.verboseLog(tag, "onClickButton_close") finish() moveTaskToBack(true) }
1
7fdd42be9f9c7fa0e5d8d4ee0a23cb1f
524a464aed9a9b2f360543a50a0648cc
Display edit wallet page
{ $categories = Category::all(); $userDetails = User::select('total_expenses','total_income','wallet_balance')->where('id',auth()->user()->id)->get(); return view('saving_wallet.user',compact('categories','userDetails')); }
0
53924e8c623886c695d868a10d3d0c86
7114ac0c255e8b52cf919e5b239b88fa
Lists all item entities.
class ItemController extends Controller public function index(): View { return view('titan::admin.items.index'); }
0
2fd4529e38a2ae33b0381bf8090f2c95
171be5d52030987dc2c3070cbf93dac7
Apply the results of the given HistoryEvent _in reverse_. That is, remove what's added, and add what's removed.
if not self.can_undo: return ops, reverse_ops = self._past.pop() patchdiff.iapply(self._present, reverse_ops) self._future.append((ops, reverse_ops))
1
d98361264abda747ba3edf31af15ed46
5f70ab4d5ee90ea44e3824f0857fe7a8
Compute norm of the gradient of numpy array in argument.
def copnorm_nd(x, axis=-1): assert isinstance(x, np.ndarray) and (x.ndim >= 1) return np.apply_along_axis(copnorm_1d, axis, x)
0
fec96e4db706c82fdcd1da72c046a8bb
9eb282758896b9b281624be66bc85c78
#### ==== Indicate position of labels in pie chart ==== ####
if(radii[1]=="N"){ if(cols[1]!=cols.CTRL[1]){ text(x=x-0.75,y=y,labels="N",font=2,col=cols[1]) } }else{ floating.pie(xpos=x,ypos=y,x=c(1,1),start=pi/2, col=c(cols[1],NA),border=NA, radius=as.numeric(radii[1])) } if(radii[1]=="N"){ if(cols[2]!=cols.CTRL[1])...
1
6e9023a5c024f24575b1477adce91800
7baf8129563158e1dc401162cc1d909a
The number of profiles with complete payoff information
i = 0 for profile in profiles: if profile["isActive"] == True: i += 1 return i
0
4d4f0f60ef40d37141331295ffe07dd2
877aa34bf920d536e9dba18991e86b81
Retrieve visibility and bounds information of the status and navigation bars. Android only. Returns: A dictionary whose keys are - statusBar - visible - x - y - width - height - navigationBar - visible - x - y - width - height
class Page(EventEmitter): def viewport(self) -> dict: return self._viewport
0
939e37cb309df3d6e933e87b3da0ac79
74979634361d1b29ab58bde7d7735c89
根据章节编号更新章节排序
namespace Novels.Machine.Forms.Settings public partial class ChaptersEdit : Form private void button7_Click(object sender, EventArgs e) { if (EditNovel != null) { for (int i = 0; i < EditNovel.Chapters.Count; i++) { EditNovel.Chapters[i].Sort = i + 1; DB.Chapter.Modify(EditNovel.Chapters[i]);...
1
2bd50a3150ed1a0f8b1c2094c84b5850
b4edbb0de06ee0d26b6fa8c2c0f81acd
Returns profile information for authenticated athlete as an athlete object
def get_athlete_info(access_token): client = Client(access_token) curr_athlete = client.get_athlete() return curr_athlete
1
11672d0dcf5a39acc6d4991b97e6cbae
5b09fa5b6b02d74c51466ae1bc678554
Must be executed when downloading of a directory item is canceled. Calling this API makes the camera cancel file transmission. It also releases resources. This operation need not be executed when using EdsDownloadThumbnail.
fun cancelDownload(id: Int) = api.cancel(id)
1
d4ce0bfd2236f5a58504fcf9083da4cd
5f17329afe6f8492edd1c800526a752a
Resets all axes to zero.
{ AccessXAxis().SetVector( 0.0f ); AccessYAxis().SetVector( 0.0f ); AccessZAxis().SetVector( 0.0f ); }
1
21f633dbac889ef611ce459a82a7869b
f184fbe443f3af67309bc532a9b80359
Returns information about the carbon footprint of passenger bus travel.
bus_info_and_emission_1, bus_info_and_emission_2, web=True ): bus_info_and_emission_1 = bus_info_and_emission_1.fillna(0) bus_info_and_emission_2 = bus_info_and_emission_2.fillna(0) bus_info_and_emission_1["amt"] = ( bus_info_and_emission_1["ng"] + bus_info_and_emission_1["coal"] ) bus_i...
1
a10cd3722e419488a8b09b5600a262a8
36dc36a43c45e8681948bfb2f84b31fe
ASTRING-CHAR = ATOM-CHAR / resp-specials resp-specials = "]"
class Parser void Parse_SEXPR() { Token *pToken = mLexer->PeekToken() ; if ( gEndOfFile || gStringNotColsedError || gSyntaxError ) return ; if ( pToken->GetType() == LP ) { Eat() ; pToken = mLexer->PeekToken() ; if ( gEndOfFile || gStringNotColsedError || gSyntaxError ) return ; if...
0
c2ef6ad70329058c30ca81fc79a1ef15
8187522737a578023ece512fdde40fc9
空操作直接跳转到退出页面
class BaseAction extends PublicAction public function _empty(){ $this->redirect('Index/index'); }
0
a41f556a624f0326bc7651adb9628297
fa5cc7c314aac315824ca0a50a9b3086
Returns the location of the PID file, if any. Returns: (Union[str,None]): The configured path, or None
class SSHConfig: def controlpath(self) -> str | None: return self.__controlpath
0
418aab931940c7391893ada857a706ad
580e5c339e57bbcfa33faddea6bc587c
同理于orderAsc/orderDesc
Expression<Func<T, Tkey>> orderWhere, bool isDesc) where T : class { if (isDesc) { return data.OrderByDescending(orderWhere); } else { return data.OrderBy(orderWhere); } }
1
2969018f17cfb4933c9053aada275045
4353dc118bcdfa5ee1f78c6d6fd356a6
更新实体时设置审核状态
{ if ($this->_entity->id > 0) { switch ($this->_entity->state) { case self::STATE_NEW: case self::STATE_NEW_REJECTED: $this->_entity->state = self::STATE_NEW; $this->_entity->modifiedFields = serialize(array()); $this->_enti...
1
82a3ce3165fff44caeb2b102dcba41bc
e542e63a333b678bf547c427a21e60e3
This function will clear FIFO flag on Arducam
void smartcard_clean_fifo(void) { *(volatile unsigned int*)(SMARTCARD_REG_FCR) = 0xC7; }
0
501fb1d1ed41d4e342693c588ed28300
ea1a0183400177218607b389834c12e4
Handler for map button being pressed on the segment control (control used for public journeys) When pressed, load the map with the journey details for the selected leg only.
namespace TransportDirect.UserPortal.Web.Templates public partial class VisitPlannerResults : TDPage private void ShowMapControl() { mapJourneyControlOutward.Initialise(true, false, false); }
0
e1f07cddc152a0bb9845bf702909fc3e
31da62bfed38bafd398acc7e569f21ad
Gets the smallest rectangle containing all graph nodes and optionally the graph links.
namespace BlueGraph.Editor public class CanvasView : GraphView private Rect GetBounds(IEnumerable<ISelectable> items) { var contentRect = Rect.zero; foreach (var item in items) { if (item is NodeView ele) { var boundingR...
1
c8b693877067d3ecffc3a9a10ae8919d
b00030ae98abd967d1de5b8c35f486dd
Returns the path of the file to use to replay GPS data from
public class Settings public String getTrackFilePath() { return trackFilePath; }
1
831a202758c7f340eab2c3fdb71a91b9
e15da92e95a01c86dc70a8e1eeec931b
have not set the option before, set it's default value
: XMILEOptionSet() { for (const XMILEOPTS & opt : defaultOpts) { m_optBits[opt] = 1; } }
1
2094bc6746b073294edc3593fb9bc537
93be2e38b0d5f9dc335bf2e6882a36a8
Validate Error message on select All items and SUBMIT
$values = $this->request->data; $ajax_arr = array('result' => 'fail', 'data' => '', 'message' => ''); if ( $this->Validate->saveAll($values, array('validate' => 'only')) ){ $ajax_arr = array('result' => 'ok', 'data' => '', 'message' => 'It\'s okay Bro' ); } else $ajax_arr['data'] = $this->Validate->vali...
1
11178b2c28eb939e61f4643d1aec22cc
935a1d06f6c6eff5011f4ca97ce8b46d
设置入组数量
class Dealer public function setGroupNum($groupNum) { $this->init(); $this->groupNum = $groupNum; return $this; }
1
6b12652a4d3cb7b34e0a7b0aeb6a6dad
2121c0419e5e2fa2b1ed92d2da5af338
生成婚否
class Profile extends CActiveRecord public function generateMarryList() { return array( self::MARRY_MARRIED=>self::getMarryType(self::MARRY_MARRIED), self::MARRY_UNMARRIED=>self::getMarryType(self::MARRY_UNMARRIED) ); }
1
eb5a41f11c6739c3dd6a46fc621137d3
917577346344301b971464f8c0a24234
Renders the needles above columns for the left building
{ for($column = 1; $column < $this->week_length; $column++) { $column_x = ($column * $this->grid_column_width) + $this->grid_bounding_x1; $this->line( $column_x, $this->padding + $this->header_height, $column_x, $this->y...
0
ee40eeaca4f06fc288b91a0b9ffa56f9
465b96dab705ddb865901d6cf8558dee
Method to get the arrival station id
public class Trip public int getEndStationID() { return endStationID; }
1
f8aeab762dbca2186c077cb37730885d
8c6d070e7a9ea0afeaec174ac990cdb1
Opens the links with given ids.
class LinkListLinkAction public function openAll() { WCF::getUser()->checkPermission('mod.linkList.canCloseLink'); LinkListLinkEditor::openAll($this->linkIDs); LinkListLinkEditor::unmarkAll(); HeaderUtil::redirect($this->url); exit; }
1
c4453bd1e649d7945b7ad06cd0207935
5ea535fe41632fb478afec41a7dd5e3f
GET: OutpatientManagement
namespace AlfaWebApplication1.Controllers public class InPatientManagementController : Controller public ActionResult ActionInPatientManagement() { return View(); }
0
5a783f28b3ccf9c2ce0ffcbe1126a825
b3759532a014d92f688d2b946adaea9d
Gets the "AddressIDType" attribute
@Entity @Table(name = "G7CONTACT_ADDRESS") @AccelaId( {"SERV_PROV_CODE", "RES_ID"}) @XmlAccessorType(XmlAccessType.PROPERTY) @XmlRootElement(name = "contactAddress") @XmlType(name = "ContactAddressModel", namespace = "http://model.webservice.accela.com") public class ContactAddressModel implements Serializable, OrderBy...
0
ea434174f37896a1697a49f8abb072a1
df1ed7d4789c0aead6ae44eaed256635
数据保存后 更新异常报告单的处理状态和异常结束时间
ReportDTO param = new ReportDTO(); param.setReportId(reportId); param.setStatus(Report.STATUS_FINISHED); int count = reportItemDao.selectCountByStatus(ReportItem.STATUS_NORESULT, reportId); if (count > 0) { param.setBizStatus(Report.BIZ_STATUS_FAIL); } else { param.setBizStatus(Report.BIZ_STATUS_SUCCE...
1
b105972f582532abad1b958a22eb021c
cb0f2d9131e1241ca32eb59865c9cb60
calculates Euclidian distance within an n-dimensional coordinate system
def euclid_dist_nD(p0, p1): return np.sum((p1 - p0) ** 2) ** 0.5
1
cedc747d39b0ed3eeae6588d0b1e3330
191a4629f48f7103afd6f055e9af0a47
点光源
function createPointLight() { var light = new THREE.PointLight(0xffffff, 1, 1000); light.position.set(50, 50, 50); scene.add(light); }
1
560ebf6f931d383ec64a3cbef5a0f63e
9f210e6aa5b8449d18acd61672cf30b8
@brief Constructor for the Pulse encoder.
RotaryEncoder::RotaryEncoder(int signalPin1, int signalPin2, int pushButtonPin) { this->init(); this->setSignalPin1(signalPin1); this->setSignalPin2(signalPin2); this->setPushButtonPin(pushButtonPin); this->singlePhaseInterrupt = false; }
1
67d9efece0d2cf088e78d5e24787fb16
da6f21793576b2c9b88b91d995bb8843
历史战绩查询
export class ResultComponent implements OnInit query(){ Base.Store.set('HistoryID',this.curgameID,false); this.pageinit(); }
0
65a3e4b366ba643e19cfe726550ed1d2
a7783ef3dd412be1a8053ada22ae147b
go up and find the closest parent with class .productItemBlock
function findAncestor (el, cls) { while ((el = el.parentElement) && !el.classList.contains(cls)); return el; }
1
93cc8a57e8694bfc0b853eedd2a8e71c
644af27b6739a824c079279063dad4dc
设置字段PHOTO为空值。
if(M('ImagewaterSetting') -> where(array('name' => 'pic')) -> save(array('content' => NULL))){ $this -> success(L('DATA_UPDATE_SUCCESS')); }else{ $this -> error(L('DATA_UPDATE_ERROR')); } }
1
c5ac78e817c294fb957d7781cbce6079
1f7289ecec7a4e03a336311abb1ec1c5
Test fixing seed is locally scoped.
self.model.B = RangeSet(4) self.model.x = Var() self.model.y = Var(self.model.B) self.instance = self.model.create_instance() self.instance.x.fixed = True for a in self.instance.B: self.instance.y[a].fixed = True self.instance.unfix_all_vars() ...
0
368ed23d8229f5db7f572f1a2fa6dfe3
3fcbcfbb39eeaf115d77712bed7d81ac
作废数据的查询
Map<String,Object> queryDisposedDataForDownload(WithdrawReportQueryDTO queryDto);
1
398c61b0f83e8b9f57c1b38ad7537eed
d35bfe7765117243700af9deb7ddb277
DB에서 유저정보를 불러온다. Custom한 Userdetails를 반환.
PrincipalDetails principalDetails = (PrincipalDetails) authentication.getPrincipal(); Long userId = principalDetails.getUser().getId(); System.out.println("UserService의 :" + userId); return userRepository.findById(userId); }
1
9a900ad859213d8425b473c2aaa76c8c
0c05315c1bb8b42bb960d905d4a567f7
Needs to update the dangling reference on projects that contain this hierarchy as project reference.
def hierarchy_to_update @project.self_and_descendants.uniq.select { |p| p.gitolite_repos.any? }.map(&:id) end
0
28d7645409cfb6dc218bb30c7872e8e2
73f89508965555a3c6b835c963427ca2
Provides lastname and firstname of employee fixtures.
class EmployeeFactory extends Factory public function definition() { return [ 'OfficeCode' => Office::all()->random()->Code, 'ReportsTo' => null, 'LastName' => $this->faker->lastName, 'FirstName' => $this->faker->firstName, 'Extension' => $this->fa...
1
46a38837e4fe45a44a513294d7824e87
21fbcddb4ceb2cdefc214d8ae1676e09
同步联盟数据到客服端(只同步最重要的几个数据)
function CUnionMgr:SaveData() print("CUnionMgr:SaveData***") for nUnionID, v in pairs(self.m_tDirtyUnionMap) do local oUnion = self.m_tUnionMap[nUnionID] local tData = oUnion:SaveData() local sData = GlobalExport.Tb2Str(tData) goSSDB:HSet(sUnionDB, nUnionID, sData) end self.m_tDirtyUnionMap = {} for sCharI...
0
ac4957d654c930031a92fed568d6d36e
d2ef715af0d291d1f7ebfc2df5b85d45
禁止页面所有点击事件
function banIOStouchPenetrate(query) { document.querySelector(query).addEventListener('touchmove', function (e) { e.stopPropagation() e.preventDefault() }) document.querySelector(query).addEventListener('click', function (e) { e.stopPropagation() e...
0
8efd3e52d716abe16c987ea518ad07f6
1b14e35e2d3667b278f106ee10c7391f
check that two block indications match in terms of their price
if self.type != b"ask" and self.type != b"bid": return False if not MarketBlock.has_fields(['tick'], self.transaction): return False if not MarketBlock.is_valid_tick(self.transaction['tick']): return False return True
0
0b10741605935cb348c48ab35b46b2c0
0df94b98ee36ecc085ea292d7f4a9e73
Runs an Append Only File rewrite process. Starts only if there is no a background process doing persistence. <p> If fails no data gets lost
if (this.getPersistence() != null) { File fileToSend = this.getPersistence().nextAvailableFileInDirectory(); String persistedData = loadData(fileToSend); HttpsURLConnection connection = createConnection(); if ((persistedData != null) && (connection != null)) { ...
0
3bbc792b0a571340ab0c83664a7934a5
2929036a1f3456f5e963afba718c1b7b
Ценрт монитора с учётом скрола по X
namespace PicView internal static class WindowLogic internal static void CenterWindowOnScreen() { if (!FitToWindow) { return; } mainWindow.Left = (((MonitorInfo.WorkArea.Width - (mainWindow.Width * MonitorInfo.DpiScaling)) / 2) + (MonitorInfo.W...
0
d425d934d7d0fbf11cd028f481f35c80
1475e796a40951060e713d120eba6948
the following example is from https://www.programiz.com/python-programming/closure#:~:text=A%20function%20defined%20inside%20another,in%20order%20to%20modify%20them.
outer_var = "outer variable" def inner(): return outer_var return inner
1
faa12cdd355257d2ec0930367ae2a9dd
3a9facf94ef992de4fd35f81fe39de47
maxEnvironmentalSuitability and minDistanceFromDiseaseExtent thresholds are used when selecting the "new" occurrences in getDistinctLocationsCount query, so we must ensure they are defined before continuing
long getNumberOfOccurrencesEligibleForModelRun(int diseaseGroupId, DateTime startDate, DateTime endDate);
0
a2e72904c4e63773d5d4e8fc7dc9eddc
522b89b8edae3f340456cb866fed95c5
3. Найти сумму только положительных из трех чисел
namespace LaboratoryWork1 public partial class MainWindow : Window private int Task3(ArrayList myAL) { int sum = 0; for (int i = 0; i < myAL.Count; i++) { if ((int)myAL[i] > (int)myAL[1]) { sum += (int)myAL[i]; ...
0
4cc52b8f4ff3dc75bfd4e00f5c2913e4
b01fb0b33021246abeee1ca7e467fbb1
Gets the time of midnight tomorrow based on a given time
public final class TimeUtil public static int toZeroTimeSecondsOfTomorrow(int timeSeconds) { return toZeroTimeSeconds(timeSeconds, 1); }
1
9de85507824a656afc4b20277930ccc3
97f565fdee490b282c91d0152cab7411
检查$cfg的合法性,对部分属性进行设置默认值
let cfgs = config.deploy; if (cfgs.type !== 'cos-cdn' && cfgs.length > 0) { cfgs.forEach((cosConfig) => { if (cosConfig.type === 'cos-cdn') { cfgs = cosConfig; } }); } cfgs.cdnUrl = config.url.replace(/([^\/])$/, '$1\/'); if (!cfgs.cdnUrl || !c...
1
055c1e92c28580760ea17d9b40399217
2511da6e0612e18e06dfe5d9e72c5c46
Sets the IP protocol number of the message. Most subclasses override this method to do nothing because the protocol number is defined by the message subclass.
class IRawDatagramProtocol(Interface): def addProto():
0
1682f78a2431b5f9606b36fae62e6fb5
133e7a50f9cc0aa240700274e8d633a9
可以通过指定的时间来生成流水号。
namespace NewLife.Data public class Snowflake public virtual Int64 NewId(DateTime time) { Init(); var ms = (Int64)(time - StartTimestamp).TotalMilliseconds; var wid = WorkerId & 0x3FF; var seq = Interlocked.Increment(ref _Sequence) & 0x0FFF; return...
1
a4a364eae939e0ec5cc4499137e5a28c
85b51181f33702fed7689270123b711e
Retrieve theme's image directory.
function get_theme_img($file) { return get_template_directory_uri().'/assets/images/'.$file; }
1
ea523725028cffb25978c066d01a4bb1
f536082cdcf6965f6da570dda98d220e
Checks for overlap of ranges in Non Standard Cost Definitions
{ assert(ClauseResult::synonymPresent(syn1)); assert(ClauseResult::synonymPresent(syn2)); assert(!_isNew); int syn1Idx = _synToIdxMap.at(syn1); int syn2Idx = _synToIdxMap.at(syn2); unordered_map<int, unordered_set<int>> syn1ToSyn2ValsMap; list<int> syn1ResultsToOverlap = resultsToOverlap.fir...
0
a45ce058c82fcbd3eecfb6492085e05b
63ae56959eb7754fb63c99805999f059
获取菜品列表 不分页
@Transactional @Service("dishService") public class DishServiceImpl implements DishService{ @Override public List<Dish> getDish() { return dishDao.getDish(); }
1
d822d49bfb917587aa771eb2d2162a52
f3a2288e5947bbb1711f8de2e1b09a21
Process contribution, issue tokens to user
def upload_contribution_with_token(username, contribution_content, metadata_dict, access_token): contribution_name = metadata_dict['name'] url = (f'{TFBUILD_API_URL}/tfbuild/users/{username}/' f'contrib/{contribution_name}') headers = { 'Authorization': ...
0
a7f7c5aa1c0a622d2e6af4784908942f
ebdf9ee986540051655c5ca18fc17e2e
Euclidean distance between user embeddings.
def difference_emb(emb1, emb2): dist = np.linalg.norm(emb1 - emb2) return dist
1
fa76b1f8ef438aeae830588b6bd61def
8e47500e6b719909b351614a6f2d5ab9
update the TLB according to the current state of the dirty bits
void pmap_update(void) { tlbflush(); }
0
e6a753e62f9c32335e192770f212993c
c320c50c39643889d12307572ac1a3ec
Each grayish pixel replaced with a grayscale pixel computed by averaging the three color channels, and setting all three channels in the new pixel to this value.
void grayscale(int height, int width, RGBTRIPLE image[height][width]) { for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { int greyavg = round(((float) image[i][j].rgbtBlue + image[i][j].rgbtGreen + image[i][j].rgbtRed) / 3); image[i][j].rgbtBlue = greya...
1
6819ad32944786af8e203e4bc57bd79c
bc65fe5a80724dbda2e63d6176599e25
node payload has finished sending, setup events and calc indexes
std::shared_ptr<DKGMessage> msg_ptr) { uint32_t senderIndex{CabinetIndex(from)}; switch (msg_ptr->type()) { case DKGMessage::MessageType::COEFFICIENT: FETCH_LOG_TRACE(LOGGING_NAME, "Node: ", cabinet_index_, " received RBroadcast from node ", se...
0
f1408abd8558e8c81ae268164a7ab2d9
cc31061681544bc14af392251ef9b17e
Sets the recipient or the recipients for the message. If more than one Recipients are passed, the mail will be generated multiple times for each recipient.
public class SendMessage extends Choreography public void setRecipients(String value) { this.inputs.setInput("Recipients", value); }
1
41b6ec95c7c1b242ae1dd8d98cb80c03
5edc3b9871a4d1c85707a1fb4bc29c6e
Perform a combined I²C write/read operation.
class I2CPeripheral(device_types.DeviceComponent): def WriteRead(self, write_data, read_count=None): if not self._device.link.IsLocal(): raise NotImplementedError('I2CBus currently supports only local targets') bus = io.open(self._bus, mode='r+b', buffering=0) fcntl.ioctl(bus.fileno(), self._I2C_PERIP...
1
aebda96c62286476f05628ac6edc394b
c58be74c985a6bc9757d72260206f144
分页查询NpcControlPart
public class NpcControlPartBo extends NpcBaseBo public List<NpcControlPartForm> getNpcControlPartPageList(NpcControlPartForm npcControlPartForm) throws Exception{ List<NpcControlPartForm> ncpFormList = new ArrayList<NpcControlPartForm>(); List<NpcControlPart> ncpList = getService().getNpcControlPartPageList(npcCont...
1
d0fd6938329df305e6108b1da505dd5d
e93fffa5af0470b3276ed49c356e7d0c
归并排序-以长度平均左右分组递归合并
void MergeSortRecursion(int arr[], int left, int right) { if (left == right) return; int mid = (left + right) / 2; MergeSortRecursion(arr, left, mid); MergeSortRecursion(arr, mid + 1, right); Merge(arr, left, mid, right); }
1
5ed6f3e9d7e64f9cb652d55439532b15
84aba7c01b0218542598a04b672a54a6
Test arrow down command (Cursor moves down).
test_str = b'heelp' input_stream = BytesToByteList(test_str) input_stream.extend(2*Keys.LEFT_ARROW) input_stream.append(console.ControlKey.BACKSPACE) for byte in input_stream: self.console.HandleChar(byte) exp_input_buffer = b'help' CheckInputBuffer(self, exp_input_buffer) CheckInp...
0
f0e2123e8f380bd50653eb89fff0b698
a67fff9dba05fc283f9a9aa080ef37fc
attempts to read the public key file and save the resulting key object in a global variable.
if not privkeyfile: return False try: with open(privkeyfile, "rb") as keyf: self.hellokeydata = keyf.read() self.hellokey = serialization.load_pem_private_key(self.hellokeydata, password=None) except FileNotFoundError: return Fa...
0
20f7e88346aabad99834bbea3f9796ae
576e28ff1cc50461420900946dbf83a8
gives us an easy way to remove the default value from any returned array
function removeFirstTwo(list){ const [,, ...arr] = list; return arr; }
0
66c83217acaca17f51020149349b22ba
7e506e1b8197913c3228f776e7a7a3da
returns a random quaternion not necessarily uniformly sampled
{ alglib.hqrnd.hqrndstate state = new alglib.hqrnd.hqrndstate(); alglib.hqrnd.hqrndrandomize(state); return alglib.hqrnd.hqrndnormal(state); }
0
e4483025f2c6de6217f089dcb2cd5ab7
a2f652e1801844efce58b5aff415ff64
Setter of the appointment title
public class Appt extends Model implements Serializable public void setTitle(String t) { summary = t; }
1
df616188cbc1a396011d243b57b0d7f9
cb6da1cb758cfd673a67d22a737010c6
根据yhm查询老师
Student getStudentByYhm(String yhm);
0
2a997bb927b14ec6b2468152cef8ddd0
e52ebf69c7fad17000487f314ccdd4d8
初始化Fragment,默认显示销售内容
public class MainActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener private void showDefaultFragment(Bundle savedInstanceState) { int[] newsType = {R.string.top, R.string.shehui, R.string.guonei, R.string.guoji, R.string.yule, R.string.tiyu, R.string.jun...
0
69d7413a3fb8f26eb1260659eaecf710
c04b243b35032930a920dde5bab105b7
下載圖片檔案至本機
{ try { WebRequest request = WebRequest.Create(PicSourceUrl); WebResponse response = request.GetResponse(); Stream reader = response.GetResponseStream(); FileStream writer = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write); ...
1
6a5099f1daeed020c745dc614f115773
373da12593d8985b64d11c0d0d92f0de
Metodo dedicado a hacer instancia al boton dedicado a calcular la masa corporal y se relaciona con el metodo que detecta "clic" al picarle al boton
public class Weightselection extends javax.swing.JFrame private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { Calcopt ca= new Calcopt(appData); ca.setVisible(true); this.setVisible(false); this.setDefaultCloseOperation(this.EXIT_ON_CLOSE); this.dispose(); }
1
369f5f7171fdf9202ca52402c6456a8a
d557bff986269be23cd67fb1a15baf74
先对字符串进行URL的UTF-8编码,然后再进行base64位编码
public class CommonUtil public static String encodeBase64(String src) { return Base64.encodeBase64URLSafeString(src.getBytes()); }
0
0349e58b70a60c12cc12ee48207f6891
1683d8b12896f05e3aa21181ec4b6238
是否是生产环境运行webpack
def production? ::Rails.env.production? || ::Rails.application.config.webpack.simulate_production end
1
c895e1df6fa756de079ba762861c05cf
71949e804e411dd888a2d9f364fc4d93
get our most recent chunk of suggestions, and pick someone from each slug to follow. For now, since high level suggestions are big name celebrities and the like, get the ones following the most others within their category, with the hopes of introducing the most diversity into our follow pool.
class User def group_recommendations(allow_run=true) compute_recommendations if allow_run && newish_user && suggested_groups.count.zero? suggested = Group.find(suggested_groups.pluck(:group_id)) counts = Notebook.readable_by(self).where(owner: suggested).group(:owner_id).count suggested .map {|gro...
0
f365da966cedbb9e71b35e1b2f005a12
575d37dd18bd5f5751575908eed8c82a
loads the proper arguments, reads a job, and executes the search.
func run() { argv := wf.Args() if len(argv) < 2 { log.Fatalln("usage: search <search> <query>") } searchID, query = argv[0], argv[1] s, err := loadSearch(searchID) if err != nil { wf.FatalError(err) } if err := doSearch(s, query); err != nil { wf.FatalError(err) } }
1
b1cc37daf96c99fccc5339f0e527d064
690baa0c9ccf412d411616bb3f4877c2
This function is used for estimating memory usage of a given graph partition
class GraphPartitionBook(ABC): def shared_memory(self, graph_name):
0
651b1959c1474f9cbd7251d9810d2b09
d8e737306c64a1d12643c3e7a9aef4f1
Change the current password of user with password comparison.
{ var user = UserRepository.FindById(userId); if (!PasswordHasher.MatchPassword(nowPassword, user.HashPassword)) return PasswordChangeResult.PasswordDifference; user.HashPassword = PasswordHasher.HashPassword(newPassword); UserRepository.Modify(use...
1
9d6c16adb86176d676eef58a1772f5dc
8c17dba6d952f80623baa4a6e03d6fc7
Check if a specific button pressed on the gamepad for a specific connected player
namespace MarsRTS.LIB.Input public static class InputManager public static bool IsGamePadButtonPressed(GamePadButton button) { return isPadStatePressed(padState, button); }
0
4f54093bf6065609f25b8bd308a332cd
ea2562e4dee59c3a46c1d8dbe084b856
创建确认模态框
var $confirmDialog = $('<div class="modal" id="confirmDialog">' + '<div class="modal-dialog my-dialog">' + '<div class="modal-content">' + '<div class="modal-header" style="color: #66787d"><h4 class="modal-title">提示信息</h4></div>' + '<div class=...
1
fbe35fb37755adda540c7aeed91021ac
ef65c0b360a29f26fbb9fd839bb6e7f6
关闭串口3
{ if (p.IsOpen) { try { p.Close(); } catch (Exception e) { System.Windows.MessageBox.Show("串口关闭失败\n"); System.Windows.MessageBox.Show(e.ToString());...
0
55d0969ac24e625bbdbfe6ff2ae78d9b
b63957061e443daecf37a9bb60ff9d6b
登记类型变化引起的表单验证切换
function typeChange(){ if ($("#billType").val()=="1"){ $("input[name='billCntr.ecdsClearType']").addClass("required"); $("input[name='billCntr.ecdsConveyType']").addClass("required"); $("input[name='billCntr.transType']").addClass("required"); }else{ $("#btn_import").attr("style",""); $("input[name='billCnt...
1
122a4589960d68eed3e08c628d994042
9dd00046f401f3e4a1b5f3e841cee619
Clear all the raw-values, and update the strip.
void LedDriverWS2801::clearData() { clear(); _strip->show(); }
1
cb4b05c4d5eb14c1a8aa9ad40ea66ad9
46887caca9a0042975c9e6ea7e4cd87a
Duplicates a poly struct.
static Poly PolyFromMono(Mono *m) { Poly p; p.monos = malloc(sizeof(Mono)); assert(p.monos != NULL); p.monos[0] = *m; p.length = 1; return p; }
0
0bf4d6d14cade59388ae4af72afb35f6
aabeeb2414481e9e38b28eeb68aa7b6f
统计注册人数,生成相应统计图表
const ret = yield call(userCountStatistics, parse(payload)); let chartData = _.get(ret, 'result.data.userCountStatistics') || {}; let chartDataList = []; if(!_.isEmpty(chartData)) { for(var key in chartData){ chartDataList.push({ '日期': key, '注册用户总数': c...
1
c6579d6451f01713bba2f9a0bf796838
ca2275c180df54b447d6808b21abcd92
校验登录用户是否注册完整
class User(object): def check_reg_complete(self): if conf.reg_info.keys() == self.reg_info.keys(): return True else: return False
1
d3e76fb470d3b11edecbcaabbbafafb9
63e188f4e5e4d15a4b7760cbd749595d
find maximum length string
static int longest_str( gchar ** strv ) { int max = 0; int i = 0; while ( strv && strv[i] ) { if ( strlen( strv[i] ) > max ) { max = strlen( strv[i] ); } i++; } return max; }
1
2b04d605601636aed0ccc4576df0f722
57d845ebb78a636150f7f53a3cd81abf
@brief RELC decode is started.(Async)
{ Ts_Sys_Msg* msg = NULL; u8_RDSTimeout +=1; if (u8_RDSTimeout > u8_RDS_Timeout_count) { memset(&st_Curr_RDS_Data, 0x00, sizeof(Ts_AMFM_Tuner_Ctrl_RDS_Data)); st_Curr_RDS_Data.u32_TunedFrequency = u32_currTunFreq; st_Curr_RDS_Data.b_NonRDS_Station = TRUE; msg = SYS_MSG_HANDLE(RADIO_AM_FM_TUNER_CTRL, u16_Res...
0
3526e0973e5b89adc6439b39f1e8903e
670378bb224b0cc18843aeec14444685
Draw the pattern of size given as ``height`` and return the text lines.
string = "" content_iter = line_iter(self.content) for x in range(self.height): content = "" if x in self.print_lines: content = next(content_iter) string += h_pad(content, self.width, self.fmt.h_align, self.fmt.fill) return string
1
33d3d883d4eb6bcc4d585b4ed326c21d
2088793b4a33587d4c81a3a9c7e71aed
send broadcast to refresh the tool list in ToolFragment
public class ButtonOperateLogic private void callback() { ContextHolder.getContext().sendBroadcast(new Intent(BundleKeys.REFRESH_LIST)); }
1