query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
da98bc37365e96d11341d292afbd0459 | 71be47f7a5cd16f00943f74bae329877 | 把写的原生广告子布局添加到对应的广告商ViewGroup中 | class NativeAD(
context: Context?,
messenger: BinaryMessenger?,
posID: Int,
params: Map<String?, Any?>
) : PlatformView, MethodCallHandler, NativeExpressADListener, OnLayoutChangeListener
override fun onADLoaded(adList: List<NativeExpressADView>) {
if (nativeExpressADView != null... | 1 |
65010c72f2718303d50eebf57adf7c26 | 52cd925ab243ae4de0eeb0394ee1565e | Communicates to the room the family member placed inside the production extended | try {
clientProtocol.sendFamilyMemberColor(fmColor.toUpperCase());
} catch (ClientNetworkException e) {
clientUI.printError(e.getMessage());
}
} | 0 |
ad134d65df901a0f84ebe7b425f3f5de | 833f96c85aff5f21bb8c6e53f66efb49 | List all registered custom event mappings. | namespace Amazon.Lambda
Task<ListEventSourceMappingsResponse> ListEventSourceMappingsAsync(ListEventSourceMappingsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)); | 1 |
7655712be77cf138d17507a1805d2db2 | 02317b7616c1e2c166fc3d0b52122d42 | 根据DayOfWeek和LessonOfDay查询所有课时 | public class CourseFragment extends Fragment
public List<Map<String,Object>> getData(){
List<CourseModel> courseModels = CourseDao.selectByDayOfWeek(dayOfWeek);
List<Map<String,Object>>list = new ArrayList<>();
Map<String,Object> map;
for (CourseModel courseModel:courseModels
... | 0 |
a55262784072ac06ba37c8fd0f2b415b | 25c97f176c0547d7ac8f75ca65f82858 | 将区块链异步保存到文件中 | filename = "transaction_" + time + ".json"
os.makedirs("tx_list", exist_ok=True)
blockjson = open(str("tx_list/") + str(filename), 'w')
json.dump(block_dic,blockjson) | 0 |
2eff518dd9675e38efaea1294874f771 | 0236f628e253dfd42e789916a8b929dc | ! \brief Priorität des aktuellen Threads ändern
\ingroup PPLGroupThreads
\ingroup PPLGroupThreadsPriority | void GPthreadObject::SetPriority(int priority)
{
if( thread_ != NULL )
{
thread_->SetPriority(priority);
}
} | 1 |
bb3d784450efd481e2cb75a18214c096 | 40408c83d4376d2e13e456bbf4ab591a | Render a form to update an existing following. | $user = Auth::user();
$user_setting = UserSetting::where('user_id', $user->id)->first();
if (empty($user_setting)) {
return view('/users/edit/follow_edit', ['user' => $user]);
}else{
return view('/users/edit/follow_edit', ['user' => $user, 'user_setting' => $user_... | 1 |
34ee383c29c6fcd250ed0afea282fbaf | 25938837d3561114d3f5f278f76875b9 | 保険会社マスタ情報を取得する | class OptionComponent extends Component
public function getMasterOptionsBySyubetsuCode($code)
{
return $this->Master->find('list', array(
'conditions' => array(
'Master.syubetsu_code' => $code
)
));
} | 0 |
952320e8d08f18f297bb5af56eae17f8 | ff2cacf2ddd22643304c41220fb16065 | Funkcija za racunanje euklidske udaljenosti izmedju dva grada. | {
int ix, iy;
double ans;
ix = fabs(a.x - b.x);
iy = fabs(a.y - b.y);
if (ix < iy)
ans = (sqrt(2 * ix * ix) + iy - ix);
else
ans = (sqrt(2 * iy * iy) + ix - iy);
ans = 100 * ans;
return ans;
} | 0 |
303f260e26ff8109af9c484a72ed2067 | 59d04892ccf86a3a0425545bd0705490 | Get the hemisphere for a given user. Only a distinction between northern and southern hemisphere is made | namespace Vintagestory.API.Common
EnumHemisphere GetHemisphere(BlockPos pos); | 0 |
f97861492442784025845ad013d5e896 | 7fcab803aae6023e7d10d8e45a8ef389 | Lists the available gui states matching the input specification. This provides the most flexible search specification of all the query mechanisms, enabling searching using comparison operations other than equality. However, it is more complex to use and will not perform as efficiently as the index or search methods. In... | class Patch_FindStoriesByState_Inputs extends Temboo_Inputs
public function __construct($inputs = array())
{
parent::__construct($inputs);
} | 0 |
cc840f8c0115906787b07cf9ebbdf270 | 16a6302ae8ce3ff0ec8dd946a05ee702 | This function calculates the number of users who survive beyond the time hurdle. | double n;
n = (log((m/(m-(r*p))))) / (log(1.0+r));
return n;
} | 0 |
a3483887dad0ff64b632901a34177b05 | 2fc7b3ef425494c074d35ce399e3fdda | every agent within a batch should have the same global state | class World:
def update_global_state(self):
self.global_state = []
for Agent in self.agent_list:
self.global_state.append(Agent.position[0])
self.global_state.append(Agent.position[1]) | 0 |
e95b93e5daf787765dd1c6dc19543c0b | 3ca7d3e8fa9fd6bed2893a3ee0d73e48 | 查询美金汇率接口 | client := http.Client{
Timeout: 10,
}
response, err := client.Get("http://localhost:7047/currency")
if err != nil {
log.Fatal(err)
}
b, err := ioutil.ReadAll(response.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(b))
} | 0 |
2a650f7dbb20fc8e8d0423da3ce7adaf | 50ad457a7bc40b06129c4ab1753c4010 | Configure CIA, copy fonts to memory, set screen struct for VDC and clear screen. | {
int i;
int keys = 0x3FF;
SETW(REG_DISPCNT, DISP_LCDC_OFF);
SETL(REG_BG2Y, 0);
SETL(REG_BG2X, 0);
SETL(REG_BG3Y, 0);
SETL(REG_BG3X, 0);
for(i=0; i<128; i++) {
OAM_BASE[i*4] = OAM_OBJ_OFF;
}
SETW(REG_SOUNDCNT_X, 0);
keys = GETW(REG_KEYINPUT);
keys = GETW(REG_KEYINPUT);
keys = GETW(REG_KEYINPUT);
keys = ... | 0 |
64d133d8815b9d70c161219851b0c173 | 1aaedc784a02ca26df480c243cf63e20 | Создает команды. | {
this.Commands.Add(new CommandViewModel("New...", new DelegateCommand(p => this.CreateNewPublisher())));
this.Commands.Add(new CommandViewModel("Edit...", new DelegateCommand(p => this.EditPublisher(), p => this.IsSelected)));
this.Commands.Add(new CommandViewModel("Remove",... | 1 |
c0f8a5c438cd58e65d0f22632ff6ed25 | 811a8f58213bcf6f32e13f4045e489c7 | Ajoute l'agent d'id ag_id à la liste des passeurs. | {
$this->template = new View('home/passers_list');
$this->auto_render = FALSE;
if(!isset($_POST['passer_id']))
{
$this->template->passers = Model_Userpasser::get_passer($this->user);
echo $this->template;
return;
}
$passer_id = intval($_POST['passer_id']);
if($passer_id < 1)
{
$this->tem... | 1 |
94485ccff02894116f12c8dae14a822a | 1e8ff7786c488467ace4676c65fe0b68 | Return the value associated with the column: defaultShippingAddress. | class User implements AdvancedUserInterface, \Serializable
public function getDefaultShippingAddress()
{
return $this->defaultShippingAddress;
} | 1 |
200ddce9a8118c6fb1c79e68d87fef5c | d71557d2a5de9cdc4d04e1a46efe87c7 | Maps a PizzaCrust entity object list to a PizzaCrustDTO data transfer object list. | namespace PizzaMaker.Core.Helpers
public static class ClassMapper
public static List<PizzaCrustDTO> ToPizzaCrustDTOList(this IEnumerable<PizzaCrust> entityCollection)
{
List<PizzaCrustDTO> dtoList = new List<PizzaCrustDTO>();
foreach (PizzaCrust entity in entityCollection)
... | 1 |
ee93c5e6e6a045a6431e3a4b549b385d | 9099026aadd414a39d5133f46abc309f | Gets the customer E faktura status. | public class KundeResponse extends ReturncodeResponse
public String getFsnummer() {
return fsnummer;
} | 0 |
6069f25c5d077bbd6935ef13ba459e1f | c9c180a9c0308633c66ac7cb3921997e | Get all geofences overlapping an area. | namespace Services.Interfaces
GeofenceLocation[] GetGeofences(); | 0 |
ec5571c2371b06bc7fd0895f32897ad1 | e042dedc97cad8973ff5f7ac7b46629b | Test Normal Operation | class IntegrationTest(unittest.TestCase):
def test_normal_execution(self):
self.move_to_start()
self.switch_to_cartesian_control()
self.move_square(self.cart_client)
self.assertEqual(self.cart_client.get_result().error_code,
FollowCartesianTrajectoryResult.SUCCES... | 1 |
9ab664e7a203a1fcbe87fabe3705225f | 506cdf033e621fd072140257d81bbc2b | Source: http://stackoverflow.com/a/9147327 | def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]:
for first in iterator:
rest_of_chunk = itertools.islice(iterator, 0, n - 1)
yield itertools.chain([first], rest_of_chunk) | 1 |
ef1ad0edcd3d1ec165b77ffecbeac59d | 15210637f4547b4b9ff2c62e09f0de6e | Stop this foreground service, with some delay in order for all background tasks to finish. | public class UploadService extends Service
private void stopForegroundService(boolean removeNotification)
{
Log.d(TAG_FOREGROUND_SERVICE, "Stop foreground service.");
stopForeground(removeNotification);
stopSelf();
} | 0 |
75c34bf4a6e2f73261fdeb8888b2d9fe | 4160ea22ebe110867cfa66a2df289410 | converts trip type from format, received from bus station to api_models.TRIP_TYPE_CHOICES format | state = state.lower()
if state == 'queued':
state = 'pending'
return state | 0 |
63ba3aa56facbb72681c81b80f7d8a14 | 9a61f92a8b26324a9ca42cc565dc8de7 | Função que retorna uma lista contendo os circuitos cadastrados | getCircuit(params){
return new Promise(resolve => {
$http.get(baseURL.circuitry_api+ '/circuit/getCircuit', {'params': params}).then(data => {
resolve(data)
})
})
} | 0 |
e3c374e7e54df1452e2df4265af08d8e | ef8415394ad3079546bf01ee538a19fe | batch, category and course given
how many {category} students were admitted to the course {course} in the year {batch} | public Integer getCourseTotalStudentNumberByCourseNameAndDepartmentId(
@Param(value = "courseName") String courseName, @Param(value = "departmentId") Integer departmentId,
@Param(value = "year") String year, @Param(value = "term") Integer term); | 0 |
7545ecbdd1950e37921c70f31cef4e88 | c09050189ae439f6451253a8b1329b2c | Derives bye weeks based on the current NFL schedule and merges them to the players dataframe. | sched=pd.read_csv('sched.csv')
key=pd.read_csv('cbb_teams_v2.csv')
sched.rename(columns={'Team': 'Team_ID'}, inplace=True)
sched=pd.merge(left=sched, right=key, left_on='Team_ID', right_on='School')
sched=sched[sched['Type']=='REG']
sched=sched[sched['Var.5']!='N']
sched=sched[['Team_ID'... | 0 |
9e95090a9a8cbf9cf4a8712053e98e14 | 9bc6946ab324b8508214e94502f58f10 | Обработчик детектора лиц. | public void onUpdate(FaceDetector.Detections<Face> detectionResults, Face face) {
mFace = face;
getFaceCoord();
if (face.getIsSmilingProbability() > 0.5) {
if (clickC < 1) {
cursorService.click();
}
clickC++;
} else {
cu... | 1 |
26204b3c048d1f97ceb5e54aef2e0d83 | 957a20b4d4fb144ad254dd81f0cc333a | Get all workspaces of a given user. | def get_workspaces(conn, user_id):
url="https://api.anaplan.com/2/0/users/" + str(user_id) + "/workspaces"
authorization = conn.authorization
get_header = {
"Authorization": authorization ,
"Content-Type":"application/json"
}
logging.debug("Fetching worksp... | 1 |
ae844d71a5e581e202a1ebb5a56d106c | 87bf7ed108a6efa7bb0b7730bac1a95d | 获取当前的数字布局 | def getNums():
nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]
random.shuffle(nums)
a = b = 0
for i in range(0, 9):
if nums[i] == 9:
a = int(i / 3)
b = i % 3
break
return nums, (a, b) | 1 |
aa0bb864edb26b66b17f09d690e38711 | f9e99a276d15bf906a225c9b7576b342 | Checks if lockfile type option was provided | class Campaign extends Model
public function lockFileExists(): bool
{
return file_exists($this->lockFile());
} | 0 |
9f5020e1ab095a8b1ff678563754ec30 | 6baf32d941199db431256dd0dc90bf42 | ### leave one out cross validation, local linear regression | cv <- rep(0,length(h))
n <- length(data$x)
loo_data <- list()
for (k in 1:length(h)) {
for (i in 1:n) {
loo_data$x <- data$x[-i]
loo_data$y <- data$y[-i]
mhat_xi_loo <- estimator(data=loo_data, h=h[k], t=data$x[i], ...)$mhat
cv[k] <- cv[k] + (data$y[i] - mhat_xi_loo)^2 /n
}
}
... | 1 |
fd42b7a63acead31f7a77dd5596b0256 | 9403b3d5f81057803a101f2f2496d3bd | Returns the angle according between three atoms. | v1 = self[k].coords - self[l].coords
v2 = self[j].coords - self[k].coords
v3 = self[i].coords - self[j].coords
v23 = np.cross(v2, v3)
v12 = np.cross(v1, v2)
return math.atan2(np.linalg.norm(v2) * np.dot(v1, v23),
np.dot(v12, v23)) * 180 / math.pi | 1 |
0b3f3c56934914af4b94c4bd54759f72 | 3aa3d367c351027c5828068902cfedfb | If set to true the chart will play animations when displaying the series. By default animations are enabled. | class Echarts extends Builder
public function animation(bool|null $animation): static
{
return $this->options(['animation' => $animation]);
} | 1 |
760ff89d3f16522cfe399560e3533d51 | c6aa44997814b2653e98f1e09831b78a | @test This test verifies that you can't determine the ranking of an empty list.
The test will pass if inputting an empty list throws an exception. Fails otherwise. | @RunWith(GdxTestRunner.class)
public class ScoreContainerTest
@Test
public void addScoreEmptyListTest() {
ScoreContainer.addScore(10, "placeholder", "date");
assertTrue(ScoreContainer.getList().get(0).getRank() == 1);
assertTrue(ScoreContainer.getList().get(0).getScore() == 10);
asse... | 0 |
f63564448bdc2750f4a981003b650c84 | c173adda6eac9e02b54e0de930f03928 | Compute the standard deviation of a bunch of numbers. | s2, n = 0., 0.
for x in xlist:
s2 += x**2
n += 1.
return math.sqrt(s2/n) | 0 |
026d8af93dba8e829ea3e59c337a51f9 | 22eb00f3af206188b17ccc2ff502bf4f | 选择标准化模块 | def stander_sacler():
std = StandardScaler()
data = std.fit_transform([[1,2,3],[2,3,4],[4,5,6]])
print(data)
return 0 | 1 |
b68ced17ffde6f7da23c7301980b2ca1 | 077134f2547426064df37ec18ae093d9 | Set the EZO device into sleep mode.
Send any command to wake up the EZO device | class freshroastsr700(object):
def sleep(self):
self._current_state.value = b'\x08\x01' | 1 |
69244b3a59e852d43878c67f68ca7434 | 5225ab9ec4ee6d4133985ac59b2e146b | Get rid of series that do not have minimum size of observations | outputSeries = []
for i in range(len(inputSeries)-1):
if (i%config.reductionFactor == 0):
outputSeries.append(inputSeries[i])
if (i%config.reductionFactor != 0) & (inputSeries[i].air_component.temperature['Converter_platform'] > outputSeries[-1].air_component.temperature['Converter_p... | 0 |
c439ff544dbdd743bd744220fd6092cb | 6d286d5fc612bf3847330906707777a2 | Create an instance of Level 1B band.
This is a subclass of :class:`Level1BVariable`. The constructor is not
meant to be used directly. Use members of :class:`Level1B` instead. | self.data_map = data_map
self.waves = self.data_map.wavenumbers
self.threshold = threshold
self.additional_selection = additional_selection
self.band_limit = band_limit
self.band_scores = None
self.bad_bands = None
self.decent_bands = None... | 0 |
290cec6317da028d72a8a8e8c289e32d | 780b727930e221aeb31b3a0e34d4e048 | Jumps to a specified post within a topic. | def post(request, bbs_name, post_id):
topic = Post.objects.get(id=post_id).topic
if not topic.is_visible:
error = {'message': u'帖子被删除或隐藏'}
return render_to_response('common/custom_error.html', {'config': config, 'error': error})
posts = topic.post_set.filter(is_visible=True).order_by('-post_... | 1 |
3d93a558aae77c116a39accd44151c6f | 2f555d9f53708f1dc160be506422ab7f | 携帯用に画面幅などを調節する | if (story.name.includes('Mobile')) {
page.setViewportSize({ width: 896, height: 414 })
}
} | 1 |
af61a058823ec39baca61b5fa19cdcd1 | ace8c76d0a007e5f4d49a5478228403d | Aligns two sequences by Smith-Waterman algorithm | def SmithWaterman(bio_type, *args, **kwargs):
seqA, seqB, match_points, mismatch_points, gap_points = tasks.preparation(bio_type, *args, **kwargs)
points_scheme = [match_points, mismatch_points, gap_points]
m, n = len(seqA), len(seqB)
pointer_matrix = tasks.empty_matrix(m + 1, n + 1)
score_mat... | 1 |
bbf155508afcb02ec90aa743469d4e55 | 7ceb936f198dd2eaff58b834b186f1a4 | createMenus() | function onOpen() {
createMenu();
} | 0 |
6e66882485bc4b7516fa0f40ba0e1bfe | 5747a2ba9995421af772785c65e9e01c | For scalar multiplication of a Vec3 object by a float. | dst = dst || new VecType(3);
dst[0] = v[0] * k;
dst[1] = v[1] * k;
dst[2] = v[2] * k;
return dst;
} | 1 |
c7038483ea6cf42aaabb5aa41614ac51 | 0da768e85d8b4076f075efff2997be0c | PDB atom name. | if atomName in ('N','CA','C','O','HA','HA2','HA3','H','H1','H2','H3',"O'","O''","H''"):
atomType = 'bb'
else:
atomType = 'sc'
return atomType | 1 |
6755ecc9472c8a964b8874449ec84cbc | f55cd67796089d21e47af692615040fc | Процентное соотношение совпадений двух строк на основе расчёта расстояния Левенштейна. | a, b, c = len(s1), len(s2), 0.0
for sym in s1:
if sym in s2:
c += 1
return c / (a + b - c) | 0 |
11bcfbc13403303544e7c59382ea27b9 | f0746ae883a4a3deae302cd049a8e4d5 | Gets the best scoring hmm state for this frame | top_prob = 0.0
best_path = None
for state in self.alphas[len(self.alphas)-1]:
val, states = self.alphas[len(self.alphas)-1][state]
if val > top_prob:
top_prob = val
best_path = states
print ("%s\t%s" %(best_path,str(top_prob)))
... | 1 |
714aa3751a1b72fb5bd0be4e48c02c95 | 9fecd0af5e570707abd04d3a17fc75e1 | Given a 2D numpy array, plot the corresponding stones on a 15 by 15 board. You may find the following function handy, | def plot_lithics(lithics):
i = 0
j = 0
for i in range(gridsize_X):
for j in range(gridsize_Y):
if lithics[i,j] > 0:
plt.scatter(i,j, c='k', marker="s", s=30)
return | 1 |
984b6669ccb21440bf9f4cb8d68cfa9f | d1beaeba52661ca866cfa86cdc96101d | AD15 当事人意见反馈(主办队员) | {
dal.Delete();
DAL.MonitorManager.M_Entry_Statistics statistics = new DAL.MonitorManager.M_Entry_Statistics();
BLL.CaseManager.B_Case_link linkBLL = new CaseManager.B_Case_link();
BLL.CustomerForm.F_FormPropertyValue fpvBLL = new CustomerForm.F_FormPropertyValue... | 0 |
b2d43e671ca353d693e5354db32dde63 | 07202bee0b3cc6896d7f0561fd3df730 | Unsubscribe from all channels that have been subscribed | export class ChannelEngine
unsubscribeAllChannels(identifier?: string) {
if(identifier != undefined) {
const searchId = CHANNEL_START_INDICATOR + identifier;
for(const [chId,chSet] of this._channels.entries()) {
if(!chId.startsWith(searchId)) continue;
for... | 1 |
9cd4eb88c52c07b8f00f96c2bc907219 | 0c4a2c7f81f5ede3409f1596d0d551f8 | 解析XML的大致流程
1:创建SAXReader
2:使用SAXReader读取xml文档并生成Document对象
3:通过Document对象获取根元素
4:按照XML文档的结构从根元素开始逐级获取子元素以达到解析目的 | public class Dom4jParseXmlDemo
public void parseXml01(){
try{
InputStream inputStream = this.getClass().getResourceAsStream("module01.xml");
System.out.println("路径"+this.getClass().getResource("module01.xml").getFile());
SAXReader saxReader = new SAXReader();
... | 1 |
4668d791b0f8e1932c82bd8429688ae2 | 5df2d1dda0e3f31fd6c895a44ec80136 | Realizeaza matricea filtru pentru sharpen | def Sharpness():
return [ [-1, -1, -1], [-1, 9, -1], [-1, -1, -1] ] | 1 |
d935f77289eeb9be515176720a44eade | 1af7a2b2aefafd65d7ab893aa8299704 | Devuelve un arreglo con los reportes que tiene asignados un empleado. | namespace EmployeesManagment.Controllers
[Route("api/[controller]")]
[ApiController]
//Report Controller
public class ReportController : ControllerBase
[HttpGet("{id}")]
public JsonResult Get(int id)
{
string query = @"select * from dbo.Reports where manager_id ="+id;
... | 1 |
421bdff40958e0508f8df6be38fdb9e2 | a120a98e64722559cf99f551a7c34f6f | Переключение режима отображения/использования констант | class Input extends IoBase
public update_quick_const(quick_const:string, value:number):void{
this.quick_const = quick_const;
this.value1 = value;
this.value2 = value;
this.module.constant_update(true);
} | 0 |
5996369f69ae4e6a9bf40b7bae630962 | 142ac3b7c8398835e81bb1984a97aa7e | 3. 调用ExecutorService中的方法submit,传递线程任务(实现类),开启线程,执行run方法 | ExecutorService service= Executors.newFixedThreadPool(2);
List<Future> futureList = new ArrayList<>();
for(int i=0;i<5;i++){
MyExecutor task=new MyExecutor(i);
futureList.add(service.submit(task));
}
System.out.println("分组完成,共:"+futureList.size());
... | 1 |
076633df680b802e43efb710fb0d593a | f6b06e6e5da18bcaf8e6074a7a548571 | Compare the taken screenshot, to a reference screenshot stored in the test
repo. Allows for the custom definition of a comparison threshold for
allowing leniancy in the comparison. | class VariationsSkiaGoldUtil:
def compare(self, name: str, png_data: bytes) -> Tuple[int, str]:
png_file = self._png_file_for_name(name)
with open(png_file, "wb") as f:
f.write(png_data)
image_name = f'{self.test_name}:{name}'
status, error_msg = self.skia_gold_session.RunComparison(
name=im... | 0 |
0ba7b6c43cb370b177bb40a96fededa6 | 3eabddef153ddb0053bbce7061d24a3d | Display the list of all the franchises. | class VdmFranchiseController extends \BaseController
public function index() {
if (! Auth::check ()) {
return Redirect::to ( 'login' );
}
$username = Auth::user ()->username;
log::info( 'User name :' . $username);
$redis = Redis::connection ();
$fcodeArray = $redis->smembers('S_Franchises');
$fnameArr... | 1 |
3920e02fc9981cd9104110a8b817b970 | 027054d4b0ee07123b78f542ea5abcc6 | 通知线程结束运行。 | public class TaskQueue
public void destory(){
isRun = false;
mThread.notify();
} | 1 |
dca928491d417e28c2cc05125f5aff6c | 6943ce45a49eb8c256866804db4f8f53 | get the country name selected in the country field. | public class AddEditCountryView extends JFrame
public String getRegionName(){
return regionName;
} | 0 |
c630f2d92863455ab5273431ba55afd7 | 8474b234ebf70f296d4a972d33fb960f | Given a dictionary/counter of available counts.
Generate the largest possible integer as a string. | max_value = max(count_dict.values())
for key in count_dict.keys():
if max_value == count_dict[key]:
return key | 0 |
083d5fc0ff309c6b603f9785fd216f27 | 3688d42f71ef75e0f548b730b24b6d62 | La fonction d'en dessous permet de rentrer le genre du film. Elle se fait sous la forme d'un cochage | global FrameEtape1_1
global VarChoixSexe
FrameEtape1_1 = Frame(root, bd=250, bg="pink", cursor = "heart")
FrameEtape1_1.place(x=0, y=0)
VarChoixSexe = StringVar()
choix_femme = Radiobutton(FrameEtape1_1,anchor=E, text=F, bg="pink",variable=VarChoixSexe, value=F)
choix_femme.place(x=25, y=30)... | 0 |
840a5e896c11fe60cc876a60ada70476 | 264aa5a12d239829e012fdae4be45bc9 | Attempts to read data from an isochronous IN endpoint. | namespace libusbK
public class UsbK
public bool IsoReadPipe(byte PipeID, IntPtr Buffer, uint BufferLength, KOVL_HANDLE Overlapped, KISO_CONTEXT IsoContext)
{
return driverAPI.IsoReadPipe(handle, PipeID, Buffer, BufferLength, Overlapped.DangerousGetHandle(), IsoContext);
} | 1 |
2b1cf05304199d59f3a1198231365555 | a23933c7ccb758f4542f7636b99eafd7 | Receive a sample, called in the source's thread. Uses a semaphore to avoid buffering infinitely. | const AudioBufferList *inInputData, const AudioTimeStamp *inInputTime,
AudioBufferList *outOutputData, const AudioTimeStamp *inOutputTime,
void *inClientData)
{
char *buf, *limit;
float sample;
buf = (char*) outOutputData->mBuffers[0].mData;
limit = buf + buffer_size;
pthread_mutex_lock (&buffer_mutex);
for (;... | 0 |
d2f4b033595f0da6822b4c545bc789c6 | 0981cd4cd5ed9dcb0bf2725e8ae69a7d | Prevent the OS from using it even if the hardware is available. | fun disableHardwareAcceleration(): Unit =
electron.app.module.disableHardwareAcceleration() | 1 |
cc32ce794c7a88b700c6bfcb0904cc52 | 1f8494d20724e4860888a757b44ded86 | Click handler for responsive subnav dropdown | const containerId = clickedToggler.getAttribute( 'aria-controls' );
const dropDownContent = this.mainContainer.querySelector( `#${ containerId }` );
this.toggleAriaExpanded( clickedToggler );
dropDownContent.classList.toggle( 'is-hidden' );
} | 1 |
78bf8ca601d5f7bb571adc491bec39f9 | 3816a53f6d00b12b59c0a4ac1a3f575e | 重新设置事项的显示位置。并重新设置行序号。
一般在LocationItems排序后使用。 | {
if (Count < 1) return this;
if (entity == null) throw new ArgumentNullException("entity");
if (String.IsNullOrEmpty(sortKey) && Factory.FieldNames.Contains("Sort")) sortKey = "Sort";
if (String.IsNullOrEmpty(sortKey)) throw new ArgumentNullException("sortKey");
... | 1 |
c31bc308d75c9644e0e88ec398a422fd | a712e6b7110dc9ff77bf52c4f189e5c1 | Test case for list_call | def test_list_functions_empty_call():
client = FunctionServiceClient(
credentials=ga_credentials.AnonymousCredentials(),
transport="grpc",
)
with mock.patch.object(type(client.transport.list_functions), "__call__") as call:
client.list_functions()
call.assert_called()
... | 1 |
4fb4f808047ca2590cea7af2b3e5efb3 | 1445b99ab280a1a858a371b5daae0614 | Update the atom tracker, only called if moves are accepted. | int mc_move() {
int rand_particle = (ran->uniform())*ATOMS;
double move = ran->uniform();
double accpt = ran->uniform();
Atom test=box[rand_particle];
if (move>.5) {
double rand_x = pbc(box[rand_particle].x + MAX_MOVE * (((ran->uniform())*2)-1));
double rand_y = pbc(box[rand_particle].y + MAX_MOVE * (((ran->un... | 1 |
823c1d57459fc0f6eb0c270db9c741a8 | 24141099e236396cb8bf4c155cc2bd1f | 根据模块路径获取uuid数据 | public List<String> getUuidsByFullPath(String fullPath); | 1 |
12fc9b4deaa19946ef3b98e5529b025d | 5d2d4b33bcd53acc7989fe1aa569e725 | Get all the lifeCycles. | namespace Repository.Abstract.Branches.IT.Equipments.LifeCycles
Task<List<EquipmentReplaceRequestLifeCycle>> GetLifeCycles(); | 1 |
3de96c1e0e03657dfe504b28bd524d4c | c1387ae178459e9d42a15c3349a99f24 | Admin Revoke Beta Key | try {
if (empty($_GET['id'])) {
throw new Exception('Nice troll.');
}
$allowed = current($GLOBALS['db']->fetch('SELECT allowed FROM beta_keys WHERE id = ?', $_GET['id']));
if ($allowed == 1) {
$newAllowed = 0;
} else {
$newAllowed = 1;
}
$GLOBALS['db']->execute('UPDATE beta_keys SET a... | 1 |
94578d66d761b80d00490a75cc1259d0 | cc109222cf800d86f48a11642b20229d | format superblock header and
all the segment headers in a cache device | {
struct buf *b;
b = bread(dev, 1);
memcpy(sb, b->data, sizeof(struct superblock));
brelse(b);
} | 0 |
8a8a39d02b352ed976f0bf3345ac8865 | 1b65d9f11454040b9c9ae32a4e85bc71 | 获取某个集合的特定对象的特定属性 | var result
$.each(objSet, function(i, obj) {
if (objName == obj.name) {
$.each(obj, function(key, value) {
if (key == property) {
result = value;
return false;
}
});
return false;
}
});
return result;
} | 1 |
342194885a74bf717b2bbd386ca57bcb | 0981a73c41aff9bc2d407e7a78b01bd1 | 找到对应的AV名字 | const QString DEditAVP::getNameAVP() const
{
return ui->lineEditName->text();
} | 1 |
189ee1c834245034cf1a057544312a7d | 3e32072bd71b51380dbd8d0c8a5b9ac5 | 查找最大结点:返回tree为根结点的伸展树的最大结点。 | splaynode* splaytree_maximum(splaynode *tree) {
if (tree == NULL) return NULL;
splaynode *node = tree;
while (node->right != NULL) {
node = node->right;
}
return node;
} | 1 |
28f31698300f21fdc8f7eabde5eab697 | adc4420f8fd775c05f64e55b56efbd0e | The pointA and pointB indicate the two 2D points between where a line is drawn
The points on the line that intersect with any of bounding boxes of spawned enemy ships are detected | {
FUL.Coordinate PointA1, PointA2, PointB1, PointB2, IntersectPt1, IntersectPt2;
Double DistanceToIntersect1, DistanceToIntersect2;
LatLongStruct ClosestPoint = RectangleCenterPoint;
Distance = SimpleDistance(AircraftPosition, RectangleCenterPoint);
P... | 1 |
b43b0746fa44d642a7ae86953312b577 | 683ceb798eae392cc0b69132cff0e232 | 修改活動資料(不含狀態) | function update_act() {
var actid = "", company = "", name = "", stday = "", eday = "", price1 = 0, price2 = 0, amt = 0, enable = "true";
var img = $("#imgLoad");
var msg = $("#msgErr");
var actid = $("#popID").text();
var tr = $("#" + actid).parent().parent();
company = $("#hidUser").val();
name = tx... | 1 |
d1d6d2dc888c20254adad5d872a6c5a0 | f7c6ca872d6dcf687697ec333ef5c14b | 向事件框架添加读事件,是否真正添加需要看当前使用的是什么事件模型,以及当前事件的状态 | public void handle(Event event) {
if (event.getType() == EventType.ACCEPT) {
System.out.println("---处理读取事件");
event.setType(EventType.READ);
selector.addEvent(event);
}
} | 1 |
8daf973e44deeb1a7498e0532570dad4 | 6bc779ed05b6d187bef0ccb24fa18558 | Hàm kiểm tra trọng số điểm 3 kiểm tra | int n;
bool Ktra = true;
cout << "nhap n: ";
cin >> n;
while (n != 1) {
int i = n % 3;
n /= 3;
if (i % 3 == 0) {
Ktra;
}
else {
Ktra = false;
}
}
if (Ktra) {
cout << "so do co dang 3^k ";
}
else {
cout << "so do k co dang 3^k ";
}
system("pause");
return true;
} | 0 |
1a3ab12d775bde01afcbf8b58c7e0f7b | 423b3752b4c11576099010ce31b025eb | PUT: api/Roles | namespace RESTfulAPI.ApiController.Controllers
[Route("api/Role")]
[ApiController]
public class RoleController : ControllerBase
[HttpPut("Update")]
public ActionResult Put(List<ViewRole> roles)
{
List<ViewRole> result = _role.UpdateRole(roles);
return result == null ?... | 1 |
eb3cdff4114a3fd48a907a5b7df8648e | 7f62bc0cf4806c5d342afabf1a52f065 | !
Helper routine to keep track of the maximum file descriptor number (needed for select() call) | static int
next_fd_value (void)
{
return hash_size (&thread_current ()->hash_table_of_file_nodes)
+ STDOUT_FILENO + 1;
} | 1 |
6474c98c7e84878d3ae67d160b85d8c1 | 2106399731d59ae6b97e4d3ddaba6e6d | Sets the text for an empty list with the advice to select at least one role | namespace WpfApp
public partial class TranscriptionQueue : UserControl
private void SetZeroListMessage()
{
CurrentPageTextBox.Visibility = Visibility.Hidden;
RecordCountWordTextBox.Text = SearchHelper.NoRecordsFoundMessage;
} | 0 |
8daa84735ca9efd8a334f4ee21da82e1 | e69922aef2276869327e1f6e8c543821 | Evaluate an array of predictions based on an array of labels and their given radius
True positive gets calculated by matching predictions with labels from shortest distance to longest distance.
False positive are all predictions without a label.
False negative are all label without a prediction. | int w = groundTruth.getWidth();
int h = groundTruth.getHeight();
int[][] truth = groundTruth.getData();
int[][] pred = predictions.getData();
int[][] cComp = connectedComponents.getMatrix().getData();
long[] res = new long[2];
for (int y=0; y<h; y++) {
... | 0 |
254ff3510dfbbce62937c0ab0ab3a01c | bc770ecdd56469d2693ce6d2518dda34 | Sets the ternary tree to a new one-node ternary tree with the given data | public void setTree(T rootData); | 1 |
ecdd5181a02edc651136caef868f2618 | 41db4d00facecf3eb81c5220796ea26a | Read transient event data. | {
std::string applicationName = "Undefined";
m_TransientData.emplace("ApplicationName", applicationName);
unsigned int sampleRate = 25600;
m_TransientData.emplace("SampleRate", sampleRate);
double displayTime = 0.1;
m_TransientData.emplace("DisplayTime", displayTime);
double refreshRate = 1.0;
m_Transi... | 0 |
59f70fdd59cf70b5670e16297d5cd63c | d5f581aad69fa24746160f4cac43e3f7 | 设置可领取耐力的条数 | public class Config
public void setLuckyMoneyCountMM(int count){
preferences.edit().putInt(KEY_GET_HONGBAO_COUNT_MM,count).apply();
} | 0 |
ca001d80ddaa5e53387ff77020f53037 | 79533b12fe733828112dfdeec46c5a4a | VALIDATIONCURVE Generate the train and validation errors needed to
plot a validation curve that we can use to select lambda | train_errors = []
val_errors = []
for lmbda in lambda_list:
self.lmbda = lmbda
self.train(X_train, Y_train)
train_errors.append(self.accuracy(X_train, Y_train))
val_errors.append(self.accuracy(X_val, Y_val))
return train_errors, val_errors | 1 |
48c05d6078a241258ed09ec680cb6262 | 36eee38a303e5efc3abcb9269fba9680 | Adds a watcher to a prop. | __markWatchedProp(ngPropName) {
this.__ngScopeOpts__ = this.__ngScopeOpts__ || {};
this.__ngScopeOpts__[ngPropName] = this.__ngScopeOpts__[ngPropName] || {};
this.__ngScopeOpts__[ngPropName].watch = true;
} | 1 |
b54d291e41bb2cc88ab51f294a3a6d67 | 80af6cbe4c473644824b761b2bd253a9 | Verifica a integridade da assinatura do movimento. | {
if (string.IsNullOrEmpty(hmacKey))
{
throw new ArgumentNullException("A chave HMAC não foi informada!");
}
var bodySha256 = GenerateHmacSignature(body, hmacKey);
var result = string.IsNullOrEmpty(requestHmac) ? false : requestHmac.Equ... | 1 |
69052cc344ec1dd51dc2a280b375a762 | 85637653eb5506934e2b618df71a503c | ArrayToTable class definiton | this.tableContainer = document.getElementById('data-table');
this.tdClass = 'data-table__cell';
if(!this.tableContainer){
this.tableContainer = document.createElement("div");
this.tableContainer.id = 'data-table';
document.body.appendChild(this.tableContainer);
}
} | 0 |
66556ca19e027f96f336abf03d5fcc77 | da80b4482e787e0e9909b60b8539139a | Must return the current x position of the roller coaster. | function getX() {
return _x;
} | 1 |
b75f8d8e9665f7217aaf336133e4f4d0 | 798a35d5c037657259c7c92488064955 | Lower bounds on slacks corresponding to soft upper bounds on u
at stages (0 to N-1);
not required - zeros by default | class AcadosOcpConstraints:
def lbu(self):
return self.__lbu | 1 |
22d15930b5d6ab774f1ee5fc7d153f09 | 6d4e1df008d71fd2552b4004de0702ac | Функиця расчета даты вступления решения в силу
по дате решения и списку выходных и праздничных дней | if start_date != None and self.start_date != start_date and start_date >= 0:
if self.prior_activity != []:
max_finish_date = 0
for iactivity in self.prior_activity:
activity = self.act_db[iactivity]
if activity.finish_date > max_finish_date:
max_finish_date = ac... | 0 |
9fb5f02bde871ba380d46f3ddcaeda09 | 18b363ebffdaeea413dfbe7d47e79bd8 | 被授权人姓名输入框 | bindinputName(e){
this.setData({
companyName: e.detail.value
})
} | 0 |
84f4fcb2027077b047ebcb838659ab18 | 2a1f81b678e0e53ceb0708f8b266ae33 | 创建递增单向链表 | DLNode *s;
ElemType e;
L = (DLinkList)malloc(sizeof(DLNode));
L->next = L;
L->prior = L;
scanf("%d", &e);
while(e != -1){
s = (DLNode*)malloc(sizeof(DLNode));
s->data = e;
s->prior = L->prior;
L->prior = s;
s->next = L;
s->prior->next = s;
scanf("%d", &e);
}
return L;
} | 0 |
8c444c27ecac3a663c341a83c473cef3 | b8b7536690be3fe94b3f2444f8e59518 | LE PASAMOS UNA CASILLA Y NOS DICE SI HAY COLISIÓN | colision = False
if (self.rect.colliderect(rectanguloChoque)):
colision = True
return colision | 1 |
61b68094277c776dfdd1d0ecf0703335 | c0e1c712f93175305d63e72928bb3910 | 查询某一天班表接口 | class SubjectController
async getSubjectByday(ctx) {
ctx.body = await subjectService.getSubjectBydate(ctx.request.header.authorization, ctx.query);
} | 1 |
ad29e18e5cae1e1499b1043d27e33f3c | 234d7d16bc00ee17c419dbbbdd147877 | Esperada a excecao na chamada do metodo pois o usuario esta solicitando
um periodo de emprestimo maior que a sua categoria de fidelidade permite. | public class UsuarioValidacaoTest
@Test(expected = IllegalArgumentException.class)
public void testPeriodoInvalido() {
uv.periodoInvalido(7, 5);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.