query_id
string
corpus_id
string
query
string
code
string
label
int64
043b4716f67ee33d12e956dc6274d5d8
f66d50cd70ea097d618f8bd5670e6b98
Возвращает сформированный объект результата проверки
class AgeVerification public function getResult(): bool { return $this->result; }
0
047d1ed460bb7ed9c46395845f41d689
0b991871f6d21b85d3150e1bf31ab555
Generate a new PDF-based receipt, save it to Azure Blob storage, and update the customer's order record with the path to the PDF.
produces = MediaType.APPLICATION_PDF_VALUE) ResponseEntity<StreamingResponseBody> createReceiptPDF(HttpServletResponse response, @PathVariable("dataflowId") Long dataflowId, @PathVariable("dataProviderId") Long dataProviderId);
0
c5854c1e22dcd8cc94948e81ac891f54
810be589ad1c8dedf4f62830e6082864
Поиск всех точек пересечения вектора с полигоном
{ bool res = false; int count = poly.VerticesCount; List<GeomPoint2D> iPoints = new List<GeomPoint2D>(); for (int i = 0; i < count; i++) { GeomLine2D edge = poly.GetEdge(i); if (Cross(edge, ref iPoints, false, false, fal...
0
96360023958bc984f9096f0a17fe51b5
c5b09c69c40e06d9b9238a300c06f767
Gets profiles by type
public function findByType(string $type): array;
1
fdb8781c60fd655f4aa6d83a457527bc
16003c494a6d8b594e1d081fb506d876
Bookmark a course.
data = { 'username': username, 'course_key': str(course_id) } return self.client.post(self.path, json.dumps(data), content_type=JSON)
1
597d86e7b42583d1e5d47f7c3d6d32be
c64a4f7b8ff36b922bc5254f123c6fff
Ustaw stan comboboksów jako `readonly`
export class NxMultiSelectComponent<S, T> implements ControlValueAccessor, NxFormfieldControl<T[]>, DoCheck, OnDestroy, AfterViewInit set readonly(value: BooleanInput) { this._readonly = coerceBooleanProperty(value); this.stateChanges.next(); }
1
ffdaffb64f156a5f2b33e635a67856f1
88eb572a8480ce20a1f6acbbf7f9165a
Sets this node as a preaggregation. Only valid to call this if it is not marked as a preaggregation
public class HLNode implements NodeInterface public void setCons() { cons = true; }
0
fee2dd0f140caa1f3d6350c0a090f346
41d30b1b4be2ab840b87eb5480cbba0a
Used to indicate that two sets of Collections have different lengths.
class NotSameLength(PilotException): def __init__(self, *args, **kwargs): super(NotSameLength, self).__init__(args, kwargs) self._errorCode = errors.NOTSAMELENGTH self._message = errors.get_error_message(self._errorCode)
1
0e3a0e16d0fa4374427cda2daeba602a
ca6ebfae0a1473f159e261f8c8ab2f76
@brief Handler when connected to mqtt broker
void on_mqtt_connected() { subscribe(<name>); ... }
1
48aeaf64bb595c7faee93c421932140f
8068e6cc0a6a2918a737c834e3ddd271
Compile a drop database if exists command.
class Grammar extends BaseGrammar public function compileDrop(Blueprint $blueprint, Fluent $command, Connection $connection) { return 'drop view '.$this->wrapView($blueprint); }
0
554c572bc7ca2f53c830a3bd71cf3d74
9d39de634c09f783d3fd23196b29cc7f
Возвращает ссылку на первую страницу.
class Pagination extends BasePagination public function firstPageUrl(): string { return $this->pageUrl(1); }
1
1d7aaa7e37156320fa811f64b326f7b6
db0de94c6dad55b1037807d4df9f1452
生成下拉按钮组合
const { menu } = this.cfg; const { list } = menu; if (this.moreStatus) { const highTems = []; const oftenTems = []; list.forEach((menuList) => { const menuBtn = new config[menuList](this.editor); const $tem = menuBtn.$tem[0]; if (this.highMenus.find(v => v === menuL...
1
c7770658c8a03741207042538ec7f9d4
1a37bcae97bf36f75448964fe04e1af7
Returns a wonderful dad joke from `https://icanhazdadjoke.com/`
async function getJokes() { let joke = ''; const apiUrl = 'https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw,religious,political,racist,sexist,explicit'; try { const response = await fetch(apiUrl); const data = await response.json(); if (data.setup) { joke = `${...
0
ad81c84f58048e4b55e40343719b7923
a6e313e108b6f2fe5bc38b5c939c1ad7
Select the first product that has a single credit adjustment for the given type.
{ foreach ($creditmemoItems as $creditmemoItem) { if (($creditmemoItem['articleNumber'] == 'adj-fee' || $creditmemoItem['articleNumber'] == 'adj-ref') && $creditmemoItem['quantity'] != 0) { array_push($items, $creditmemoItem); } } }
0
2984721b3a7b776acabeca18d4683988
c6264d74677f1fcd3291bf2fcfd1abe3
计算两个日期之前的天数,前面一个参数要比后面一个大,否则返回负数
if(!isGreatThan(d1,d2)){ System.out.println("必须d1大于d2"); return -1; } int days=0; Date tmp=new Date(d1); while(isGreatThan(tmp,d2)){ tmp.sub(1); days++; } return days; }
1
83a8030d450fbdcca53badd1bdd4cf21
94e005d43749e36ab48e3cdb90296021
根据机构code分页查询投资人信息
@Service public class investorServiceImpl implements InvestorService @Override public viewInvestorInfo findInvestorDeatilByCode(String code) throws Exception { gs_logger.info("findInvestorDeatilByCode方法开始"); viewInvestorInfo info = null; try { info = investorDao.findInvestorDeatilByCode( "viewInvestor...
0
8f884224f3330d75207c69a04556a0fd
475ce21923f2716a3e4615024c7be308
make sure the food is not on the snake
def snake_is_eat_food(snake_coords,food): if snake_coords[HEAD]['x'] == food['x'] and snake_coords[HEAD]['y'] == food['y']: food['x'] = random.randint(0, map_width - 1) food['y'] = random.randint(0, map_height - 1) else: del snake_coords[-1]
0
b3f1eb7922255429cf8943d0caa305b7
e6eaf0fa115bd60d04d0e8ab4cd99319
Takes a list of DPoints and removes any duplicates.
def remove_dups(pcs): out = [] for i in pcs: if i not in out: out.append(i) return out
1
f0b8f4e24e80566de0d37b3e5fe9cd2e
7e9391c8a42186cc71858b8e28852f65
Grimacing face.
def face(): print " ^-^-^\n /_ _\ \n( O , O )\n | ^ |\n \ <=> /\n \_ _/\n V"
0
c70d81d6ceb25c60b9db03c5a3eea545
b8c7244e79af232ef392679784f1afb3
Function : signed distance color function
Color answer; if (distance < 0.001) { answer.r = 0; answer.g = 0; answer.b = 0; } else if (distance < 0.2*max_distance) { double tmp = distance * 5.0 / max_distance; answer.r = 0; answer.g = tmp*255; answer.b = 255; } else if (distance < 0.4*max_distance) { ...
1
170c2f5befb112d4c7bbeacaea08d958
9266eb478ad2a3a81c4116e63c35de86
Expand the cached list of allowed ips.
$new_input = $old_input = get_option( 'rsa_options', array() ); $ips = $args; $added = array(); if ( !empty( $ips ) && is_array( $ips ) ) { foreach( $ips as $ip_address ) { if ( Restricted_Site_Access::is_ip( $ip_address ) ) { if ( false === array_search( $ip_address, $new_input['allowed'] ) ) { ...
1
02d4cc70df656043c6503fd112aa82c4
504d86538e682b4bb4df85117eb96c86
缩容指定集群实例的节点数量 缩容指定集群实例的节点数量。 Please refer to HUAWEI cloud API Explorer for details.
class GaussDBforNoSQLAsyncClient(Client): def shrink_instance_node_async(self, request): return self.shrink_instance_node_with_http_info(request)
1
920d8e57ae99ade40776d6e0ccc52ed1
c35c858f83bdcc360f234117fa307dfb
DONE 显示隐藏要求
var status = $("#q" + id).css('display'); if (status == 'none') { $("#q" + id).show(); } else { $("#q" + id).hide(); } }
1
acde8cc9425a2dfeb53f095022eaa845
1b53a336d520e72d3a36f882dca087c2
funcion para obtener los municipios de un acuifero
{ if ($idestado !== NULL) $sql = "SELECT * FROM municipio WHERE idestado = '$idestado'"; else $sql = "SELECT * FROM municipio"; return ejecutarConsulta($sql); }
0
175187b324a7cf101d8152d2fa0cb732
bab3718881dd83180328a354d49e337e
解析历史消费记录
namespace TorchPoints.Service string InsertConsumeHistory(ConsumeHistory info);
0
ec2e5d4cb7989984efea33f1f98c4ea4
db6d4d77351b16e68ae6c785408a849f
分页查询电价
ActionForm form, HttpServletRequest request, HttpServletResponse response) { String start = request.getParameter("start"); String limit = request.getParameter("limit"); if (start == null || limit == null) return null; String custId = request.getParameter("custIdFind"); String priceNoFind = request.ge...
1
aa6987e44a8b93aa0ab872f415144216
cf2bd0241b15555f781ec0a80372da0a
Write the given part data to nbt.
{ stream.writeInt(this.modelID); stream.writeLen(this.parts.size()); if(!this.parts.isEmpty()) { for(var partsK of this.parts.getKeys()) { var partsV:number=this.parts.get(partsK); stream.writeInt(partsK); stream.writeInt(partsV); } } }
1
45d5167ccf45b879ad01cd5c589c9f79
1a95e1b1a1a4d2739fd2a17d3340007b
Resets the current structure tree element.
public class IFContext public void resetStructureTreeElement() { setStructureTreeElement(null); }
1
a68c502e88a9753e2b095de584168d84
b7ed78958bc6c0da35456b9a2c05d3a4
整张表同步后的扫尾操作。
public class SimpleSyncOpreatorExecutor implements SyncOpreatorExecutor private void syncReTableAndStructure(TableStructure ts, MappingStructure ims, Mapping mapping, Generator generator, Connector connector) { if (ts != null && ts.isValidate()) { TableStructure imts = ims.findTable(ts.getName()); ...
0
3287edafa26f82421d7cb08ea7657118
e98400bad5675f6f53cf0c96218ed2dc
Given the skeleton's joint dictionary, coputes the angle of the skeleton's left elbow
def angle_wrist_elbow(frame): origin = [frame["bodies"][0]["joint_positions"][27][index] for index in range(3)] elbow_left = [frame["bodies"][0]["joint_positions"][6][index] for index in range(3)] wrist_left = [frame["bodies"][0]["joint_positions"][7][index] for index in range(3)] elbow_right = [frame["bodies"]...
1
0531f94eb514dc9c343b8c1004e7a603
93bf3acdd3c4b8d04c32563b9df4d928
Initializes a Map with a given number of containers.
aMap = [] for i in range(0,num_buckets): aMap.append([]) return aMap
1
46bd030c99c690d289515e1f41ca1285
5e61316876b07c824a6b5f10c9b6823f
Загружает суммы прожиточных минимумов
namespace InsoftBusinessLogics.Msp.Unload [ToolboxItem(true)] public partial class Format62BusinessLogic : InsoftBusinessLogic public void LoadMTable(int flag, string mspIds, DateTime? from, DateTime? to) { dsFormat62.MTable.Clear(); format62DataAdapter.FillMTable(dsFormat62, fla...
0
cd6eaa9e78cd022b0a2e2668f121edfc
7448ceb0b13853f18a125c3191eb2358
For the given variable, select one of the two values provided in the input records. Uses the variable_priority values to influence the selection.
class Algorithm(object): def pick_value_decision(self, pf_assignment, field): values = field.get_values() values_scores = [None for value in values] values_best_hits = [None for value in values] values_comments = [None for value in values] last_choice = list() all_comment...
0
809e76e1f9ff1d46940828262f6e8cc8
48b5d916fba4e470c711f383711699f4
Function to retrieve Artist data from Spotify Api
def get_artist_data(artist_uri): index = 0 artist_results = {} results = spotify.artist_top_tracks(artist_uri) for track in results['tracks'][:10]: name_of_song = track['name'] formatted_name = re.sub(r" ?\([^)]+\)", "", name_of_song) songs = genius.search_songs(f'{formatted_name...
1
8b27ccdc671dbdea2a1b886f921730ad
6afa936f8be75cc7e9c1824079dfcfe3
This method returns true if the user is a Basic user (no supervisor, rrhh, admin)
boolean isSupperUser();
0
06af65a7ecade6caae05e89f772b9c08
294fed5cbbf87309c884ad7f30b5b60d
Below function fetches parent page via category Id
{ $db = $GLOBALS['osC_Database']; $sql = "SELECT parent_id FROM " . TABLE_CATEGORIES . " WHERE categories_id = '" . $catID . "'"; if (isset($this->categoryParent[$catID])) { return $this->categoryParent[$catID]; } else { $parent_query = $db->qu...
1
01bbe46bda955f3075d744410ee34ab6
ccc330fe94c9be2a1ef1b57809b385a9
Function to get the wheel velocities for diff drive robot.
public class Chassis extends SubsystemBase public DifferentialDriveWheelSpeeds getWheelSpeeds() { return new DifferentialDriveWheelSpeeds(getLeftVel(), getRightVel()); }
1
aadc6f51929cc7f68ec988b1dda6db7b
3a073e420b2e94cfd10949472444db76
클라이언트 소켓이 닫히게 되면 호출되는 함수
namespace KBJ_MessengerByTCP.Client public partial class ClientMessenger : Window private void Messenger_Closing(object sender, System.ComponentModel.CancelEventArgs e) { closeClientSocket(); }
1
d32c8bbe7266ff074c7dfc3aa9f09c0b
16500888282118ff4a1e91c18f4c9747
Retorna se o usuário está ou não cadastrado na plataforma
{ using (Conexao con = new Conexao()) { return con.Usuario .Where(u => u.Login == login) .Count() > 0; } }
1
4f22981f87ae6e2ec8bf16cc6823a7a0
4e707ec91f34d47ab1ef898a2cbf1692
populate the storage from the JSON data
temp_list = [] for item in json.loads(data): temp_base = Base() temp_base.set_dict(item) temp_list.append(temp_base) self.clear() for item in temp_list: self.append(item)
1
3ba80af8190e9d5f95e7cd7d7baf53d4
6950a45df5b33aaafcc5864c20309f79
選択したペットを登録し、メイン画面を再表示する
class RegisterpetController extends Controller public function show(Registerpet $registerpet) { return view ('registerpets.show',compact('registerpet')); }
0
8d18f6a4ce816ccf80093a8d20bbeb47
31173f3444140091a149694b67c0af67
加载所有Raw文件
def Load_All(): load_path=r"./数据/原始数据" data_dict={} FileList=list(filter(lambda x:(x[-4:]==".csv"),os.listdir(load_path))) for file in FileList: var_name=file[0:-4] data_dict[var_name]=np.array(pd.read_csv(load_path+'/'+file)) return data_dict
1
5760ce82e4e842d9ef9ea039a1c4ef00
4e5cd61f3b21e82b0084079bc89739a2
返回AutoSchedulePresenterImpel实例
public class MainActivity extends BaseMVPCompatActivity<MainContract.MainPresenter, MainContract.MainModel> implements MainContract.MainView @NonNull @Override public BasePresenter initPresenter() { return new MainPresenter(); }
0
b4a334be32b1304a01351543acb5bf73
df540ee739395649d0169dd8884c60a1
This function will take two members from the population and picks a random spot to crossover the genes to breed two new genomes. Crossover leads the population to converge on a good solution--exploitation.
pc = select_crossover_rate(generation) parent1_genome = parent1.genome parent2_genome = parent2.genome if random.random() < pc: while True: r1 = random.randint(1, len(parent1_genome)) r2 = random.randint(1, len(parent2_genome)) child1_genome = parent1_genome[:...
1
1f4dc067af2c33ac36072039d9daad17
273a417b4162182593fa643b7132b133
Constructs a <see cref="IndexBuffer"/> with the given storage size. The IndexBuffer will be configured to store 16-bit unsigned index data.
namespace ClassicalSharp.GraphicsAPI public abstract partial class IGraphicsApi public abstract int CreateIb(IntPtr indices, int indicesCount);
0
c31784b4e6ff66b2382f981ebc9846bb
7760a7bd7515f6dbf7980d3d5bcb5a2a
Metoda nastaví název adresáře s JSPluginem
public function setPluginName($pluginName);
0
8b9cb8ba7694003e65660b470a0a6be9
802d5d1be6e4cd4fefd8d7d4577c0120
ログインユーザーのいいねを表示
@user = User.find(params[:id]) favorites = @user.favorites.pluck(:post_id) @favorites_list = Post.where(id: favorites).page(params[:page]).reverse_order end
1
58522f053559ac161ee02f56f1345aa6
4b97e5f2ae9a1011fbbb8aeebcc1d1a7
Sorts according to index priority, storage size/complexity, and name.
{ var trv = Traverse.Create(obj); var theirPriority = trv.Field("priority").GetValue<int>(); var theirIndex = trv.Field("index").GetValue<int>(); if (priority != theirPriority) return -(priority.CompareTo(theirPriority)); return index.CompareTo(theirIndex); }
0
bedcb788b9396935e1240a53b59bf12b
cbb0c17579836260df38d172b48315ac
Returns the "raw" SVal bound to LV before any value simplfication. <editor-fold defaultstate="collapsed" desc="clang::ento::ProgramState::getRawSVal">
void toRawValue( JBlock block, JVar $var );
0
a2e461f13b94a8f2b9c0fec1c357551c
0ce32ab31cdbc7fa9055dfc6eb67dc78
删除携带最小值的节点,返回删除后的bst的根节点
{ if(NULL == node) { return NULL; } if(NULL != node->left) { node->left = __bst_removemin(bst_desc, node->left); return node; } else { bst_node_s *node_right; node_right = node->right; bst_desc->count--; free(node); return node_right; } }
1
0a53b933b5009b66b088a878d6d7134d
a7c15a2f004c60bfeed95c03a78a2cd2
Send arbitrary command to TV via HA service.
export class OnkyoSerialPlatformAccessory sendCmd(cmd) { const rawCmd = '!1' + cmd + '\r'; this.platform.log.debug('sendCmd', rawCmd); this.port.write(rawCmd); }
1
369c5cdea1241e39b04b99dc32e5fbd9
729c6a67a6f1d980ecf9a0cdde5597e0
matrix entry calculation between two Contracted Gaussian functions
ns, ms = mat1.shape nl, ml = mat2.shape size_to = max([ns,nl]) if ns < nl: mat1 = numpy.vstack(( mat1, numpy.hstack(( mat1[0,1] * numpy.ones((size_to - ns,1)), zeros((size_to - ns, ms - 1)) )) )) else: mat2 = numpy.vstack(( mat2, numpy.hstack(( mat2[0,1] * numpy.ones((s...
0
8e0a6d02136b922946d25bd4ff44a194
d01786a2f1cde6dfec187b7a375f54b2
Pack integer 'n' with 'size' bytes and 'islittle' endianness. The final 'if' handles the case when 'size' is larger than the size of a Lua integer, correcting the extra sign-extension bytes if necessary (by default they would be zeros).
if type(n) not in int_types: raise TypeError('expected an int (got:%r)' % (type(n),)) if not -8388608 <= n <= 8388607: raise OverflowError("n is out of range") order = None if not self._is_big_endian(): order = [0, 8, 16] else: orde...
0
f45d99f75e21c26e1a9e421c0d10ef4e
a579f94f650f04fa2620a750fab4bb3a
Set bounds on many base-model variables/constraints from dict.
x0 = list() xmin = list() xmax = list() mapping = list() for prog in progset.programs.values(): if prog.name in bounds["unit_cost"]: x0.append(prog.unit_cost.vals[0]) xmin.append(bounds["unit_cost"][prog.name][0]) xmax.append(bounds["unit_cost"][prog.nam...
1
75a3e043938ecb7bc15a2e40b633c207
b1b98e6974857530404090276a45d7d1
Converts a Gregorian date to a Julian day.
{ DateTime calendar = date.ToUniversalTime(); return JulianDay(calendar.Year, calendar.Month, calendar.Day, calendar.Hour + calendar.Minute / 60.0); }
1
2c8ae97caaf34799c29d58e7cf2797c8
dae7a9c696c5e29297b0df276877a289
проверка на тип детектора
namespace SkladannyaBuletnya public partial class Meteonablyzheniy : Form private void ButtonDetector1() { if (buttonXC11.BackColor == Color.LightCoral) { if (buttonOC11.BackColor == Color.LightCoral || buttonOC12.BackColor == Color.LightCoral) { ...
0
1ed5039e207ccd08b23c1f2486b518d9
c8c5bc22fd22745440df81874a19b7d2
Метод перемещения курсора. Меняет позицию в зависимости переданных координат и текущего размера тайла
double x = currX + offsetX; double y = currY + offsetY; if (offsetX < 0) { if (x < 0) { if (overMoveEnabled){ if(isHold){ x = currX + offsetX / overMoveResistance; } }else { ...
1
136c5cff74df25c72f14ac2ea0763551
9d488c77b5423c8aa66b4d6ef6e824e6
停止指纹识别
try: f = widget.figure_dll.FPICheckFinger(widget.parent.device.figure) if f == 0: widget.parent.device.figure_timer.stop() pstz = ctypes.create_string_buffer(512) length = ctypes.create_string_buffer(512) widget.figure_dll.FPIFeatureWithoutUI(0, pstz, ...
1
337ae986f769c718f0c84849ca340a13
30aafa1dddddc0038d5628db4570f3f9
处理终结符,终结符要么是terminal_set第一行中的特殊符号,或者是如Name('a')这种带括号的形式
String tstr = str.trim(); if (tstr.equals("")) { addWS(); return; } char first = tstr.charAt(0); if (!str.startsWith(tstr)) { addWS(); } if (!Character.isLetterOrDigit(first)) { addWS(); } addSymbol(new AssemblyStringTerminal(tstr)); char last = tstr.charAt(tstr.length() - 1); if (!str...
0
a7a491d35360ae70dd5adac6130dd958
56bac3e37827fe309762eb9d021476c5
定义一个名为 is_before_start 的访问器,当前时间早于秒杀时间返回true
class Seckill _isIng() { return this._currServerTime() >= this.startTime && this._currServerTime() < this.endTime }
0
5ec17e355a35db967afd2ac4d75f6eb8
5e231f036281942448a12f7a7316592f
查询该用户邀请的所有用户的手机号和注册日期
public List<InvitedUser> inviteUserInfoList(Long invitedUserId) { List<InvitedUser> invitedUsers = new ArrayList<>(); MemberInvite memberInvite = new MemberInvite(); memberInvite.setInviteUserId(invitedUserId); memberInvite.setValid(0); List<MemberInvite> inviteUserList = mem...
1
10aa1eb48a94f1ec1337ccef91c64129
756a3353b53514990c039e00ccfa9c94
Gets rows from the datasource based on the PK_BillOfMaterials_BillOfMaterialsID index.
{ int count = -1; return GetById(transactionManager, _id, start, pageLength, out count); }
1
375a75cd47c89fbb06932eddfc0710c1
cb95fb13a77414a4ca7ecabf6df7fa1f
全スレッド実行完了イベント通知 ※エラーあり終了を検知したい場合など、必要応じて派生クラス側で継承して実装する
public class ThreadCB extends IflThreadCB public static void atError() { }
0
1d9c860eeda6adefe844f52195c41055
d1f0a487aea189bbf713ad1fbb6d2d5c
更新逝者关联守灵厅信息
public class BusinessFarewellProvider public String updateBusinessFarewellMourn(@Param("item") FarewellMournItem item, @Param("loginItem") LoginItem loginItem) { return new SQL() { { UPDATE(TableNames.Mourn); SET("MournHallID = #{item.hallId}"); SET("B...
1
fa784cfc751b9eeebbc3c192b8c442e2
e9e6064c0d2b873230aa75c09cede820
them mat hang bao gom them chi tiet
namespace QuanLyCuaHang class BanHang public static void luuChiTietDonHang() { for (int i = 0; i < chiSoMang; i++) { MatHang MH = new MatHang(arrayMaMH[i]); KetNoiDuLieu.openConnect(); KetNoiDuLieu.executeQuery(string.Format("insert int...
1
16d84e25151131a480ebbc1d36bfdc22
c80896b77f42f077bf11e550c3d8564b
判断两个sn是否一样
namespace IMES.Station.Implementation public class SNCheck : MarshalByRefObject, ISNCheck public void CheckTwoSNIdentical(string custsnOnPizza, string custsnOnProduct, string pdLine, string editor, string stationId, string customerId) { logger.Debug("(SNCheck)CheckTwoSNIdentical start, custsnOnP...
1
65614279f8dd6fa953eade0b222fdc04
3c124097092cc4df9fb7c6947350f4a0
Show refresh progress and start to loadViewPager new data.
public class UrlWebActivity extends BaseWebViewActivity @Override protected void onRefreshData() { progressBar.setVisibility(View.GONE); loadUrlWithHeaders(); webView.setWebChromeClient(new MyWebChromeClient()); }
0
b09f1764e113a62f3fc94bb9938645ae
fd8739c734d431e0da6ae69e17506c20
Register your external dependencies here, these should be usable in production code and mocked out in unit tests.
namespace OrleansSample.SiloHost public static class DependencyInjectionHelper public static void IocContainerRegistration(IServiceCollection serviceCollection) { serviceCollection.AddSingleton<IEmailSender, FakeEmailSender>(); serviceCollection.AddTransient<IBlobStorage, BlobStorag...
1
3b7da5eb3b058103ca743bc700fd215f
205e22fd01033cc6fb6277fb54e2c35a
método para ler mensagem a partir de um ficheiro de texto
{ using (Stream Stream = File.Open(openFileDialog.FileName, FileMode.Open)) using (StreamReader streamReadFile = new StreamReader(Stream)) { IList<string> listLinesRead = new List<string>(); string mensagem; while ((mensagem = s...
1
686fb466827c36da685cfbb2dd65a99e
d2b03a44e4bd03c5b6e231da653dcc58
Check if "expense" has a value
class ReceiptFragment : Fragment(), ExpandingFabAnimationInterface private fun isExpenseInputValid(userInput: TextInputEditText) : Boolean { return if (userInput.text == null) { false } else if (userInput.text!!.isEmpty()) { false } else if (userInput.text!!.isBlank()...
1
0e879a2905aaf127fe78a8755b12450b
8040a5b4cf2460825b04fe364b986e32
The ARN of the output. :cloudformationAttribute: OutputArn
class CfnApplicationOutputV2( _CfnResource_9df397a6, metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_kinesisanalytics.CfnApplicationOutputV2", ): class KinesisStreamsOutputProperty: def __init__(self, *, resource_arn: builtins.str) -> None: if __debug__: type_hints = typi...
0
a4211e228fa4a38d3ef4ec21bb3d483d
4ee8b643cf0cae2f3d17c5ed24053c2b
Add applied workarounds
class Billmate_Bankpay_Model_Api_Standard extends Mage_Paypal_Model_Api_Abstract protected function _applyCountryWorkarounds(&$request) { if (isset($request['country']) && $request['country'] == 'PR') { $request['country'] = 'US'; $request['state'] = 'PR'; } }
1
53d9e2c55b8fe996fbea915774f3191e
6000eda37d56b1a841121e11be528502
removes last kitten in og array, returns a new array & leaves og alone
function removeLastItem(arr) { let newArray = [...arr] newArray.pop() return newArray }
1
dc2a69f16eba8d083beddadc6ec33beb
06a3cd9cd9efdb63e458ea3e836161af
微博内容算法训练
vocab_size = 50000 batch_size = 128 embedding_size = 128 skip_window = 1 single_num = 2 valid_size = 16 valid_window = 100 valid_examples = np.random.choice(valid_window, valid_size, replace=False) noise_num = 64 graph = tf.Graph() with graph.as_default(): train_input...
0
a9a1b75c8e521a4478e5dcfde1f63008
7f17482d813bfe40387f3fc925a02bed
Handles the BlockUpdated event of the Block control.
namespace RockWeb.Plugins.com_shepherdchurch.Misc [DisplayName( "Share Workflow" )] [Category( "Shepherd Church > Misc" )] [Description( "Export and import workflows from Rock." )] public partial class ShareWorkflow : RockBlock protected void Block_BlockUpdated( object sender, EventArgs e ) { ...
1
e7ddc0b65568e864b60137913590c7d4
dfd5a77fadc056ac1a311efc4de3503e
\brief Gets the size of the target texture image in pixels.
{ float2 toReturn; std::string szHandleString = _szHandle; if( m_mapTextures.count( szHandleString ) ) { toReturn.vX = (float)m_mapTextures[ szHandleString ]->m_SurfDesc.Width; toReturn.vY = (float)m_mapTextures[ szHandleString ]->m_SurfDesc.Height; } return toReturn; }
1
c5049ca74b121b0a25c3646308626ac6
101a7318d388aabc5b26c95513a8ab1b
Returns the file name that contains the current Controller.
class Mvc{ public static function controllerFile($isAbsolute = TRUE) { if ($isAbsolute) { return self::$currentApp->documentRoot() . "/" . self::$currentMvc->controllerFile(); } return self::$currentMvc->controllerFile(); }
1
37b71b125b058787c88e997d13819397
453a362a7972de9b8e2f28253bd6f3ad
Gets Mode based on Switch State
class Tritac_Capayable_Helper_Data extends Mage_Core_Helper_Abstract public function getMode($store=null) { $configMode = Mage::getStoreConfigFlag('payment/capayable/test',$store); if($configMode) { return 'test'; } else { return 'production'; } }
1
554443b4b7ecd262fc4edf7880bbae17
aba92191e98a151f5cd79d699b17d7d9
Инициализация поверхностных нагрузок
int size = K.getRows(); F = new Matrix(size,1); F.zeros(); for(int i =0; i<getLoads().size();i++){ Loads loads = getLoads().get(i); if(loads.getType().equals("Nodal")){ LoadNodal loadNodal = (LoadNodal) loads; ...
0
a9d8178735ab817624c7cd64346a05f1
4dc7d0912ed0dce3bd1d8f0176cac9ac
When trying to fetch server status and the server responds with an error (other than HTTP 500 Internal Server Error) the client must throw an exception
e = HPOneViewException({ 'errorCode': 'ANOTHER_ERROR', 'message': 'server-hardware error', }) g.oneview_client.server_hardware.get.side_effect = e response = self.client.get( "/redfish/v1/Systems/0303437-3034-4D32-3230-313133364752" ) s...
0
903eb15758cc0efbff253e1d1c0cd58e
f8c3d609b412eb9a2da06554c3d68b0d
Sets the map, making sure is not going to be converted into a js string.
{ $this->jsonBuilder ->reset() ->setJsonEncodeOptions(JSON_FORCE_OBJECT) ->setValue('[map]', null) ->setValue('[coordinates]', array()) ->setValue('[bounds]', array()) ->setValue('[points]', array()) ->setValue('[sizes]', ar...
1
f4ed8cd76af6b39a109022fb2abe5272
5fe584c1250e38060cf6b1dcb6d7f3cd
Return a list of posts in descending order. Limit determines how many posts are returned.
{ $this->db->query('SELECT * FROM ' . BEPOSTSTABLE . ' ORDER BY post_id DESC LIMIT ' . $amount); return $this->db->resultset(); }
1
993b94fce7f1d70034966abbba7c56ec
dd4e9c166732be1f8d03d2fb685cc15c
买卖股票的最佳时机 I
if (prices.empty()) { return 0; } int buy = -prices[0], sell = 0; for (int i = 0; i < prices.size(); i++) { buy = max(sell - prices[i], buy); sell = max(buy + prices[i], sell); } return sell; }
1
6181f1fbc68ee85eb6731cc5e408f3ec
806073d042390335579dcb085e602bfc
Replies if the scroll moves are allowed.
public class NestedScrollingChild2View extends LinearLayout implements NestedScrollingChild2 private boolean canScroll() { return true; }
1
56c020d511f62ac6c673718df910959e
42ce3df42896298073b9913fa60c6abb
Formula表数据导入到ConsMixprop表
public void beforeImportFormulaChange(List<RMFormulaChange> insertObjs, List<RMFormulaChange> updateObjs, List<Map<String,String>> columnInfo,List<Map<String, Map<Integer, Map<Integer, String>>>> errMsgSheet, Map<String ,List<Map<String, Object>>> importNodeInfo, Map<String, Property> importPropInfo);
0
5c6f1604420f3fc8b0f4417b6d4d7a94
6d338f546aa1bfa7887dff23c19dbb4f
删除季度计划所关联的备件采购明细,如果备件采购明细已被制作为采购单,则不能删除
{ ArrayList listADD = new ArrayList(); string[] arrID = ID.Split(','); if (arrID.Length > 0) { for(int i=0;i<arrID.Length;i++) { StringBuilder sqlMasterDet = new StringBuilder(); StringBuilder...
0
5d5e5c354f682cf7aa16c8cda30e0549
3d53e9b6d7890ee8172b1240d6eb6729
Indexe les projets ANR
$query = $GLOBALS["bdd"]->prepare("UPDATE projections SET fin_annee='0' WHERE fin_annee='1'"); $query->execute(); $query->close(); $query = $GLOBALS["bdd"]->prepare("UPDATE projections SET fin_annee='1' WHERE nom=?"); $query->bind_param('s',$nom); $query->execute(); ...
0
898c5971216d7a8356013b753ad1d7c6
0cd4cd75135a1d58a8a9b736de14062c
Getter for the kml directory
class RosbagReport(): # pylint: disable=R0902, R0904 def get_kml_dir_path(self): return os.path.dirname(os.path.realpath(__file__))
1
8952b32ce592c454192057ffedb0de1e
dae94357a20e24f40072ca1edf92aad1
释放连接,如果池有空间则放回连接池,如果没有则直接关闭。
class SwooleHttpConnectionPool extends BaseConnectionPool public function release($connection) { if (\in_array($connection, $this->connections)) { $this->channel->push($connection); } }
0
a58d18077f8bb2e148af01881e955ef7
b64e7c1c55b3dcbf6ee308e8cb06151a
价格格式, 保留小数点后两位
priceFilter (val) { val = val / 100 return val.toFixed(2).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') }
1
315e0b01a4deed275e582f1a789c7aff
360fcfd8f1c87c08f300cadfeb743b15
type ==> classification / regression analyze the classification model on the parameters f1-score , recall , precision , accuracy analyze the regression model on the parameters mse and rmse
def get_score(Model, X_test, y_test): try: y_pred = Model.predict_proba(X_test)[:, 1] except: y_pred = Model.predict(X_test) print('Mean Absolute Error:', metrics.mean_absolute_error(y_test, y_pred)) print('Mean Squared Error:', metrics.mean_squared_error(y_test, y_pred)) print('Root...
1
5d5a7dfd5b592fcc361acf91a3e80f5f
cb60f67c96ad0a9f04988047ba49a738
Remove all personal information
def __remove_personal_info(data, personal_info=None): if personal_info is None: personal_info = ['first_name', 'last_name', 'cc_n'] logger.debug(f"Personal data to be removed: {personal_info}") return data.drop(*personal_info)
1
db60749b87dccfdb36beec8772dbe431
a43efcdcc95924695aeb11fb8b6fdf30
해당상품의 주문 개수
public int getProductOrderCount(long productId) throws Exception;
1
a53b0c1cf1a3ce0ea5f617a79c3eb67b
2abf2fe4799f38e962d15ac656d5cab7
服务器向浏览器写入cookie
Cookie cookie = new Cookie(key, value); cookie.setMaxAge(timeOut); cookie.setPath("/"); resp.addCookie(cookie); }
1
b8e3391c03aa46d6012da162e9e3e5a1
1aa2127c5df7475b5cec6270ac5f0327
设置朋友搜索框的加载旋转动画
public class ContactsActivity extends Activity implements OnClickListener, HttpHandlerListener, OnItemClickListener, OnItemLongClickListener, OnHandlerListener, OnChildClickListener, TextWatcher private void searchAnimation(final boolean on) { runOnUiThread(new Runnable() { @Override public void run() { ...
0
dd1737736939739ff0be2908ce8f8f74
ad3c7bc0e2f4eed01c62cfb64ce2c8c0
Calculates the various totals depending on the specified calculation mode.
namespace Contoso namespace Commerce.Runtime.Workflow [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "In progress of refactoring.")] public static class CartWorkflowHelper public static void Calculate(RequestContext context, SalesTransaction trans...
1
1c4bd3a6849b0131a6b4e9a6369dc2cb
d625a9d025aaf198571682c5d4e7808b
Retorna o array de notas fiscais.
class Nfe public function getProducts() { return $this->products; }
0
0fd0b3d535abc7a8a9030935794b55b2
f30dc1f1fdb6665348e5c508dad531cf
Checks if the window needs to be redrawn. * *Returns* : * *Return* *Type* :
local function _checkRedraw(self, oldPos, newPos) if #self.visibleItems < 1 then return true end local viewStart = 0 local viewEnd = self.contents:GetHeight() local function _visible(state) local b = state.bottom - newPos local t = state...
1
440d3c0c05191ee6ce9f76cfb73e5dcd
e348168afd6acb1bf1f3571514a691c3
Checks if a matrix is symmetric positive-definite.
def is_spsd(A): if is_sym(A): try: np.linalg.cholesky(A) return True except np.linalg.LinAlgError: A += 1e-5 * np.eye(A.shape[0]) try: np.linalg.cholesky(A) return True except np.linalg.LinAlgError: ...
1
cf056ccc92248797670324c756bb3e6f
04a813139fc9a9830bb2776388dc3caa
Write hunt results from a given client as part of a given hunt.
def WriteHuntResults(client_id, hunt_id, responses): hunt_id_urn = rdfvalue.RDFURN("hunts").Add(hunt_id) msgs = [] for response in responses: if isinstance(response, rdf_flow_objects.FlowStatus): continue msgs.append( rdf_flows.GrrMessage(payload=response.payload, source=client_id)) with d...
1