query_id
string
corpus_id
string
query
string
code
string
label
int64
6329aef202bc6541422d9aefc25da62d
be31edba0dfc802e767d098e06f1a3e7
Calculates the x component of the distance in meters between two GPS coordinates using the equirectangular approximation.
double phi1 = toRadians(p.getLatitude()); double phi2 = toRadians(q.getLatitude()); double lambda1 = toRadians(p.getLongitude()); double lambda2 = toRadians(q.getLongitude()); double delta = abs(lambda1 - lambda2); double firstTerm = cos(phi2)*sin(delta); double secondTerm = cos(phi1)*sin(ph...
0
0ec049d26ff08434d689229a38b55055
4ba0f6619060bfa9b72eaa4f651354c1
Fixture for files_zooms.mapchete.
class TestFunctional(TestCase): def provider_filesystem_uploader(): return ( ([ResizeFilter(100, 100), RotateFilter()], { 'photo1.jpg': '9f8bb12a840adc598c9257f0309fd04b', 'photo2.jpg': 'df0452191369cd17da8a686af4b2f90e', 'photo3.jpg': 'c17294d3485ee34...
0
ccc8a338b6f394d42538c5cf9828dc8b
15592cdcbdecd675cef88610c82811a4
Utility method that delegates to the methods of NetworkInterface to determine addresses for this machine.
List<NetInterface> addressList = new LinkedList<NetInterface>(); try { Enumeration<NetworkInterface> netInterfaces = NetworkInterface.getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { NetworkInterface iface = netInterfaces.nextElement(); ...
1
43b2a221c7cf9dbd9bd945dd8d8b587c
da18f0b42d02f8ddec796e1cf18a44dc
Save google data for user in db
{ if (!$this->user || !$this->user->hasAGoogle()) { return redirect()->back(); } $result = $this->googleService->retrieveData(); $this->user->profile->update([ 'first_name' => $result->given_name, 'last_name' => $result->family_name, 'g...
1
96e7a196b8e1f7aadec48a200cabfa67
23e2cb8e88034f0597ca88063a53e889
Dagster resource for parameterizing the ``ferc_to_sqlite`` graph. This resource allows us to specify the years we want to process for each datasource in the Dagit UI.
add_to_environment = context.resource_config.get("add_to_environment", False) if add_to_environment: with ParameterStoreResource.from_resource_context( context ).parameters_in_environment() as secrets: yield secrets else: yield ParameterStoreResource.from_reso...
0
e5b0e211be75e0d1291087438b9ff551
8727bf5361ee6645fda0a802c989a072
Implementing select transactions tab functionality
{ lbPlannedTransactions.SelectedItem = dgvPlans.Rows[e.RowIndex].Tag as MoneyDataSet.PlannedTransactionsRow; tabsMain.SelectedTab = tabPlannedTransactions; }
1
790598167e33b7746cd8e1f117c3eb41
55ce3dcf8ed2e4ab76e99ebbcc75483e
通过名称删除指定供货商
boolean deleteByName(@PathVariable String name);
1
c8d1c412da2b44e2925bf41c4be6956e
03fa047253bb830df057e2c27fff516f
Basic Monte Carlo single-thread implementation
def MC_s(sample_size, N, T, J, h): num, den = 0, 0 for i in range(int(sample_size)): s = spin_config(N) BF = bf(s,T,J,h) num += s.sum() * BF den += BF return (num/den)/N
1
e7b2a11ce043dc6443483b5d154f06c1
e6e2009c814dd735f5ff95fde0840e0d
@brief 设置低通滤波截止频率
D_ERROR_CODE BoardMPU6050_SetLPF_CutOffFreq(MPU6050_LPF_FREQ cutOffFreq) { return BoardMPU6050_WriteByte(MPU_CFG_REG,(uint8_t)cutOffFreq); }
1
71516e23060d46f0221146a7bb4853db
6670c6ff1bccadf8e2c16f27544dfde3
Determines whether a predicate has SUCCESS type.
{ if (predicateType != null) { foreach (PredicateType myPredicateType in this.PredicateTypes) { if (myPredicateType.Equals(predicateType)) return true; } } return false; ...
0
ccc8360862c774c6a120e4ab4f14db86
2805770c56b44f4de9ecac878b4017d6
Generate patient's Address label
function addressLine1Formatter(patient) { return `${patient.address_line_1 ? `${patient.address_line_1}` : ''}${patient.address_line_2 ? ` ${patient.address_line_2}` : ''}${ patient.foreign_address_line_1 ? `${patient.foreign_address_line_1}` : '' }${patient.foreign_address_line_2 ? ` ${patient.foreign_address_...
1
6f8caaf12838b22aebece944f70edf50
2207edbe20295a937da80da799f4e6a8
Only start moving towards a point if the action requires movement
namespace MoreMountains.TopDownEngine [AddComponentMenu("TopDown Engine/Character/AI/Actions/AIActionPathfinderToTarget2D")] //[RequireComponent(typeof(CharacterMovement))] //[RequireComponent(typeof(CharacterPathfinder3D))] public class AIActionPathfinderToTarget2D : AIAction protected virtual void Mov...
0
e1d5978c13f4125fcd864ce24e08bc93
c540644426a2cf69e74b448304fbd710
retrieve all keys in localStorage
var values = [], keys = Object.keys(localStorage), i = keys.length; while (i--) { values.push(localStorage.getItem(keys[i])); } return values; }
0
0503b3b20760684512514b1ec56a4ab7
e677cf4c65b89d1728a8ad5dcb1e4114
Returns the result of multiplication of values on the diagonal
class SquareMatrix(PlainMatrix): def diagmul(self): result = 1 for el in self.diagonal: result += el return result
0
c9edb58d6b9dcd91e23035849c100938
7239c4894392f2d56f6aeac6ac50d2f5
SOS report custom plugins RPM package.
return rpmmd.PackageSet{ Include: []string{ "dnf", "dosfstools", "e2fsprogs", "glibc", "lorax-templates-generic", "lorax-templates-rhel", "policycoreutils", "python36", "python3-iniparse", "qemu-img", "selinux-policy-targeted", "systemd", "tar", "xfsprogs", "xz", }, } }
0
a26eacd8ee2001eab430f21980a6e2dc
7c88622985e06be6526dced0579a74e0
转换PascalCase/camelCase 规则的字符串,为一句话,并以空格分割 例如: "ThisIsSampleSentence" 将被转换为"This is a sample sentence".
{ String[] strings = StringUtils.splitByCharacterTypeCamelCase(string); strings = Op.on(strings).map(new TitleFilter()).removeAllNull().get(); return StringUtils.join(strings, " "); }
1
a56cf2003e8e8f5cf02186dec171b275
3770525596d74ad59eb2ceff5868b7fc
Calculates the value of 'gamma(brut)'.
class Bulletins public function getBrutCsg(): ?float { return $this->brutCsg; }
0
4274341e4b15b07a0fdb060b7ae734d0
cc0d8004c512e10e8f0a7560b38db995
Sets the log message of revision <rev> to <logtext>.
public class DefaultChangeLog implements ChangeLog @Override public Tag tag( long revision, String description ) throws Exception { if ( revision < 0 ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_239 ) ); } if ( revision > store.getCurrentRevision() ) ...
0
1c82efc6fa1325cf2656b2c71b95b793
dbf2aa091fabc76eeed7f823aaa648d6
Add a node to the Tomography. The Tomography will assign an address if needed.
String addNode(int xCoord, int yCoord, String floor, String building, String nodeType, String longName, String shortName);
1
9b212f01d9c2fd47383f4fccd10bcdc4
b79ba3762bfa8f3a6b60761cd90512ab
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). The approximated number of unique elements observed via `PFADD`.
RHyperLogLog<Object> hyperLogLog = redissonClient.getHyperLogLog(key); long count = hyperLogLog.count(); return count; }
1
493c84e4849024dd7e7f194e725fe550
90b04ffbb9cc9a9566efb216b9b58441
Changes the bullet color.
this.gapWidth = gapWidth; bulletColor = color; isBullet = true; return this; }
1
f12d8ee88e9f43251c41d36e87ed3c3c
1250a9dd558de1e0b7686aeba9034fde
Setea la Expresion Regular dentro del jTextField
{ String newRegex = JOptionPane.showInputDialog( "Regular expression", _regex ); if ( newRegex != null ) setNewRegex( newRegex ); }
0
f4059599bdc49d1bcf7c78560e695f25
31f863409e519dd5b62b1fe9080eea16
显示服药方式弹窗
namespace iih.ci.ord.opemergency.assi.rationaldrug.viewmodel.datong public class RationalDrugDTViewModel : RationalDrugViewModel public override void ShowDrugInstruction(string idOrsrvmm) { OrdSrvMmDO ordSrvMm = orderSrvmmService.findById(idOrsrvmm); this.ShowDrugInstruction(ordSrvMm...
1
605aa4ae8903886d36d39ba74877c392
0db233bfc8abf06f633328455d3f58dc
Check whether Content Approval is enable on current library
$nReturn = 0; if ($mediaInstance->Caller == 'library') { $nReturn = 1; } return($nReturn); }
0
91c6adbd9b331f4c14a223019df4a326
361d72251ba66415948b1883b3e1c8a1
Returns the position of the given work item in the pipeline. For comparison, this method uses the native or overridden object.Equals() method. <para/>This method is an O(N) operation with respect to the items currently in the pipe. The pipeline search begins at the head (i.e., the next item that will be processed)...
{ int i; if (_useObjectCastComparer && isNullable) { for (i = count - 1; i >= 0; i--) { if ((object)items[i] == (object)item) { break; } } ...
0
296e7ed2a2450ebc26b5158651abb118
8b2fe11831241ef1aa3ecee3c6c9112b
Returns the meta object for the containment reference list '{@link es.us.isa.interparamdep.interparameterDependenciesLanguage.Model#getDependencies <em>Dependencies</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getDependencies();
1
951f6ab66675d319b0c526cdfc0a0f3f
09e48b27a147ae8cbdc8e028c37f852e
Sets whether to only use getX/isX accessor methods (as opposed to any method returning a value).
public class BeanJSONJournalEditorService extends JSONJournalEditorService implements BeanJSONJournalEditorServiceMBean{ public void setFieldOnly(Class type, boolean isFieldOnly){ if(propertyAccessTypeMap == null){ propertyAccessTypeMap = new ClassMappingTree(); } PropertyAccessType ...
1
fa4f2fa98e6627b10353584984073186
f379a1b7c6dcd1a2a6d366d5e7ba835c
Return the value associated with the column: DOCUMENT
@java.lang.SuppressWarnings("all") @javax.persistence.Entity @javax.persistence.Table(name = "Document", schema = "Production") public class Document extends org.jooq.impl.UpdatableRecordImpl<org.jooq.examples.sqlserver.adventureworks.production.tables.records.Document> implements org.jooq.Record10<java.lang.Integer, j...
0
8f693ad1507f130209fe4bbe78240678
1226774aff1bab99f58bcff0647c55bb
Wrapper around a torch criterion. Enables transforms before applying the criterion. Should be subclassed for implementation.
self._blank = kwargs['num_classes'] - 1 zero_infinity = kwargs['zero_infinity'] self._criterion = nn.CTCLoss(blank=self._blank, reduction='none', zero_infinity=zero_infinity)
0
046b7ebc133073f9f6e79a97b312ff54
28c006f5b465248833166545bc8e0d48
筋肉別の平均値算出
boin = np.array(boin) boin_0 = boin[boin[:,1] == 0][:,7:] boin_1 = boin[boin[:,1] == 1][:,7:] boin_2 = boin[boin[:,1] == 2][:,7:] boin_3 = boin[boin[:,1] == 3][:,7:] boin_4 = boin[boin[:,1] == 4][:,7:] boin_5 = boin[boin[:,1] == 5][:,7:] boin_6 = boin[boin[:,1] == 6][:,7:] boin_7 = ...
1
3d9714ddc08520000a2cbe97d7844a41
02c79fb76d644a7e2c949ae937dd555a
发送来电姓名或号码
public class BluetoothFragment extends BaseFragment implements View.OnClickListener private void sendCall() { byte[] call = new byte[1]; if (ConstanceValue.MISS_CALL > 0) { call[0] = 1; } addData(DataProtocolUtil.getData(DataProtocolUtil.MSG_TYPE.MSG_CALL, call)); }
0
2cf96a19d3179640c0b39015563bb8d7
f492261b85e4654cd80be7d07311c4b7
优惠活动列表,有则显示,无则隐藏
function showPrmtList() { $(".cart_youhui_list").each(function(){ $(this).find('li').each(function(i){ if(i>=4){ $(this).hide(); ...
0
22c0098b5e16a5b1c1adc0e8c2147917
390a13ca47ec9510a72e277903bec35e
通过cid找到mid的对应关系
{ if($cid>0){ $Mid=$this->pdo->getRow("select mid from ".DB_PREFIX_WEB."category where id={$cid}"); return $Mid['mid']; }else{ return $cid; } }
1
72082628ad88af88d6abd5f6911d0f82
fdfe22d363813f014c367b75ca34dba9
Обработка нажатия пальца на экран
class Application: # создание экрана def mouse_key_event(self, event): if event.button == 1 and event.type == pygame.MOUSEBUTTONUP: self.widget_event(event) else: self.mouse_event(event)
1
26be9ee90fb06787b0ea1e9ffe32e2d0
da10eead9413c2140a499e3ff042674f
Sort a word count list using the provided comparator function.
WordsList *sort_words(WordsList *words, int (*compare)(char *, char *)) { char *temp; int i, new_limit, num_words = words->num_words; do { new_limit = 1; for (i = 0; i < num_words - 1; i++) { if (compare(words->words_array[i], words->words_array[i + 1]) > 0) { tem...
1
f30a251565dc9fb774220616908f0b86
bc560654c9bcfbefe6cd2bccb5a79707
RFC2409 5 The length of the Diffie-Hellman public value MUST be equal to the length of the prime modulus over which the exponentiation was performed, prepending zero bits to the value if necessary.
static status_t p256_public_key_length_check( const ecc_public_key_t *public_key) { if (launder32(public_key->x.key_length) != kP256CoordBytes || launder32(public_key->y.key_length != kP256CoordBytes)) { return OTCRYPTO_BAD_ARGS; } HARDENED_CHECK_EQ(public_key->x.key_length, kP256CoordBytes); HARD...
0
7ea707f1883edb1209c932083e8f4a25
755713b34445521c5f1702d1db3527e1
Show the species report for a specified date range and location
try { $results = Mapper::speciesForLocation($locationId); if (!count($results)) { return self::formatErrorResponse(Response::HTTP_NOT_FOUND, self::HTTP_NOT_FOUND_MESSAGE); } return self::formatNormalResponse(Response::HTTP_OK, $results); } catch (Exception $e) { return self::formatErrorResponse(R...
0
8817b62f422f754ac8b83a85e2db08eb
149dce7eb20c2ee9004c21e5f5b47917
NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. Default value is `NO_NAT`. Possible values are: `NO_NAT`.
class TargetInstanceArgs: def nat_policy(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "nat_policy")
1
5423bc949998c4ff9c66d2cae73cbae1
8b333efbdb5787d21633760e799642f1
The Amazon Resource Name (ARN) of the DB cluster.
class ResourceGroup(pulumi.CustomResource): def db_cluster_id(self) -> pulumi.Output[str]: return pulumi.get(self, "db_cluster_id")
0
3b7c63a7c51af21226b75326c566560b
67231a8949d83ebef4a45c3fde7479fd
SetData(data pointer) -> boolean
int RField::SetData(float data) { memcpy(fldData, &data, sizeof(float)); fldChg = TRUE; return (sizeof(float)); }
0
821ba9d9bf8244c5485052f81b528f24
1fb79d4825654fd298710d2f94a8c9f3
Overwrite a global table without breaking references
void update_global_table(uint32_t global_aggr_key, uint32_t count_delta, uint64_t sum_delta) { uint32_t h_glb = (uint32_t) (global_aggr_key * BIG_NUMBER); h_glb >>= 32 - log_global_buckets; if (global_table[h_glb].aggr_key == global_aggr_key) goto increment_bucket; while (!__sync_bool_compare_and_swap( ...
0
94f64a11fefc7f1b779ac09aca112c83
cb1387e214ccfc46cca7fb1d54a8cfac
Returns the id and database primary key of this instance.
namespace LinFx.Extensions.Blogging.Domain.Posts public class PostTag : CreationAuditedEntity public override object[] GetKeys() { return new object[] { PostId, TagId }; }
0
5ca25e418fd87d644ad309727a3a53e1
f63e5042637442832a208bba273a2f48
create the columns portion of the INSERT statement
{ if(isset($val) && is_array($val)) { $stmt=""; $count=count($val); $i=0; foreach ($val as $value) { if($i<$count-1) { $stmt=$stmt." $value, "; } else { $stmt=$stmt." $value "; } $i++; } return $stmt; } else { echo "ERROR 2012: invalid argument ...
1
6bf1cbf0dcce6b936ec2e77339751982
a1c459168ba9ccc2717fda2611b6b929
Método que permite obtener el usuario del administrador de la aplicación. Método publico que permite obtener el usuario del administrador de la aplicación.
class admin extends Model public static function getCurrentAdmin(){ $usuario =Auth::user(); $admin=admin::all()->find($usuario->id); $admin->usuario=$usuario; return $admin; }
1
49a3bf6fce83fc3055193a2ce6129174
552e51336340bfa2d5ab5cee1365ce5f
Creates collection of tag definitions.
class TagDefinitionsApi def get_tag_definitions(opts = {}) data, _status_code, _headers = get_tag_definitions_with_http_info(opts) return data end
0
1e36fd4cf4b7c6c7a874865c66bdec8d
676a5d1da70db2a6f48b927d4de8b89a
Adds a position to the cart.
public function addToCart($request);
1
c677c6fab2da772a67d19c9d85f34542
c225629974d12a952c4378ce305adca4
端末画面サイズ変更
{ _screenSizeEdit = true; int heightTb = Convert.ToInt32(tbHeight.Text); int widthTb = Convert.ToInt32(tbWidth.Text); if (_sizeScreen.X > widthTb) { _caller.Size = new Size(widthTb + 16, heightTb + 71); } else ...
1
f37ca5e8e0961c4ec2cf8552a59df997
7e114884be4b32742c802888a57d743d
Fills output list
{ FILE* output = fopen(filename, "w+"); while(outputlist!=NULL) { fprintf(output,"%s\n",outputlist->line); outputlist=outputlist->next; } fclose(output); }
0
0112e704e2e21b90fb49f92f57b2db90
80f89b9703339f0cf7509649188c2a13
Routine to tell the user the serial port has been set
printf("\n--------------------\n" "\n | Position change events will call their associated function every time new position data is received from the device.\n" " | Press ENTER once you have read this message.\n"); getchar(); printf("\n--------------------\n"); }
0
09cecf345d04c161d908405ac26274ff
3e465375b2f386d2660b541a1e54835f
过滤掉不满足条件的酒店
public class Search implements SearchBLService public ArrayList<HotelVO> filterByNumberOfRooms(ArrayList<HotelVO> hotelList) { ArrayList<HotelVO> newList = new ArrayList<>(); for(int i=0; i<hotelList.size(); i++) { HotelVO hotelVO = hotelList.get(i); if(roomType!=null) { int index = hotelVO.getRoomTypeLis...
1
8db9941059a3f08e61f30e219a2c15b5
5d7fa115eed7d693517f251949017355
Sharpen an image after resize
enh_sha = ImageEnhance.Sharpness(img) sharpness = 1.5 gf_sharped = enh_sha.enhance(sharpness) return gf_sharped
1
8e81d3dc2455a4ae7a4638625c63fc06
36b0108e1550c80d3d5625805d3eea9a
Cleanups the application identifier.
full_app_id = self.entitlements["application-identifier"] if is_need_prefix: return full_app_id else: return full_app_id.replace("{}.".format(self.app_id_prefix), "", 1)
1
132350f85f84fce894e0927fd3ffb943
5339820056bfe7930d8bcce7ae8353a5
Creates an event handler for clicking and dragging.
export class EdgeDragHandler constructor( id: string, edgeWrapper: EdgeWrapper, listenerAdder: IDragListenerAdder, selectionManager: SelectionManager, private readonly stageInterface: StageInterface, ) { let clickData: { isCtrlOrMetaClick: boolean; mouseStartLocal: { x: num...
1
0b749831d84c68ec80bc07611e084a81
62e4867f3f7dde141854c9b6da418656
Sets the archive handler that's associated with this context
public void setSource(ReadableArchive source);
1
4bb9b01ea670e9c5ce64e6d7f467f213
fcdf2f33bfaae95ceb1ce6ce054514a0
Set fling enable for page.
public class BaseActivity extends AppCompatActivity public void setIsOpenFlingClose(boolean isOpenFlingClose) { this.isOpenFlingClose = isOpenFlingClose; }
1
6541cde15c978cf278759ea0abc64c77
e52f80b8767d512c2badf54ba0e7deab
点在线段上 包含端点
bool onSegment(const Point &l, const Point &r, const Point &p) { return (onLine(l,r,p) && checkOnSegment(l,r,p)); }
1
b47aaf49d816cf6afffb976685c8cc4b
cddbdc41b4fbb3c08b264606769c4c80
Questo metodo calcola il valore delle statistiche correnti a partire dai punti esperienza.
public void calculateStatsFromExp(PlayableCharacter pc);
1
6634eb7fcca6ae236e85f25399530519
5c6566d64556eba6805722190a360561
Called when health is taken from the player
void AFDMainCharacter::OnHealthChanged(AActor* InstigatorActor, UFDAttributeComponent* OwningComp, float NewHealth, float NewMaxHealth, float Delta) { if (Delta < 0.0f) { GetMesh()->SetScalarParameterValueOnMaterials("TimeToHit", GetWorld()->TimeSeconds); } if (NewHealth <= 0.0f && Delta < 0.0f) { APlayerContr...
1
b0362933096de3bbf6d0298bc5792286
b102e13dc08e840780610f21064faaac
对输入的原始彩色图像进行预处理, 包括灰度化, 中值滤波, 利用图像掩码提取主要车道等
def frame_processor(image): color_select = HSV_color_selection(image) gray = convert_rbg_to_grayscale(color_select) smooth = remove_noise(gray) edges = detect_edges_canny(smooth) region = mask_image(edges) hough = hough_transform(region) result = draw_...
1
ea00725c995919ef683b76cf7c9860be
a3bb90b2be64b41c7880369d6a2b72f6
converts bytes into a temperature value and saves it
global tempInInt converted_Temps = lastTemp - 273.15 tempInInt = int(converted_Temps) dropWeather()
0
5a6a9df563d89c3c22c0ac2fcc6d768d
53ccdd0ed19e97eb059c988dbac3448e
Set the qualifier matcher.
public abstract class AbstractFunctionExp extends MathExp public final void setQualifier(PosSymbol qualifier) { myQualifier = qualifier; }
1
2734450b2a45b2cb9ccda13f3a6cfc13
3c075552787334a88c40fd4be3817187
Creates a list of {@link ExtractedResult} which contain all the choices with their corresponding score where higher is more similar @param query The query string @param choices A list of choices @param cutoff Keep only scores above cutoff @return A list of the results
protected List<ScoreElement> postprocessQuery(List<SegmentDistanceElement> partialResults, ReadableQueryConfig qc) { final CorrespondenceFunction function = qc.getCorrespondenceFunction().orElse(linearCorrespondence); return ScoreElement.filterMaximumScores(partialResults.stream().map(r -> r.toScore...
0
7b1db3f20d8095266b26270030154eb7
6ac0b565ec462bb17f1f9ed66130e818
Validate count of days from range that are beautiful
class TestBeautifulDaysAtTheMovies(unittest.TestCase): def test_sample(self): result = beautiful_days_at_the_movies(20, 23, 6) self.assertEquals(result, 2)
1
2b7fbf261c6df8ef2d6901f5ba223793
cebec322ffa9deae17ea78bfcb802a15
Create an account status Create an account status record for an account.
class OrganizationsClient(Client): def show_create_account_status(self, request): return self._show_create_account_status_with_http_info(request)
0
53855b4c73855957f2e3b8454f6df3a4
0e9aff8a9fcac84149404828bc404407
Создает модель вопроса и возможных ответов
class Quiz extends Model public static function createForModel(Model $model, int $author_id, array $data): ?Quiz { $author = User::find($author_id); if (!$author) return null; $quiz = self::create([ 'creator' => $author->id, 'editor' => $author->id, 'model...
0
723c4675c92f0b585fb296e8996c5bd2
d0ceb1e38cdeca9c5cf250cda86355d5
get all active programs
var p []Programs err := DBRead(QueryPrograms, EmptyInter, &p) if err != nil { fmt.Println("err query:", err.Error()) SendError(w, "Error Processing Request") return } progs := make([]string, 0) for _, pr := range p { progs = append(progs, pr.Folder) } b, err := json.Marshal(progs) if err != nil { fmt...
0
e85aef30fde257ca70a370f982e92ba1
2a6b9b057e8afbb83d6300887b8f539e
https://stackoverflow.com/a/15423899
string randomString(size_t length) { static auto& chrs = "0123456789" "abcdefghijklmnopqrstuvwxyz"; thread_local static std::mt19937 rg{ std::random_device{}() }; thread_local static std::uniform_int_distribution<std::string::size_type> pick(0, sizeof(chrs) - 2); std::string s; s.reserve(length); while (length...
1
89a7dd44dc4d3dbbdc9396d6d084c1af
dce2c3f4ee6234bf16de920dc02e1198
Ensure that we preserve dict order on python3
def preserveYamlOrder(): _mapping_tag = yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG def dict_representer(dumper, data): return dumper.represent_mapping(_mapping_tag, data.iteritems()) def dict_constructor(loader, node): return collections.OrderedDict(loader.construct_pairs(node)) yaml...
1
b42a3343389d1f43ce805fea45c4370a
4e731719926ab0e27a3341b186038f25
БИНАРНЫЙ ПОИСК ДЛЯ ИЗМЕНИЯ РАСПИСАНИЯ НУЖНОЙ ГРУППЫ
protected function getSearchGroups(array $teams, $isLocation = false) { return DB::connection('old_mysql') ->table('eck_group as g') ->join('eck_library as l', 'l.id', '=', 'g.library') ->whereIn('l.id', $teams) ->where('g.no_search', true) ->where...
0
632df16db7df66e9dccd7055ef7b8700
40538869a01eb17021db037b1c3e2aa7
Calculates the minimum number of inliers as a function of the number of putative correspondences. Based on equation (7) in Chum, O. and Matas, J. Matching with PROSAC -- Progressive Sample Consensus. In <EM>Conference on Computer Vision and Pattern Recognition (CVPR)</EM>, (2005), pp. 220--226. on p_badsupp, that the...
def ransac_iters(w=0.5, d=min_num_pairs(), z=0.99): k = np.log10(1 - z) / np.log10(1 - w**d) return k
0
d20cacb3296015df984f2073a58e6d78
84e4122fde71ab66df4a203078da5c75
action 导出邮寄地址
Language::read('deliver'); $address_list = Model('daddress')->getAddressList(array('store_id' => $_SESSION['store_id'])); Tpl:: output('address_list', $address_list); Tpl::showpage('store_deliver.daddress.select', 'null_layout') ; }
0
4fdc6d0c1f66702bd728373d418700fb
8f8ed864a8b6291b0fd858693b8d5c83
结算价除以活动价 小于 SVIP折扣率-商家品牌表中技术服务费率(SPOP)
@RequestMapping("/product/costPriceRate") public ResponseMsg costPriceRate(HttpServletRequest request) { boolean flag = false; if(StringUtil.isEmpty(request.getParameter("priceArray")) ) { flag = false; }else { String brandId = request.getParameter("brandId"); MchtProductBrandExample mchtProductBrandEx...
1
b7b29644bbf1494b5854cce4523699ca
e860b4f555f597b13d7b377632301972
将列表中指定位置的元素替换为指定元素,并返回原先位置的元素
public Object replace(int i,Object e) throws Exception;
1
ec0149334f7acaf1bdc46db7a6deefaa
5440d5e14fb35647e4a1b297e7090fe2
驾校的教练列表
if(!empty($this->session->userdata('schoolRegister'))){ $licence=$this->session->userdata('schoolRegister')['licence']; }else{ redirect('/manage_schoolRegister/goRegister'); } $schoolWhere['licence']=$licence; $res=$this->school->search($schoolWhere); ...
1
e2bb7ab840ebe0b25386bcccd82ef602
05f0a31bd2ad7d1396fff6f388fcf329
Get port N.
class contents: def pgetN(self,value): return self.pickupweights[0]
0
73a206adfad653d303c17fc31bc31a78
e817fff8e28f82f70faa56c35e20f8d2
스택의 top에 있는 데이터를 반환하고 제거하는 함수
if(isEmpty()) { printf("스택이 비었습니다."); } else { return stack[top]; } }
0
fe283fdac3fc65d88667672275191573
3ff8f011ed9634c5b4fa5ac5ec28bf34
Fail case of play quiz api test case with wrong bearer token.
class TriviaTestCase(unittest.TestCase): def test_play_quiz_failed_wrong_bearer_token(self): response = self.client().post( '/quizzes', json={}, headers=self.wrong_bearer_token) json_data = response.get_json() self.assertEqual(response.status_code, STATUS_UNAUTHORIZED) self.a...
1
8165e9bc104b1194c8dbdad7004a2100
25361bd0dcfb69eb0bc441ddc0aac52b
Bounce message to sender.
void Snd_Message(peer *p, AAAMessage *msg) { touch_peer(p); peer_send_msg(p,msg); }
0
c1aa93f28bd6ba53b232a98cddd94b81
83aecafd3d91ab88a6301f0a50bd501f
해당 조직에 대한 공간들의 통계 목록들을 조회한다.
public @ResponseBody List<RpairTrgetGroupVO> selectRpairTrgetDeptStatistics(@RequestBody RpairTrgetGroupVO rpairTrgetGroupVO, ModelMap model, HttpSession session) throws Exception { rpairTrgetGroupVO.setUsePage(false); List<RpairTrgetGroupVO> items = rpairTrgetGroupService.selectRpairTrgetDeptStatistics(rpairTrget...
1
515211d5aa82f532e7e1451b31edd879
7cd3b7c4b975e5a6da89bcd9a66f9879
Resume a paused sms, if conditions are now ripe.
class ConversationResumed(AlwaysEqualEventMixin): def apply_to(self, tracker: "DialogueStateTracker") -> None: tracker._paused = False
1
f4b235f28597ba268e87d5352ead01a9
165ea564e5496cc574c0f702463ee783
添加排班设置信息
namespace XBase.Business.Office.AdminManager public class WorkShiftBus public static bool AddWorkShiftInfo(WorkShiftSetModel WorkShiftSetM,string WorkShiftTimeInfos) { return WorkShiftDBHelper.AddWorkShiftInfo(WorkShiftSetM, WorkShiftTimeInfos); }
1
a790d1a75fb7dd90297dbe77c68395ab
656d427c2ff5f6803746daa7989284fd
\brief Value constructor
class AddValue AddValue(const T& v) : theValue(v) { }
1
1aa2c58e86744b5528ee91cfa6dd02c9
770d676c01665897c312b1f5a874fec9
Largly inspired by https://github.com/danieldiekmeier/memegenerator/blob/master/memegenerator.py This takes an image_file that is stored as part of the dropdown options and overlays a string inputted onto the poster.
fontsize = 80 draw = ImageDraw.Draw(img) font = ImageFont.truetype('/usr/share/fonts/truetype/freefont/FreeSans.ttf', fontsize) img_width, img_height = img.size text_width, _ = font.getsize(text) text_height = fontsize draw_x = (img_width - text_width)//2 + x_offset draw_y = (img_height ...
1
cfa1d6fdbbd8f6cb808d758e512d9304
672c87c14b2d8f7118bee6df3e3b75e1
根据歌曲id下载歌词
return new Promise((res,rej)=>{ axios .get(`https://api.imjad.cn/cloudmusic/?type=lyric&id=${songId}&br=128000`) .then(function (response) { res(response); }) .catch(function (error) { rej(error); }); }); }
1
da3b2a75a601259bdffbdffcc512eed7
c73982294afdb797b1ac3707c6b550e6
** String::charAt
BUILTIN_FUNCTION(string_charCodeAt) { JSValue str, ret; cint pos, c; builtin_prologue(); if (args[0] == JS_NULL || args[0] == JS_UNDEFINED) type_error_exception("string_charAt"); str = to_string(context, args[0]); GC_PUSH(str); pos = na >= 1 ? toInteger(context, args[1]) : 0; if (pos < 0 || string_l...
0
82632c9c978a9bcb4b822ee56103124d
097f5ff91063f836a3db3c2ab14ef738
未登录时移除购物车商品
let _this = this this.removeAllGoods.on('click', function() { _this.cart = _this.cart.filter(shop =>{ if(shop.check === true){ }else{ return shop } }) console.log(_this.cart) localStorage.setIte...
0
a0955dcb1391f2806844afd09bea586b
a2ba8b005505966ac3635f586f9bf7e8
Get DXF entities from a SolidOperation.
RVector c1 = sol.getVertexAt(0); RVector c2 = sol.getVertexAt(1); RVector c3 = sol.getVertexAt(2); RVector c4 = c3; if (sol.countVertices()>3) { c4 = sol.getVertexAt(3); } dxf.writeSolid(*dw, DL_SolidData(c1.x, c1.y, c1.z, c2.x, c2.y, c2.z, ...
1
5a3b886add7828444a03c4cfb7fae4fe
f08aeb33fc5481e5b16fb28515280a86
Both people become eachothers spouses
{ for(int i = 0; i < arrayYounger.length(); i++) { if( arrayYounger.at(i)->spouse == nullptr) { for(int j = 0; j < arrayOlder.length(); j++) { if(arrayYounger.at(i)->spouse == nullptr && arrayOlder.at(j)->spouse == nullptr && arrayOlder.at(j)->gender != array...
1
1e13e416bdaaf1944fbdef5ffdd36446
67ad8b35fcbe50cb5bbaeb6353823436
取得更新、删除、添加记录数
public long recordCount(Map<String, String> param) throws SQLException ;
0
f3a698608465de5cd6ddb58dbbf95152
759112cf34e86c5305a559bcf4da563a
Get reporter id. Returns: str: Reporter id.
class CheckWithReportIds(object): def id(self): return self._id
0
73c78f59a89395f09b785789da5af4f4
9f7e036333faa305324159257ccc7f8e
Applies any damage modifiers (increase/decrease damage taken) to the caclulcated damage amount.
public class DamageEffect : EffectDescriptor void CheckDamageModifier(PitchCharacter src, PitchCharacter target, BaseAction context, ref DamageType dmgType, ref int dmg) { dmgModifiers.Clear (); src.GetEffects (dmgModifiers); for (int i = 0; i < dmgModifiers.Count; ++i) { var mod = d...
1
26f064c06edbaaab5fb45310929990ca
0f2e7a7c74b92c12701e40b4d6a6eaf2
Returns the current principal if session is authenticated. Otherwise returns undefined
interface PrincipalFacade fun getPrincipal(): UserPrincipal?
1
e31a20f810fff812ed0635f1340e5d18
aa3572afab0e863c7400676c5aeb0a9f
ContainsAll checks if given slice contains all searched strings
func ContainsAny(s, chars string) bool
0
ad59734f531db316a8b2d53bb7789406
483bf9080c60010acdc1e63dc806e60d
Sets up system properties, required for running launcher.
doSysProps(mc); doAppProps(mc); final String logbackConf = ConfigurationHelper.getSystemThenEnvProperty(CONF_LOGBACK_EXT, null); if(logbackConf!=null) { URL url = null; try { url = URLHelper.toURL(logbackConf); LoggerFactory.getLogger(JVMMonitorMain.class); JMXHelper.getHeliosMBeanServer().i...
1
92277b8ad8d644c72cdbc4c0817519dc
00102ee396fea74bef6246b13fea79e7
Worker function that extracts audio features of given subset of data.
for sub in range(1, self.num_subjects+1): if (not self.has_model or (self.has_model and sub == self.target_subject)): if self.verbose: print bcolors.WARNING + "\nReading audio of {}. subject".format(sub) + bcolors.ENDC [Fs, x] = audioBasicIO.read_audio_file("{}/raw_da...
1
3a00fa87b0334ea02e975e75eb2537a0
761c11b65118a0d1cc1dd4279894ac6a
获取当前Bundle程序集全名
namespace HOTINST.OSGI.Core class Bundle : IBundle public string GetBundleAssemblyFileName() { return BundleConfigProvider.GetBundleConfigAssemblyName(this.manifestData); }
1
5336d727eecbdcfcaab730b5e3b30310
91192180890096728cfdb0f2e0c5c555
Get travel distances from each source point to each target point.
class TSP: def get_distances(self): return self.data.edge_weights
1
e076b5f92137ed7ef96223db02ebb87b
4b7fd9e06849363ed4bab95fbe976daa
Checks the user privacy authorization to Health Kit.
fun canAuthenticate(context: Context): Int { return from(context).canAuthenticate() }
0
aa45ee16f14f51c1357f9950c68c8fdd
fc1c927564710fc164b045db6c222c5b
Solicita las canciones al servidor de top semanal
job = scope.launch { try { val response = fanRepository.getSongsList() when (response.isSuccessful) { true -> { _songsList.postValue(response.body()) } false -> parseError(response.err...
1
c9ea1806aee08957e237a3b01fbd2a96
f86552f3cc92f83fca5893923bef9dc8
向数据库中添加新的类目。 在添加新类目之前,对要添加的类目先进行判断: 若该类目名已经存在了,那么返回1 若该类目名不存在,那么就成功添加,然后返回0
{ bool flag = false; string sql = "insert into category(name) values(@caName)"; SqlParameter [] paras = new SqlParameter[] { new SqlParameter("@caName",caName) }; int res = sqlhelper.ExecuteNonQuery(sql,paras,CommandType.Tex...
0