query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e5c97f70d1aafa2f1d4fac9fd64b1c6b | 2aee5d373421475a2fc2e45cce597070 | This section unregisters the team member post type, as well as containing behavior for when the plugin is deactivated | function pmprommr_deactivation()
{
remove_role('pmpro_membership_manager');
} | 0 |
a0d34f812f7a353158b07d0173e78b44 | fd9412acd862af4d16ea93f3595d31d5 | Test of get_supercell with/without SNF by SiO2. | molecule_plane_normal=[1,0,0],
supercell_mult=(7,7,7),
nn=32,
sheet_angle_tolerance=10,
sym_tol=0.1,
preprocess=True,
bonds_kw={"mult": 1.20, "skin": 0.0, "update": False}):
self.supercell_mu... | 0 |
726db007865ac44a8f6180cb8cf8194f | c4420f344ed54ab4d689d6cc84f0a0e4 | 自动同步his价格表 | {
try {
echo "价格查询中<br/>";
$model1 = new \app\common\model\Supplier();
$list = $model1->where(['is_auto' => 1])->select()->toArray();
dump(array_column($list,'pgw'));
foreach ($list as $key => $val) {
$model = new \app\common\model\... | 1 |
824d9eaae5675acbaae8c6ed75932f63 | 97751df1c36d77d113fd9ad2960a0957 | 获取用户的所有签到历史记录 | List<UserSignIn> getUserSignRecord(Long userId); | 1 |
e1168e0b0b7295bb0e0dba34547b4c73 | c675cc752a19616ed7b428ed73cd2389 | 通过itemDefId获得Action | namespace Gemstar.BSPMS.Hotel.Services.EF.PosManage
public class PosItemActionService : CRUDService<PosItemAction>, IPosItemActionService
public PosItemAction GetPosItemActionListByActionId(string hid, string actionId)
{
return _db.PosItemActions.Where(w => w.Hid == hid && w.Actionid == actionId... | 0 |
1d0e7de33856042d734ad8ab9659c0a7 | 2f3514aad4da26c068b95fefdcf22017 | Add a filter to exclude matching file names. The files will be
filtered using a regular expression. | public final class ListSFTP
public final ListSFTP setFileFilterRegex(final String fileFilterRegex) {
properties.put(FILE_FILTER_REGEX_PROPERTY, fileFilterRegex);
return this;
} | 1 |
c6598aa10a4c77c332df8099088e7d0a | ac6c249231102bf3fef255d2605a264a | Minimum edit distance algorithm(Levenshtein) implementation using dynamic programming | matD = np.zeros((len(src), len(dst)), int)
for i in range(len(src)):
matD[i][0] = i
for j in range(len(dst)):
matD[0][j] = j
for i in range(1, len(src)):
for j in range(1, len(dst)):
minUpAndLeft = min(matD[i-1][j], matD[i][j-1]) + 1
minUpLeft = matD[i-1][... | 1 |
5a620d258d013ea4127fd8346737f445 | c2142e79cce81cee86c85c03fc2bea7f | Given an array of ints, return the number of
9's in the array.
array_count9([1, 2, 9])
1
array_count9([1, 9, 9])
2
array_count9([1, 9, 9, 3, 9])
3 | int numOfNine()
{
int num = 0;
for (int i = 10; i <= 99; i++)
{
int ones = i % 10;
if (ones == 9)
{
num++;
}
int tens = i / 10;
if (tens == 9)
{
num++;
}
}
return num + 1;
} | 0 |
61b9e9933edcc3392a643a01af3a70ec | 0bcf8b5daa9bbd50db74a10bcbecabd6 | The url of a specific project membership | class ProjectManagementData(object):
def get_proj_url(self):
pass | 0 |
d261e82f3a7ad416f175171ae66a7862 | 479ea365deacbe9c00c8a9ffe9b9da59 | Return an instance of <code>CriteriaBuilder</code> for the creation of
<code>CriteriaQuery</code> objects. | public class EntityBeanAbstrato<T>
protected CriteriaBuilder getCriteriaBuilder() {
return this.manager.getCriteriaBuilder();
} | 1 |
558848ab3a060246b8a1c4fb786cdff7 | 7277e46253afcfea32c14fde86b69096 | Returns if it's moving forward. | public class CardImage
public boolean isGoingForward() {
return forwardGif != null;
} | 1 |
7959a718f13c3f49b66964a14740c537 | a81a666d98591c5c4233c6d32b914ac9 | Put resolver_match (ResolverMatch instance) into the context. | {
matcher = Validate.NotNull(nameof(matcher), matcher);
handler = Validate.NotNull(nameof(handler), handler);
GetResolver(matcher).Add(data, handler);
} | 0 |
be71d344fd1bb08a100e9dd01ba97468 | fbc3a03e3d7177d3a506b31bea227a40 | Checks the directories for new files, starting jobs if files have not changed since the last run. | class Adapter
def poll_changed_directories
until stopped
sleep(latency)
report_changes
end
end | 0 |
a5ecc181bb7168dbb0d5bc17f11eb431 | f600d402bc671ac4195d2127287a3566 | Read all performance tests for a single project. | const { testId } = ctx.params;
let perfTest, perfRuns
try {
perfTest = await StorageRepository.readSinglePerfTest(testId);
} catch (error) {
ctx.status = 400;
ctx.body = { error };
}
ctx.status = 200;
ctx.body = perfTest
await... | 0 |
6d638ec02f951d61b7df1b5debcf522f | fbd982705b172f8ce31101af30a5296d | React函数式组件(也叫静态组件)的ref获取方式:
1.使用useRef hook获取ref(常用)
2.回调函数方式获取ref
PS:1.也可以使用createRef获取ref,但是一般不建议使用于函数式组件
2.静态组件不能使用字符串获取ref | export default class App extends PureComponent
render() {
return (
<div>
{}
<div ref={this.myRef}>
App
</div>
{}
<button onClick={e => console.log(this.myRef.current)}>查看Ref</button>
</div>
)
} | 0 |
0e76ae5f17d92dcb6c2a69120f6c7f8c | 250d6c68c8c85ae152428cdc3252ddfe | Get a trending plot, showing two variables plotted against each other. | class Trend:
def trendmap(self):
df_clean = self.df_clean.copy()
zipcodels = self.convert(self.zipcode)
selected_data = df_clean[df_clean['Zipcode'].isin(zipcodels)]
interval = alt.selection_interval()
if self.datatype == "DEATHRT" or "HOSPRT":
sorteddate = df_clean.i... | 1 |
dc2e2c5f9deaa8c8ca77ded7647ff7d4 | 25b8c490a43f7ab1869ae8cc2923d59a | Get the error quark for xmlroff.
If the quark does not yet exist, create it.
Return value: Quark associated with xmlroff errors. | function()
{
w <- .RGtkCall("S_gdk_pixbuf_error_quark", PACKAGE = "RGtk2")
return(w)
} | 0 |
f4b9e389e09c3ac2eeaa641ae8a024c0 | c0b1372b83f98f7d44cc0880eca13d2c | Gets the row of the selection's start | int getSelectionStart(); | 0 |
2b59e72dcb6d1837d61882957fa3e844 | 5067f1cd25c10f19803850ed4cbb7d1d | Returns the size of the space used by files and folders under 'path'.
If 'blocksize' is specified, mimic the space that will be used if the blocksize of the underlying filesystem where the one specified.
This could be useful if used to transfer files from one directory to another when the target filesystem use another ... | class GitStorage extends \OC\Files\Storage\StreamWrapper{
public function free_space($path) {
$space = @disk_free_space($this->getSourcePath($path));
if ($space === false || is_null($space)) {
return \OCP\Files\FileInfo::SPACE_UNKNOWN;
}
... | 0 |
aa9908e6bb10feb8d1c37abc2c999ef0 | 8ce9a3176f9e42ee3ae32861333acc66 | Returns coordinates of immediate neighbour of a tile on hexagonal grid. | {
float x = position.x / (HexMetrics.innerRadius * 2f);
float y = -x;
float offset = position.z / (HexMetrics.outerRadius * 3f);
x -= offset;
y -= offset;
int iX = Mathf.RoundToInt(x);
int iY = Mathf.RoundToInt(y);
int iZ = Mathf.RoundToInt(-x - y);
... | 0 |
f5775ed2ed90ee0432bd262b8587083d | 436d18402d1d0a9e1a57da1c3bce7aed | ARM resource identifier of the Event Hub used for telemetry. Requires granting Orbital Resource Provider the rights to send telemetry into the hub. | class EventHubEventSource(pulumi.CustomResource):
def event_hub_name(self) -> pulumi.Output[str]:
return pulumi.get(self, "event_hub_name") | 0 |
90723e52e1eab799ab4f2f34e470a442 | 36aae1c27bd6a16335b4732afe9c2d98 | 判断字段是否可作为条件 | if ("is".equals(operator))
return false;
if ("in".equals(operator))
return false;
if ("not in".equals(operator))
return false;
if(operator.trim().length()==0)
return false;
return true;
} | 1 |
40ad1a00600e2b4a462324f6258e9724 | eadde6ff44ebb4bba5296d417a1a4740 | 提取json中的车牌号 | public class MainActivity extends AppCompatActivity
private String getLicensePlateJsonBean(String json) {
LicensePlateBean licensePlateBean = GsonImpl.get().toObject(json, LicensePlateBean.class);
LicensePlateBean.WordsResultBean words_result = licensePlateBean.getWords_result();
return words_re... | 1 |
94d32ceb0cc43d1c78c779faa47a0106 | 6fc1b6fa5134b6c51a518cd1968beff1 | Add new script to the storefront | async def post_script(data: new_script):
BotScripts.add_script(data) | 1 |
7af52411a64ca57f974185b7d1bd211b | 2453c141bfa35ad9a3be3cf2d48d8cd2 | Gets the inverse of the current <see cref="Rational"/> value (that is, one divided by the current value). | namespace PeterO.Numbers [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1036",
Justification = "Awaiting advice at dotnet/dotnet-api-docs#2937.")]
public sealed partial class ERational : IComparable<ERational>,
IEquatable<ERational>
public ERational Decrement() ... | 0 |
6b2c21763b371c6ddb851059190ab4d8 | 81a2b4e04347875e58aad53a6d0b42d7 | Returns a dict with count of each word in a phrase
keys are the words and values the count of occurrence. | phrase = phrase.lower()
counter = {}
for ltr in phrase:
if ltr in VOWELS:
counter[ltr] = counter.get(ltr, 0) + 1
return counter | 0 |
27702edffc0c284c27c3e0388c16b4f3 | e1c73b527d96ca1682acd39a217dfa3a | 按维度创建sheet | workbook = xlsxwriter.Workbook(XLSX_MULTI_SHEET_PATH)
for sheet_name in ['已签到', '未签到']:
worksheet = workbook.add_worksheet(sheet_name)
bold = workbook.add_format(dict(bold=True, border=1))
worksheet.write(0, 0, 'row1,column1', bold)
worksheet.write_row('A1', ['a', 'b', 'c'])
... | 1 |
6e9a5b98f7006d323c98073350696e81 | cd81e0185bf0c73a74431b5dfcf82198 | Zwraca wszystkie publikacje należące do xml'a | class PublicationsResource(Resource):
def get(self):
res, status_code = list_publications(filter_model.parse_args())
return res, status_code | 0 |
4743734c1fe122b4a7f6f0c614ccfbdc | c3c5ce4754be54435715d63ff5ca3f46 | Called by the ASP.NET page framework to notify server controls that use composition-based
implementation to create any child controls they contain in preparation for posting back or rendering. | public partial class CMSModules_OnlineMarketing_Controls_Content_CombinationPanel : CMSAbstractPortalUserControl, ICallbackEventHandler
protected override void CreateChildControls()
{
base.CreateChildControls();
if (!stopProcessing)
{
SetupControl();
}
} | 1 |
d3bd1c48f544b044e696ca5a073d7085 | c18c67cb990f70fc4e61758818591a68 | Gets keys which identify a single entry in the set. An array as key can
be defined by few fields. | public function getKeyFields(); | 1 |
53dbae8878d73d8ee7fb1e1e4ccdaeeb | 8fed527cf49dc45e109037fe3dd14afc | Se reinicia la escena si el jugador muere. | {
if (playerCurrentHealth <= 0)
{
gameObject.SetActive(false);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
gameObject.SetActive(true);
}
} | 1 |
095aaaada66018f76ebd20cea76fa429 | 9960d7989b654dd36b96f4baaa8a3f21 | Tests if an objective bank search service is supported. | class ObjectiveBankQuerySession:
def can_search_objective_banks(self):
return | 1 |
df2ed44b4516f7404e9468a12618ea2f | 0e04daa21615e09ee396a70383ce92d6 | Returns the user's screen width | def screen_width
return 284
end | 0 |
4ccd6c080a98ccc556d2fab374f218ef | 6c4c69f65b0f89c71b3e2f9671c8806f | Checks if a revision's gzipped content object exists on S3. | def s3_key_for_revision_metadata_exists(wiki, pageid, revid):
return s3_key_exists(
wiki['s3_bucket'],
s3_key_for_revision_metadata(wiki, pageid, revid)
) | 0 |
9451f1fbd0d99e905ab69d49c63a0e19 | bb6237a6bafed5a12a75d3c9e5ed2666 | JTable uses this method to determine the default renderer
editor for each cell. If we didn't implement this method,
then the first column in the wizard would contain text
("true"/"false"), rather than a check box. | public class IssueTable implements MouseListener, AncestorListener, KeyListener, PropertyChangeListener
public TableCellRenderer getRenderer() {
return table.getDefaultRenderer(Node.Property.class);
} | 1 |
bea87026ce68d7673ad55224a70edfed | e432e6c553fbf525bf19e21e6136a645 | 本日の未投稿者にメールを送信するサービス. | void sendTodayMail(); | 1 |
d2361b7ce654e5356e31650c57342976 | 717e062af34d8fe10a0c80958e4b40ef | Handle new snapshot for a given session. | public void onWaveletSnapshot(ObservableWaveletData snapshot,
HashedVersion lastCommittedVersion,
HashedVersion currentSignedVersion)
throws ChannelException; | 1 |
da4bbc4ca40c69cfc3b3405933347131 | 0e4e971935034266de75e249e456d99f | Raised when trying to extract fields that don't exist in a given record.
Often because that record has a different number of fields than the header | class FieldNotFound(RuntimeError):
def __init__(self, field_name: str):
super(FieldNotFound, self).__init__('Field not found', field_name)
self.field_name = field_name | 1 |
e98a7ae6490eaf78eec0f14af8e9c843 | 0276348df3d33c542afbac15818bac63 | パッケージごとに日次更新の警告内容のチェックを行う<BR>
<BR> | public class S01_0502 : PT71, iPT71
public bool CheckUpdate()
{
base.clearExistErrorProperty(this.gbxUpdateItem.Controls);
if (this.isExistHissuError())
{
CommonProcess.createFactoryMsg().messageDisp("E90_022");
return false;
}
if (this.chbDelete.Checked == false)
{
if (this.checkOverlappingData_U... | 0 |
f3c1582815907a5a5b31c04ffcc1b64b | e8a1f746c265a1ab115e269d235d6008 | Returns double [flLow, flHigh) | class TFloatInst(TInstant, TFloat):
def getValues(self):
return [floatrange(self._value, self._value, True, True)] | 0 |
498b298dba6cc640d3ecd06e95d72551 | 722de4694112c9483a25d326798a3ab5 | 退货申请审核 | let _this = this;
_this.ajax.put({
url: '/woAgent/checkPassRefundGoods',
data: {
'afterNo':_this.orderId,
'opinion':_this.opinion
},
success: (res) => {
if (res.success) {
swal('已同意退货', '', 'success');
_this.hideWindow();
_this.AllSal... | 1 |
85900f2c778677b8f2ca6db8091ff091 | 5836ac078ec2c1dff0c8068ff94c6333 | close down a pap connection without telling remote
useful for forking off the a pap fork without carrying the baggage | {
Sink sink = a2dp->signal_conn.sink;
uint16 pdu_size;
uint8 *resp = NULL;
if (!sink || !SinkIsValid(sink))
return;
if (pSeps == NULL)
{
if ((resp = a2dpGrabSink(sink, 3)) == NULL)
return;
resp[0] = (ptr[0] & 0xf0) | avdtp_message_type_reject;
resp[1] = (uint8) avdtp_close;
resp[2] = (uin... | 0 |
5e62bebede05f46400d18e8f5742fe50 | 7b39cf7adcbaa87f37442b15f64b6d2d | 判断字符串是否为正确的时间格式
格式:10:10:10 | function isTime(str){
var number="1234567890:";
for(var i=0;i<str.length;i++){
if(number.indexOf(str.charAt(i))==-1){
return false;
}
}
if(str.indexOf(":")==-1){
return false;
}
if(str.length<3 && str.length>5){
return false;
}
var arg=str.split(":");
if(arg[0]<0 || arg[0]>24){
return false;... | 0 |
b068ab8dee6ce4f9619cc5bac7bd7eab | bf5651524450d7f7d7f98cf3d91bc124 | IsClientID returns true if the client has an identifier of the specific type. | {
if (clientID.getArgs()[0] == this.getArgs()[0])
return true;
return false;
} | 0 |
04968625a375aa97a1ee2b8dd6c3a9ed | c4d8653bad23a83cc65b60f17f1011c0 | @brief Copy the stored data to User space buffer | int len = strlen(keys_buffer);
int ret = copy_to_user(buf, keys_buffer, len);
if (ret) {
printk(KERN_INFO "Couldn't copy all data to user space\n");
return ret;
}
memset(keys_buffer, 0, BUFFER_LEN);
keys_bf_ptr = keys_buffer;
return len;
} | 1 |
fe303cace3c72ba7de1b9893fd89a857 | b9be86361ed19951ff66a5f25173b798 | Return html that can be used to render a bootstrap alert on the form | {
$html = array();
$html[] = '<div class="alert alert-' . $notificationMessage->getType() . ' alert-dismissible" role="alert">';
$html[] = '<button type="button" class="close" data-dismiss="alert" aria-label="Close">';
$html[] = '<span aria-hidden="true">×</span>';
$ht... | 1 |
4998940551456a8d68c4f7790dd03d6f | 6f20e18a2f72501d402e22cca0883b7b | Test that Gaussian filters can be truncated at different widths.
These tests only check that the result has the expected number
of nonzero elements. | x = np.array(
[
[
[
[
[0.0, 1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0, 9.0],
[10.0, 11.0, 12.0, 13.0, 14.0],
[15.0, 16.0, 17.0, 18.0, 19.0],
],
... | 0 |
ec7ee0d38682f632e258d89fd0ceca37 | 98b54e10119064d98594c5b825098593 | Retrieve the emails of the user based on the query and messages
already retrieved before.
Keyword arguments:
query -- Query on which to filter messages.
Returns:
List of messages (see Gmail API for format). | class Message(models.Model):
def get_by_search(email, words_to_match):
try:
user = User.objects.get(email=email)
except:
raise
return Message._get_recursive_union_filter(
Message.objects, words_to_match, user) | 0 |
a714bd26814c2d55283fac5c53e08262 | 463f0140bfaac0ba685016a055201186 | Render a nine patch. | export class NinePatchNode extends LeafNode
public constructor( name: string, renderer: WebGLRenderer, textureManager: TextureManager, shader: Shader, texture: string,
layout: Array< number >, width: number, height: number )
{
super( name );
Asserts.Assert( layout.length === 4, "NinePatchNode Layout must con... | 1 |
c79ada50ee33cc92dbea38a92e817079 | 9f1064ec505b31f5d3704beb634f4a63 | check whether Shift Duration field is entered | public class MainActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, CompoundButton.OnCheckedChangeListener
public boolean isDurationInputValid() {
boolean isDurationInputValid = true;
String durationStr = controlDurationInput.getText().toString().trim();
if (durati... | 1 |
30a48d86ff199f9e51e675db72977785 | 714e02e70ab6d62c2a11ebe908957234 | Sets the robot to turn to face the specified location when the next execution takes place. | double newAngle;
position = odometer.getXYT();
newAngle = (getHeading(xf - position[0], yf-position[1])+270) % 360;
turn_to_angle(newAngle);
} | 1 |
1ea01af4db1ee64e4e8d3734f0d7cef2 | f8b92fafa1f1e6a5c72741f6e1b60888 | calculate Unix date from Excel Date | class Pml
function dexcel_unix($date_excel)
{
$hours_diff = 19;
return (( $date_excel - 25568 ) * 86400) - ($hours_diff * 60 * 60);
} | 1 |
beff9a2b07a91f61d5c2bc5bd2aedaf2 | ca319fc420c893f908c6b3b272eff321 | Retorna el monto del iva del total del contrato a dos decimales y formato. | class MaquinaSandwich
public int getIVA() {
return ingresosPorVentas * 19/100;
} | 0 |
09d55cec06e8cb1e9b1aa9b8ada0337f | 51af46f051482afdae2fdb443a42c017 | This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. | class ManagedZoneArgs:
def reverse_lookup(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "reverse_lookup") | 1 |
6feede624fb0d36eb5bf3835becc60a4 | c43311bf6aae99fc8e2fa53597b487a6 | Use the Conjugate Gradient method to solve the linear system. | void solver::conjugate_gradient(bool diag = false) {
vector<double> tmp_b = _b;
if (diag) {
diag_scaling();
vector<double> eye(_b.size(), 1.0);
for(int i = 0; i < _b.size(); ++i) {
_b[i] = sigma_mul(i, 0, _dim, _C, eye);
}
}
set_x(0.0);
int iter = ... | 1 |
c7cb2d1412f1220572d010e62359e8e3 | 8ac4178fdd51e731fbd5af894d0313be | Ova funkcija se poziva kada se odabere određeni redak unutar data grida,
Služi kako bi spremila ID odabrane osobe unutar varijable ID koja će se kasnije
koristiti prilikom brisanja | {
if (e.RowIndex >= 0)
{
DataGridViewRow red = this.dgvSviFilmovi.Rows[e.RowIndex];
IdFilma = int.Parse(red.Cells["IdFilma"].Value.ToString());
}
} | 1 |
8c6a9b82a9e7a337c7fc1c88ca01d723 | a307723719eeb052bfbcd58417880f8a | Delivery costs set to 15pln unless order > 200pln | if (orderAmount.compareTo( new BigDecimal(100)) == 1){
return BigDecimal.ZERO;
}
return new BigDecimal(10);
} | 0 |
644e537f9e1f08e40df56948397a926b | c6aa69a91f5d4b19af01dee0791d4173 | Get the authorization code TTL | public function getAuthorizationCodeDuration()
{
return $this->_authorizationCodeDuration;
} | 1 |
ffaf76d394954a3123d545fc9f088950 | 01546d443ed909b1a677f9edb6c5fcf8 | Unconditionally delete all commands, active macros and everything from the stack. | {
tcl_timer_t *mark = *stack, *old;
while (mark) {
old = mark;
mark = mark->next;
nfree(old->cmd);
nfree(old);
}
*stack = NULL;
} | 1 |
85b0fdc8908828ed69eb51e63ddebdee | fa9212dc1d3b02f59404c7fdf13ee42a | Main driver program to prompt user for embedding or extracting a message to/from a sound file | {
auto useKeyword = false;
auto waitForUser = false;
auto speechConfig = CreateEmbeddedSpeechConfig();
auto audioFormat = AudioStreamFormat::GetWaveFormatPCM(GetEmbeddedSpeechSamplesPerSecond(), GetEmbeddedSpeechBitsPerSample(), GetEmbeddedSpeechChannels());
auto pushStream = AudioInputStream::Creat... | 0 |
8f9efe855a3ab1016269e83ba724d548 | 3dbeca5ee124a5cdd68cedc0b63b6211 | make call to API to get list of route stops | namespace ITB1704Application.Controllers
[Route("api/[controller]")]
[ApiController]
public class RouteStopsController : ControllerBase
[HttpGet]
public async Task<ActionResult<IEnumerable<RouteStop>>> GetRouteStops()
{
return await _context.RouteStops.ToListAsync();
} | 1 |
c0ee1d8c964042ca174e40e3f976b1d6 | 7532f74bb45500e8f7927ca364b5d651 | Comenzando en la posicion (0,0), da la cantidad de pasos indicada | int main(int argc, char** argv){
double y0Step = 1;
double x0 = 10;
double y0 = 10;
double x = x0;
double y = y0;
string filename;
if(a==0.05 && b == 0.002 && d == 0.06 && c == 0.004){
filename = "ficheros/poblacion.txt";
} else {
filename = "ficheros/poblacion_inestable.txt";
}
ofstr... | 0 |
e371a023349e92377bb9b2abe02741fd | 23937b4fac2ff1274f727a0a6b093df6 | Stellt eine Verbindung zur Datenbank her und gibt die
Datenbankverbindung als PDO zurück. | {
$config = Config::getDbConfig();
$conn = new \mysqli(
$config['host'],
$config['user'],
$config['password'],
$config['database']
);
if ($conn->connect_error !== null) {
throw new \Exception('Datenbank Verbindungsfehler');
... | 0 |
ad1fc289552867d2209140c01e251468 | b9100b51d40971fb701b7b123231be5e | 根据日期,获取每个日期下对应个数 | void getCountMapByDate(ArrayList<MusicEntity> data,String key); | 1 |
a1f545f3db210608cd5adb3d928c0809 | 0aa4f5531c645f64f75ef835dbf8b2ca | Caches the purchase types in the entity cache if it is enabled. | {
$obj = Craft::app()->commerce_productTypes;
$refObject = new \ReflectionObject($obj);
if ($refObject->hasProperty('_fetchedAllProductTypes')) {
$refProperty = $refObject->getProperty('_fetchedAllProductTypes');
$refProperty->setAccessible(true);
$refProp... | 0 |
0f12fd9b276ce5cf5b8017cd2718d295 | 6fb9bb055dc4280730627e1af38945fa | not supported, do nothing | public class FileSystemStatsManager implements StatsManager
@Override
public void rate(Track track, int rating) {
} | 1 |
1e07ebe9bbc2572ff5b51097b35ef9b6 | 712ce9938efc48499c9d8d29d5f1b1ff | 데이터 프레임 df와 그 데이터 프레임의 컬럼이름들의 리스트 cols를
argument로 받아서, 해당 컬럼의 값들을 평균이 0이 되도록 변환.
원본 데이터 프레임 df는 유지, 새로운 데이터 프레임을 생성해서 리턴 | def fillna_mean(df, col_name):
df[col_name] = df[col_name].fillna(df[col_name].mean())
return df | 0 |
781dbd52c44e9b60416f9185c426b8ee | 0fbb4a0647186db57da5575cbcaf924f | returns the latest albums associated with this category. If the category
has children, then the latest albums in each child are also included. | public class SubsonicLibraryRepository
public LiveData<List<String>> getRecentAlbums() {
return dataSource.fetchAlbumList(SubsonicNetworkRequest.AlbumListType.RECENT);
} | 0 |
179d828fe1d3b890d14447d03150c6f7 | 7d8e4d9b7bd4bd36312d333771456c5e | 暂停人物活动 | if role == nil or role:isDead() then
return
end
if role:getName() == 'Pet' then
self:allTimersControl('pause')
self:warriorAction(role,1000 + role:getDistant())
Utils.delayExecute(self, function()
if self._isCrazy == false and
self._isHaveE... | 1 |
f3f69ccb53d71bbec564cc9baad1310b | 2351bb249931c3ab9261a1d268c84de5 | 动态规划算法求解硬币找零问题 | public class DynamicProgramming
private int findCoins(int[] coins, int remain, Map<Integer, Integer> memo) {
if (remain == 0) return 0;
if (memo.containsKey(remain)) return memo.get(remain);
int res = Integer.MAX_VALUE;
for (int i = 0; i < coins.length; i++) {
if (remain >= c... | 1 |
eb2db9ff7e7a01fc82bee31289f5df78 | 513de8d4231930a36445a13294ba7ade | wrap a line to fit in the header box | const width = 998
if len(s) > width {
splitIndex := strings.LastIndex(s[:width], " ")
if splitIndex == -1 {
splitIndex = width
}
return s[:splitIndex] + "\n" + wrapSMTPHard(s[splitIndex+1:])
}
return s
} | 1 |
c0c111534d5b6dca17deb150f7a9f1e4 | 57374f6357efd13dbdbdc785c8c96d8d | Gets a cell nearest the centroid of this skin.
In illustrations, this cell is often a good representative. | public Point getCentroid(); | 0 |
34f366d4784de253fc5c85f09b7ea14e | 1a7ffa05affea3193e928fb237fc1c47 | This function initializes the KMOD base module. | PyMODINIT_FUNC PyInit__hrutils(void)
{
Py_Initialize();
PyObject *module = PyModule_Create(&_hrutils_definition);
PyModule_AddIntConstant(module, "IFF_ALLMULTI", IFF_ALLMULTI);
PyModule_AddIntConstant(module, "IFF_AUTOMEDIA", IFF_AUTOMEDIA);
PyModule_AddIntConstant(module, "IFF_BROADCAST", IFF_BROADCAST);
PyModul... | 0 |
2681f8948dae24f479d08d28c8b8a1eb | 10d34bddd357936f14b42d37a9b88483 | 设定菜单是否开启,0代表未开启,1代表开启 | namespace Web.DAL
public class MenuClass
public int SetIshow(string id, string Ishow)
{
Base.Conn.Database db = new Base.Conn.Database();
int count = db.GetRowCount("Update [MenuClass] Set [Ishow]=" + Ishow + " Where [id]=" + id);
db.Dispose();
return count;
... | 1 |
e20daf75586e83276e4388ca1b268521 | 83ce4a24164992e3d90146497fe9608c | This method converts the desired columns to one hot encoding sequence. | class OneHotEncodingTransformer(BaseTransformer):
def transform(self, data):
dummies = pd.get_dummies(data)
return dummies.reindex(columns=self.dummies, fill_value=0).values.astype(int) | 1 |
41e828c17ea5cb414890d292cc90fbfb | 9411c56ccca9baed35aa6d9f5d888023 | Get middle node of a linkedlist by an efficient approach | class Solution:
def getMiddle(self, head):
if (head == None):
return head
slow = head
fast = head
while (fast.next != None and
fast.next.next != None):
slow = slow.next
fast = fast.next.next
return slow | 1 |
e963ca7b8f9c4c127327fa18422f7371 | 8f60cc5613cdcba5ad84884f8ca1358a | Método abstracto para eliminar datos de la base de datos | public class FrameListadoAbstracto extends javax.swing.JDialog implements
ActionListener, KeyListener, ImplementadorListado, VentanaSimiento
@Override
public void eliminar() {
} | 0 |
ee3bb646e72bcdfb462eb5f5abdf1b48 | 9b042ac0b3266d06a7fd49d29b473dc7 | Ask user for some network address.
(Used for netmasks, too.)
Either numeric or dns resolved. | int net_choose_device()
int net_get_address(char *text, inet_t *inet, int do_dns)
{
int err = 0;
do {
err = 0;
if(dia_input2(text, &inet->name, 32, 0)) {
err = 2;
break;
}
if(!inet->name) {
err = 1;
break;
}
if(net_check_address(inet, do_dns)) err = 2;
if(err) dia... | 1 |
2be3d65a8f0364f745b1b5f21b95292e | a529a157ce1510e6f3bbb2d2e0c0becf | 根据报告类型利用多态获取对应的查询服务类 | switch (type) {
case "FQueue":
return new FQueueService();
default:
return new FQueueService();
}
} | 0 |
46e0489585f66b75a8260cd2264ea664 | 67f028a9d637a2feba4b2716cbfe5080 | Only convert non-persistent types | final class TypeConverter implements TypeConverterInterface
public function convertType(Type $type, bool $input, ?string $queryName, ?string $mutationName, string $resourceClass, string $rootResource, ?string $property, int $depth)
{
if (false !== strpos((string) $resourceClass, 'App\\Entity\\')) {
... | 0 |
6b2588ce05f854c04d70bedb08ceeec4 | 1d0a348b297ae6f9238a4afa65398cac | Linearize the feature matrix | rowsum = np.array(features.sum(1))
r_inv = np.power(rowsum, -1).flatten()
r_inv[np.isinf(r_inv)] = 0.
r_mat_inv = sp.diags(r_inv)
features = r_mat_inv.dot(features)
return features | 0 |
23e4676d06ed1adf051b0f015377198b | d6e609e27d2562eb0bbd293f47f06806 | Recherche les terminaisons associées à un modèle
et retourne ces entrées. | $terminaisons=[];
$terminaisons[]= "ague";
$terminaisons[]= "agues";
$terminaisons[]= "ague";
$terminaisons[]= "aguen";
$terminaisons[]= "agués";
$terminaisons[]= "agon";
return $terminaisons;
} | 1 |
05fa0b9b1654852fbf579999b5735d60 | 31c90a82c66b2d68fd13a92c608c6615 | Now show the pet names of all cars with ID greater than 5. | resp = self.app.get('/pets', query_string='available=true')
self.assertEqual(resp.status_code, status.HTTP_200_OK)
self.assertGreater(len(resp.data), 0)
self.assertIn('fido', resp.data)
self.assertIn('kitty', resp.data) | 0 |
57f45aeb2efcbea483faa3e503115f4f | 17f584fd007ea0ad32ae6bb1fba1822b | is default link (highlighted if no other filters active) | class DataLinkTargetSignalfxDashboard(dict):
def is_default(self) -> Optional[bool]:
return pulumi.get(self, "is_default") | 1 |
7f453ccfb34f3af98d5e55e4876ace44 | e1b48707c7319c862dff9f58313471c0 | 通过xlsx插入宿舍详细信息 | QueryRunner queryRunner = utils.getconnection();
String sql = "insert into baoxiu VAlue(?,?,?,?)";
Object[] parm = {dorm, mag, sname, snumber};
int a = queryRunner.update(sql, parm);
if (a == 1) {
return true;
}
return false;
} | 0 |
e9ea9744386389f12197ef86bad34e3b | 1ae1f333a83ae192194ed4613ace940d | 抽取年份,返回4位数字或空 | def get_year(date):
if date!='':
date = date.strip()
year = date[:4]
year = year + '年'
return year
return date | 0 |
d9ecea9ff3c5595400d08da247726a3d | 826a891811425e27db79615de2a9beb2 | builds and returns complete deck except for cards in hands | combined_deck = []
for card in room_cards:
combined_deck.append(card)
for card in weapon_cards:
combined_deck.append(card)
for card in suspect_cards:
combined_deck.append(card)
return combined_deck | 0 |
5d72068019c07e304063a9167dbc0941 | 3a2df8824fa95e2949030658d5bd0296 | Blocking access request to the data server | class Store(object):
def block_access(self):
self._connection.block_access() | 1 |
08d778d17c0a97bc232b0ab188930bb8 | afc52db54efb4b94def159dfab1645ef | A list of expected settings for an email template | class block_asp_todo
public function expected_settings() {
return array(
'id',
'stepid',
'task',
'obsolete'
);
} | 0 |
73d322b9f60a9e400333d97a77b7503e | bffd0dd9c01c46ffaf1e5e030e9820d9 | 获取map所有的字段和值 | public Map<String, String> hgetAll(String key) {
RMap<String,String> rMap = redissonClient.getMap(key);
return rMap.readAllMap();
} | 1 |
893fc4ab0670877c503e733729ce8503 | be46825a15cdf97dfddb5dd610c7acac | 给field新建一个getter方法 | if (!check(fieldName, fieldType)) {
System.out.println("类中有属性或者类型为空");
return null;
}
String getMethodName = "get" + getCamelName(fieldName);
String getMethodString = String.format(" public %s %s(){\n return this.%s;\n }\n\r", fieldType, getMethodName... | 1 |
ae9b07a745059a22eaa96ffb2dfba333 | d5e8903a6b68a161d3c960dce75cc4e6 | Возвращает минимальное значение возможной ставки для лота | {
settype($id, 'integer');
$sql = "select bid_amount from bids
where bid_lot = $id
order by bid_amount desc
limit 1";
$result = query_scalar($link, $sql);
if ($result === false) {
return $default;
}
return $result;
} | 0 |
77096bd0a1d44bb1ff0bdb99c6b0058a | e89b0aee654e2505fc732b876a18fc40 | Get simple information about popular articles for the current wiki | public function getPopularContent($counterId, \iUmiDate $from = null, \iUmiDate $to = null); | 1 |
35a75e3b586a4933f813565d43142c00 | 2e25816a4f14312fdb17fd452bc9829b | (optional, integer) Sets the year (such as 1989) of the specified date serial number. | export class DateTime
public setYear(value: number) {
this.date.setFullYear(value);
this.update();
} | 1 |
a53b54c93c2afe3d888fafa1254fc49d | 56ea4c1ad297ba806b426e00dd252456 | Sets the ocf region cd. | return from(this._storage.set('cdvd', _value).then(
success => true,
error => false
));
} | 0 |
1dac6e819f564ed10f1c4cba4e4d8399 | 31390ce564c5510c98f890817651ea2f | 会員登録があるかどうかのチェック(仮会員を含まない) | if(!chk_is_number2($member_id)){
return false;
}
require_once 'CommonForm.php';
$objCommonForm = new CommonForm();
$whereData = array(
'table_name' => 'tbl_buying_history',
'field_key' => 'f_member_id',
'where_data' => array(
'f_member_id' => $member_id,
'f_del_flg' => DEL_FLG_OFF,... | 1 |
9809767943f13852c586a93e2f027683 | cf9f274e74b89b240b6b0c24a96df1f5 | Sets the value of the settlCurrAmt property. | public class PaymentMethod
public void setSettleAmt(String settleAmt) {
this.settleAmt = settleAmt;
} | 0 |
9ca0ac8f888d11e9a26c06dce5808338 | fdcd2531b589f0e2a5923a12fb5c47a2 | function to delete <li> items from screen | function deleteNews() {
const oldLi = document.querySelectorAll("li");
oldLi.forEach((li) => li.remove());
} | 1 |
dd4c0fd909187f708b8522e9490a0608 | 83c44a437b998fbe8a9ae4e693ad7b6c | This method retrieves value of amperage. | class ec(pty_driver.ptyDriver):
def _Get_milliamps(self):
return self._get_battery_values()['ma'] | 1 |
fc2987e9e05786aeebc11abb7e5061f7 | 0d27916d1ac266b256610c0863d1d528 | Counts total TF ops in any TensorFlow computations under `comp`.
Notice that this function is designed for the purpose of instrumentation,
in particular to check the size and constituents of the TensorFlow
artifacts generated. | def count_comps():
pass | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.