query_id
string
corpus_id
string
query
string
code
string
label
int64
2d3dd53f8b61f53285b13da45c62758c
44afcd6f6f519756bff4f40306955d83
执行在子线程,如果发布者是子线程则直接执行,如果发布者不是子线程,则创建一个再执行 此处可能会有线程阻塞问题。
public abstract class Callback<T> protected void deliverRunning(Runnable runnable) { if(isTest) { deliverRunningToCurrentThread(runnable); } else { deliverRunningToUIThread(runnable); } }
0
45c91d2c288b15292ee8607ed0585520
7428adaa58adfcb8024fe55370e81056
Checks if explosion animation is in progress.
public class Shimmer public boolean isAnimating() { return animator != null && animator.isRunning(); }
0
633ba3838452ccb85eacb8aaad643fc0
54e598f021f30c8d09a109e545c8bf02
Gets the current character set used for output of the cipher
public Charset getCharacterSet() { return characterSet; }
1
b4ed923cdabf7176fc3db51d66334094
9eb65aa6da04d853d7a7a7e8d705e803
this is a wrapper for the actual function in protocol_FL702LT.c
void my_function_CMD_2702(unsigned char*pData, unsigned char len) { unsigned char response = 0x00; np_api_upload(0x2703, &response, 1); }
0
599daf79aedb1d3bf2867f0800e8af32
f954a74d8cd7f5d5f99176985c246ba2
A function that prints a section of memory. You can change the width (w), which decides how many bytes you want to put on each line.
void print_mem_range(SWORD x, SWORD y) { int i = 0, j = 1; if( x > y ) { i = y; y = x; x = i; i = 0; } fprintf(stderr,"MEMORY: %i to %i\n",x,y); for( i = x; i <= y; ++i, ++j ) { fprintf(stderr,"%05i\t",memory[i]); if( !( j % 10 ) ) { fprintf(stderr,"\n"); } } fprintf(stde...
0
18efe1be9daddfad988f50c11bcd84cd
18038190114cb5e84d14017c6f160a75
通过反射获取表类中的表项的内容,包装成表项实体
public class Table2Entity public static final ClassBean table2Entity(TableEntity table) { Properties p = PropertyUtils.getProperty(Resource.TEMPLETE_FILENAME); String packageValue = p.getProperty(TemplateConfig.ENTITY_PACKAGE); boolean underscoreToCamel = Boolean.parseBoolean(p.getProperty(TemplateConfig.UNDERSCO...
1
0e7cc0df39596838ba388ccfecc6546c
26221832eb2c2d5b64ff4d4a37190007
Low trust test that creates separate app domains with a variety of permissions
public void Test_EventSource_LowTrustAppDomain() { TestUtilities.CheckNoEventSourcesRunning("Start"); var scenarios = new[] { new { Zone = SecurityZone.Internet, TrustEventSource = false, GrantUnmanagedCodePermission = false }, ...
1
9ac099df271a7628cccfab350584a43a
b3c7dbbb584151e401fdeb6fdef6c18e
Test making labels from filths
class FilthTypeReplacerTestCase(unittest.TestCase): def test_process_filths(self): class TestFilth(Filth): type = 'test_type' filths = [ MergedFilth(EmailFilth(0, 2, 'ab'), TestFilth(1, 2, 'b')), EmailFilth(5, 6, 'c') ] post_processor = FilthReplacer()...
1
12a8e9117301e3c4c605cd5ecb87a5fd
c7a3162a0b306bc026416c5dea4111be
Get all basic application information with paginated manner
class Handler extends AbstractHttpHandler public function getAllApplications(ApiRequestOptions $options) { return $this->getFullResourceCollection('getApplicationsByPage', $options); }
1
cfe8fe82f0d0b6dfe243c698b3f7b575
de6e63ecd49e0ec161134fdf8e775ff7
门店名称,当前卡券核销的门店名称(只有通过卡券商户助手和买单核销时才会出现).
@JsonDeserialize(builder = SellerOrderAttributes.Builder.class) public final class SellerOrderAttributes @JsonProperty("storeName") public String getStoreName() { return storeName; }
1
72bff87dd3f341290d413c6f51efba6a
6b062fc5e4c90fc3da01b1fcefab2a50
产生假文章
class Generator public static function getArticle(): array { $faker = Factory::create(); $comments = []; for ($i = 0; $i < mt_rand(0, 8); $i++) { $comments[] = [ 'author' => $faker->userName, 'content' => $faker->paragraph, 'created...
1
6f5583eaca110fdfd897ac167c1c4c3b
ceee9c692a5053936ab938a77063ecd8
获取计时器经过的时间
public class Timer public float getTime() { return m_time; }
1
8879fba4fbb4bed4b9e0f5656ed4be64
aa7c2db97e11bfe5a8dd76ff20871afa
Dumps the RethinkDB database and returns the name of the dump.
ensure_environment() sys.path.insert(0, 'esp/esp/') from local_settings import DATABASES default_db = DATABASES['default'] sudo("PGHOST=%s PGPORT=%s PGDATABASE=%s PGUSER=%s PGPASSWORD=%s pg_dump > %s%s" % (pipes.quote(default_db['HOST']), pipes.quote(default_db['PORT']), pipes.quote(env.dbn...
0
0f81d4ef1fe9b05a3c593656d487a2f5
7c3f1c83062b99c97de7c260189a5ece
数组清空 容量回归默认
for (int i = 0; i < arr.length; i++) { arr[i] = 0; } int rear = 0; int front = 0; }
0
bb3649e3ae293ed864929d95164ecd11
b0763cd3372888287bcfd46592f00e4f
Returns an ascending linked list.
{ if (list == NULL) { return NULL; } else { if (list -> value > num) { return construct(list -> value, increasing(list -> next, list -> value)); } else { return increasing(list -> next, num); } } }
1
ab798a9ce5c6cc64506eb9bf16ee005e
24617415cdae9e3922430f80db19504c
检测url是否含有参数,如果有,则把参数加到参数列表中
Map<String, String> resultMap = new HashMap<>(); int lastIndex = 0; Term lastParamTerm = null; for(int i = 0;i<this.termList.size();i++){ Term term = this.termList.get(i); if(term.type.equals(TermType.Param)){ lastParamTerm = term; }else{ int startIndex = url.indexOf(term.name,lastIndex); i...
1
11ea2017464b69847b05500440e2bd95
4b37a31af8739a1f04fb57c4e624c157
两两翻转链表
T = head var pre,next *ListNode = nil,nil for head!=nil{ next = head.Next head.Next = pre pre = head head = next } H = pre return H,T }
0
8dfae0431b597f5c73dbfe4048398793
2506da13dc093d7872c4e98697acd575
计算时差的毫秒数
public class DateUtils extends org.apache.commons.lang3.time.DateUtils public static long pastMillisecond(Date date) { long t = new Date().getTime() - date.getTime(); return t ; }
1
38c55cdbb2aae25c23c79be2e60feabc
51170998da5d2b97d6959d668625ea1a
Evento que atualiza os campos com a informação da turma selecionada
function setCampeonato(i) { var campeonatos = JSON.parse(localStorage.getItem('Campeonatos')) document.getElementById('nomeCampeonato').value = campeonatos[i].nome document.getElementById('localCampeonato').value = campeonatos[i].local document.getElementById('dataCampeonato').value = campeonatos[i].data docu...
1
2c6e66be9a2d422f02d033e9a86a926e
a4202379674166a31e2a070d694008fe
显示定时关闭的消息显示框
{ if(timeDelay<=0.0f) timeDelay = 1.0f; if(Random.Range(0,2)==0) this.transform.localPosition = new Vector3(-189,75,0); else this.transform.localPosition = new Vector3(287,30,0); this.SpriteLianjiditu.transform.DOKill(); this.LabelShuzi.transform.DOKill(); this.SpriteLianjiditu.transform.localPo...
1
c4c4a1a539119b22252bb6de25dd5859
5ec41c2e5a12f739024db6cc18ec9fc0
periodic signed distance if all interaction sites are in the same simulation box
def inter_distance(mol, coords=None): if coords is None: coords = mol.atom_coords() rr = numpy.linalg.norm(coords.reshape(-1,1,3) - coords, axis=2) rr[numpy.diag_indices_from(rr)] = 0 return rr
0
149bf23bbbf2be92f964fc0a5ae4e301
ee5b663174acb8b6d4f394daa34ec657
获取电影价格
class NuoMi: def getFilmPrice(self,filmName,filmUrl): data = self.getFilmPriceData(filmName, filmUrl) print(data) soup = BeautifulSoup(data) class_soup = soup.find_all(attrs={'class':'cinema'}) if (class_soup != None): for classData in class_soup: cine...
1
d02b7d9263f360e660c5850ea4a65749
0fc5761fb165cdf56d96961ab5634239
https://cses.fi/problemset/task/1072
def main(): from sys import stdin, stdout rl = stdin.readline wl = stdout.write int1 = int str1 = str r1 = range t = int1(rl()) for _ in r1(t): x, y, n, s, e, w, p = [int1(x) for x in rl().split()] c = (n * y) + (e * x) if c > p: wl("-1\n") elif c == p: wl(str1(x + y) + "\n") else: cs = sorte...
1
2b923898d02bee70f74d4365121e191e
2439a3761a5cf3058413975b7823a74b
Plots proximity of samples on heatmap.
x_min, x_max = np.min(X, 0), np.max(X, 0) X = (X - x_min) / (x_max - x_min) plt.figure() ax = plt.subplot(111) for i in range(X.shape[0]): plt.text(X[i, 0], X[i, 1], str('o'), color=plt.cm.Set1(4 / 10.), fontdict={'weight': 'bold', 'size': 9}) shown_flag...
0
06921f04ce13261a13ea0a6796a80d30
82c176a0d8760f6e5b3f51773c8f1798
Constructor for objects of class Nodo
class Nodo: def __init__(self, token): self.izq = None self.der = None self.token = token
1
2ae8e477a2c07a3e27311e78f9aa18ed
9c6a6574c4a48958a933012d3ff597a6
更新crawler的資料到es
query = {"_id": _id} update = {"$set": {"entities": entities}} update_results = self.crawls_collection.update_one(query, update) return update_results
0
4b4c690cdfb878aeec2aa78e416fe6a0
5e5c888b2e5bf2b7199ae06661a9c27d
两个MyRunnable共享了同一个NotThreadSafe实例,它们调用add()方法时会造成竞态条件
public class MultiThreadShareData public static void example1() { ShareData data = new ShareData(); new Thread(new IncrementRunnable(data)).start(); new Thread(new DecrementRunnable(data)).start(); }
1
41b6af58969e4dce80668afbf585782e
9fc346727c3356353c6ecf1ea441493f
Returns all instances of <see cref="HttpContent"/> in a sequence that has a <see cref="MediaTypeHeaderValue"/> header field with a <see cref="MediaTypeHeaderValue.MediaType"/> property equal to the provided <paramref name="contentType"/>.
namespace Naos.FluentUri public static class UriExtensionMethodsForCall public static ICallOnUriAll WithContentType(this Uri uri, ContentType contentType) { return new ImplementationForICallOnUriAll(uri).WithContentType(contentType); }
0
9b83db63aa97ce710cb0a50bb2c02c2e
045c42706f594db4bf571001dcbc8d1b
判断用户输入是否是9的倍数
n=len(nums) if n>4: n=4 for i in range(n): if nums[i]==9: return True else: return False
0
73584d026e3511447906340a69f8bf4c
7c83bed57342a338f0ceacba2387dce4
构建Hive作业执行上下文空间
spark = SparkSession.builder \ .appName("TestSparkSession") \ .master("local") \ .config("hive.metastore.uris", "thrift://hadoop1:9083") \ .config('spark.executor.num','4')\ .config('spark.executor.memory','32g')\ .config("spark.executor.cores",'4')\ .config('...
1
339ab2a8d713f5c5af26778f2c85fbb7
bb577669e03a09f5a8fb425967a14aea
Remove the specified treatment from storage.
class TreatmentListController extends Controller public function destroy($id) { $delete=TreatmentList::find($id); $delete->delete(); return back(); }
1
15dcc19d05e19a3345d14963022dbaef
ec6df919bef0163801ad5cf8a65604a4
Get workflow data for content element
{ ServiceContext context = new ServiceContext(); return this.wfClientFacade.GetBusinessData(context, item); }
1
9ffb377abea6a8f33c199ba57428796b
ac76cbcfa1eff3707342e9bf77e83972
------------------------------------------------------------------------------ Search ----------------------------------------------------------------------------
namespace LightpointGlobalTestApp.Controllers [Route("api/items")] [ApiController] public class ItemsController : ControllerBase [HttpGet] public IActionResult Search([FromQuery] ItemsSearchModel model) { var result = _itemsService.Search(model); return Ok(new ...
1
fbf31d8b0396ff7f03600467515e171f
4931853d754dd21a84bc89f04dfc26e7
Runs the tracking once while the tracking is paused.
paused = false; lastFieldOfView = dollyTrackCamera.m_Lens.FieldOfView; Waypoint waypoint = waypoints[currentCount]; if (waypoint.startDelay >= 0) { paused = true; StartCoroutine(DelayMovement(waypoint.startDelay)); } currentEase = waypoint....
0
0206c787631c0f7ca5bb5a6789f0abe1
dd3e24a5866ea5837b98e24f1c95bb5e
Gets the message query var name.
public class QueryMessage extends Query implements PGridMessage, RoutableMessage, XMLizable public int getDesc() { return PGridMessage.DESC_QUERY; }
0
b5a9c1b7a0ae891cba15063265e53b00
9e7718de21a0688ed7ca63ff258761ee
根据文件夹路径查询文件夹的id
class DiskController extends Controller protected function retrieveFidByPath ($baseId, $path) { $arr = []; $pathArr = explode('/', $path); foreach ($pathArr as $item) { if (mb_strlen($item) > 0) { array_push($arr, $item); } } $preFid = $bas...
1
ba1efbea33592eef2068d9900b3fd5c2
a71d175ba33deb7b3f160cf54e9a3d68
触模屏校准
servoAngle=RobotApi.UBTEDU_ROBOTSERVO_T() sensorValue=RobotApi.UBTEDU_ROBOTINFRARED_SENSOR_T() servoAngle=RobotApi.UBTEDU_ROBOTSERVO_T() servoAngle.SERVO1_ANGLE= 90 servoAngle.SERVO2_ANGLE= 140 servoAngle.SERVO3_ANGLE= 163 servoAngle.SERVO4_ANGLE= 170 serv...
0
06a0eca244293f691760592e96608c0f
2ef4919962bcf940ffff8981363eebb4
Adds registered models to the current revision, if any.
{ if( $this->revision_id <= 0 ) { return; } $post_id = get_the_ID(); if( false === $post_id ) { return; } $meta_fields = $this->get_alb_meta_key_names(); foreach( $meta_fields as $meta_field ) { $builder_meta_data = get_post_meta( $post_id, $meta_field, true ); if ( ! emp...
1
656597240cf52c8ff28c0f765f386d79
d33ae670716f752be3df2159cf707e74
Finds sub commodities by commodity.
String department, String subDepartment, Integer itemClass, Integer commodity, Integer subCommodity) { return this.repository. findByKeyDepartmentAndKeySubDepartmentAndKeyItemClassAndKeyCommodityAndKeySubCommodity( department, subDepartment, itemClass, commodity, subCommodity); }
0
3916c2829bc2f6127575185cb0c08522
83f72acf7c2d74ca72c43b80e84722e4
반려동물 정보 수정폼
@Controller public class AdoptionController @RequestMapping("adopUpdateForm.ado") public String adopUpdateForm(@RequestParam("adopId") int adopId, @RequestParam("page") int page, Model model, HttpServletRequest request) { AdoptionBoard adopboard = aService.selectAdopBoard(adopId); AdoptionFile af = aService.select...
1
134082d9a51a2bfb47fc7bf7ee2d9c32
ff42e9663b1fddfad1e4a75ce90ed536
Tomcat limits the header size to 8192 bytes (8 KB). See maxHttpHeaderSize on https://tomcat.apache.org/tomcat-8.5-doc/config/http.html <br> If we write the save request cookie to big we will exceed 8 KB and the client will receive a 500 from Tomcat with the following stack trace. <pre> Increase maxHttpHeaderSize on the...
public class Jetty6WebDefaults extends AbstractWebDefaults @Override protected int getMaxCachedFileSize() { return 10000000; }
0
41a787d3c99d04812aadc1f829dda066
70166a41e84dbc9c6875fb69ecac1390
Applies the Berlekamp-Massey Algorithm to the given sequence of bits; Returns the smallest annihilating polynomial F, ie. the smallest inverse feedback polynomial corresponding to the generating LFSR.( F(sequence) = 0 )
class nist: def berlekamp_massey_algorithm(block_data): n = len(block_data) c = np.zeros(n) b = np.zeros(n) c[0], b[0] = 1, 1 l, m, i = 0, -1, 0 int_data = [int(el) for el in block_data] while i < n: v = int_data[(i - l):i] v = v[::-1] ...
1
8fe4609224285b5b4376d7a43feddddb
05ac10dcf00f4281e210ef7e6e34f2e8
13の倍数かどうかを調べる関数
{ if (x % 3 == 0 || x % 7 == 0) { return true; } else { return false; } }
0
ebc2fe8eed91d2976e55f626b512abde
78add149f0b7a2c25d742741891e53c5
Copy payload, expand the cryptic abbreviated roles in the JWT token to full versions.
payload = _default_jwt_payload_handler(identity) user = Users.query.filter(Users.username == payload['identity']).scalar() if not user or user.token_expires or user.role == Users.ADMIN: return payload payload['exp'] = datetime.datetime.max return payload
0
33b344c24b9734b46eb89e1b2d63257d
514451348477b65e47ca10b7e5fa1e65
Discovery for previously defined service should return defined service.
class ServiceBusTest extends \PHPUnit_Framework_TestCase public function testMultipleDiscovery() { $endpointA = $this->serviceBus->discover('calc'); $endpointB = $this->serviceBus->discover('calc'); $this->assertSame($endpointA, $endpointB); }
1
5f0a789eb8babfde4785918d3b89c2ac
43e42361eb75fb9afd0489c484ef9199
Retrives the ExtendedDataParam passed into the constructor
public class IIOrder implements Runnable public Event_ getExplicitParam() { return explicitParam; }
0
bc1ba743b98463b0460bfe57c8cd10d9
510147f88d1b455923478c3688a56250
Gets the UDPRN.
@BA.ShortName("WeMoDevice") public class WeMoDeviceWrapper extends AbsObjectWrapper<WeMoDevice> public String getUDN() { return getObject().getUDN(); }
0
e017ee2f5f24e775f5d868cf85b4c7b4
146d44c8e145bf6df7eebccfd65b1f19
Whether the right bumper (RB) was released since the last check.
public class OI public boolean xBoxRightBumper() { return this.xBoxJoystick.getRawButton(6); }
0
1cb036e8d450fc98482fbb2a72e4394f
d9955be41f5fedaa07c051432a2e6247
Getter for <code>storeal.stl_webservice_account.is_module</code>.
public class CmsADEConfigData public boolean isModuleConfiguration() { return m_isModuleConfig; }
0
2d25a28c67d5f344af38864c95699ad6
8dab12f33891b7179acb102bd164ca93
User-defined labels for the metastore federation.
class ServiceMetadata(dict): def labels(self) -> Optional[Mapping[str, str]]: return pulumi.get(self, "labels")
1
14cc5182156367e9c3390ab0c82ec2a1
dea764ad4d40db6b777f0c066f16f1cb
Initializes GameObjects containing HUD elements
namespace ZombieSplasher public class GameHUD : MonoBehaviour void Start() { }
0
27d7bd233d04ca39fc888c4a7d2532d9
d8a0a9e54375ee8fee9385f7c69fa9ba
Creates a notification and shows it in the OS drag-down status bar
namespace BitcoinNotify public class MainController private static void CreateNotification() { mainForm = new NotifForm(new Size(500, 100)); inNotification = true; mainForm.ShowDialog(); inNotification = false; mainForm.Dispose(); mainF...
0
7ca1dbd6dda3126414dae0094aac7cf3
5062ad2e0eb7d1aeb83118e8cbc607ec
Пост метод получаения всех кошельков.
@RequestMapping("/wallet") @RestController public class WalletController @GetMapping() public List<Wallet> findAll() { return walletRepository.findAll(); }
0
6186b95edd082c55ccf1cf5c83912049
c8587e35084c7eda272d5410cec05bca
Writes a P3 image from an Image structure to an file
def WriteImage(path, image, width, height): file = open(path, 'wt') file.write('P2\n') file.write(str(width) + " ") file.write(str(height) + " \n") highest = 0 for y in range(height): for x in range(width): if(image[x][y] > highest): highest = int(image[x][y])...
0
92f09980bd946e778ea05498b9ebb1a8
205eb4d00cf19511c4e558d557bb0f92
Convert from IOB to IOBES notation.
def convert_iobes_to_bio(seq: List[str]) -> List[str]: return list(map(lambda x: re.sub(r"^S-", "B-", re.sub(r"^E-", "I-", x)), seq))
0
084351ca1125fbfb8242a14b05e3ce6a
31df8f28176731663a8475d34dcf0fe7
修改乐理包
for k,v in pairs(changeItems) do self.packData[Pack.shengZhuangPack][v.index] = v end for k,v in pairs(self.packData[Pack.shengZhuangPack]) do if v.amount <= 0 then self.packData[Pack.shengZhuangPack][v.index] = nil end end end
0
e70e70f5cfef759f2edef7fa413c3be0
781c4c4d169ce43b9a07514257c7199c
使用提供的算法名创建一个算法工厂。
namespace JWTDecoder.Algorithms IJwtAlgorithm Create(string algorithmName);
1
9bdb563c141d47c83c31b60352195f87
7627c5aa3ed33ddc692df11c122a5148
Finalize inflating a view from XML. This is called as the last phase of inflation, after all child views have been added. <p>Even if the subclass overrides onFinishInflate, they should always be sure to call the super method, so that we get called.
public class MyMultiStateView extends FrameLayout @Override protected void onFinishInflate() { super.onFinishInflate(); Timber.e("onFinishInflate()"); }
1
ab25a00f16d1c63f639010b4051cf613
69a8c2114cc63172228b7b2145cbeafc
A function to reconstruct an array of every listener given a context and a host element. This function exploits the fact that contexts retain their nearest ancestor host element. We can determine all the contexts which are directly listening to an element by traversing up the context tree and checking that the host ele...
ctx: Context | undefined, host: Element<string | symbol>, ): Array<EventListenerRecord> | undefined { let listeners: Array<EventListenerRecord> | undefined; while (ctx !== undefined && ctx._ho === host) { if (typeof ctx._ls !== "undefined") { listeners = (listeners || []).concat(ctx._ls); } ctx = ctx._pa; ...
1
9d1bd4a7a2ebfc8bdcc354781b2508c7
004dc30842db6e8062ef7d79af4d22fb
Generates presentation from template and excel values.
class Document(models.Model): def generate_document(self, customer) -> str: workbook = load_workbook(self.template) sheet = workbook.active for map in self.mapping.split(";"): cell, value = eval(map) sheet[cell] = str(value) filename = f"{customer.comp_name}-{st...
1
04ac6c3986ac0e777abdfb617654aada
0ed17584315c201328d511455295a08c
The ratio of how much the grid walker occupies the given cell width.
qreal GridAttributes::gridStepWidth() const { return d->stepWidth; }
0
1011934632829fea59022cbcccaa7df2
e2b9aeed184ddf837f88300fcf61934b
Генерирует ориентированный связанный граф в виде списка смежности.
namespace GraphClass public class Graph public List<List<int>> CreateListAdj() { List<List<int>> ListAdj = new List<List<int>>(); for (int i = 0; i < Matrix.Length; i++) { var Adj = new List<int>(); for (int j = 0; j < Matrix.GetLength(0); ...
1
34943fc088f075c49499ec0c4af36899
0e68810950f8cf83da1e8482e7f54e6d
Disable the OpenGraph.
function aiospinitSocialMetaInPosts($) { $('input[name="aioseop_opengraph_settings_customimg_checker"] ~ .aioseop_upload_image_button').on('click', function(e){ $('input[name="aioseop_opengraph_settings_image"]').attr('checked', false); }); }
0
18e2d02beacaa7720c6571d1eaf90928
39f3efe8026a724c78d196745bbf0f37
线性筛求质数,效率比埃氏筛高,但会额外占用空间
{ cnt=1; memset(isprime,1,sizeof(isprime)); isprime[0]=isprime[1]=0; for(long long i=2;i<=MAX;i++) { if(isprime[i]) su[cnt++]=i; for(long long j=1;j<cnt&&su[j]*i<MAX;j++) { isprime[su[j]*i]=0; } } }
1
139b6c3cecddc9736ba052578b850dfe
2519c11fecb76b48482d4a22142cbbe3
设置摄像头权限状态
switch (type) { case CAMERA: if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, ...
1
d63339f13f593889bb799ae3770a61ef
07de248b910fc007b7425cf6c91f5753
Changes direction in x or y if it meets a boundary
if self.x < bound_x1 or self.x > bound_x2: self.right = not self.right if self.right: self.x += self.vel else: self.x -= self.vel
1
9e1f3e1f39e68194cb3eeea21be60382
257aa218959d935291aab1f0f526777d
Compute cohesiveness strength between two patches // PROXIMITY //
{ std::vector<double> positive, negative; for(unsigned i=0; i<nrPatches-1; i++) { Patch3D *p0 = (Patch3D*) kcore->Gestalts3D(Gestalt3D::PATCH, i); for(unsigned j=i+1; j<nrPatches; j++) { Patch3D *px = (Patch3D*) kcore->Gestalts3D(Gestalt3D::PATCH, j); double closeness = p0->CalculateProxim...
1
dae2b1d78e8e47abefce3df918e57557
b54e81934520fddc093606b5812a121f
Returns the length of time the light is red
public class TrafficLight public double getGreenPhaseLength() { return greenPhaseLength_; }
0
0fec28c70f67abdef12ef805e1fff130
7f61448ad6da3ef0f9cb03f40c5be655
Modified from K&R
cases like (1)
0
07c5b33a6d5ffca698093c959bc8f500
fb8119c8b0b723d72d3f5c181749712b
Force storing of values important to the task in the management element monitoring the group, i.e the WorkerWatcher. Will store the TaskContainer and contained task description and variables, most importantly the initParams/value array, i.e. a meta-checkpoint. Upon re-deployment the Task instance will be feed the initP...
public class ExecutionSafeOutputContextManager extends ExecutionDecorator protected ITaskState storeState() { return null; }
0
ef5dcaab451951153e9d361458305c36
f1ff5db781a36a67792ad0013bdf53cb
Hilfsfunktion für die Berechnung des Zinssatzes nach dem Iterationsverfahren nach Newton.
public class ASADModel private double calculateInvestmentGivenInterestRate(double interestRate) { return IConstant * Math.sqrt(Math.sqrt(Math.pow(interestRate, 2) + 4) - interestRate) / (Math.sqrt(2) * averageInflation); }
0
025b58ec8ee6498ce9a3d2ee6fda5c93
632a3478ff976dfbb53f324abc21ab61
获取Air Export HAWB的信息
{ WorkFlow objWF = new WorkFlow(); OracleCommand SCM = new OracleCommand(); string strReturn = null; Array arr = null; string strSERACH_IN = ""; string strReq = null; string strLOCATION_IN = null; arr = strCond.Split...
1
39eb42e981fd7dc30ab4fe2d0858aed3
7d1eb5fac220ce0ee7cea9f56835daa2
When transforming the thread dump back to a string, only add the stack traces marked as visible.
Scanner input = new Scanner(fullStack); String newStack = ""; while (input.hasNext()) { String nextLine = input.nextLine(); if (nextLine.indexOf("org.junit.") != -1) { continue; } else if (nextLine.indexOf("java.lang.") != -1) { ...
1
cc1b4ffa405e3653253fc8b118168bb6
480603aa3ca507168bcf02705d5bc627
将内存中数据表格添加到Microsoft.Office.Interop.Excel指定工作表的指定位置一
{ for (int i = 0; i <= dt.Rows.Count - 1; i++) { for (int j = 0; j <= dt.Columns.Count - 1; j++) { GetSheet(ws).Cells[i + startX, j + startY] = dt.Rows[i][j]; } } }
1
54dbb3a7fead73098a265f1fc4eb7f3c
a4eec9f1e763e4c592bde3e79006b1eb
判断字符串是否无符号整数
public class StringUtil public static boolean isUnsignedInt(String str) { for( int i = 0; i < str.length(); i++ ) { char c = str.charAt(i); if( c >= '0' && c <= '9' ) { continue; } else { return false; } } return true; }
1
33c0a31d18fe19d15ac97f439fb7e2fb
1aa25431a66977b345ca232d5f26cbea
实现父类中的抽象方法,重写复制文件的方法体 如果文件复制成功返回TRUE,失败则返回FALSE
{ if (copy($this->upfile, $this->file_path)) { } else { print $this->showerror("意外错误,请重试!"); } }
0
e385b538484bd4929f63b10520fcbb16
59d7049916bb59da85df1dff5bcdf708
Return a context manager that returns enter_result from __enter__, but otherwise does nothing. This can be replaced by ``contextlib.nullcontext`` if we want to support only py>=3.7.
class ReSult (object) : def __enter__ (self) : return self
0
74d49b711c9ed080423ec477f3d1d4cd
032fe38e8b4e63240a4a8e615956e7ba
比较两个文件,输出不一致的句子。
lines = open(path).readlines() for line in lines: if len(line.strip()) == 0: continue if '.txt' in line[:8]: cur = line[:line.find('.txt')] l = line.split() origin = l[-2] judge = l[-1] if cls1 in origin and cls2 in judge: print 'Error in ', cur
0
c2632ab060b79fc516d80fa5d9b7d48b
7f61448ad6da3ef0f9cb03f40c5be655
make these tainted in case anybody reads them
cases like (1)
0
044087aaa1dbe4ab236724b2d7edb0a2
3badfe22c96905dcadf502443e7b3d36
Utiliza la base de datos para insertar un nuevo fichero al sistema y devuelve el id del repositorio donde se sube
def insert_new(nombre, parent_id, title, description, filename): if check_duplicate_files(nombre,parent_id)[0]==False: folder_id = insert_folder(parent_id,nombre) file_id = insert_file(title, description, folder_id, 'Files/'+filename) else: file_id, parent_id = find_file_id(filena...
1
3f0d7e9c069e037e0990a4432169a533
c57287fa7a4486a40697387f79a36ded
根据 机器名或IP地址 判断证书是否在 相应的存储区的名称、位置中 已经存在
{ char tmp[BUF_MAX_SIZE]; int ret = 0; memset(tmp,0,BUF_MAX_SIZE); do { if(calculation_certificate(mac,product,company,tmp) != 0) { ret = -1; LOGD("calculation_certificate mac=%s product=%s company=%s error!!!\r\n",mac,product,company); break; } ret = strcmp(certificate,tmp); }while(0); return ...
0
379b0a321a2098a0893f7c125517dff1
76b30dbb4372e71fee24324892a60437
查看咨询单的流程日志
class OrdersController extends BackendController public function logs(Request $request){ if($request->method('post') && $request->has('id')){ $read = $request->input('read', 1); $log = Logs::find($request->input('id')); $log->read = $read; if($log->save()){ ...
1
68e5aa527c4f810e06b76a23ab6c470d
de6334a4408654847b4311a2d89d590a
Подготовка формы и отправка диалога
"use strict"; let readyToSend = false; if (data.status && data.status === 1) { let modal = makeModal(data.header, data.data); let form = modal.find('form'); form.on('afterValidate', function (event, messages) { if (messages) { let key; for ...
1
7f7d9858c2bc2a8320da06d8c340b02a
5b8e7e217a5ca28a74d046939d0f25d2
Gets the value of the coldWater property. possible object is {@link QualityServicesType.ColdWater }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "QualityServicesType", propOrder = { "objectAddress", "coldWater", "hotWater", "electricity", "gas", "heating" }) @XmlSeeAlso({ ru.gosuslugi.dom.schema.integration.volume_quality.ImportVolumeAndQualityInformationRequest.ImportVo...
1
cf7f9632443ae4ab5c0fe57c423f5966
555ab9e2cc2961d84a3ea58266fc3b37
tests getter for number of toppings
class PizzaTestModels(TestCase): def test_total_toppings_amout(self): classic_pizza = Pizza.objects.get(name="Classic pizza with mushrooms") self.assertEqual(classic_pizza.total_toppings_amount, 95)
1
5f811b977f4a672d09e38fffeddff7c2
0ad887b75f9bd26945322232870a5f0b
Calls the ActionHandler to do the work and changes our state accordingly
public void handleState();
0
cd0e81302d0fd10f452dd70715d231ac
9aa6e6aad5cdc4cb5afa8f078bd9141e
把尺寸描述结构转换为实际的游戏屏幕尺寸
{ stArea.stTopLeft.udwX = stArea.stTopLeft.udwX * (10080 * m_stTVWallCfg.stScreenInfo.udwColNum) / m_dwTVWallWidgetWidth; stArea.stTopLeft.udwY = stArea.stTopLeft.udwY * (10080 * m_stTVWallCfg.stScreenInfo.udwRowNum) / m_dwTVWallWidgetHeight; stArea.stBottomRight.udwX = stArea.stBottomRight.udwX * (10080 * ...
1
afc41557061cacfb96df1f9e1f0e6299
53102c58648f3fffddf1693a1aa1c8cc
Test very basic single argument parsing
arguments = [ { "name": "sum", "type": "int", "default": "4" }, ] parser = reading.build_template_argparser(arguments) values = parser.parse_args([]) assert values.sum == 4
1
5ea7434cc7c657f6fa31cca25b4e8409
ac40666b25afb916f94029cc1db71588
equation index: 72 $DER.Gate_Angle = Gate_Rotation
{ int32 arg; FS_UNUSED_PARAMETER(lOpCode); SECURE_CHECK_FOR_POP (LocalGS.stackPointer, 1); arg = CHECK_POP (LocalGS.stackPointer); CHECK_INT16 (arg); LocalGS.globalGS->localParBlock.angleWeight = (int16)arg; return pbyInst; }
0
4a82338fde65043291d3eccbd9000107
5ce4b62c06199d612ea17febf801c20b
metoda sorteaza filmele (care au fost deja sortate in functie de filtrele primite) dupa durata acestora filmele se compara prima data dupa durata, iar al doilea criteriu este titlul
for (int i = 0; i < classic.size(); i++) { for (int j = 0; i < classic.size(); i++) { if ((classic[j].getRelease() + classic[j].getReleaseMonth()) < (classic[i].getRelease() + classic[i].getReleaseMonth())) { Movie temp(classic[j]); classic[j] = cl...
0
012664e20f06f47cd8d0ace9db014af3
e6465e9ef6f3431dfde96769c59e0e95
sorts given array according to BubbleSort algorithm in ascending order.
public class BubbleSort public int[] sort(int[] array) { boolean swapped = true; int temp; int j = 0; do { swapped = false; j++; for (int i = 0; i < array.length - 1; i++) { if (array[i] > array[i + 1]) { temp = arra...
1
ffa42b24265ff1454a8d32b28418c532
5a1643dbba3405e098bc0ec1ab9d7c6a
Coordinates of the right handle (after the control point)
float getRighHandSide();
0
9e767745797d8b8472ce3d22a23eb626
26b387b6871157c26a18c909b9372e78
Exit a parse tree produced by {@link GrammarParser#rating}.
public class fullQBaseListener implements fullQListener @Override public void enterRating(fullQParser.RatingContext ctx) { }
0
e465ce55ef759af3e84a4f29c89b1460
0f3d99055329b8e040145523c8cd4555
Defining "UserInput" function. Takes user's response and processes output based on it.
public class MainWindow extends AnchorPane @FXML private void handleUserInput() { String input = userInput.getText(); String response = duke.getResponse(input); if(input.toLowerCase().equals("nbcb")) { dialogContainer.getChildren().addAll( DialogBox.getUserDia...
1
1921d1875828a1f21e69db0dbc559180
b4be5bf882490d5b68a54b06b54722d7
Serial Port Selected Get the serial port stored in the preferences file Returns: str -- port id ex 'COM1
class Controller(QWidget): def get_port(self): return self._port.layout().itemAt(1).widget().value()
0
64b4148fd8c4e7d44c81404736b209a2
5e3bfdab0869fdb168e3de72b3f82381
デフォルトのパネルCSS情報を取得する
$skin = $this->get_skin_info($this->get_skin_id()); $getcss = $skin['set_skin_set_id']; $this->DB->query ("SELECT set_skin_set_id FROM ibf_skin_sets WHERE set_default = 1"); $default = $this->DB->fetch_row(); if ($getcss == '') { $getcss = $default['css_id']; } $this->DB->query ('SELECT set_cache_c...
1
3d048687ee2ca661a0240c7acd8fe5b0
d2f3510706c18429e957ff3f22d0111f
Test unique where filter properly reports an error when conditions are met.
{ $link = $this->builder->expr()->andX(); $errors = new ErrorCollection(); $this->filters->applyEquals($this->builder, $link, $errors, 'table_name', 'column_name', new self); $this->assertEquals(1, $errors->count()); $this->assertEquals(['parameter' => 'column_name'], $erro...
1
064ca70e9cb28f8a06c9a24a8432300e
2a5c700c47ad5398cdf98ff06d4a333a
双击托盘图标 显示当前窗口
namespace vcs_RegisterHotKey2 public partial class Form1 : Form private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.Show(); }
1
fad24fb7d77c1717ffe63629ba0f8b27
8dbf6d748d6cd46edaadac20e17a6334
Filter the query on the messate column Example usage: <code> $query->filterByMessate('fooValue'); // WHERE messate = 'fooValue' $query->filterByMessate('%fooValue%'); // WHERE messate LIKE '%fooValue%' </code> Accepts wildcards (* and % trigger a LIKE)
abstract class BaseWallQuery extends ModelCriteria public function filterByMessate($messate = null, $comparison = null) { if (null === $comparison) { if (is_array($messate)) { $comparison = Criteria::IN; } elseif (preg_match('/[\%\*]/', $messate)) { $m...
1
3b96968c2cdab403970d07f247bf0480
c937466254040222b99e06babb7454c3
Sets the mute status to the given bool
class LinkPlayDevice(MediaPlayerEntity): def set_muted(self, mute): self._muted = mute
1