query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9672e95a1f75f00b6fc8a71860cb2011 | 2473a6a964fe02c8761dc45686c988f8 | Draw a coloured Lissajous figure | counter := 0
for {
w, h := leggo.Dimensions()
for y := 0; y < h; y += 1 {
for x := 0; x < w; x += 1 {
var r, g, b byte
switch mode % 8 {
case 0: r = byte(rand.Uint32()); g = r; b = r
case 1: r = byte(rand.Uint32()); g = ... | 0 |
6cb51fd241d6546c41e98774ad8e47eb | 647d29741f2a17270bd88f7a9f78ee8b | This is called during object construction to validate any dependencies | namespace Cirrus public abstract class Agent<T> : IDisposable
protected virtual void VerifyConstruct (LambdaExpression construct)
{
} | 1 |
e476d463a97928f1ed1ff5d2d92ed240 | 558a000fc2ec5d426ca8f9c8fd0f8b47 | Return the extension key this processor belongs to | class EmConfiguration
protected static function getExtKey() {
return self::$extKey;
} | 1 |
d2a3e41542418f7c1562676d510d7a60 | 8e86e3dcbad78cca6cd80035a027a8cf | Modify a flux dictionary to contain fluxes corresponding to the flux vector being normalized to unity. | def sflux_remove_zeros(sflux_dict):
inds = np.nonzero(sflux_dict['fluxs'] != 0)[0]
if len(inds) != len(sflux_dict['fluxs']):
for key in ['phis', 'thetas', 'fluxs']:
sflux_dict[key] = sflux_dict[key][inds]
sflux_dict['nflux'] = len(sflux_dict['fluxs'])
return sflux_dict | 0 |
af612d216ebc79bb420e3a50941cc1ba | f0f495e54ac6a1b07e6104826cb58787 | 案例:原生sql查询所有 | public class MyTest
@Test
public void test2(){
List<Customer> queryAllCustomer = sqlSession.selectList("queryAllCustomers");
for (Customer customer : queryAllCustomer) {
System.out.println(customer);
}
sqlSession.close();
} | 1 |
db2312390bf8852797c0a1e22de95d09 | 1e0d8e0262375ff49a93b1d7ca8384be | Checks whether the user's input is in an acceptable format
Returns: bool | class SentenceTab():
def is_valid_input(self):
return check.sentence_input(self.sentence_input.get(), self.MAX_LENGTH) | 1 |
2d56e44bf3026827be6e3a5ff166d75b | 65202a00ee715f282f0572d8e68d2290 | Удаляет из карты объект по заданному по ключу. | namespace ImTools.OldVersions.V1
public sealed class ImMap<V>
public ImMap<V> Remove(int key) =>
RemoveImpl(key); | 1 |
f546a9cf72c0d032ce4055c5124d806b | 4c61fb7e6afae21f80c4b973f74729b2 | Flip the atoms velocity if it collides with the boundary. | VECTOR2 Vdiff = ent.getVelocity() - velocity;
VECTOR2 cUV = collisionVector;
Graphics::Vector2Normalize(&cUV);
float cUVdotVdiff = Graphics::Vector2Dot(&cUV, &Vdiff);
float massRatio = 2.0f;
if (getMass() != 0)
massRatio *= (ent.getMass() / (getMass() + ent.getMass()));
if (cUVdotVdiff > 0) {
s... | 0 |
46c69837b38ff2ceb7ca835a7235fa82 | 4d58cb2633c966b9c2156b7bf92e9edc | Opcode 0xc3 | void Processor::OPCode0xC3()
{
u8 l = m_pMemory->Read(PC.GetValue());
PC++;
u8 h = m_pMemory->Read(PC.GetValue());
PC.SetHigh(h);
PC.SetLow(l);
} | 1 |
44815e5cadaf64e86d88e9330fb68cbc | f38e70cf6e7e4b4aff22795ce0954080 | method is case sensitive. | boolean caseSensitive) {
for (int i = 0; i < strings.length; i++) {
if (caseSensitive == true) {
if (strings[i].equals(string)) {
return true;
}
}
else {
if (strings[i].equalsIgnoreCase(string)) {
return true;
}
}
}
return false;
} | 1 |
fdb5fc7848a83d0bc3d94d64aef25c3b | 1c5e75ca456e823475ac858b6019c5da | Returns a list of datastores accessible by the current user | public function getDataStores(); | 1 |
054c358f3ca89744be0ed40dcb89f400 | c8fd82d774b07d1f8bb95dd7981bb07a | 获取指定用户最近的审批轨迹 | namespace LJ.UMFramework3.DTO.Base
public partial class QuickApprovalCenterDTO : BaseDTO
public List<ApprovalTrackOutput> GetApprovalTrackListLikeNodeCode(string approvalId, string nodeCode)
{
var tracks = ApprovalTrackBusiness.GetApprovalTrackListLikeNodeCode(approvalId, nodeCode);
... | 0 |
77fef708cc5c1b5f53e589a81a355a07 | 754ff61ffb0ef3c468c19733edb8b37e | LDAP username format. | if ( ! uwp_is_gdv2() ) {
return "username";
}
} | 0 |
4e00b2feed242f5b50cb81fc25e0f88b | 47e0a43640d624d4da4aa0a1de993d5d | Stores coefficient data of a specific curvelet angle. | axisNumber = self._getAxisNumber(axisID)
C = np.zeros((len(self.refAxis.topo.lIndex[axisNumber]), 3), self.coef.dtype)
C[:, 0] = np.take(self.coef[:, 0], self.refAxis.topo.lIndex[axisNumber])
C[:, 1] = np.take(self.coef[:, 1], self.refAxis.topo.lIndex[axisNumber])
C[:, 2] = np.ta... | 0 |
24eda56dbd8e9fa3105a9df1c7ea69b0 | 7a6095a6d4251b9c8d30bde8e5970964 | Function to add a digit to a vector: | {
int *vector = NULL;
if(*length == 0)
{
vector = allocateVector(1);
*length = *length + 1;
}
else
{
*length = *length + 1;
vector = reallocateVector(a, length);
}
*(vector + *length - 1) = toAdd;
return vector;
} | 1 |
8b506d58ab68a79741ffcceeb0b9b432 | 1d5132a9c3df7d04c8cd6dbec6ddb291 | удаление элемента из рассрочки | class TireRemontController extends Controller
public function destroy($id)
{
$dt = Remont::select('dt')->where('id', '=', $id)->first();
Remont::destroy($id);
return Redirect::to('/defect/vvgh/remont/control?dt='.date('d.m.Y', strtotime($dt->dt)));
} | 0 |
1c56d0f5643ae182faaf982ee646ed0a | 5fdcf0ef0d2ddfb62a41ccd0dd1401ab | Returns mean reaction time of given block. | def load_wheel_reaction_times(eid, one=None):
if one is None:
one = ONE()
trials = one.load_object(eid, 'trials')
if trials and 'firstMovement_times' in trials:
return trials['firstMovement_times'] - trials['goCue_times']
moves = one.load_object(eid, 'wheelMoves')
if not moves or 'pe... | 0 |
6faa55106ee8c73c1d93320a38208cc1 | a9c4c8ff98756e715728dbbf855b9e1f | GET: Guide_Registration | class GuideController extends Controller
public function index()
{
$guides = Guide::all();
$questions = Question::all();
$types = GuideType::all();
$enterprises = Enterprise::all();
$counter = 0;
return view('guide.index',['guides' => $guides, 'counter' => $counter, '... | 0 |
949049c14f71baed0632e322ba91dfa6 | 697d854a537610d4305fafe5513406a5 | Funkce slouzi k inicializaci grafu. Nastavi vzdalenost inicialniho
vrcholu 's' na 0 a zbytek na nekonecno. Predchudci vsech vrcholu jsou
inicializovani na None. | {
for(int i =0; i < graph->size(); i++) {
travelTime[i] = INFINITE;
predecessorEdge[i] = NULL;
}
source = NULL;
} | 0 |
869a42d6917d0fba6e83460581fe0a29 | e3170052205f914cc45c96ef2be777bc | get the 'request_count' attribute of the specified sample | def get_count_of_requests(target_list):
return {'Count of all requests:': len(target_list)} | 0 |
38314437afeb5f9aba9c6ff6d8e8db13 | e2707df9dfb1ea005a7c4ec4d3915b45 | 测试函数,对每一个测试样本调用测试函数 | def testdata():
train_data, label = traindata()
test_file = listdir("F:/学习文件/源码/源码/第7周/testandtraindata/testdata")
num = len(test_file)
for i in range(0, num):
this_test = test_file[i]
test_data = data_to_array("F:/学习文件/源码/源码/第7周/testandtraindata/testdata/" + this_test)
... | 1 |
1474da0c7d5636742281fd34292936da | c92b5376f303726a925a256c17f94e99 | Sets the state of the "launch in terminal" checkbox. | if state == Qt.Checked:
self.active_job = True
else:
self.active_job = False | 0 |
d76e6bc58d22d0a0c9bf3ac11f538bb5 | ee1500e3b1a7b35eda20bd7881d2bd8a | Single very short flash, to indicate a relays command | {
byte[] tempCMD = new byte[8];
tempCMD = Relay.CreateCMDByFlash(_Address, _Line, times);
SendCMDToBUS(tempCMD);
} | 1 |
9c097171e0ed8e8303f9617ef1fdc813 | 3f069841ea74a0b902f7cbcc60fbe6c9 | Gets comma seprated custom attribute list with their values for notification | public class NotifyUsersRule extends AbstractRule
public String[] getAttributesList( )
{
return _attributes;
} | 0 |
0065ea988d29b2185453239fd983bdce | a6cffe7c7e66ad0630d905162beb6ab3 | JSON data type editor | function JSONObjectEditor(value,provider,classPrefix) {
EventHandler.apply(this,[this]);
this._provider=provider;
if (classPrefix===undefined) {
this._classPrefix="";
} else {
this._classPrefix=classPrefix;
}
var self=this;
this._dom={
root:$("<div>",{
"class":this._classPrefix+"JSONObje... | 1 |
862515d00b72bb96cc43b98f5a9d8ab5 | a9594bb3e0de22e8c8f4566b1e3bd469 | Sets the enabled state of each individual LED in the bar graph. | if (componentImage != null) {
for (int i = 0; i < numVisibleSlices; i++) {
int slice = i + (currentPage * numVisibleSlices);
if (slice < numTotalSlices) {
componentImage[i].setEnabled(flag);
}
}
}
} | 1 |
d9beb67101b5ae819492c7728e411ec1 | dd3c70bbb524b92ae7233554d430ce88 | .
验证错误发票的格式 | namespace ebIModels.Models
public partial class InvoiceModel
public static EbInterfaceResult IsValidErbInvoice(XmlDocument erbInvoice)
{
EbInterfaceResult result = IsValidErbInvoice(erbInvoice.InnerXml);
return result;
} | 1 |
9287eee135a47003b01040d27e731923 | 85e7d2535fe0a662c2471400f2a0f83a | Notify listeners that the card group has changed | namespace Acquire
public static class BoardManager
private static void NotifyGroupChanged(TileGroup changedGroup)
{
if (GroupChanged != null)
GroupChanged(changedGroup, new EventArgs());
} | 1 |
726de12cc6702d1c5372e00f030a1656 | 3f58341895d6a34c89fd9d2d059fa3f0 | !
Method finds all blocks from tree which have intersection with given block | {
if( header.nodes[ parent_index ].file_type == 'd' )
{
for( unsigned int i = 0; i < header.nodes.size(); i++ )
{
if( header.nodes[ i ].file_parent_id == header.nodes[ parent_index ].file_id &&
header.nodes[ i ].tree_id == header.nodes[ parent_index ].tree_id &&
i != static_cast<unsigned>( parent_index... | 0 |
597b0988c8434ac9a91e9b757bd82b95 | 25bfcf560e7cfb8f3dfffcef00997995 | Persons/Institutions invited to the event (if sent by email meaning To:) | $recipients = array();
if ($includeWaitingList) {
$registrations = $event->getRegistrations();
} else {
$registrations = $event->getNonWaitingListRegistrations();
}
foreach ($registrations as $registration) {
if ($registration->getAttendee()->getEmail()) {
$recipients[$registration->getAttendee(... | 1 |
ff45c87eb4f6db2b193bad05c619f2c9 | d2d92a977efccc193e3d2e1c5a1453ba | Tests MvcLite\Controller::init(). | {
$factory = $this->resource->init();
$this->assertInstanceOf('Mol_Mail_Factory', $factory);
$view = $factory->getView();
$this->assertInstanceOf('Zend_View', $view);
$expected = array($this->getTestDataPath() . '/');
$this->assertEquals($expected, $view->getScriptPat... | 0 |
1c4867654523b4b7e2019fe7c6ce6b1a | a293239250ac66589147eee07d016460 | Called by PUN when this client entered a room (no matter if joined or created). | {
if (!setManager.isHost)
{
IsConectingRoom = false;
infoText.text = "";
Debug.Log("OnJoinedRoom() called by PUN. Now this client is in a room. From here on, your game would be running. For reference, all callbacks are listed in enum: PhotonNetworkingMessage");
... | 1 |
c8b49b81707650cfd1caa2c48b94d392 | 849843337bfef52622623a5c82ac99ff | To show the keyboard(hide the panel automatically if the panel is showing) with
non-layout-conflict. | public class KeyboardUtil
public void showKeyboard() {
System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAA"
+ keyboardView.getVisibility());
int visibility = keyboardView.getVisibility();
if (visibility == View.GONE || visibility == View.INVISIBLE) {
keyboardView.setVisibility(View.VISIBLE);
System.out.printl... | 0 |
0f34c89cc04c1f048063c86ab8b0ae3a | fb389fc37a6b1af8bd6a576fd11bc135 | 查找所有MaterialBean用于显示 | public ModelAndView findAllMatBean(); | 1 |
bcd84d78b1a62d287795e9cfadc5287c | 68aaefa2834c635e9f1bf283d803b9db | @brief nastaví stav všech relátek | def SetStateAll(state,AllCards,n):
for i in range(n):
AllCards[i].SetStat(state) | 1 |
ace683db215f42640c889c6f79f9a08d | 2c92a3623c2107494287c12700e1641e | 失敗しても指定回数リトライするタスクを作る。 | {
return new AsyncRetryTask { Task = Task.OnFailure((result, tryCount) => failureAction(tryCount)) };
} | 0 |
2c44cad7b69e45c961b9671a615968e7 | 320f84a16ea0a36edcd4e8af4f75236f | Sets the modifiers of the event. This is only used for input events. | namespace TundraEngine.SDL
[SuppressUnmanagedCodeSecurity]
public static partial class SDL
[DllImport (LibName, CallingConvention = CallingConvention.Cdecl)]
public extern static void SDL_SetModState (SDL_KeyMod modstate); | 1 |
c641fd227f12c1b6f0f18f6589238bde | f98e8d623a1d3ed62f4b73654704e3cf | The getSTATUS_INDICATOR method returns the STATUS_INDICATOR for this bean. | {
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(STATUS$2, 0);
if (target == null)
{
return null;
... | 1 |
ecd3f65977e2165a8081966176314043 | 0d65a58f069cf54039631f11219ad93a | This function takes in a string and tweets it | def tweet(msg):
import json
with open('/Users/aepps/.twitter_creds.json', 'r') as creds:
keys = json.loads(creds.read())
api = get_api(keys)
api.update_status(status=msg) | 1 |
b96a37763cfb597755c2e291e620b2ee | 6ba64e644f9fdd944faf58c5251eb434 | 統一駅データが既に存在すれば更新、存在しなければ追加を行う内部メソッド。 | def refreshStationRailways
res = RailwayAPI.fetch({})
railway_list = JSON.parse(res.body)
railway_list.each do |railway|
existing_railway = Railway.find_by(odptrailway: railway["owl:sameAs"])
railway["odpt:stationOrder"].each do |station|
existing_station = Station.find_by(name: station... | 1 |
f52646fe69fb777a106e255408de5e9c | 69473be61d6c842401d5d9e732a61d1f | Retourne la vie MAX | public getMaxLife() {
return this.maxLife;
} | 1 |
6dad6911709d1e48e48b9b569b93f373 | 3bf1fd6da10f6b0873446acfa4041ae1 | 获取指数函数拟合的参数 | def TestLeastsq(p,Xi,Yi):
s = '参数估计次数'
Para = leastsq(error,p,args=(Xi,Yi,s))
k,b = Para[0]
print('k=',k,'\n','b=',b)
plt.figure(figsize = (8,6))
plt.scatter(Xi,Yi,color='r',label='Sample Point',linewidths = 3)
plt.xlabel('x')
plt.ylabel('y')
x = np.linspace(0,2000,1000)
y = k*x+... | 0 |
e15b0bfaceccc99ed4ab41857c6dc384 | 868c59e9849ac415d9379980845df184 | 统一的道具使用弹出框 | Global.SoundModel.playEffect('exchange');
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
wx.aldSendEvent('点击转换道具');
let num = Global.GameModel.mLevel + 1;
wx.aldStage.onRunning({
stageId: num,
stageName: '第' + num + '关',
... | 0 |
18e99e93e445bf97943485cefb8f59ec | 76b1b41544de01a89536ba558bcac269 | This function traverses entities list and creates biagrams of entities for each sentence, then counts biagrams. | def previous_and_next(some_iterable):
prevs, items, nexts = tee(some_iterable, 3)
prevs = chain([None], prevs)
nexts = chain(islice(nexts, 1, None), [None])
return zip(prevs, items, nexts)
n_entities = []
save = False
current_entity = ""
... | 0 |
ceff21d41756fa330466f5bba6541462 | f951def6b7a1d40577c457d93587c07c | Estimates motion from the set of tracks and their 3D location | List<PointTrack> active = tracker.getActiveTracks(null);
List<Point2D3D> obs = new ArrayList<Point2D3D>();
for (PointTrack t : active) {
Point2D3D p = t.getCookie();
pixelToNorm.compute(t.x, t.y, p.observation);
obs.add(p);
}
if (!motionEstimator.process(obs))
return false;
if (doublePass) {
... | 1 |
61c8c81b2389354629cd7cebb3a15019 | 4a4896af85ab76694b1717c73c402b0c | Load buttons colors definitions from config file | try:
with open('colors.json', 'r') as f:
colors = json.load(f)
for key, item in colors.items():
setattr(self, key, tuple(item[:-1]))
except FileNotFoundError as err:
print("\033[91m Couldn't find 'colors.json' file inside script... | 1 |
8a4e666b99fae92a84fab85b8ad83834 | a3c7e7bdedcc2736d7dbb2e15b283210 | Loads the ViewCounter data. | class CounterRepository extends AbstractRepository
public function loadViewCounterData()
{
$viewcounterClass = $this->loadViewCounterClass();
return $this->getEntityManager()->getRepository($viewcounterClass)->findAll();
} | 1 |
99806bbc7a76f28d9e767ffeef9bbf07 | e78f6dbb1dd7b54fd815e8e63fc01a0c | DELETE /service-authorities/:id : delete the "id" serviceAuthority. | class issuerservicesIdDeletePost(AuditableMixin,mixins.DestroyModelMixin, generics.GenericAPIView):
def post(self, request, *args, **kwargs):
return self.destroy(request, *args, **kwargs) | 1 |
ee5769dfe1eff629bfe17b3b96506fdd | 1f659cfe53219b22cc90b205e2cb5c41 | 选中 今天、本月、上月后,动态显示 对话框中 开始和结束时间 | namespace NIKE_Project
public partial class MainForm : Form
private void comboBox11_SelectedIndexChanged(object sender, EventArgs e)
{
DateTime dt = DateTime.Now;
int dayOfMonth = dt.Day;
switch (this.comboBox11.Text)
{
case "本日":
... | 1 |
519a0a7d4630c64390bd7eaee3b0f29b | 6f53896f6c3fc9cf783bce8d2af7a6c1 | Загрузка информации в блоки записей по каждому приему пищи | {
char[] message;
int size;
try
{
MemoryMappedFile sharedMemory;
sharedMemory = MemoryMappedFile.OpenExisting("MemoryFile");
using (MemoryMappedViewAccessor reader = sharedMemory.CreateVie... | 0 |
f3b000cc944c1748016d2fa5bc1d921c | cfe68e19a0238af279c916810b3427fd | set ShipDate back to null, in case of accidental shipped status | class _Order extends \IPS\Patterns\ActiveRecord
public function get_shipped_date()
{
return $this->_data['shipped_date'] ? \IPS\DateTime::ts( $this->_data['shipped_date'] ) : NULL;
} | 0 |
2ef6f932a8446739b1da66371f85be01 | 81a7f2d15bea1919894853b805b11d43 | Handle click events on the show/hide overview button, update the UI on changes | markers: MarkerWithInfoWindow[],
map: google.maps.Map,
) {
const listingButton = $(Mapping.Configuration.TOGGLE_LISTINGS);
if (listingButton.hasClass("selected")) {
listingButton.removeClass("selected");
Utilities.hideMarkers(markers);
} else {
listingButton.addClass("selected");... | 1 |
e474b8e3d1e8bd788d742659e742bf7c | 106c7694f7745feea625d9e6f89adf8b | 録画番組情報を新規作成 | {
_currentRooms.Clear();
if (_lvRegex.IsMatch(programId))
{
_currentProgramId.Value = programId;
}
else
{
Debug.LogError("不正な番組IDです");
}
} | 0 |
22b929775a5617510fb385639360acc2 | efc2effcdd763f98c301ff66d3defe2a | 记录最大和的子序列 | n = len(nums)
if n == 0:
return 0
f = [0 for x in range(n)]
f[0] = 1
max_sub_seq = 0
for i in range(0, n):
for j in range(0, i):
if nums[i]>=nums[j]:
f[i] = max(f[j] + 1, f[i])
else:
... | 0 |
400464e7f7dcbcedc9c132593ac9aa98 | 008357cf314045f2554f58f898d2737f | Selects optimizer. To be extended (SGLD, KFAC, etc). | def get_optimizer(): | 1 |
92689333326511b4b122eb6141104a38 | 7cadb4fed3fab6208d2712d97c94725d | 得到word的id对应的部分,col为对应feature文件中的列,maxlen为特征最长长度 | class Predict:
def process_file(self,contents,max_length=400):
data_id = []
for i in range(len(contents)):
data_id.append([self.word_to_id[x] for x in contents[i] if x in self.word_to_id])
x_pad = kr.preprocessing.sequence.pad_sequences(data_id, max_length, padding='post', truncating... | 1 |
fcacae85119751c9bb0473d905c64d5f | 9a87dc89ad7d8a9194388e93f596b494 | 判断是否为浏览器 ArrayBufferView 类型 | function isArrayBuffer (value: any): value is ArrayBuffer {
return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer
} | 0 |
a4ab44c647edfb60969b3e12e4d66c04 | b2055e62291e3abb356016f58197649b | If two models with a ForeignKey from one to the other are removed at the
same time, the autodetector should remove them in the correct order. | project_state = self.set_up_test_model("test_crmoih")
operation = migrations.CreateModel(
"ShetlandPony",
[
(
"pony_ptr",
models.OneToOneField(
"test_crmoih.Pony",
models.CASCA... | 0 |
2c591d399c1dd29f614f74687e3dd2c1 | ab89e335580b4697d5cd213e581360f2 | 联表查询-根据personid查询person和book | "b.bid as bid,b.bname as bname,b.bprice as bprice from Person p inner join Book b on p.pid=b.pid " +
"where p.pid=:pid")
List<PersonInfo> findAllInfo(@Param("pid") String pid); | 1 |
ae14b6fb1c91d0a3bdba8164114e91a9 | 2ef85011ba24e2b58fd007820e00665a | symbol and file id values. It is assumed that the file ids have already
sorts 'em, and then changes all ids (both file and symbol) to the new values. | void SortMatch::restoreSymbolOrigOrder(void) {
} | 0 |
1a0799bbcc7cde3ab9ce0ad40930c605 | a19ca8b690e6100529a17059fe2fb8e8 | a = f/m | Pn = Pn_f(f, P=P, A=A, L=L)
Rf = R_f(f, L=L)
return Pn/Rf | 0 |
1802062b548f81458766ce6cfe15b7e7 | 974b23c8f730c4fabe1a660e1f74b4a3 | Tests that getting the class and calling it returns the same singleton instance. | class SerializerTest extends TestCase
public function testGettingSingleton()
{
$serializer = Serializer::getSerializer();
$serializer2 = Serializer::getSerializer();
$this->assertSame($serializer, $serializer2);
} | 1 |
6a7c633f351ef3ce83d33465e17b924e | 7eabe166a3c09caf004206c81742a2bb | Cria a imagem | $this->img = imagecreatetruecolor($this->width, $this->height);
$color = imagecolorallocate($this->img, 255, 255, 255);
imagefilledrectangle($this->img, 0, $this->height, $this->width, 0, $color);
} | 1 |
193ee42eb1e0a1b1465339bfeb38f6a3 | c73119bf59320f54d7bba8ba3c99d36e | Optional callback if you need to know when the user accepts or declines notification permissions. | interface PermissionListener
fun ignoredCallback(permissions: MutableSet<String>) | 0 |
6475d69d3018163472378ca1c94befb4 | c756a019373e1c0c0ea9d5499d430976 | 获取pod的日志 | namespace := c.Param("namespace")
name := c.Param("name")
podLogOpts := v1.PodLogOptions{}
if err := c.BindJSON(&podLogOpts); err != nil {
zap.L().Sugar().Errorf("更新deployment失败,原因: %s", err.Error())
c.JSON(http.StatusBadRequest, model.NewResponse(false, nil, err.Error()))
return
}
req := config.GetK8sClien... | 1 |
fb00cf531dda8f4c879d8a085ff2c7fa | f37b3a85ecae74777f331e35f56d6a9a | gera um n´umero aleatorio de itens para produzir / consumir | namespace Lab3.Data
internal class ProdutosFake : IProdutosFake
public IList<Produto> Produtos(int quantidade)
{
var resultado = new List<Produto>();
if (quantidade > 0)
{
for (int i = 0; i < quantidade; i++)
{
resultado... | 0 |
719eb5a71bc3274d7c4c42defe529389 | af2291dc63c3456d4c6d621fbb0ddd70 | Algorithme trouvant l'objectif le plus proche | if len(objs) == 0:
return 0
closest_o = objs[0]
for o in objs:
d1 = get_distance((x,y), (o.x, o.y))
d2 = get_distance((x,y), (closest_o.x, closest_o.y))
if d1 < d2:
closest_o = o
return closest_o | 1 |
2295dd3854bcb946a289815b054460f5 | cbb2a3f571b97e08fa632116239b4b86 | Cursor absolut positionieren. (Ansi.sys) | void PutCursor(U32 FixedX, U32 FixedY)
{
PositionCursor((U16) FixedX,(U16) FixedY);
} | 1 |
7cd89b21093c42c5fad6bb6ba125aeb3 | a8856966d2f9a627bade067b5ca76382 | 파싱한 데이터들을 바탕으로 Spot를 빌드한다 | void XAccount::CreateSpotsByCloud(XPropCloud::xCloud *pPropArea,
XDelegateSpot *pDelegate,
XArrayLinearN<XSpot*, 1024> *pOutAry,
bool bDummyMode )
{
XArrayLinearN<ID, 512> arySpots;
pPropArea->GetSpotsToAry(arySpots);
XARRAYLINEARN_LOOP(arySpots, const ID, idSpot) {... | 1 |
82ea4b96f3c02477bf29cfbc8a01f834 | b4373d6d69008694acc63cd66132b88a | iterate through the list, convert all values to lowercase and save to a new list.
input is the file contents as list. | def names_lower():
for name in list_names:
list_names_lower.append(name.lower()) | 1 |
e9f5c3d9f3e855d9eac89b65ff431697 | 6ed837c367f40d2663b2c6ad041eaa27 | Affiche l'image d'intro | {
bool quit= false;
blit_image (150, 150, image2, screen);
SDL_Flip (screen);
while (quit == false)
{
if (SDL_PollEvent( &event ))
{
if (event.type == SDL_MOUSEBUTTONDOWN)
{
int a = event.button.x;
int b = event.button.y;
if (a> 450 && a < 525 && b >525 && b <600 &&
event.button.but... | 1 |
8706f29b2d7ca503c4de4645e4664ead | e76fc16102f79d6010ca3923865abcff | Set the file name of the jsbundle for the Skin included in the application's assets | var fstring, oldName = oldName || bundleName, targetStr, matchStr;
var rscript = '<script\\s+.*(?:src=[\'\"][-\\w\\/]*(' + oldName + '[-\\w]*\\.js)[\'\"]).*>';
fs.readFile(config.buildTemplatePath, function (err, data) {
if (err) {
return;
}
if ((fstring = data.toString()... | 1 |
e05a1db9dc3f744a564ee26c248f0f93 | 17dc83d533e5c3ae1028846a9272e958 | <para>
The parser `Array(n,p)` parses `n` occurrences of `p` and returns the results in an
array.
</para>
<para>
For example, `Array(3,p)` is equivalent to `Pipe(p,p,p,(a,b,c) => new[] {a,b,c})`.
</para> | {
return (n, o, p) => function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p);
} | 0 |
6a7a58620592e149653342647665a5ab | aa0ffe601e014d4f8cee1ad41db3f41f | find the smallest difference between two arrays of integers. | class Solution
int smallestDifference(vector<int> &A, vector<int> &B) {
sort(A.begin(), A.end());
sort(B.begin(), B.end());
int mindiff = absdiff(A[0], B[0]);
int indexA = 0, indexB = 0, lenA = A.size(), lenB = B.size();
while (indexA < lenA && indexB < lenB) {
if (A[... | 1 |
8c26d4e2d41e68a0770b74579456b4a7 | 9a1176161c2c82cc05c04f9c5a06c72c | 标准化数据,将数据转化成均值为0,方差是1的数据 | def stand_scalar(data):
data = (data - data.mean()) / data.std()
return data | 1 |
7d8cc69ed3e3605bc60ec2862fdbf7a2 | 8c30f5b9f5dc2e013b490f311a78685d | Clone System # noqa: E501
Clones the specified System to a new System with the provided name. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | post_params=None, response_type=None, response_headers=None, auth_settings=None,
collection_formats=None, request_type=None):
return self.do_http_request(
method=method,
resource_path=resource_path,
path_params=path_params,
query_... | 1 |
3310ae57204b9035a0874ad69361335a | 64b1a1b7188cd8d1ea3fc53c586fccdc | Checks that the coolant channels are placed at the correct azimuthal placement
angles for a given start angle. | theta = np.array([x[0] for x in self.regular if x[0] > 0])
phi = np.array([x[1] for x in self.regular if x[0] > 0])
vec = ang2vec(theta, phi)
comptheta, compphi = vec2ang(vec)
np.testing.assert_array_almost_equal(comptheta, theta)
np.testing.assert_array_almost_equal(comp... | 0 |
0e147cd4f3453545b49573f9bcb7b756 | f2ecf2e49615f12e21987c655a299c1c | Converts a VSR time specification to a UNIX time stamp. | time_t
rcs2time(char *from)
{
time_t the_time = 0;
long the_offset;
int year, mon, day, hour, min, sec;
char *s, *d;
if (sscanf(from, FMT_DATE, &year, &mon, &day, &hour, &min, &sec) == 6)
the_time = packdate(year, mon, day, hour, min, sec);
if ((s = getenv("RCS_TIMEZONE")) != NULL)
the_offset ... | 1 |
75224e61337606745db13a59e1dea5ba | 35ee2f53889011edddffd06edd778b30 | Returns None if the argument passed in is not an integer | def convert_number(usr_input):
try:
return int(usr_input)
except ValueError:
return None | 1 |
ff64de62b017a4f17cb035bfd3f88023 | e4bf5046dcbf75a9a4759a37c977b0b0 | Validuoja vektorių jei paspaudžiamas Enter esant vektoriaus kortelėje | {
if (Pavadinimas_text.Text.Length > 0 && Kodas_text.Text.Length > 0 && TelNr_text.Text.Length > 0 && Id_text.Text.Length > 0)
Itraukti.IsEnabled = true;
else
Itraukti.IsEnabled = false;
} | 0 |
a54b4ba6121a373f89e21caee8fc7d4c | 131ce561ce938f6bf89051baccabec92 | Vagrant ssh task. | public function vagrantPlugin($arg = '')
{
$this->taskVagrantPlugin()->arg($arg)->run();
} | 0 |
f815367b6e56fcc72c7321992f950ffc | f946f51de3b6b96a3132390ae65f97be | The behavior when a Spot Instance is interrupted. Can be `hibernate`,
`stop`, or `terminate`. (Default: `terminate`). | public static final class Builder implements software.amazon.jsii.Builder<LaunchTemplateInstanceMarketOptionsSpotOptions>
public Builder instanceInterruptionBehavior(java.lang.String instanceInterruptionBehavior) {
this.instanceInterruptionBehavior = instanceInterruptionBehavior;
return this;
... | 1 |
797beaba55dc48870f3ed3be2c7db2c7 | eb62012f091f70fcf9dab2be78899e01 | app考生获取我的报名 | class Seller extends Home
public function getSelfApplicant(){
if(request()->isPost()){
$app_model=model('Applicants');
$result=$app_model->SelectApplicantsNotice($this->user_id);
return json($result);
}
} | 1 |
1fe9f4185f1a937504fd4cfad5c17adf | 46544dcebbc72cdf7216000ecdd85400 | Internal handler for tactical respawn end process, child classes can override to add custom logic | namespace Arena
public class GlobalManager : Academy
public virtual void
AtAnTeamRespawn(){ } | 1 |
a9d3b1e94a86550887cb97c1d677d750 | b5acfff6a2016cb1607d32a89b10e9a3 | Pause the printer for a number of seconds.
This is used to let fine structures cool down before starting new layers. | debut = time()
while (time() - debut) < duration:
if six.PY2:
sys.stdout.write(
(
"Sleeping for "
+ str(-int(time() - debut - duration))
+ " s"
+ " " * 35
+ "\r"
... | 1 |
39b2ecd39fc0a91f1258e7d9219edf90 | e2f1f113c713533232d2e9f5d90691c8 | Show the Summary of the Selected job | return (
<table className='ui very basic table'>
<thead>
<tr><th className="two wide"></th>
<th className="thirteen wide"></th>
</tr>
</thead>
<tbody>
<tr key={this.sta... | 1 |
16acbfcc02151117208c4e89312f7252 | 43c02c9fa78f6ef4feee0911d33c38a9 | Метод очистки карты - удаления всех блоков | namespace Assets.Scripts.Data
public class Figure
public void Destroy()
{
foreach(var block in Blocks)
{
block.View.Destroy();
}
} | 1 |
334bbdd30bf9bae9bbea2ff11e48f0a0 | 8122a58189d0cae406c8a66f85f5f7fd | Проверка навигационных кнопок (для навигации по статьям) | public class MainPage
public MainPage checkTitleLinks() {
links.shouldHave(CollectionCondition.texts("Кинотеатры", "Фильмы", "Дома", " "));
return this;
} | 0 |
40c2d2022ac9c2c26f36cfdfe131878b | b556f379dd3dc5cc5ed7f944d70f6823 | 发布心愿页 | {
$data=[
'username'=>I('post.username'),
'content'=>I('post.content'),
'time'=>time()
];
if($id=M('wish')->data($data)->add()){
$data['content']=phiz_replace($data['content']);
$data['id']=$id;
$data['time']=date('Y-m-d H:i',$data['time']);
$data['status']=1;
$... | 1 |
93647697bb7de045450290682520fe25 | 84fdcbcfb087c732212b5323179b7b5c | 跳转注册的Label点击事件 | namespace mYShop
public partial class RegisterForm : Form
private void RegisterLabel_Click(object sender, EventArgs e)
{
this.Hide();
LoginForm loginForm = new LoginForm();
loginForm.Show();
} | 0 |
be3dd413a1e204c2d01e7266ea2bc885 | f6933e9d8e50a51dc7957b55586d8a3e | 设置医生信息 | ImageLoader.getInstance().displayImage(doctorInfoDomain.getImage(), doctorPortraitImaegView);
nameTextView.setText(doctorInfoDomain.getName());
dutyTextView.setText(doctorInfoDomain.getLevel_title());
hospitaltextView.setText(doctorInfoDomain.getHospital());
signTextView.setText(doctorInfoDomain.getWelcome())... | 1 |
bf1596513d20f85a7b224624352b9ce8 | 218e667b3a119a312c0ad788111f7586 | Set the sort direction for field: ETCCtrDesc | public class RefinancePlanObjectFilter extends BaseFilter implements Serializable
public void setChgWhoSortDirection (boolean ascending) {
this.ChgWhoSortAscending = ascending;
} | 0 |
0f0140e24b4b2bb521900636be55b08f | 1f8538f18e88fdc98a0fb2f23f131b13 | Return the current HDMI out. | class ForeignToplevelHandleV1FullscreenEvent(_EventBase):
def output(self) -> Output:
return Output(self._ptr.output) | 0 |
076a7ca3692dee567e2436950ec39330 | ba8d98e73fe93db969d9cf64ca048a3b | Toujours applicable. | public boolean isPosable(Partie partie, Joueur joueur) {
return true;
} | 1 |
ecb34748dea75724e3bb9ad07ffda5f5 | 3733dea70460e7256f0654cd955baea6 | Adds the application id information to the event. | prefix = "api" if event.get("via_api") else "ui"
event["unique_id"] = f"{prefix}_{event['recid']}"
return event | 0 |
8d8145aac2faf527b9494069611a8b47 | 10bbdf3cd145bba777c53016d32ebc52 | Cambiar mesajes a leidos | namespace PPSaaS.Models
public static class NotificacionService
public static Boolean marcarComoLeido(int clave)
{
Boolean success = false;
return success;
} | 1 |
3172a5438540a83699a1df575065e070 | d4e0fb8aaf2ac33db2f9191e07536983 | Sets necessary headers, as required by the nature
of the HTTP exception (e.g. <c>Location</c> for
<see cref="HttpRedirectException" />). | {
_logger.LogException(exception);
httpContext.Response.Clear();
httpContext.Response.StatusCode = 200;
httpContext.Response.OnStarting(_clearCacheHeaderDelegate, httpContext.Response);
httpContext.Response.Headers.Add("_BingErrorFormat", "true");
... | 0 |
6579288b4460c34729e9d7ecd6cdafdd | 87178da2ad1f8e2eec41b99f3246b4e2 | 区間スケジューリングを行います。<br>
計算量は要素数Nに対してO(NlogN)です。 | while (true) {
double window_size = WINDOW_SIZE;
int overlap_cnt = 0, i, j, k;
std::map<string, double> usage;
struct container_timestamp {
string name;
double time;
};
std::vector<container_timestamp> timestamp_vector;
std::vector<string> overlap_check_vector;
double now =... | 0 |
c71e92ace1baa6e572ed01b631dc83e6 | ceb190089adf17147df5fc8399d98062 | Creates a new HazelcastInstance (a new node in a cluster).
This method allows you to create and run multiple instances
of Hazelcast cluster members on the same JVM.
<p>
To destroy all running HazelcastInstances (all members on this JVM)
call {@link #shutdownAll()}.
<p>
Hazelcast will look into two places for the config... | {
if (options == null) throw new ArgumentNullException(nameof(options));
AsyncContext.Ensure();
var client = CreateClient(options);
return new HazelcastClientStart(client, client.StartAsync(cancellationToken));
} | 0 |
8031fd3da947fdd00acfe8c9ec8e0689 | f1ab081453599d7651cdab7f942375a5 | Al completarse el llenado de la tabla de reporte,
colorea los saldos negativos | namespace ProyectoFinal
public partial class frmFactura : Form
void ColorearGrid()
{
foreach (DataGridViewRow row in dgvFacturas.Rows)
if (Convert.ToBoolean(row.Cells["colEstado"].Value)==true)
row.DefaultCellStyle.BackColor = Color.LightGreen;
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.