query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
22ee3ce029a956dbc29e8adf90c34ce2 | 5f40f7f0543c770ec812cc496acadbf4 | Initializes activity and creates tables in database. | {
mManager = new ProfilesManager(getApplicationContext());
boolean tableExists = mManager.doesTableExist();
boolean tableEmpty = mManager.isTableEmpty();
Log.d(TAG, String.valueOf(tableExists));
if(tableEmpty){
Log.d(TAG, "dB table doesnt't exist.");
new CreateDefaultProfiles(mManager).execute();
}
... | 1 |
896ebeeb1f749d9d36afa6857be05767 | 34a59349f45580d4c98e1c648f2a798f | 添加作家信息(校验是否已存在该作家) | class Book_Change_Repository extends Repository{
function register_author(array $author){
if($this->author_exist($author['name'])){
$this->author_update($author);
return true;
}else{
if(isset($author['name']) && $author['name'] != ""){
if(filter_var($author['url'],FILTER_VALIDATE_URL))... | 1 |
510db5a5e8a76e8155449055f03b3f58 | 9cdd46edab55143076661548c31d74b1 | Assert that layout block is not rendered | template = "{% load marketing_blocks %}{% render_marketing_block obj 'header' %}"
out = Template(template).render(Context({"hide_marketing": True, "obj": issue}))
assert out == "" | 1 |
acf26655e89e3f44e0a94a2a0506fce6 | 6f377a360d56a2dd0fa3c763fdf02caa | Returns Text Shadow presets. | {
return [
['Styles', 'Format', 'Font', 'FontSize'],
['Bold', 'Italic', 'Underline'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight']
];
} | 0 |
03cb7837add76af4c9c5c9a995d2b9be | b898e2354d5a08b8786589cefd0c2f31 | 将文件写入到输出流中 | public class FileDao extends BaseDao<FileDO>
private void write(InputStream in, OutputStream out) throws IOException {
byte[] bytes = new byte[64];
int rc = 0;
while ((rc = in.read(bytes, 0, 64)) > 0) {
out.write(bytes, 0, rc);
}
} | 1 |
c17dcd00ca8a57ebf2b36251391e30fe | d51bd0f3fc402ebe15b2dc250b56f71a | 根据父编码查询字典信息列表 | @GetMapping("/areaCode/listDictByParentId")
ResponseResult<List<Map<String, Object>>> listDictByParentId(@RequestParam("parentId") Long parentId); | 1 |
f387c078e4ef09821813d7c3e91103dc | b497d0512b88de4e102fb75f0189c346 | Calculates the distance from a point to Dublin office | def calc_km_from_dublin(entry):
lat_radians = math.radians(float(entry["latitude"]))
lon_radians = math.radians(float(entry["longitude"]))
km_from_dublin = EARTH_RADIUS * 2 * math.asin( math.sqrt ( math.sin( math.fabs( DUBLIN_LAT_RADIANS - lat_radians ) / 2 ) ** 2
+ ( math.cos( DUBLIN_LAT_RADIANS ) * math.cos( la... | 1 |
2c6f5d34b711b2f33067c7e8eaeb0ce6 | bfdb6bde166a5734f7fd5e62175b57ec | 分配样本到聚类中心 | assignment = []
for i in range(k):
assignment.append([])
for point in data_points:
min = 10000000
flag = -1
for i in range(k):
value = distance(point, center[i])
if value < min:
min = value
flag = i
assignm... | 1 |
b67ae1e2255ee99480b8c676fb5bc024 | 3779faff6f4df975fe04002d6e8fc172 | Get whether the perplexity is converged or not | public class PLSA
private boolean isConverged(int cur_iter) throws Exception{
return cur_iter>=max_num_iterations;
} | 0 |
3961d9bae52734a232dc424d2b02afed | 8d0c4599c2367ff4bf830d33554b87cd | Compares two ChatMessagesADT. | public class Message implements Serializable{
public boolean equals(Message other) {
return this.toString().equals(other.toString());
} | 0 |
8987c5b1ac7fa8eda39660555d5d1031 | 114e8631497baa6cc79955ec82e7cfdc | 设置好易支付分配的终端设备号,与下单一致 | public class AlipayMsaasMediarecogAftscvpayTransactionInitializeModel extends AlipayObject
public void setTerminalId(String terminalId) {
this.terminalId = terminalId;
} | 1 |
b1c2b8fb6a53211078f6b5954c2aea18 | 6ce75d466cccd226a88f5df749ea7099 | Find non-numerical features index list of data | class DataProcessor:
def get_non_numeric_columns(self, data=None):
if data is None:
data = self.data
return get_non_num_cols(data) | 1 |
d44aa8edaf4426f34a6d5a087875832b | f4a5d6dd05cbec0730f97569370825e6 | Called just after new page is inserted. | namespace HighResolutionApps.VisualControls.HRVChartInfo
public partial class HRVChartInfo : UserControl, IVisualControl, IPageEvent
public void AfterPageInit()
{
} | 1 |
299d1fc8d2b17dfc1ed81d39aa92d218 | d4c1e6f40a065ebfe3f3205642b99e09 | Call the Ruby initialize method with the supplied arguments and block. | def initialize(*attrs)
set_attributes(attrs.extract_options!)
end | 0 |
f85f52fff17f053f14c5bc22a8e59776 | 66a90b3a5d5c129dab5c3a4cd1bac095 | Sends a command to the pulse generator RTL via FIFO | void fdc_send_cmd(uint8_t cmd){
uint16_t i;
for (int i = 0; i < 500; i++ )
if (fdc_read_status() & FDC_MSR_MASK_DATAREG)
return outportb (FDC_FIFO, cmd);
} | 1 |
ac39ccf239658e3c4b403a619d5f929d | 30a890722d40b3b897eab24967811a4b | Sets if XML should be indented.
Default is true. | public final class XFormat implements Serializable, Cloneable
public void setIndent(boolean indent) {
this.indent = indent;
} | 1 |
d775d6b7520142d96952809c7b92da55 | 10a1152510e4af78f3468882cc11f0eb | Show the next image for all portfolio image gallerys | let nextPosition = (this.galleryModalCurrentPosition + 1);
if (this.$galleryPhotoData.length < nextPosition) {
nextPosition = 1;
}
this.changeImageInGalleryModal(this.$galleryPhotoData.filter(`[data-position="${nextPosition}"]`));
} | 1 |
8b863a183bfb10a5b7a7fa64cd9185de | 170e69a14a6ba314aac4976214aa6432 | Order lines count. | abstract class OrderDecorator implements OrderInterface
public function count()
{
return count($this->order);
} | 1 |
b1a7078ad64a8a6c2bdb3ad0f835d064 | 3c864adf7f29d8378a266cd4709c2136 | https://leetcode.com/problems/single-number-iii/ | func main() {
x := []int{2, 2, 1, 1, 3}
singleNumber(x)
} | 0 |
c97faea8650f9ac11649c48a8b0955e6 | 9351c6e22d85aabf7f99fea637067031 | Consumes a person and sees if the person likes two entries
Returns false if the person does not exist, or if both entries are not liked.
Otherwise, returns true | public boolean bothLiked(String person, String a, String b) {
if (likes.containsKey(person)) {
LinkedList<String> entry = likes.get(person);
if (entry == null ) return false;
return entry.contains(a) && entry.contains(b);
}
return false;
} | 1 |
73af6661bf36b3842c29b82bb3142042 | 5855b1f8410da2933df8f80425c69199 | 左侧菜单解除点击事件 | $('.content_left_menu dt a').attr("class", "dt_down");
$(".content_left_menu dd").slideUp(500, function() {
$(this).hide();
});
} | 0 |
6be9d862a18f159feb35769bf9d0bee9 | 788a5cc416d732bf494e567106a5d04e | Constructs the list tag | $config += ['list_type' => 'ul'];
parent::__construct($View, $config);
$this->Crud = $config[0];
$this->filter_property = $config['filter_property'];
$this->filter_match = $config['filter_match'];
$this->list_wrapper = (object) [
'open' => "<{$config['list_type']}>",
'close' => "</{$config['list_type'... | 1 |
5863ecc4b27af26cbf807443d373d723 | 2744441e5963ae5a4ea1c07ebc35adf6 | Compares pizzas by calories | public int compareTo(FoodItem f1){
return(int) (nutrients.returnList().get("Calories") - f1.getNutrients().returnList().get("Calories")) ;
} | 1 |
d33b77f318be37ecac748b5a563e5798 | 5258e07af7cb8cd2cc2fe0060cd29aa9 | Turn it into a NationStates ref name | class IPNation(BinWrapper, ReaderMixin, WriterMixin):
def format(self, target):
pieces = target.strip().split('.')
target = bytearray([int(p) for p in pieces])
return str(target) | 0 |
f586abd2344a42cb24bc7c01d5e9007f | 3930934522fe28c82e0e54fa3ce547d3 | Generate a sequential sequence to fill a buffer. | i = 0
buf = bytearray()
while len(buf) < length:
buf.append(i)
i = (i + 1) % 251
return buf | 1 |
1356a41b9c3cf9604b5437a84e742371 | 9a10d9cd3c488036cc1b31ef93ac38a2 | Calculate soil-adjusted VI | savi = (1.5 * (band5 - band4)/(band5 + band4 + 0.5))
plot.show(savi)
new_savi = rasterio.open(path+'\\savi.tif','w', driver='Gtiff',
height=height, width=width,
count=1, dtype='float64', crs=crs,
transform = affine)
new_sav... | 1 |
d24f057749a4c42d54fde2e8c95a7ead | ac34d11441cb2005285f8c56a71da3fb | Gets one specific IP, with it's note matching your input | class IpNote extends Model
public static function find($parameters = null)
{
return parent::find($parameters);
} | 0 |
328e38444a012b3be600367e5d5c7d77 | f6de5caf16384dcbb9b0491c744ddffe | Depending on the command, serialize the needed data
Authentication will serialize the command, the concerned key and
the serial number
Reading data will just serialize the command
Writing data will serialize the data as well | class AlpesCommand(AlpesMessage):
def pack(self):
if self.prefix == PREFIXES.ECRITURE_REGISTRE:
self.packed = self.prefix + struct.pack('<HH', self.start_register, self.number_registers)
self.packed += struct.pack('<%si' % len(self.data), *self.data)
elif self.prefix == PREFIXES.... | 1 |
5e259c8a9a9d2992535745ed0bc492f9 | 53b1ade08fd55567d8ff1eba66f53058 | Test case for get_destination | @ContextConfiguration({"classpath:applicationContext.xml"})
public class DestinationTest extends AbstractTestNGSpringContextTests
@Test(dependsOnMethods = "testAddDestination")
public void getDestinationSuccess() {
Optional<Destination> destination = IDestinationService.getDestinationById(id);
Asser... | 1 |
5bdebf51bbcb02e19ccfea82a570f2bc | 395b0b2785124644487d825be850e833 | Checks that fixture can be removed in test class node | required_by, can_be_removed, can_not_be_removed = self.check_remove(
self.ITEM_TYPE, self.ITEM_PUBLIC_ID
)
assert not required_by, required_by
assert self.DEPENDENCY_PACKAGE_ID in can_be_removed
assert self.DEPENDENCY_PACKAGE_ID not in can_not_be_removed | 1 |
d4460abf910351bd238880eb1e124e3b | dffbc11bb7578185e9d90162c145a55f | Template tag | {
$tag_id = get_config('launchrock_id');
$template = get_tag_template('launchrock_widget');
if (launchrock_validate($tag_id)) {
return str_replace('%%TAG_ID%%', $tag_id, $template);
}
} | 1 |
e14ae7f16dfed53bb65e9cb485726a6f | d3e93b367be5a632a0d0b2a595ac7468 | set scale to the current matrix | void SDL::pushMatrix()
{
m_transformations.push_back({{0,0}, {1,1}});
m_scale = GetCurrentScale();
m_translation = GetCurrentTranslation();
} | 0 |
43143964c2e56c47f2d204f716a5b158 | aaa55be433a45100d486980f671513a8 | This command allows a policy to be bound to a specific creation
template. This is most useful for an object creation command such as
TPM2_Create(), TPM2_CreatePrimary(), or TPM2_CreateLoaded(). | void* out_parameters = NULL;
uint8_t buffer[TPM_MAX_COMMAND_LENGTH];
int buffer_size = sizeof(buffer);
void* auth2 = NULL;
RETURN_ON_FAILURE(TtlRunCommand(TPM_ORD_SetRedirection,
2067, -1, in_parameters, out_parameters,
auth1, auth2, buffer, buffer_size));
return TPM_SUCCESS;
} | 0 |
860e647aaa569093b93200e86b1317cd | 0064e2799ef253cbb237d719024d8480 | Execute the selection SQL and handle the result set.
changed. | class SqlTable implements Table
public function updateSelection(UpdateSelection $selection)
{
$typeAdapter = $this->owner->getTypeAdapter();
$sqlString = 'UPDATE ' . $this->owner->quoteModel($this->name);
$data = $selection->getData();
if (count($data)) {
$sqlString .= ' ... | 0 |
f3302134eac672a80a85e1f82f53050b | 6a6eb85625febf6a7590c71e9a352910 | 统计用户的课程学习时间 | const { ctx, app } = this;
const userdoc = ctx.helper.getSaltyMd5(mail, 'userdoc');
await ctx.helper.makeDir(`${pc.userdoc}/${userdoc}`);
let redisContent = await app.redis.get('count').get(courseId);
let result;
if (redisContent != null) {
result = JSON.parse... | 0 |
c43eaa83b95221382aa58d1ae0413e2e | 0492aa00b5a9af19aa690b6c2a920073 | Parse list of comments of pojo @Comment to list String | if (CollectionUtils.isEmpty(comment)) {
return Collections.EMPTY_LIST;
}
List<String> res = comment;
for (int i = 0; i < res.size(); i++) {
res.set(i, " " + " " + res.get(i) + "\n");
}
return res;
} | 0 |
6ebfb3081659eece49c287d10da0e96d | 27760ff7a4c3596893df23ef7bc3931e | 异步修改列表页 内容 | async putAction() {
const list = this.post('list');
if (list) {
const affectedRows = await this.modelInstance.updateMany(list);
if (affectedRows) {
return this.success();
} else {
return this.fail();
}
}
if (!this.id) {
return this.fail('CONTENT_NOT_EXIST');... | 1 |
7b9fd18b363b8cce1bb8befdc3ca788a | c62e388e6e8d08dec28b5a5120204989 | 打开挂件-边框宽度选择框 | const style = {
display: 'inline-block',
height: 300,
marginLeft: 70,
};
const menu = (
<div style={style}>
<Slider
vertical
max={1}
step={0.1}
className="mySliderStyle"
defaultValue={props.defaultValue}
onChange={(value) => props.changeOpacity... | 0 |
a3de620d7a3019a2271c3111326ee7ef | f46c3e5dbe5674006435046c9dfbf25d | 从文件中获取action名称 | local item = getItemByid(id)
if(item) then
return item.actionName
end
end | 0 |
508f881a3e002d7d1b4c05ba1aba75e0 | 0af48b29107669d9b69058850a007ae6 | Set up the spirograph's parameters. | function setParameters(aScale: number, aMoveMsPerUnit: number, aMoveSpeed: number, aSpinMsPerDegree: number, aSpinSpeed: number) {
scale_x = aScale;
scale_y = aScale;
move_ms_per_unit = aMoveMsPerUnit;
move_speed = aMoveSpeed;
spin_ms_per_degree = aSpinMsPerDegree;
spin_s... | 1 |
c2bd23999aa173c71a8cfcc6cf46111c | 29c755c41d642eb218a38aa15315c45b | Tries to parse specified string as IDE version and returns null if not succeed.
if the string is not a valid IDE version | data class UnityVersion(val major: Int, val minor: Int? = null, val patch: Int? = null) : Comparable<UnityVersion>
fun tryParseVersion(value: String?): UnityVersion? {
val version = value
?.split("a", "b", "p", "rc", "f")
?.firstOrNull()
if (version != null) {
... | 1 |
d81c07233b5bcd31e002922f08332458 | d18ffb23f2149a4953ba87dc06dba6cf | Expand a dataframe with a list into multiple rows. | def expand_array_cols(df):
if len(df.index.names) > 1 or df.index.names[0] is not None:
raise NotImplementedError('numpy repeating may not handle index. '
'reset_index first.')
array_cols = arraylike_cols(df)
if len(array_cols) == 0:
raise ValueError('df did not appear to have an... | 1 |
ad341269e2a7d9b4b0bbcc448fedf4df | af750d46f1b7517913e543897ac87ae1 | Add a default exit menu | entries = {
'Teach Menu': [self.__mm.loadDefaultMenu,"teachMenu"],
'Show Camera': self.__mm.bb.showCamera,
}
if self.__moveit:
entries['Manage Boxes']=[self.__mm.loadDefaultMenu,"addBox"]
entries['Select Gripper']=self.__m... | 0 |
15f402e44a79044c1891251debd7cafa | 6993f90ea0fe7eaccc6026124c81bcda | Constructor method for GetConversationItemsType | class EwsGetConversationItemsType extends EwsBaseRequestType
public function __construct(\Ews\StructType\EwsItemResponseShapeType $itemShape = null, \Ews\ArrayType\EwsArrayOfConversationRequestsType $conversations = null, \Ews\StructType\EwsNonEmptyArrayOfBaseFolderIdsType $foldersToIgnore = null, $maxItemsToReturn = n... | 1 |
38debcb45c314c0b95dd4e5825fc88cf | 02c5670fc4e9cad6bbf6acde5dd996f8 | aggiungo l'utente ai gruppi degli insegnamenti dell'anno del corso di studio scelto | void SciDiv::addGroup(int course, const SciGroup& group)
{
mapa[course] = group;
} | 0 |
faa5ec079c0633d7d9de6df6a9eb4b6d | f5ca6919ebcea332d2a0a95dbc2d5c20 | Called when property on button label is changed. | DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
ViewButton viewButton = dependencyObject as ViewButton;
viewButton.SetState();
} | 1 |
94ec972fe2d93c790e51fc00123396d6 | dde4d8865d7ebc9bfbc197bd8678894d | Класс для шифрования/дешифрования текста в изображение. | function Encryptor() {} | 0 |
eec18c4b4c33f7fdc1909556dcf0740a | 2d2b874f38999f304aa302d812fe5b29 | Tells if an index table for a given table exists | =>
(int)
ExecuteScalar(
$@"SELECT COUNT(*) FROM sys.indexes
WHERE name = '{indexName}' AND object_id = OBJECT_ID('{
GetFullTableName(schemaName, tableName)}')") != 0; | 1 |
3c4205a602d3df9ba2c637a61653f563 | 405e9911ff6aabc4152d0407b71750a2 | 初始化涉密等级下拉列表 | var json = tools.requestJsonRs("/sysCode/getSysCodeByParentCodeNo.action", {codeNo: 'POWER_LEVEL'});
if(json.rtState) {
var page = "";
var powerLevelJson;
for(var i=0 ; i < json.rtData.length; i++){
page = page + '<input style="width: 15px; height: 15px;" labelAlign="left" label... | 0 |
f3609708115312addbf3159f987717f3 | 4ad0c9dad77d29122b95daded5b11d92 | @brief Met le timer en mode Fast-Pulse Width Modulation (Fast-PWM).
ATTENTION : les broches PD4 et PD5 seront gérées par le compteur.
Pour éviter cela, mettre com1a et/ou com1b en mode DISCONNECTED. | {
LPC_PWM1->TCR = 0;
LPC_PWM1->CTCR = 0;
LPC_PWM1->PR = 0x1C;
LPC_PWM1->PC = 0;
LPC_PWM1->TC = 0;
LPC_PWM1->MR0 = TIME20MS - 1;
LPC_PWM1->MR2 = TIMEDEFAULT;
LPC_PWM1->MR5 = TIMEDEFAULT;
LPC_PWM1->MCR = 0x02;
LPC_PWM1->PCR = 0x2400;
LPC_PINCON->PINSEL4 = (LPC_PINCON->PINSEL4 & ~((3 << 8)|(3 << 2))) | ((1 << 8... | 1 |
4dbcf5946fc72d3a323fd147e5dbe541 | 15afc89754f1c34985d9575743cd04b8 | 빠른 매치 요청 답변 패킷 처리. | CompoundReturn compoundReturn = RequestBuyManager.getInstance().msg_ask4FastSale(player);
if(compoundReturn!=null){
ArrayList<Long> list = (ArrayList<Long>)compoundReturn.getObjValue();
long[] entityId = new long[list.size()];
for(int i = 0; i< entityId.length; i++){
entityId[i] = list.get(i);
}
... | 1 |
81ba605f93d3e1825b0136ab2bdebdfb | 58128af4ebeb64adf236556048e3fb71 | IssueCert issues a certificate, either a self-signed CA or from a CA in a keystore. | class CertificateAuthorityClientArgs:
def issue_state(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "issue_state") | 0 |
b0f5307be70546c6a1d7a5c44dc44985 | fb7a816217f13ba7d760fad8ba22e9bf | this method shows the employees list in a ascending order based on IDs | public class EmployeeManagementSystem
public static List<Employee> sortId(List<Employee> emp) {
List<Employee> temp = emp.stream().sorted(Comparator.comparing(Employee::getId)).collect(Collectors.toList());
return temp;
} | 1 |
c1a4fb6b1a65da462d15cee22f8174d4 | afd3fa49f0f77d027d42a94eae3e3537 | Snippet for DeleteReferenceImageAsync | const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const galleryName = "myGalleryName";
const galleryImageName = "myGalleryImageName";
const galleryImageVersionName = "1.0.0";
const galle... | 0 |
5863cddfb4780d49df3b6571a1817964 | b8b9a58e56c210b4ecf407cd3e362491 | Test if 'untag' works as expected. | $tagnames = ['foo'];
$collid = core_tag_collection::get_default();
$tags = core_tag_tag::create_if_missing($collid, $tagnames);
$user = $this->getDataGenerator()->create_user();
$context = context_user::instance($user->id);
$component = 'core';
$itemtype = 'user';... | 1 |
a3733773c4753d9f2b2229fb0635a8a7 | 79a4510482911903c40b919458d47b1a | Create visit log mock file. | def mock_xml():
filename = './mock_data.xml'
xml_content = ('<?xml version="1.0" encoding="UTF-8"?>'
'<people>'
' <person full_name="h.simpson">'
' <start>01-01-2020 10:00:00</start>'
' <end>01-01-2020 19:00:00</end>'
... | 1 |
9c9c4c5a3dc5f55e912d12dcaa8386ed | 7ef3bb63d52bd4106dca4e3684e551c1 | Checks, whether player pointer is on the last player who played this turn | IList<string> playerIds,
string lastPlayer,
string player)
{
var lastPlayerIndex = lastPlayer == null ? -1 : playerIds.IndexOf(lastPlayer);
var playerIndex = playerIds.IndexOf(player);
return playerIndex == (lastPlayerIndex + 1) % playerIds... | 0 |
238b6380087824b1e7b99dbcb79d987a | dca59c1c0966c2dc33c86f434f8f0423 | Run `status` command. | class comrv_status_command (gdb.Command):
def __init__ (self):
gdb.Command.__init__ (self, "comrv status", gdb.COMMAND_NONE) | 0 |
c7314169f1cef20296e06a0b260d1222 | 1e1b9949f74ecdc86b13c0e38a05d067 | Sets the number of training epochs. | class Trainer:
def with_nb_episodes(self, nb_episodes):
self.nb_episodes = nb_episodes
return self | 0 |
291cd1df019345cbecc980fc02bff233 | 71e14764ae04b6eecb02f2bdcc624f38 | 展示日韩电影 | @GET("Showtime/LocationMovies.api?locationId=561")
Observable<MovieHotBean> getHotFilm(); | 0 |
63e6107e63d3e49888402c21ecfdd036 | 42801aa6a93337c34baae358959d360c | == Définition des fonctions de rappel des types de champ == | {
if(tree->nbChildren == 2)
{
codeDeclChamp(getChild(tree, 0));
codeLDeclChamp(getChild(tree, 1));
}
else
{
codeDeclChamp(tree);
}
} | 0 |
327649dfac588142b358c9adf8f7849c | bd919a10ba122d7c31c027d493cb087e | Возвращает заголовок документа в HTML формате | public String getTitle(final Document document) {
return document!= null?document.title():"";
} | 0 |
81215195529812a7d64cdda43dffb9f2 | 7081e89b241af12beb619e976ddac648 | Converts our Shading enum to the D3D ShadingMode equivalent. | FString GetShadingModelString(EMaterialShadingModel ShadingModel)
{
FString ShadingModelName;
switch(ShadingModel)
{
case MSM_Unlit: ShadingModelName = TEXT("MSM_Unlit"); break;
case MSM_DefaultLit: ShadingModelName = TEXT("MSM_DefaultLit"); break;
case MSM_Subsurface: ShadingModelName = TEXT("MSM_Subsurf... | 0 |
0d2c78c075aebe135641eb38d98a1f78 | 05ee9a5c0c6ddcd25c57d901b79d15c7 | Конкретная реализация нанесения урона Верблюдом по цели | this.skill.addSpellTarget(monster.getEntity(), this.applyAlf);
Skill.damageEntity(monster.getEntity(), this.applier, this.tickDamage,
this.skill.isType(SkillType.PHYSICAL) ? EntityDamageEvent.DamageCause.ENTITY_ATTACK : EntityDamageEvent.DamageCause.MAGIC,
this.knockback);
} | 1 |
05c16110e09f73da3872664705522976 | 84d716b2bc71f49f3fa3fc68fb2860b0 | 发送带附件及图片的邮件 | public class MailUtil
public static void sendAttachmentsMail(JavaMailSender javaMailSender) throws Exception {
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
helper.setFrom("335747019@qq.com");
helper.set... | 1 |
39be99ccf960262232b9f10f83893564 | febdb63550845bc3b50702449feee5aa | 按钮材质初始化 | if (this.material) {
ButtonMaterialSet.remove(this.material);
this.material = null;
}
this.material = materials;
ButtonMaterialSet.addChild(this, materials);
this.updateMaterialVisible(this.getButtonState());
this._labelField.forEach(label => {
this.removeChild(label);
th... | 1 |
7f349fe398d8b9350afd5f0401b15004 | 76b84cfcea5cc8e4527a201cf8b6b01f | Gets a cosine interpolated noise value for the given coordinates for a noise with just one octave. | {
float floorX = (float)Math.Floor(x);
float floorY = (float)Math.Floor(y);
float s = FindNoise(floorX, floorY);
float t = FindNoise(floorX + 1, floorY);
float u = FindNoise(floorX, floorY + 1);
float v = FindNoise(floorX + 1, floorY + 1);
float int1 = OkuMath.InterpolateCo... | 1 |
9be7293bfd10b5f4f8e662d554345d60 | 05eb95d2ea08a37bd4799ab514c0f3b2 | Test that the header, data, and footer methods are called. | self.assertEqual(self.rt0.get_size(), len(self.frame_0))
self.assertEqual(self.rt0.get_header_size(), 24)
self.assertEqual(self.rt0.get_body_size(), len(self.frame_0)-24)
self.assertEqual(self.rt0.get_tail_size(), 0)
self.assertEqual(self.rt1.get_size(), len(self.frame_1))
... | 0 |
167e04d2036863e76b01d1198514ced0 | e4244f78d47f746420932c7d3424c8ce | What string should we use to represent the author (user) of a given
The nice, human-readable display name should be used when a display_name
is available on the annotation AND:
Return the string that should be used for display on an annotation: either the
username or the display name.
feature flag enabled | annotation,
isThirdPartyUser,
isFeatureFlagEnabled
) {
const useDisplayName = isFeatureFlagEnabled || isThirdPartyUser;
return useDisplayName && annotation.user_info?.display_name
? annotation.user_info.display_name
: username(annotation.user);
} | 1 |
47d04a617bf22a1f1f2394cc77ee1f43 | 086a6aec5e19e10ed12619d5a978f15c | handle Click event to save send to list | namespace Scheduler
public partial class JobEditor : Form
private void saveBtn_Click(object sender, EventArgs e)
{
saveList();
} | 1 |
816e577ae7175eed4c68e8bc43b441f2 | 8a87edb721aad598282c766a2f5d1bc9 | M�todo est�tico para obtener la referencia al singleton. | public class GestorTablasSimbolos
public static GestorTablasSimbolos getGestorTS() {
if(instance == null) {
instance = new GestorTablasSimbolos();
}
return instance;
} | 1 |
47a71ecb220d405632f4508353a9b8e6 | 239a254d8bba2e85f3856c5bd1fae604 | Constructs a major chord from its base note | return {
chord: false,
pitch: {
step: pitch_1.Step.REST,
alter: pitch_1.Alter.REST,
octave: 0
},
rest: true,
divisions,
duration
};
} | 0 |
89d01c5bc833f7b747ee8c7c2c16ef95 | 454633d93bd5da7546755cfbea4fcc34 | Creates a new finder. | final class ResultSet
function __construct(private string $command, private Finder $finder) {} | 0 |
4e78d6a864f3c6e6ef09054e832a1dfe | 1b30564c031583a69c50c12ab7ddc148 | retorna o nome do método, com o primeiro caracter em minúsculo. Ex.: index | class SpotifyGrammar extends Grammar
_key2Method(key = '') {
return key.split('-').map((item, index)=> {
return index > 0
? item.charAt(0).toUpperCase() + item.slice(1)
: item;
}).join('');
} | 0 |
167e97cbeb8f43ccbed4d4c23e875a70 | 2102baf9e9736180ea03935a5e0a424a | PrivateRegistryTransform modifies all Pods to use registry for the image source and adds the imagePullSecret | for _, imageName := range imageList {
framework.PullPublicImage(c, imageName)
}
} | 0 |
7f7663c308a7f797dad3f95a5665b27c | aa6e6bb419f804cb2d615c93ea8075c2 | Change stage of service request from queue to new | if (queue.length > 0) {
var user = queue[0];
performance.ongoing = true;
performance.staging = true;
performance.user = user;
queueRemoveUser(user);
stageEnter();
performanceIntro();
}
} | 1 |
bac1fa25a672cee49bf03faa5485b704 | d4e70f58aa7401f73f725936e1949473 | 根据物流单号查询该订单的物流状态信息 | {
StatusTable st = new StatusTable() { Msg = "" };
try
{
ITopClient client = new DefaultTopClient(StaticSystemConfig.soft.ApiURL, StaticSystemConfig.soft.AppKey, StaticSystemConfig.soft.AppSecret, "json");
LogisticsOrdersGetRequest req = new Lo... | 0 |
f999159b98fafea03adabe114975d677 | b9e7db1f8af2285a803f37312d55441f | 从账表中计算某个产品的剩余库存 | BigDecimal calculateAmount(ProductConvertStockPo po); | 0 |
697e923c7dee29d0a4f9242050b43388 | 78bcc6b7880fda5906f452433f3f5d76 | Tranforma etiquetas Spacy en el formato BRAT. | new_tags=[]
for i,tag in enumerate(tags):
if tag.split('-')[0]=='B' or tag.split('-')[0]=='O':
new_tags.append(tag)
elif tag.split('-')[0]=='I':
new_tags.append(tag)
elif tag.split('-')[0]=='S':
new_tags.append(tag.replace('S-','B-'))
elif tag.... | 1 |
0d2850ce0431622f2d807a044c4c9950 | 6fb8c81559b3afd77572c18632fa06a4 | Occurs when the DropDown button is pressed or released. | {
base.OnChecked(e);
if (DropDownMenu != null)
{
DropDownMenu.PlacementTarget = this;
DropDownMenu.Placement = PlacementMode.Bottom;
DropDownMenu.IsOpen = true;
RaiseEvent(new RoutedEventArgs(DropDownEvent, this)... | 1 |
3fe9296b978b985797d12e51f3d66b1a | 3215896e645e67be87dc8cb9a7ac66a2 | Spawn Infected at the Airdrop location. | public class AirdropManager implements Listener
public void spawnAirdrop(World world, String crateName, Location location) {
if (crates.containsKey(crateName)) {
int x = (int) location.getX();
int z = (int) location.getZ();
String droppingMessage = pl.getConfig().getString("B... | 0 |
508a6ea2f0a9c0ad06b45d9c5c59630c | 53d12b5fdb7ab4c3263a049a8fae37c8 | Обновляет заявление о согласии на зачисление абитуриента | namespace KisVuzDotNetCore2.Models.Abitur
public class ApplicationForAdmissionRepository : IApplicationForAdmissionRepository
public async Task UpdateApplicationForAdmissionAsync(ApplicationForAdmission applicationForAdmission)
{
_context.ApplicationForAdmissions.Update(applicationForAdmission);... | 1 |
0cc4b5c6c1ac3bbe7131b4be4a3955c6 | ebab167269540191310725cc819c2309 | Indique si une cible est acquise | bool GameObject::target_position_acquired()
{
return target_pos_acquired;
} | 1 |
53383604e7ec0e761775a24c9ffd2fc0 | 1bab75517d25e3fa072dd2c9b26cbef5 | Zend_Dateインスタンスの取得 | {
$dateTime = \DateTime::createFromFormat('U.u', $this->getCrdate().'.0216');
$dateTime->setTimezone(new \DateTimeZone(date_default_timezone_get()));
return $dateTime;
} | 0 |
3c183e34fd8940bd3756fca18728ce5b | c54ac109c69b2cc652c23828b5b5d8a4 | Returns the publication browser's content in HTML format. | Entry currentEntry = WriterHelper.INSTANCE.currentEntry;
if (currentEntry == null) {
return buildIndexContentHTML();
}
DOMNode contentHeader = partialBuilder.buildContentHeader(currentEntry);
StringBuilder sb = new StringBuilder(contentHeader.toString());
sb.a... | 1 |
f448b0cd5a0962992e2cc0e85997f532 | 067ed068f192c482aeeff5ee814beb76 | Notify connected nodes that AudioPath has changed | public class PresenterController
void notifyAudioSharedChanged(boolean newValue)
{
for(ControlLoop.StateChangeListener listener : stateChangeListeners)
{
listener.onAudioCaptureChanged(newValue);
}
} | 0 |
6b1dde64b7bff648b36a2459ead83c8e | e20a96b8596fcc03e4fce3c623876f3a | @brief Computes and compares the CRC stored in a packet | uint8_t AD7175_ComputeCRC(uint8_t* pBuf, uint8_t bufSize)
{
uint8_t i = 0;
uint8_t crc = 0xFF;
while(bufSize--)
{
crc ^= *pBuf++;
for(i = 0; i < 8; i++)
{
if(crc & 0x80)
crc = (crc << 1) ^ AD7175_CRC_POLYNOMIAL;
else
crc <<= 1;
}
}
return crc;
} | 1 |
d26208f2b25c49a4d4754ae27bbb762e | 81738b553a9fe57b3e553a60a7bdc684 | 计算账户持仓状况,返回列项分别为账户id,时间,方向,股票代码,成本价,股票可用数量,股票总数,市价,市值,盈亏百分比 | @Service
public class AccountsServiceImpl extends BaseService implements AccountsService
@Override
public AccountsPositionResponse getAccountsPosition(AccountsListModelV1 accountsList) throws Exception {
return new Extractor().getAccountsPosition(accountsList);
} | 1 |
ec9d66435c476bccc892bc0a3ff1508d | ac48b4d849611d89e37483ed65ceeada | Gets information about one of your numbers using the number's ID
'/users/:user_id/phoneNumbers/:number_id' GET | {
$person = Person::with('phoneNumbers')->where('id', $id)->first();
return response()->json(['person' => $person], 200);
} | 0 |
36733e3c466f3858ae490755f051ca07 | 020671637066a933df58903c149d0287 | Get the validity of each subdivision: | bs = []
for p in polygons:
if not p.is_empty and p.is_valid and p.area > 0:
bs.append(True)
else:
bs.append(False)
return bs | 1 |
7b21b0546cdda9baa54921addc85f2f4 | 8c082cef8dc5bb17b98f11609d483a33 | 创建标题部分,并绑定事件 | function bindTitleEvent(){
$.bindEvent($(_pageId + "header .header_inner"),function(e){
var wrapperObj = getVIscroll().getWrapperObj();
wrapperObj.scrollTo(0, 0, 100);
},'click');
} | 1 |
25bf790b6b3bb8a0e61556f662723f94 | 2a4b076044be3d4d02deb76d693c5a3f | Get a monster on the current level by its index. | function getMonsterByLevel(level){
var chance = level.CHANCE,
fam = chance[Math.random()*chance.length|0],
start = fam * 5, end = start + 5;
return MONSTER[(Math.random()*(end-start)|0)+start];
} | 0 |
316e6ebe74ad383f37c53b2aa4b1b857 | d64101c6b32a965c002657eacac23755 | Checks Discord to see the current user's
Discord information. | discord_query_response = await self.query_discord_id(ctx.message.author.id)
if discord_query_response == "Badge not issued":
str_id = str(ctx.message.author.id)
author = ctx.message.author
await ctx.send(await self.give_badge("discord", "10", author.name, str_id, str_... | 1 |
e0177a690fe4c07c63d25288dd410dbb | 557cf3d2a2cc4b42dc14efb3f80b972c | Loads text file as string, seperating lines with '\n' | public class Files
private String loadTextFile(String fileName) {
String file = "";
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new FileReader(fileName));
while (bufferedReader.ready()) {
file = file.concat(bufferedReader.readLine()).concat("\n");
}
}
catch (Fi... | 1 |
64fc7a22e72cab0b92a3c98ad076a5a0 | b07165304c3b3d72857d9e55e88e13cb | this test asserts that the histogram sizes of both images are equal | def test_histogram_length():
assert len(histo_test_adaptive_thresholding) == len(histo_adaptive_thresholding) | 1 |
0bdd52a9059c461214523b327541e744 | e2e2dce6ee0275c770fa2d3d8abf5b93 | Read an environment variable and interpret it as an integer. | if value, ok := os.LookupEnv(key); ok {
val, err := strconv.Atoi(value)
if err != nil {
return fallback
}
return val
}
return fallback
} | 1 |
d9c16394d37c71bd22fad226dac3e931 | fc25b97d58d0b279338112fb62e951bd | Scope a query to only include posts that are available to show. | class Posts extends Model
public function scopeAviable($query)
{
return $query->whereIn('status', [0, 1]);
} | 1 |
6373ffe806688b0ebdef9882e39b1e2a | 271878747495850f669f0ddb26c91195 | Render save metabox | $cmb = cmb2_get_metabox( $args[1]['id'], self::$props[ $id ]['key'] );
if ( $this->should_save( $cmb, $id ) ) {
$cmb->save_fields( self::$props[ $id ]['key'], $cmb->mb_object_type(), $_POST );
}
$cmb->show_form();
} | 1 |
f6500f4c0c2913f16c8bd40d5cbfd558 | a80e15cfd585ddc9d49625f78a086a39 | 정해진 UIType에 존재하는 패널을 모두삭제한다. | {
List<FairyGUIBaseUI> uIList = _LayerDictionary[ui.UIType];
if (uIList == null || uIList.Count <= 0)
{
return;
}
for (int i = uIList.Count - 1; i >= 0; i--)
{
FairyGUIBaseUI uiListItem = uIList[i];
... | 1 |
0f925ca5d14e873970ea2d346c8b9573 | 878c657acca7630e665f0e266d4f2fd7 | OPERATOR TO ASSEMBLY INS
Converts an arithmetic operator to its assembly
instruction equivalent | {
if( strcmp(mnemonic,"ADD") == 0 )
{
if( operand1[0] == 'A' )
{
if( operand2[0] == 'B' )
fprintf(ptrOFile,"01 ");
else if( operand2[0] == 'C' )
fprintf(ptrOFile,"03 ");
else
fprintf(ptrOFile,"15 %s 01 ",operand... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.