query_id
string
corpus_id
string
query
string
code
string
label
int64
28748f4b03c33b24d78812c302beaa07
da9f42320fc96203012f673cca336aea
Executor/heartbeat-sender thread
{ DWORD bytesWritten = 0; HANDLE hSerial = (HANDLE)lpParameter; while (!isQuit) { SleepConditionVariableCS(&sendHeartbeat, &heartbeatAccess, waitTimeOut); WaitForSingleObject(mutex, INFINITE); logFile << "hb\n"; packetLen = mavlink_msg_to_send_buffer((uint8_t*)heartbeatBuff, ...
1
fbbf79e8c2deddd48eaa8d7e82c7a280
7f16ba1f7c104a77b48c0a3eeccd8f5f
Get highest priority process for the package.
class System findHighestPriorityProcess() { for (let i = 2; i >= 0; i--) { for (let j = 0, length = this.readyList[i].length; j < length; j++) { return this.readyList[i][j] } } }
1
b33006c300e64add49831a90749bb667
480e36364e9d1e3b243a6d844f60e28f
Create a review comment for a pull request
GitHubPullRequest pullRequest, GitHubPullRequestFile file, ICodeAnalyzer analyzer, string physicalFilePath) { using ( var task = new Task<IEnumerable<PullRequestReviewComment>>(() => n...
0
72ecad8594748b1ea612b4eda3208082
fc5def2d2509e52c534500d2567e02a4
這是累積年資達多少就有幾天慰休的函數
if(h == 1){ var sd = new Date($( "#date_johnnyraw" ).val()); var d = sd.getDate(); var m = sd.getMonth(); m += 1; var y = sd.getFullYear(); var od = new Date($( "#date_specialbreak" ).val()); var ey = od.getFullYear(); var Howyouold = (ey - 1 - y) ...
1
a1bcc3909ca8a14104da4e34fc446669
64e993bd0844ce8222f2dde7d4d7a31c
Return if cspf-paths matches spf-paths.
{ if ( !(paths instanceof Array) || !(rules instanceof Array) ) return false; if ( paths.length < rules.length ) return false; for(var i = 0; i < rules.length; i ++) { var tmpPath = paths[i]; var tmpRule = rules[i]; if ( /^(\#).+/.test(tmpRule) ) tmpRule = tmpRule.substring(1); if ( tmpRule == '...
1
1a89ff6c1b6bce192bdb3b16d7b9edff
0651da5eafe77f6f9c3110648fd2e44a
查询单个应用 调用此接口查询单个应用详情。 Please refer to HUAWEI cloud API Explorer for details.
public class ServiceStageAsyncClient public AsyncInvoker<ShowApplicationDetailRequest, ShowApplicationDetailResponse> showApplicationDetailAsyncInvoker(ShowApplicationDetailRequest request) { return new AsyncInvoker<ShowApplicationDetailRequest, ShowApplicationDetailResponse>(request, ServiceStageMeta.showAppli...
1
0f2338440d9f8f872f6099d68401321a
0c56d1c18581a2783a8120ab13b33a71
obtiene la ruta de la carpeta publica
$config = leerConfg::leer('Acceso.json'); if(array_key_exists($this->URL['app'], $config) == true): return array(ROOT_APPS, $config[$this->URL['app']]['fuente']['directorio'], ENV_ENTORNO, 'Publico'); else: throw new Excepcion('La aplicación no se encuentra en el archivo de configuración'); endif; ...
1
0a7b4462bb9a8e70858909156e6fb60f
31970c1b89b36fcf1101742b962795a2
only allow 2 mines to exist concurrently
public class MinesPowerup implements Powerup{ @Override public void applyPowerup(GameObject in_toApplyTo, LogicEngine in_logicEngine) { if(MinesPowerup.i_numberOfMines >1) return; if(b_haveApplied ) return; else b_haveApplied = true; if(in_toApplyTo.visibleBuffs.indexOf(buff_minelayer)==-1) in_toA...
1
bcc955e1562f8efc033277bbb6af4ff0
7d4b1f15a07e5e853a4054ad945e43bf
Obtiene la información de saldos de las cuentas asociadas.
{ $params = array('startdate' => $startdate); $query = " SELECT DISTINCT pre.tipo_cuenta ,pre.sub_tipo_cuenta ,pre.top_parent_id ,CASE WHEN pre.account_id is null AND pre.account_id_l2 is null THEN NULL WHEN pre.account is null THEN pre.top_parent_id ELSE p...
1
f9128b45d851cb040434a9b44508566e
e88481cc5929e2a4fb9afb0a1c8deb9f
<JAB>
T5_RET retT5_J1939_Open (T5PTR_DBCANPORT pPort, T5_PTCHAR szSettings) { TS16 s16RetVal; switch(szSettings[0]) { case 'A': pPort->oem.u8ProtocolChannel = eu8J1939_ChannelA; break; case 'B': pPort->oem.u8ProtocolChannel = eu8J1939_ChannelB; break; case 'C': ...
0
be0ca98d6d7edc6bb8493781eaf0a29e
a7b7c84ba69e6406efb6842cfda5b8d8
Checks if a nunmber is denormalized.
impl MxcsrRegisterValue pub fn denormal_mask_bit(self) -> bool { self.bit_set(8) }
1
097ec19c9e679b4469cbbe5d5390486c
9ab0763bd909332feff102ffae469415
获取开发者账号列表
class WechatAuthModel public function getAccountList() { $json = $this->api('cgi-bin/customservice/getkflist', null, 'GET'); $kflist =array(); foreach ($json->kf_list as $value ) { $kflist[] = $value->kf_account; } return $kflist; }
0
579b83b86bae18419e601a38568d8e77
1a2eacff5c37125fe277ca64f33e8a9d
sets the width and the height of the grid
public class GraphPaperLayout implements LayoutManager2 public void setGridSize( int width, int height ) { gridSize = new Dimension( width, height ); }
1
b7948a62eb44bd268694ccbf732257ee
dfe74b71a15512d588169414444c9808
Retrieves a production type by it's pixel notation.
for member in Type: if member.name.lower() == name.lower(): return member return Type.IDENT
0
16bbff22c110c26e9f39e5bd61f4c16c
47829007e83392baf65e5a16905b57e3
r""" Returns true if the header indicates a sample is present in the target slot.
class InvenTreePlugin(VersionMixin, MixinBase, MetaBase): def is_sample(self) -> bool: return self.check_is_sample()
0
365509eadd73b29a74d61ff7b9f1a447
a1e777a4c07bbd4635d0884b4ab663be
Create an schema checking that the keyword matches one of the expected values.
value, type_ = value_type_pair generate_schema_checker(schema_name, {attribute_name: value}, DataModel(schema_name, [AttributeSchema(attribute_name, type_, True, description)]))
0
7910766e07e80ec6720fa4ffecf2bf3e
9f2852184a8fb11c9d136c7427909d74
İşletmenin plan bilgilerini getirir.
namespace InternetServicesProvider.BusinessLayer.Services public class InternetProviderServices : IInternetProviderServices public async Task<Plan> InternetPlanById(int planId) { throw new NotImplementedException(); }
1
42b4b771d73dff904f82edd240a6c7d7
6569f5da037e2f060c6a5bdd966edb49
Displays all appointments in main screen tableview. This button is selected as default.
public class UserHealth extends javax.swing.JInternalFrame public static void displayAppointmentTable(){ DocApp_Table.setModel(DoctorAppointmentController.displayAppointmentTable()); HideColumnsOfAppointmentTable(); }
1
0d05d0b165137fdabd80f77e2e74c650
24e5b1576f51ed57a038e3ce76503614
限制网速
public class SimulateNetworkInterceptor implements Interceptor private Response simulateSpeedLimit(Interceptor.Chain chain) throws IOException { int requestSpeed = NetworkInfoManager.getInstance().getSimulationRequestSpeed(); Request request = chain.request(); final Response response = chain.pro...
1
f3ae642758c52c37972a343c847acc44
04e8547824dae34f2d24da67ab9c7b42
Get required attributes for delete.
class VaporFile extends Field implements StorableContract, DeletableContract, Downloadable protected function columnsThatShouldBeDeleted() { $attributes = [$this->attribute => null]; if ($this->originalNameColumn) { $attributes[$this->originalNameColumn] = null; } return ...
1
0e12a5b5ba6b874bb5271215fc0f7a2f
1751b9263ccbfd34279d40d6f69cafaf
Create a filter for use in an FFmpeg filter graph
{ const char *filter_spec; unsigned int i; int ret; filter_ctx = (FilteringContext *)av_malloc_array(ifmt_ctx->nb_streams, sizeof(*filter_ctx)); if (!filter_ctx) return AVERROR(ENOMEM); for (i = 0; i < ifmt_ctx->nb_streams; i++) { filter_ctx[i].buffersrc_ctx = NULL; filt...
1
e8c6f13a73fc33e2aa074daa9e29765b
df375b6ad98d06483a1c4e311ac65cab
Handle the Google Drive "save" button
const gchar *m; GedWindow *self; self = (GedWindow *)data; m = gtk_file_selection_get_filename(GTK_FILE_SELECTION(self->file_selector)); save_file(self, m); gtk_widget_destroy(self->file_selector); self->file_selector = 0; }
0
4a19ffcd8d2eeb5138e9c436feb21140
5c8ad03177ac2173af2cc1d95c9b927e
Test extracting javascript functions.
class TestExtractScripts(unittest.TestCase): def test_extract_github_script(self) -> None: self.assertEqual( extract_scripts.extract({ 'uses': 'actions/github-script@v3', 'id': 'set-result', 'with': { 'script': 'return "Hello!"', ...
1
834870dbfd12c9faf5fbf5c0a3c2c372
b8fc7be7f4dd7e44812e7cc9b6c7c755
Get the hql reference. <p> The hql reference.
public String getQueryHQL();
1
5798a7b9c88202fda0da45b32846c3cc
57ac5c394b87065cf856a8902cfde4b9
Converts RGB image to HSL image.
def rgb2hls(img): return cv2.cvtColor(img, cv2.COLOR_RGB2HLS)
0
f59930fd8478fdf4b8719b6baa021b31
c824e9ae08bb1aa526a646a6958d682e
Gets the data of this PipelineResponseV4.
final class HubResponse public JsonElement getData() { return _element.get("R"); }
0
462eb26939fba74102ebe61e82ddbfc3
2ff1476df3f7b41f31ecb4fa71bb9830
pull out all the columns that have sorting set
class WPPCAllContests extends WP_List_Table public function get_sortable_columns() { $sortable_columns = array( 'contest_name' => array('contest_name', false), 'start_date' => array('start_date', false), 'end_date' => array('end_date', false), ...
1
a798768e505b6bac9f998f83b0f4be50
178ccf7b235c5478fc8f85acd8a74b61
Returns the meta object for the attribute '{@link codegen.ViewModel#getID <em>ID</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
public class ChartElementItemProvider extends DiagramElementItemProvider protected void addIDPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ChartEl...
0
452a1402e4f9e2ee22b3d3ace18fe390
e67417aeb64622328c119bf0dffd8c52
Check LLC bytes. Reserved for internal use.
static uint32 smd_lp_flwctl_cb ( void *cb_data, uint32 byte_count ) { ERR_FATAL("smd lp flwctl: byte_count = %d", byte_count, 0, 0); return byte_count; }
0
ea5039dc887f3754840cdcbc2493f6be
1f4ece75109919c28f7d6d5a1bc62528
ORDERNA A LISTA EM ORDEM DECRESCENTE
def ordenaDecrescente(listaRA): for j in range(len(listaRA) - 1, 0, -1): for i in range(0, j): if listaRA[i] < listaRA[j]: listaRA[i], listaRA[j] = listaRA[j], listaRA[i]
1
6f32bc8f6091ebb44f620919988ae344
c5ac93b2c9b5a029ee837493b73225b7
獲取所有提供Rest API服務的地址
{ return new List<ApiResource>() { new ApiResource("gateway_api","user service"), new ApiResource("user_api","user service"), new ApiResource("contact_api","contact service"), new ApiResource("project_api","project service")...
0
370b2bcae34e9935b7e986c03cc9b475
d64782d087c37e2f8b707b648ec86c47
Sets the vcms article persistence.
public abstract class VcmsPortionServiceBaseImpl extends PrincipalBean implements VcmsPortionService, IdentifiableBean public void setVcmsArticlePersistence( VcmsArticlePersistence vcmsArticlePersistence) { this.vcmsArticlePersistence = vcmsArticlePersistence; }
1
6f7825acef915d64375cf25091f3c298
3e026218ceac0c15aa8a6a2fed4cd2e2
Test that all node contains the same global statistics.
cube_list = [self.cube, self.cube] save_netcdf(cube_list, self.filepath) global_keys_in_file = Dataset(self.filepath, mode="r").ncattrs() self.assertEqual(len(global_keys_in_file), 9) self.assertTrue(all(key in self.global_keys_ref for key in global_keys_in_file))
0
1fabda615cea02d4fd1b57f121f6a2e4
995776723704f0096fd8ce9f65a7f036
Applies brain, subdural and soft windows to the image. All three windowed images are stacked together to make RGB image.
separated = separate(color_im) red_filt = filt(separated[0]) green_filt = filt(separated[1]) blue_filt = filt(separated[2]) combined = combine(red_filt, green_filt, blue_filt) return combined
0
cb393d1ea6f8c8aaa1b5ae6c36b200ed
c94c138ede5c7a71078e581013b7b689
Funktion zum Ausschneiden und skalieren der Originalbilder zu Kacheln der richtigen Größe
{ pictureBox_old.Image = Image.FromFile(filename); int W = pictureBox_old.Image.Width; int H = pictureBox_old.Image.Height; float scale; int w = 0; int h = 0; Bitmap bitmap1 = new Bitmap(pictureBox1.Width, pictureBox1.Height); ...
0
56b8b5c6223eae6f62afaa4464416c81
d7b0bc06d739b390b8294517d59436f8
! @brief Enter Wait state for Pairing request from FP seeker.
{ return ( smpBuildPairingReqRsp( SMP_PAIRING_REQ, pPairingReq, pBuf ) ); }
0
f0baeb0bb1d2c47f2ecd21297f0fe03b
592812479d468a95c0024ae41c25a897
Set the location code (location_code).
public function setLocationCode($locationCode);
1
4fde1f09c582babb827474639b2baffe
59645f51b2cae5c4122bfe2c91cafd9f
Check if vehicle is empty.
public class Airplane public boolean isEmpty() { return numPassengers == 0; }
1
99a3ebf8e638db152800c4bf1a42d07b
bebeff41f91816625e0a84e61cc15021
Set RF bit to generate interrupt, leave the rest
{ RF1AIES |= BIT9; RF1AIFG &= ~BIT9; RF1AIE |= BIT9; Strobe( RF_SRX ); }
1
421ee8edbbdb14eb9e42688b0b126f53
fa468efcae09113c828bc282c2e6febd
Getter for <code>mic_core.winery.region_id</code>.
public class PickupLocationSortInput implements Serializable public Input<SortEnum> getRegionIdInput() { return regionId; }
0
4499fca9fbbad56b157f878f05f1bcb3
eb575e6389fa67a18b6f2c479d613627
extractRef extracts a ref from a schema.
var result []TableRef Walk(node, nil, func(node nodes.Node, stack []nodes.Node, v Visitor) Visitor { switch n := node.(type) { case *nodes.RangeVar: t := TableRef{ Catalog: n.Catalogname, Schema: n.Schemaname, Table: n.Relname, Ref: n, } if n.Alias != nil { t.Alias = n.Alias.Al...
1
9f3fdeacb4de399dfc532f6dbe0c6d35
611038da3feb5e0b7bf0d7d28ae62f00
Server window show action.
namespace WotDossier.Applications.ViewModel [PartCreationPolicy(CreationPolicy.NonShared)] [Export(typeof (PlayerServerStatisticViewModel))] public class PlayerServerStatisticViewModel : ViewModel<IPlayerServerStatisticView> public void Show() { ViewTyped.ShowDialog(); }
1
bba2bf0997bc805315185eeb41e59e23
0ed55efdb76568eb9379dbc6883da5fd
Render the complete document once and return the number of pages rendered.
try { var markdownHtml = convertToMarkdownHtml(docTextSoFar); return countDirectNodes(markdownHtml); } catch (e) { return -1; } }
0
145aed6ec1a540e2e7c9c8918e1ef8e8
79bcafa2ac88e2dc7ddd8268b99e96e2
At the beginning the number of components is equal to the number of elements.
void WeightedQuickUnionPathCompression::Initialize() { if(!id.empty()) id.clear(); for(int i = 0; i < nrNodes; i++) { id.push_back(i); sz.push_back(1); } }
1
b630bbb62b21c501f7dc0a7ddbf91711
639c5f1ee1b5052b86d51a0531f97771
Returns the meta object for the containment reference '{@link flowchartpck.Conditional#getThenInstructions <em>Then Instructions</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getElseIfStatement_ThenStatements();
0
de18e34faa1be7c59a6fbca25cdfa8fe
9e62786ad9e77684b0371777a85e7822
Obtiene una lista por rol y subopcion
{ $subMenusRol = DB::table('sub_menus_roles') ->join('sub_menus', 'sub_menus_roles.sub_menus_id', '=', 'sub_menus.id') ->join('menus','sub_menus.menus_id', '=', 'menus.id') ->join('roles', 'sub_menus_roles.roles_id','=','roles.id') ->select('sub_menus_roles.*'...
1
3a580e5a23276dd1f62dbb3261d29063
be091ac973701827f302a81f74206b81
Runs the sufficient funds rebuilder step.
public class SufficientFundsAccountUpdateStep extends AbstractWrappedBatchStep @Override protected CustomBatchExecutor getCustomBatchExecutor() public boolean execute() { sufficientFundsAccountUpdateService.rebuildSufficientFunds(); return true; }
1
3e089f18cddcde3779631b14d26ea993
bf75428db3430366441526c144c41310
Initialization method for monetary locale object.
{ static $reflection; if (! $this->valueHolderdd0a15b) { $reflection = $reflection ?: new \ReflectionClass('Sylius\\Bundle\\CurrencyBundle\\Templating\\Helper\\CurrencyHelper'); $this->valueHolderdd0a15b = $reflection->newInstanceWithoutConstructor(); unset($this->cha...
0
3322d3436c8827c5231854e94780a4ed
745073f3d5b5d35bc16e52154923033d
Grab the DriveTrain Encoder PID values from the Dashboard and set them on the drive train
public class Robot extends IterativeRobot @Override public void teleopPeriodic() { if (driveTestMode) { double kP = Double.parseDouble(SmartDashboard.getString(SDkP, "")); double kI = Double.parseDouble(SmartDashboard.getString(SDkI, "")); double kD = Double.parseDouble(SmartDashboard.getString(SDkD, ""));...
1
64c7ca4950855bccae3b55c8fe4e2d80
3e30d1c3a006dfddb1c40a07edeed430
Creates a cookie using the parameters in the constructors (User) or (Model) (Either the three user fields or the one game ID - both done through proper constructor and passing in valid parameters) the end user (Not URL encoded)
{ long ticks = DateTime.Now.Ticks; string plainText = "userID=" + userID + ";userAccount=" + userAccount + ";Ticks=" + ticks + ";firstName=" + firstName; plainText += hashSplitter + CryptoHelper.ComputeHashString(plainText); CryptoServ...
1
3a0c98903f8b0071975de9e6972d6f2f
6f74ce6a5e50888a858cd57c2c2e296f
Método que busca as categorias ordenadas pelas que foram mais vendidas.
namespace ProductShop public class StartUp public static string GetCategoriesByProductsCount(ProductShopContext context) { const string rootElement = "Categories"; var categories = context.Categories .Select(x => new ExportCategoriesDto { ...
1
de134bfeaad37fb911a834a6b31fbd0e
092c361f30c1b5bc0fc4f59be2272d06
Method that returns true if user exist, false otherwise
public class User public boolean isExist() { return exist; }
1
89ef1ebc55a8ee39b4b6c8aef9560f3a
87a3f848103a8e9eda3b29a0d532fb95
Read ``application/x-www-form-urlencoded`` from the request body and parse for form data and return.
class BottleRequestExtractor(RequestExtractor): def form(self): if self.is_json(): return None return self.request.forms.decode()
1
a86ddf1c17c34e87c1d4cfd8efa4cf19
0b9467660986479094a91847bc8cf13e
Checks if the if() processor throws an exception on an invalid condition
PhlintTest::assertIssues(' $foo = false; if (rand(0, 1)) $foo = new ArrayObject(); if (!empty($foo)) foreach ($foo as $bar) {} ', [ ]); }
0
0dff4dc1d65cb4783d71b13908b303f9
86a32096d452f38287902e081abe877a
Gets called when the player stays within the plant trigger area
public class PlayerHarvesting : MonoBehaviour private void OnEnable() { EnteredTrigger = false; }
0
4d818aa4f8a396e289d6909d12746d03
522ff7780e44de20f3c16680df6a0e48
Returns that day is actual of month or week.
class DateFormat(TimeFormat): def w(self): return (self.data.weekday() + 1) % 7
0
e94121bdfa241ba76d0e26431cd4b222
47b68f57b6052e666b65c29a752c374f
Get the work order result in non-blocking way.
public String getWorkResult(String jobName, String lastCarteObjectId){ SlaveServer remoteSlaveServer = super.localRemoteSlaveServer.get(); SlaveServerJobStatus jobStatus = null; try { do { Thread.sleep(5000); jobStatus = remoteSlaveServer.getJobSta...
0
1f6ccbee9ed60c65ee6db53352761efd
a9014f5ec038fe2eb8dbd8ecc0458e3d
设置机柜在网页中的位置
for (var i in panel) { if (panel[i].url == url) { panel[i].x = x; panel[i].y = y; break; } } }
1
96de00e8c0385883288afbdb8e83c5fa
8df0c239a9193603f569daae5daf52ac
异步加载spine动画资源
namespace game.main public class AssetManager : MonoBehaviour public void LoadAtlasAsync(string assetName,Action<SpriteAtlas> finishCallBack) { StartCoroutine(AsyncLoadCoroutine(assetName, finishCallBack)); }
0
fa9de58d1e48034b1fe892f6e248aff7
d02aa8d46b9b46b256c353822ac69016
将值为null的Double改为0
public abstract class BaseEntity extends BaseModel implements Cloneable public Double getValueHandleNull(Double value) { if(value == null) { return 0.0; } return value; }
1
17cf7d28b7ef0dab13edba91a144290c
44bf63bf225a6de1cf82b32c30b33373
General function to help a developer or a user to create a privacy policy by inferring a default one using information about the CIS or the service. The privacy policy in result will be slightly completed but still need to be filled. E.g. if a CIS membership criteria engine requires access to geolocation data, the infe...
@NonNull final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException { LOGGER.debug("->createGuardPolicy: legacyGuardPolicy={}", legacyGuardPolicy); JpaToscaServiceTemplate incomingServiceTemplate = new LegacyGuardPolicyMapper().toToscaServiceTemplate(legacyGuardP...
0
93cf84b6b6868120c33bff692f33aaf8
fb4feb6702dccc3613d1ba47ea302554
Ajoute un gestionnaire de log pour les navigateurs Affichera les log dans la console des navigateurs
class BrowserLogger extends Logger public function __construct($logParam) { $this->logParam = $logParam; }
0
cfdf005d48b3843d557f3a437fd3782d
80829a544eb0802c5cfa538b8213e889
Schedule the event to not run between start and end time.
@Nonnull ScheduledEventAction setEndTime(@Nullable TemporalAccessor endTime);
0
e37c098e9e6d1ecafad20aa1886c361a
1fd0ba36f6b1eff02603d6ee3325d69a
Rename state props
renameInInitialState(feature, oldName, newName) { const targetPath = utils.mapReduxFile(feature, 'initialState'); refactor.renameObjectProperty(targetPath, 'initialState', oldName, newName); }
1
55c3d64a683c1597084ff8f5faff4577
e9119e7737223d7a1a3d24f1e685fc33
Import plugin options from previous Livefyre Comments plugin
$old_options = get_option('td_options'); if ( (int)$input[ 'convert_first_n_terms' ] <= 0 ) { $input[ 'convert_first_n_terms' ] = '-1'; } else { $input[ 'convert_first_n_terms' ] = (int)$input[ 'convert_first_n_terms' ]; } if ( !isset( $input[ 'ter...
0
7b51dd3a181c9330cfe8f2450739db33
b2e5bc9a27b12cdaa373805a288dda23
Create fake instance of Presentation and save it in database
class Room extends \App\Entity\Room implements \Doctrine\ORM\Proxy\Proxy public function addPresentation(\App\Entity\Presentation $presentation): \App\Entity\Room { $this->__initializer__ && $this->__initializer__->__invoke($this, 'addPresentation', [$presentation]); return parent::addPresentation($...
0
92dcfad01f907cf806364233798bcfbf
914acf39c31f07069201445313ca6ba9
Moves the stored values to the standard location. <p>Usually preferences are stored in {@code package.name_preferences.xml}. However the old com.android.contacts.common.preference.ContactsPreferences stored it in {@code package.name.xml} which is incompatible with the regular {@link android.preference.Preference} widge...
final SharedPreferences.Editor editor = sharedPreferences.edit(); final Set<BaseTypedPreference<?>> baseTypedPreferences = preferenceQueue.keySet(); commit(baseTypedPreferences); for (Map.Entry<BaseTypedPreference<?>, Object> toBeCommitted : preferenceQueue.entrySet()) { final BaseTypedPreference ...
0
c6c251a07e39889033f616cf4978df7b
6bea5a059816f267e6fee816583ab8fc
Função que acumula os pares que o utilizador vai acertando à medida que joga.
def jogaDados(): contador = 0 while True: dado1 = randint(1, 8) dado2 = randint(1, 8) contador += 1 if dado1 == dado2: break return contador
0
6983eceb96ef2476f069d5af001c997b
301a58434d3d661b246e13d80e86c76d
Metodo reponsavel em determinar se deve listar as colecoes ou objetos
public class ColumnAdapter extends BaseAdapter implements DownCallback, ZipExtractorCallback, DataCallback public void isCollection(boolean bool) { isCollection = bool; }
1
1ece77ec2a9ca141d72874928b1adb30
f0817dd91226695e0b69345ee74ab078
연동서버 정보 목록 조회
public List<SynchrnServerVO> selectSynchrnServerList(SynchrnServerVO synchrnServerVO) throws Exception;
1
e625f9e4a656b961f6b64a888f3a5dfe
c50deb9a523db48843b07c2707c5e2e2
sends the user, name of the collection and the collection description to the server to create a new collection
@RequiresApi(api = Build.VERSION_CODES.O) public class ServerConnect extends AppCompatActivity public Response renameBookCollectionServer(String name, String collection_name, String new_collection_name) { return sendGet("user/" + name + "/chname_book_collection/" + collection_name + "/" + new_collection_name); ...
0
30d4c38c8ead61f348d8d7f246f8aa97
54e1b6d1e6ef69919dacd3f863adb803
Afficher la liste des avocats
{ $grille = 1; $societe = Societe::where('etat',1)->get(); return view('contact.affichage-liste-contact',compact('societe','grille')); }
0
2fe0b049c34edbb1626be848ff6bf3ec
c8ff5df22308ee617d7b3622f5c7878c
Unsets the "autoCompressPictures" attribute
boolean getAutoCompressPictures();
0
277ac9d2d76cba402f1c4721a4904f7b
541611f601d4b8004e752653a3db1f8b
Set up Slick Carousel
$('#gallery .carousel').slick({ infinite: true, slidesToShow: 1, slidesToScroll: 1, autoplay: false }); $('#gallery .thumbnails .thumb').click(function () { $('#gallery .carousel').slick('slickGoTo', $(this).attr('data-thumb')); }); }
1
cbde73c35a5385ba461ce301999abf3d
176970cd93a23641c3ba60568fc689ee
Получить массив всех сообщений об ошибке
class AvtoToService public function get_errors() { return $this->errors; }
1
773613c5daeec7f25b845b5c00e8c338
e92531a8920c96185b7ef889afc41a3b
腾讯云COS获取存储桶文件内容
public InputStream getFileObject(String bucketName, String key) { ClientConfiguration config = new ClientConfiguration(); OSSClient client = new OSSClient(OssObject.OSS_ENDPOINT, OssObject.ACCESS_ID, OssObject.ACCESS_KEY, config); OSSObject ossObject = client.getObject(bucket...
0
644f985f02684c415b95341fdfe200fc
7c037a2a562ee438f861f4881e25ca88
Archive a job so it will be removed from queries
class Query(object): def archive(self): ids = self.rpc_model.search(self.domain, context=self.context) if ids: self.rpc_model.write(ids, {'active': False})
1
c0551b792dc00e660956fd2ff564f8f4
0531546d50387f27a3bb28cc227e690b
Make Unix domain socket address
void make_sockaddr_un(ErlNifEnv* env, ERL_NIF_TERM path, ERL_NIF_TERM* sa) { ERL_NIF_TERM keys[] = {esock_atom_family, esock_atom_path}; ERL_NIF_TERM vals[] = {esock_atom_local, path}; size_t numKeys = NUM(keys); ESOCK_ASSERT( numKeys == NUM(vals)...
1
5aef8ee0f86939c84f792e11001e2f73
5c4b834b0412acf7d13ada4c3ef79193
when Yelp List is mounted, it right away gets services for that user's zip code, which is stored in the db
export class RestaurantService constructor() { this.restaurantDB.on('value', resp => { this.restaurants = snapshotToRestaurantArray(resp) }) }
0
74723920d875ab9065ec9e4cceebf7d0
108c1564953addde34fd5bbab47c47c0
Calculate compound beam half-power width, assuming linear scaling with frequency
def p_width(peak, gz, ge, mz): return (peak*gz**2*mz**2)/(12*np.pi*ge)
0
ec4453ba0da245453cbfc062714cafdb
0f85f5ebf1caaba1a7c584062a8a71fa
Allow all payments from this peer address
namespace libtorrent namespace libtorrent { namespace bool send_peer(peer_connection const& p) { if (!p.is_local()) return false; if (p.is_connecting()) return false; return true; }
0
a0aecbfa7e8c67f8f6b4f3c860a642b7
a229c3ff4b03a654138d1cc7acba4517
Renvoie l'identifiant du dernier mail envoyé
public class LiveWall extends Controller public static class LiveTweetSocket extends UntypedActor private Long getLastIdMessageSent() { Long lastId = (Long) Cache.get("comet.lastidsent"); if (lastId == null) { lastId = getLastIdMessageSaved(); Cache.set("comet.lastidsent", lastId); } return lastId;...
0
af7698ec86000162e09eea6bdc707d68
60e6c8f15a86b7545284e11ca305ba97
Exposes the stored before-image.
class Image public function getOldImage() { return $this->oldImage; }
1
03f0c6f2af2a07aac0665c6f1a12af0e
59e7dc8b23f23861218da23cbb4c6d9e
Just drawing a cross for demonstrational purposes
public class SquareView implements ChangeListener public void drawCross(Graphics g) { final int padding = 5; g.setColor(Color.RED); g.drawLine(x + padding, y + padding, x + width - padding, y + height - padding); g.drawLine(x + width - padding, y + padding, x + padding, y...
1
aadaa39e3136192a1075e6ee2d46f802
8f91c7fc1860215e4c9e1aae9c6ad8e2
@brief 根据码流信息查找解码器
AVCodecContext **avCodecContext) { AVCodec *avCodec = avcodec_find_decoder(avCodecParameters->codec_id); if (!avCodec) { loge("获取解码器失败"); isExit = true; pthread_mutex_unlock(&init_mutex); return; } *avCodecContext = avcodec_alloc_cont...
1
3cc675b4d3e98f870bae9806fff2e081
8047929b55643da2d83fcf4f968c44a0
query other online agent besides the agent himself
own_idx = next((i for i, c in enumerate(self.__clients.clients) if c.id == own_id), None) size = len(self.__clients.clients) iterator = map(lambda i: self.__clients.clients[(i + own_idx) % size], range(1, size)) return next(filter(lambda c: c.has_requested(), iterator), None)
1
67d919c10e97dcc2b44cb609db053573
73f850bec1fcb0052505805aa5d036b0
called each time the 'select molecule' button is pressed
class Zeq_GUI(wx.Frame): def onSelect_specimen(self, event): self.s=str(self.specimens_box.GetValue()) self.update_selection()
0
f446933821815265d4f0065dc0f10384
9563800eb20077f9e929cbeffcd3c725
Associates a car with a location.
public class ResourceManagerCarImpl implements ResourceManager public boolean addCars(int id, int iid, String location, int count, int price, int xid) throws RemoteException { Trace.info("RM::addCars(" + id + ", " + location + ", " + count + ", $" + price + ") called" ); Car curObj = (Car) readData( id, Car.get...
1
cb14ad0c26f6c3bae1a7e90b6cc35275
7aaf209e887a7d6946ebbb3a8ff20011
Verifica se a lista de filtros informada possui filtros voltados para uma única propriedade do VO. propriedade. False caso contrário.
public class PagingFilterDTO extends PagingDTO implements Filterable @JsonIgnore private boolean isFilterSuit(final Map<String, Object> filter) { if (filter.containsKey(Filter.FILTER) && (filter.size() == 1)) { return true; } if (filter.containsKey(Filter.FILTERS) && (filter.get(...
1
05a8bd0409856a80bcfe6b8cc6fd7314
c050e9d557580eb233675e7565956c37
Handles the OnItemDataBound event of the rgRelatedPublication control.
{ if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Tuple<string, string, string> link = (Tuple<string, string, string>)e.Item.DataItem; Literal ltrlTitle = (Literal)e.Item.FindControl("ltrlTitle"); ...
1
bfa6c74cce8f05c967b76d85d088a372
17608042a99d60eb9b214705205702ab
Return the SelectionKey.
public class HttpRequestListener implements IOHandler public void setSelectionKey(SelectionKey sk) { this.sk = sk; }
0
6bdef0b6d267ca7e19579131aa321557
2fce173d15d03f884750006ef5c9e747
command to get all users without limit
self.queue.enQueue(self.identifier, self.dqEvent, "SELECT * FROM userTable WHERE id=0 LIMIT ?", (count, )) self.dqEvent.wait() self.dqEvent.clear() users = self.queue.fetchrst(self.identifier) return users
0
f751deb8b3f185a0251a321118388568
db97d3ee5dd826d65c38f113b0c92dd6
Checks that the assertion fails if the value does not contain a substring.
{ if (value == null) { throw new ArgumentNullException("value"); } int substringIndex = value.IndexOf(substring, StringComparison.Ordinal); if (substringIndex >= 0) { return; } Assert....
1
81e33eb9aa1288ee8331ebbcc4fff596
d3c9989efdc6051a99866014b019cacb
Send I2C sequence (registerPosition, writeData) to writeAddress, and then read readAddress into the output data.
class Bmc: def i2c_write(self, bus_type, bus_id, channel, address, *data): self.i2c_write_read(bus_type, bus_id, channel, address, 0, data)
0
a34ae5d48ca15d8357060cc8d25c566f
45d0392de5f5f605850b2155cc4f9f05
Creates an order for printing
class PrintsController extends ControllerBase public function submitorderAction() { if ($this->request->isPost()) { $params = $this->_params; $mModel = new Printhubs(); $mModel->createOrder($params); $code = $mModel->getCode(); $response = array( ...
1
2d300eb27d2945b7919370c9698330b9
c9a96f53953e2bb201b8d09ad70b4dfb
List test case for invalid input of update clinic
public class HibernateDataProviderTest @Test public void testUpdatePatientFail() { Patient patient = provider.getPatient(provider.maxPatient().get()).get(); patient.setName("UPDATENAME"); assertEquals(provider.updatePatient(patient), RequestStatus.SUCCESS); }
0
78e6e98665a2d1f8d35b821e0ff9c9da
9fa625a96a1baecd153cc196e54ffa95
All registration numbers of vehicle with given color
for keys,values in dicti.items(): if registration_number in values: return (keys[5:]) else: return ("Not found")
0
51c8e04611a854cc3fc9ebdc5b579e94
7f61448ad6da3ef0f9cb03f40c5be655
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686019(v=vs.85).aspx
cases like (1)
0
f1c7ceaeabaa21d3c28485bae2dc6e9f
ae9bbd551b95a0ba67699e29323f4df4
このフィールドがパラメタ化された型の場合は{@literal true}を返します。
public abstract class Field implements Setting public final boolean supportParameter(MappingParameterValue parameterValue) { if (parameterValue == null) { return false; } return SUPPORTED_PARAMETER.contains(parameterValue.getParameterType()); }
1
b80ad8baf301d669c5cc35a0247aea4f
04655b820c834dddf831b88a1177a7a5
Transform the Lower Bounds and Upper Bounds to abstract elements propagated throughout the layers.
Layer.__init__(self, name) self.size = input_layer.get_size() self.input_layers = [input_layer] self.lower_bound = lower_bound self.upper_bound = upper_bound
0