query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5bf8ba2c16941885ea40bcffe0e37c74 | 8adbc70b4ed9264de9837f8da75adf7b | Generates the steady state modulation using a simple squre wave | void ModulationBaseClass::setSquare()
{
std::fill(waveTable, waveTable+sampleRate, 0);
const double radPerSec = 2*3.1415926536*timeStep;
for(int i = 0; i < sampleRate; i++)
{
for (int j = 0; j <35; j+=1)
waveTable[i] += (sin((2*j + 1)*i*radPerSec))/(2*j +1);
}
} | 0 |
c06eb40f201a997529c53a609d41a15d | a067761aad7cb4db2c1f5876c0c45d2e | retorno do valor da posição solicitada, ou nulo. | class CPU extends MemoriaRam
public function pegaPosicaoMemoria($posicao)
{
return $this->memoria[$posicao];
} | 0 |
a19cde92c1098a0fd69de0efbc12399f | 6b25442dc378ff5f2388dc5e41a98ed3 | 填充数据并进行rs编码 | var result = [];
for(var i=0; i < data.length; i++){
var err_pos = [];
for(var j=0; j < data[i].length; j++){
if(data[i][j] == 0)
err_pos.push(j);
}
var decoded = RS.decode(data[i], nysm, err_pos);
if(typeof decoded == "string"){
$("#rs-decoder-error").text("ERROR: "+decoded).removeClass("invisibl... | 0 |
371c5980dcbfb0db3bc1f028959523ac | 6e8c88f22bba307e82acc4508c83b28b | 去除多余的星号 | res = []
i = 0
while i < len(p):
res.append(p[i])
if p[i] == '*':
j = i + 1
while j < len(p) and p[j] == '*':
j += 1
i = j
else:
i +... | 1 |
7345601ba7283a44bb65d306dd88f154 | 8195a9192346a77f544bef3cafe26291 | Close the list of months or years. | class form_generator
function closeList() {
array_push($this->data, '</ul>');
} | 1 |
09a296aa799d2d3907829db60f761287 | f56c61fefb5e5c80c7cb51a4f35ecb24 | 파일에 저장되는 정수값을 설정한다. | public class SetupShared
public static final void saveDate(String where, int intData) {
editor = sp.edit();
editor.putInt(where, intData);
editor.commit();
} | 1 |
9ca9ec4aa44521902ea177b843a60a55 | 21dd766c5494ad0d14a204dfa3c061df | 分页获取数据,获取用户微博列表 | namespace MLMGC.IDAL.Personal
DataTable GetList(E_Weibo data); | 0 |
0b41904dcbe8515f01a8ab6004be4346 | 50f55683dda1559a983359857e57b90e | Indicates whether third person perspective is active.
Should not be modified directly. See {@link DeltaControls#setOrbit}. | export class WebXRControllerMovement extends WebXRAbstractFeature
public get rotationEnabled(): boolean {
return this._featureContext.rotationEnabled;
} | 0 |
4bfc4a5ce51bf365d60b6d429002fc99 | 1891a76c411741d0736477837dafd1b3 | Arrange a series of clips in a horizontal row. | def hstack(*args, align=Align.CENTER, min_height=0):
return stack_clips(args, align=align, min_dim=min_height, vert=False, name='hstack') | 1 |
b877003557be791267ed7c5502b83aaa | e12eb5695a519b7aea18b112bcccc181 | Update the FW result in the dict. | def add_to_result(result, var, dict_var):
try:
index = dict_var.index(var)
except:
index = len(dict_var)
binarize(result, index, len(dict_var)+1) | 0 |
3643500b3997979c11179888b0c78be3 | abfa76939a6fbd5ede48ea8aeca5124a | Calculates the number of marked cells in the current game | int tilesLeft = totalTiles - totalMarked;
if (tilesLeft == 0) return 3;
if (tilesLeft <= 6) return 2;
if (tilesLeft <= 12) return 1;
else return 0;
} | 0 |
f2a07302cb86d0d3ec7228505523e073 | f268b20878d9497f87f4154a1305ceb8 | Get Map of all NamespaceDescriptors for a given namespace. | endpoint = '{}/osm/nsd/v1/ns_descriptors/{}'.format(settings.OSM_COMPONENTS.get('NBI-API'), nsd_uuid)
headers = {"Authorization": "Bearer {}".format(self.bearer_token), "Accept": "application/json"}
response = self.__client.get(endpoint, headers)
logger.debug("Request `GET {}` returns HT... | 0 |
2f3f29da2c0cba1f20665fa153cd015a | c54a3512d75bfc4ae541216601d00579 | Returns list of tile coordinates that can be targeted from a given facing the weapon list | {
int sinRot = (attackDir % 2 == 0) ? 0 : (2 - attackDir);
int cosRot = (attackDir % 2 == 1) ? 0 : (1 - attackDir);
var attackables = attack.Range.Select(p => new Vector2Int(
p.x * cosRot - p.y * sinRot,
p.x * sinRot + p.y * cosRot
) + unit.Coordinate).ToList();
return attackables;
} | 1 |
c98ef829bbc70d0552e8d9e5b5565436 | a3b4008337ef8ef4afe7853f834aa65c | 设置 多货件数. | public class StTaskExportDto
public void setGoodsQty(Integer goodsQty) {
this.goodsQty = goodsQty;
} | 1 |
8f4df0e7ab94dba33de7ef41a222a21e | b5f4e8f0595a4cb39d10f39020da3076 | Inserta una vacante favorita | let config = {headers: new HttpHeaders().set("Content-Type", 'application/json')};
let response=this.http.post(this.url + '/api/colonias/favoritos', JSON.stringify(data), config);
return response;
} | 1 |
4809b42c747a5428ef24ecda07e836e5 | 5068c87613c49bb9cdb0cdc6201d05e7 | Returns a random integer greater than or equal to zero and
less than or equal to <c>MaxRandomInt</c>. | {
Debug.Assert(randGen != null, "StaticRandom is not initialized yet.");
var r = StaticRandom.Next(0, int.MaxValue);
var k = (double)maxValue / int.MaxValue;
Debug.Assert((int)(k * r) < maxValue);
return (BigInteger)(k * r);
} | 0 |
91f842e0dc59b194404d6a0836ebba20 | 8fb35a3236aa73d6fc3f798767bfc1a9 | Separate objects after inter-object collision | namespace SimplePhysicsAndCollision
public class MovementManager
public bool SeparateCollisionObjects(IPhysicsObject physicsObject, ICollisionObject collisionObject)
{
Rectangle physicsRectangle = IntersectionRectangle(physicsObject);
Rectangle collisionRectangle = IntersectionRectan... | 1 |
6d9602259b83933b814f6eb64e66fd79 | f6879ea39ccff14e6c4350f25e643979 | @brief Get ASCII representation of stored system time | CheckTime(timeptr);
sprintf_P(ascTimeBuffer, PSTR("%s %s %2d %02d:%02d:%02d %04d"),
__day[timeptr->tm_wday], __month[timeptr->tm_mon], timeptr->tm_mday,
timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec,
timeptr->tm_year+1900);
return(ascTimeBuffer);
} | 1 |
2b6d086fa0fd9a7fbb2ad04188cee76a | 8ce28313652a2d5e0e9238d48187ba78 | Action triggered when click sort by last name | public partial class frmMain : Form
private void mnuViewLastName_Click(object sender, EventArgs e)
{
clsSortLName comparer = new clsSortLName();
mClients.Sort(comparer);
displayData();
} | 1 |
1a72223b5b6741e799c429e3ba1a2bea | 280aaddea7f0e1b3b52f84a58d501590 | Get cells from a worksheet with the following column headers:
"equivalentClass"
"subClassOf"
"propertyDomain"
"propertyRange"
"Definition"
"DefinitionReference_index"
Where "DefinitionReference_index" points to worksheet2 column headers:
"ReferenceName"
"ReferenceLink" | from mhdb.spreadsheet_io import get_cell
from mhdb.spreadsheet_io import get_index2
equivalent_class_uri = get_cell(worksheet, 'equivalentClass', index, exclude, True)
subclassof_uri = get_cell(worksheet, 'subClassOf', index, exclude, True)
property_domain = get_cell(worksheet, 'propertyDomain', ind... | 1 |
15eaac4d86d67b1b183e407afe756228 | 8cbd65bcd4b8822e05ba823ab7c4a678 | Returns a enumerable with two values. | namespace LanguageExt
public static partial class Prelude
[Pure]
public static IEnumerable<T> seq<T>(ValueTuple<T, T> tup) =>
new[] { tup.Item1, tup.Item2 }; | 1 |
bd3c40b7c927c76ca6eb1db0ab1eed5d | 92409a25caa599b534e84654a6716c3f | Accessor for whether the keys are embedded. | BOOL
CFilterPinDescriptor::
IsEmbedded
( void
)
{
return m_IsEmbedded;
} | 1 |
e2744da4db2efb60dfdb7293432823c6 | 229dc9b2a5206e37a7d3b5c0f75b6fad | Instead of configuring everything inline (see commented out section below) we are going to use
a combination of Linq and reflection to process our mapping configuration from our view models. | namespace SupportTicketApplication
public class MvcApplication : System.Web.HttpApplication
private void ConfigureAutoMapper()
{
Mapper.Initialize(config =>
{
config.CreateMap<Ticket, TicketIndexViewModel>().ReverseMap();
config.CreateMap<Ticket, Ticke... | 0 |
172a4b53721c78da5ce8bb4f1eb95c1a | 29d9524bb64ac4c00860eb61ffd5249b | 按显示顺序获取打印页面的字段列表 | public abstract class BasicListMB<Bean extends AbstractEntity> extends AbstractMB
public abstract List<ColumnPrint> getColumnsToPrint(); | 1 |
a5c5de4145b17fd4141592f9422fa784 | e976cc871cb9a14abd8c0eb288c8d9b1 | 查找是否是保留字 | def check_reserve_word(str):
reserve_dict = {'if':1, 'then':2, 'else':3, 'do':4, 'while':5,
'for':6, 'int':7, 'float':8, 'char':9, 'boolean':10,
'and':11, 'or':12, 'not':13, 'true':14, 'false':15,
'null':16}
return reserve_dict.get(str, -1) | 1 |
7b592acdbeafdcc93120c21d39a0cf82 | af5b84031dbe85fb4774d51db1ca8323 | Returns the instdDrctPty | {
RCI_I05_PRDCTD ret = null;
try
{
ret = (RCI_I05_PRDCTD) this.get_Renamed("PRDCTD");
}
catch (NuGenHL7Exception)
{
throw new Exception();
}
return ret;
} | 0 |
f4c9f450621ef6eab737df078a13e90e | dd32f1db201b978b40bf338a72d31315 | Converts the EnhancedPath into a Path2D.Double. | public PathIterator2f logical2pixel(PathIterator2f p); | 0 |
f1fc0e524d2d741308e68ac21e47b2ca | 3992fd82ffaefbbc2736bb65ae9046a7 | Various pre defined period types. | {
$dtObj = new DateTime('2020-01-01');
return [
[ '2020-01-01', null, '2020-01-01' ],
[ '2020-01-01', 'YmdDate', '2020-01-01' ],
[ '2020-01-01', 'YearPeriod', '2020' ],
[ '2020-01-01', 'HalfYearPeriod', '2020H1' ],
... | 1 |
1669a5f05b49153d958d293397cc3298 | 15e1d0e0be69d29f621269650954298f | Appelé par OpenComCommand, vérifie si le port est ouvert | namespace GSM_NBIoT_Module.classes public class STM32L412CB_Controller : Controller
public bool PortIsOpen() {
return serialPort.IsOpen;
} | 1 |
2d305b0e7ce2273b22bce39148f9e67a | 3c0aaa010dab48196378439e230c715d | 在欢迎界面停留1500毫秒 也就是1.5秒 | class SplashActivity : AppCompatActivity()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Thread.sleep(1000)
startActivity(Intent(this,HomeActivity::class.java))
finish()
} | 0 |
708a546dc1043c70d08ffa1c1f8f12e3 | c003b4e337e55d59681e166a38b9cbc5 | An abstraction for reading and parsing Apache log files. | class LogcatParserUtils(object):
def __init__(self, device):
self._device = device
self.__logcat_file = None | 0 |
b9f7e590053eb8180e99d3539e9c983d | b52e60b34a5ddb990ad9158c52f0e842 | <para>Activates all <seealso cref="JobDefinition"/>s of the provided process definition key.</para>
<para>Note: for more complex activate commands use <seealso cref="updateJobDefinitionSuspensionState()"/>.</para> | namespace org.camunda.bpm.engine
void activateJobDefinitionByProcessDefinitionKey(string processDefinitionKey); | 1 |
f27a8b27257be03ca2eaf083c64b6d56 | 02c3eaf30ca3de784067c7640ba29de7 | Добавляет перевод аннонса | namespace GI.Admin.Contracts.Managers
Response<string> AddTranslation(AddTranslationRequest request); | 1 |
b89248029bcaa08b12723847b3a71b62 | 43fe55336db64a5045552b08588fc68f | Returns the map for a given source for the extended model. | class Synchronizer
public function getMapModel(string $name = ''): Map
{
if (empty($name)) {
$name = rtrim($this->name, 's');
}
if (isset($this->maps[$name])) {
return $this->maps[$name];
}
$className = 'App\\Integrations\\Comarch\\' . $this->config->get('connector') . "\\Maps\\{$name}";
if (isset($t... | 1 |
c37fdfbda444209657028c73d6bcd146 | 91ee5f8c6e00084ce1fcebe3a8195aa6 | 同じ名詞の連続 | return token
.filter((t) => {
return t.pos === '名詞' && t.surface_form.length >= 2
})
.map((t) => t.surface_form)
} | 0 |
7b087379748c978af364b84d795393f8 | b12718d852facb26054f10278c865678 | 保存温度基础数据 | @Controller
public class SelController
@RequestMapping(value = "/sel/saveBaseval")
@ResponseBody
public AjaxModel saveBaseval(AjaxModel model) throws Exception {
return selService.saveBaseval(model);
} | 1 |
1382eae291d46bcd0da298b67e9ac294 | 8c056f0a9e62bafc98420713b1ec418d | Get initial y position for selection range | public class ScreenshotBoundsManager
public Rect getInitialEntryBounds() {
return calculateClipBoundsBelow(mCurrYStartPosition);
} | 0 |
e98fc799249eacc6d7799568f9359238 | e879e5954dd40a139af32a0ddb7f24d2 | If the current user is the guild owner, then it can manage itself. | class LumaAPI
canManageGuild(permissions: number) : boolean {
let perms = convertPerms(permissions)
return perms.MANAGE_GUILD
} | 0 |
84dfcd2bbcc175aad82a96b19945d5bc | 57f977bc2d55e5439950c8f45f94291e | only allocate + load if the playhead has changed, otherwise return cached copy | export class TrackView
get tPlayhead() {
if(this.playheadOffset == null)
return null
else
return this.audioctx.currentTime + this.playheadOffset
} | 0 |
7a7358bba93fe82206099e5cea745061 | ef000e22c29bf218f9ebafd5396cf863 | 设置全局log 打印带行数 | func init() {
flag.Set("alsologtostderr", "true")
flag.Set("log_dir", "./log")
flag.Set("v", "3")
flag.Parse()
bkaiguan = make(chan bool)
if initNet() {
return
}
panic("链接服务器失败!!!")
return
} | 0 |
2c334b77fd8a0daa50ba9aee8f516516 | e8abd0f8ef35b70aa83d0f4d8391b0dc | If we have a connection string, construct our context with it,
if not, use the new constructor | abstract class ConnectContext
public static function create(array $data = [])
{
$requestContextData = RequestContext::getContext();
if (!static::get() && $fd = ($requestContextData['fd'] ?? null))
{
static::use(function ($contextData) use ($data, $fd, $requestContextData) {
... | 0 |
1fe2622dfa1bc1fb897328df64bf252c | 4a5a467017f672a021e613cd7c1ce056 | 작업중인 행동 규칙 화면을 갱신합니다. (블록 코딩 부분) | {
WORK_INSTRUCTION_STATUS oWI;
oWI = this.oSimDataStore.dViewWorkInstructions[ContID];
if (oWI.JOB_ID != null && oWI.JOB_ID.Length > 0)
return;
long JobID = DB_ECS.Instance.GetNewIndexNum(StatusEnums.IndexType.JobID);
long TaskID = DB_E... | 0 |
0cc87bfd5b278eeeaa59625641a2e4c9 | f081681adbb3277e259cd15d7e0b7596 | 把所有的金额 除以100 | namespace Library
public class FormatHelper
public static decimal GetAmount(int amount)
{
return (decimal)amount / (decimal)100;
} | 1 |
4cafb9d805860473d8a6e725d240ca9b | 0a88661d15d01265d54beb512509f534 | @brief 线程变量初始化函数 | void initialize_flag()
{
pthread_mutex_init(&thread_flag_mutex, NULL);
pthread_cond_init(&thread_flag_cv, NULL);
thread_flag = 0;
} | 1 |
b3d9bd8326f693c0e839f688260c06e8 | b2be26baae5eac6d5cc87c68a1ae529a | 给员工添加表彰信息 | public void awardUpdate(Employee emp); | 1 |
0cb6de5c04f71957c6cca4e4b1fcbd3a | 88b9e51554f20567039728bcf0fedd79 | ParseString text/template for a string. Fails on error. | template, err := template.New("test").Parse(text)
checkFatal(err)
buff := bytes.NewBufferString("")
err = template.Execute(buff, data)
checkFatal(err)
return buff.String()
} | 1 |
12bc98a18b6f39f0a2f3dd0f81a9cffa | c22c64d052a3fd36a45aad158cc89a38 | Recalulate and replace existing Checksum on all xml files
Typically used by installer after install/modify | namespace SobekCM.Resource_Object.Divisions
[Serializable]
[DataContract]
public class Division_Info : XML_Writing_Base_Type
public void Clear_Checksums()
{
List<abstract_TreeNode> pageNodes = physicalDivisionTree.Pages_PreOrder;
List<abstract_TreeNode> fileNodes = downloadDi... | 0 |
fbbc87f26134478cca86a005c539d2c5 | 838a81dd4625c227f8a7350969cf24e6 | real numbers are either in the true or false range
according to the semantics of mathbuild. This method
returns true if this number represents true, and false
if this number represents false. | public class Engine public class Num extends Node
@Override
public boolean isTrue() {
return this.val != 0;
} | 1 |
c27ace427d723cf1cdc4cd1cd0740826 | 96c350896ff4849d6b9c08efcd5e98d7 | Set a new subscription status for this member, must be either subscribed, unsubscribed or cleaned | class MailChimpMember extends \App\Database\Entities\MailChimp\MailChimpMember implements \Doctrine\ORM\Proxy\Proxy
public function setStatus(string $status): void
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setStatus', [$status]);
parent::setStatus($status);
} | 1 |
c3e10db11a8a88bd214e6ecb373fbe15 | b7a977e88d956c0b217fd998c22cfcaa | Setter for <code>TEXTSITES.NAME</code>. | {
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.XmlString target = null;
target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NAME$20, 0);
if (target == null)
{
target = (org.apache.xmlbea... | 1 |
3ff2c1b5ea1cfcdf32d3be6b6c713bd0 | cf9f7f80b90c2bb959c2768eab09cacf | Map sequence references to equivalent bismark indexes | def pacbio_index_bam(merged_bam):
pbindex_path = '/slipstream/SMRT4/SMRT/smrtcmds/bin/pbindex'
subprocess.call([pbindex_path, merged_bam]) | 0 |
f1c83a1a669cebf57de1be0e86695bb7 | 7008b1f474a3e0b6263db9cc74b977be | Print out implementaion-specific info on line width granularity and width. | {
printf ("%s v%d.%d.%d [%s]\n",
GxB_IMPLEMENTATION_NAME,
GxB_IMPLEMENTATION_MAJOR,
GxB_IMPLEMENTATION_MINOR,
GxB_IMPLEMENTATION_SUB,
GxB_IMPLEMENTATION_DATE) ;
char msg [LAGRAPH_MSG_LEN] ;
GrB_Matrix A = NULL ;
LAGraph_Graph G = NULL ;
LAGraph_TRY (LAGraph_In... | 0 |
5bfa9402d87385a833a80b836196cbae | ca5ccabf92c9cb0554f95210db7efd78 | Haetaan sudokusta koko rivi listana, rivi-indeksin mukaan | thread Sudoku::getRowThread(int row) {return thread(&Sudoku::checkRow, this, row);} | 0 |
bf076c607bfd3bf12fc6537a67d79408 | 8f68d765388926236d1747f3d7a45ce7 | 取消下载按钮点击事件 | namespace UIThreadTest
public partial class MainForm : Form
private void OnButtonCancelClick(object sender, EventArgs e)
{
_cancelDownloadClicked = true;
} | 1 |
1b0dafbcea1ad476727941bac4904beb | 63460e9055fb02eee5f9152a20fed47c | Returns a value indicating if the date/time value is valid for SQL Server. | namespace Tripous
static public class Simple
static public bool IsDateTimeStrict(this SimpleType Value)
{
return (Value == SimpleType.DateTime);
} | 0 |
7e7415e1c30d4498afcb3bb1e761be95 | 3e4aeaac54e6023d7bc1b344f5395484 | @brief This function initializes the event counters in L2 Cache controller
with a set of event codes specified by the user.
xl2cc_counter.h. | int evt_init_rcnp()
{
return 0;
} | 0 |
a06bbf9002194c09e4c35a712309ab4e | f25655d86f276126592b09ed8419a914 | https://github.com/KieranWynn/pyquaternion/blob/master/pyquaternion/quaternion.py#L965
Get the 3x3 rotation matrix equivalent of the quaternion rotation.
Returns:
A 3x3 orthogonal rotation matrix as a 3x3 Numpy array
Note:
This feature only makes sense when referring to a unit quaternion. Calling this method will impli... | Q = self.orientation
q0 = Q[0]
q1 = Q[1]
q2 = Q[2]
q3 = Q[3]
r00 = 2 * (q0 * q0 + q1 * q1) - 1
r01 = 2 * (q1 * q2 - q0 * q3)
r02 = 2 * (q1 * q3 + q0 * q2)
r10 = 2 * (q1 * q2 + q0 * q3)
r11 = 2 * (q0 * q0 + q2 * q2) - 1
r12 = 2 * (q2... | 1 |
efb1eec7d60499cb5249df603cf1186b | afdca576f652633b28ab30755c8dfdeb | Exibe tela para realizar transferencia entre contas | class TransfersController extends Controller
public function create()
{
return view('transfers.createByAccounts');
} | 1 |
6e0a8da8ee551bb0b823693481d0442c | 1f33aa91879923e4c62488e86cb3be2f | 设置浏览对话框的初始路径为桌面 | class MainWindow(QMainWindow, Ui_MainWindow):
def set_default_values(self):
if sys.platform.startswith('win'):
self.lineEdit.setText("E:\\EricProjects\\")
self.comboBox.setCurrentIndex(0) | 0 |
1d00ea103ef496273b4740e2c982f4b2 | 90b021bb4be6f1d82b8baf9c0ab4a824 | Returns the Amazon resource name (ARN) of the bucket to which data is exported. | class BotS3BucketLogDestination(dict):
def s3_bucket_arn(self) -> str:
return pulumi.get(self, "s3_bucket_arn") | 1 |
f2325698f1ac8b129aa40ef82b937955 | c2b96487a8485bc0484a1d9cb27ac2ed | New creates an instance of resources.Volume | class DataApi
def create_volume_post(create_volume_param, opts = {})
data, _status_code, _headers = create_volume_post_with_http_info(create_volume_param, opts)
return data
end | 0 |
d64597d0509be9d1db83f26f534dba3d | 2a496c999c02f348bca4fdc156f6e0d7 | Plays mouse enter sound. | [RequireComponent(typeof (BoxCollider2D))]
public class ButtonSoundManager : MonoBehaviour
public void OnMouseEnter()
{
audioSource.PlayOneShot(hoverClip);
} | 1 |
47e21b677cb38d2ea73186c2247955ae | c813a5779dc90e4f4cb2337487d50134 | 测试读取单行效率 | function test_io() {
$fp = @fopen(PHPSELF, "r");
$timeStart = gettimeofday();
for($i = 0; $i < 10000; $i++) {
@fread($fp, 10240);
@rewind($fp);
}
$timeEnd = gettimeofday();
@fclose($fp);
$time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"];
$time = round($time, 3)."秒";
re... | 0 |
5e4396e6630b56e491b95ff95a166d6f | dfd337b58a861708ae6b3258c04aa7da | Метод отвечает за физическое сохранение файла на сервере. | class File
public static function save($file, $folder)
{
if(!$file['name'])
return False;
$parts = explode(".", $file['name']);
$file['name'] = Transliter::getSeo($parts[0]) . "." . $parts[1];
$path = self::getPath($folder, $file['name']);
move_uploaded_file($file['tmp_name'], ... | 1 |
bc76738ad0ce19c6438a2cea83db4594 | b478c7e2ebeb4de2e97c8003ff4a6794 | Get memory allocate count for test | {
struct memoryList *current = head;
int count = 0;
while(current != NULL) {
if( !(current->alloc)) {
count++;
}
current = current->next;
}
return count;
} | 0 |
81b232c19338586cdf969e32061a2367 | 06e92822f9bee93fb419534029959563 | Adds PopupMenuListener to combo box to listen to the events fired by the
combo box's popup menu containing its list of items | public class BasicComboPopup extends JPopupMenu implements ComboPopup
protected ListDataListener createListDataListener() {
return new ListDataHandler();
} | 0 |
4e698c8eb561633eb3a0c9c62a1cc219 | 9036c6d25ff069782eed057780f20f4c | Set Sales Rep. | public class X_LVE_CloseX extends PO implements I_LVE_CloseX, I_Persistent
public void setSalesRep_ID (int SalesRep_ID)
{
if (SalesRep_ID < 1)
set_ValueNoCheck (COLUMNNAME_SalesRep_ID, null);
else
set_ValueNoCheck (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
} | 1 |
72dac3336d58e82c1a168aa223bb81d5 | f6aff6c2cc6497b0a12eae40d8bab2fd | 根据历史统计信息记录从一个 zone 到另一个 zone 的概率
从一个 zone 出发的所有概率只和 <= 1 (没有 normalize 到 1) | graph = self.graph
p = self.p
q = self.q
unnormalized_probs = []
for dst_nbr in sorted(graph.neighbors(dst)):
if dst_nbr == src:
unnormalized_probs.append(graph[dst][dst_nbr]['weight']/p)
elif graph.has_edge(dst_nbr, src):
u... | 0 |
0d2da5fdd261ea7351b89be5500b45cb | 2c5c541e49e64abf903fedb4b7757b89 | From: https://pandas.pydata.org/pandas-docs/stable/user_guide/cookbook.html | def chunk_df(df, size):
return (df[i:i + size] for i in range(0, len(df), size)) | 1 |
673b3cd781be7150cb6cdb92612a8a95 | 334239ac9c41d2d7344721665679580a | 返回定位信息,纬度/经度/高度 | def getLoc(headerLib):
loc=[]
loc.append(float(headerLib['latitude']))
loc.append(float(headerLib['longitude']))
rad=float(headerLib['radius'])
return loc,rad | 0 |
7d15e451a5b7ef12ec8fe4c6e6e4efa7 | 3e2ccf87bf7229c18633da8c48e7a8f5 | Finds out what row the coordinates are in with a reversed perspective | public class Localization
private int switchRow(int row, int column) {
int movedPosX = map[row][0][0]
+ (int) (30 * Math.sin(((1 - column) * Math.PI) / 2));
int movedPosY = map[row][0][1]
+ (int) (30 * Math.cos(((1 - column) * Math.PI) / 2));
int wantedRow = 0;
for (int r = 0; r < 12; r++) {
if (map[... | 1 |
cb5fcbf89210b234769c56c934ad8bc0 | dc071478011c51c194ee3f24b713ee38 | réinitialiser les éléments des frais forfaitisés | FraisMois fraisMois = Global.listFraisMois.get(leMois.getAnnee()*100 + leMois.getMois());
fraisMois.getLesFraisForfaitModifies().clear();
Serializer.serialize(Global.listFraisMois, MainActivity.this, Global.filename);
} | 1 |
de3677682df85ea5d9be50d91b787d3e | e15cb43e58e4621684791eac2aec86a5 | @brief Updates the range allocated for the TCAM manager. | (
IN GT_VOID *tcamManagerHandlerPtr,
OUT CPSS_DXCH_TCAM_MANAGER_TCAM_TYPE_ENT *tcamTypePtr,
OUT CPSS_DXCH_TCAM_MANAGER_RANGE_STC *rangePtr
)
{
PRV_CPSS_DXCH_TCAM_MANAGER_STC *tcamManagerPtr = NULL;
CPSS_NULL_PTR_CHECK_MAC(tcamManagerHandlerPtr);
CP... | 0 |
5dd6ee0beaa2645ff29a4e453ba8a7a3 | d20f05312f65c91d632d6bb1c9c8230b | Sets the value of the fkVocAttivitaVigilanza property.
allowed object is
{@link DSchedaVigilanza.DAttivitaVigilanzaTrasferimentoProprieta.FkVocAttivitaVigilanza } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"dateRichiesta",
"dateAutorizzazione",
"textDescrizione",
"textMotivazioni",
"numeComplessivoUnita",
"numeMetriComplessivi",
"fkVocTipoContenitoreScarto",
"fkVocTipoUa",
"numePeso",
"textNote"
})
@XmlRootElem... | 0 |
47aa672c62f3828c0baa33f866ea15ae | 9e5492c1d5b1cfb356280c76b1e7c047 | Write key pem (necesary to connect with IoT Core) in NVS (ioled_data partition) | auto nvs = Nvs::get();
if (__device_id and nvs) {
auto service_url = nvs->getUrl();
if (service_url.length()) {
String time = ctime(&_now);
String id = String(__device_id, DEC);
std::array<uint32_t, 4> icounts({__count1, __count2, _... | 0 |
b8527691c21103b52d56ea90abbad2c4 | a03cb3dc7ae86091b2fa2a2b55b4d56b | Marca la casilla y retorna el nuevo tablero | void marcadoTab(int filRob, int colRob, char direction, char matrix[][columnaTab+1]){
for (int i=0; i < filaTab+1; i++){
for (int j=0; j < columnaTab+1; j++){
if (i==filRob && j==colRob) matrix[i][j]= direction;
else matrix[i][j]=' ';
}
}
} | 0 |
8ca2ebed00a9121808e943c12f663c3b | 78997c1bc589814079f214503db86e4a | Pretty print serialized job. | class JobDTO(object):
def to_str(self):
return pprint.pformat(self.to_dict()) | 1 |
ceed2754325c66e724ebf058119bf8b2 | 15be855359113809ea9d805c6d6093e3 | 餐馆列表 | class OrderController extends ClientController
function menu(){
if (IS_POST) {
if(I('post.r_ID') == ""){
$this->error('Something Wrong!', U('Client/Restaurant/lists'));
}
$r_ID = I('post.r_ID') / 10086;
$rst = $this->update_curRstInfo($r_ID);
... | 0 |
458784d0b5793fb78cd4d269400b940e | f7cc0db4f4c0f106ac7d20165a5e32bc | Test gesd on real data with standard. | f = sas_gen.OMFData()
f.ystepsize = 3
omf2sld = sas_gen.OMF2SLD()
omf2sld.set_data(f)
sld = omf2sld.output
sld.set_sldn(0.1, False)
model = sas_gen.GenSAS()
model.set_sld_data(sld)
output = model.run([[0.01, 0.03], []])
analytical = np.arr... | 0 |
be590472ad864899b25fc9501f664bff | d2a1353e7bad0f57c7cde36a1b479dd7 | Changes filter so that GetFirst() and GetNext() will return saved games | {
c4_View SavedGamesView = GetView(ViewTypeStr(V_SavedGames));
const DWORD dwSavedGameCount = SavedGamesView.GetSize();
for (DWORD dwSavedGameI = 0L; dwSavedGameI < dwSavedGameCount; ++dwSavedGameI)
{
if (this->bLoadHidden || p_IsHidden( SavedGamesView[dwSavedGameI] ) == 0)
this->MembershipIDs.Add( p_SavedGame... | 0 |
a1ea8ba537d21b9efdb5f332e40fd2d7 | f14ed43cb171e6cead92e1f2b5598e8b | 设置SmartSelect选择条目 | setSelectInit(obj);
var cnt = 0;
if(optionName != null || optionValue != null){
obj.options[0] = new Option(optionName, optionValue);
var cnt = 1;
}
if( arrResultData.length > 0 ){
for(var i=0;i<arrResultData.length;i++){
var name = arrResultData[i]["name"];
var code = arrResultData[i]["code"];
obj... | 1 |
0e72458a17b323f51d32e132cc67e6be | fc4304bb0a70ab7a7cb435a01c5ce97c | notify the renderer that we want to change the encoder's state | namespace FTI.Trialmax.Encode
public class CWMEncoder
public void OnStateChange(WMENC_ENCODER_STATE eState)
{
} | 0 |
76a90a153ba56360c2d09d04cc112325 | 22a1bf4504eeec3506b978092e810bf6 | 页面中平滑滚动 | function move(amount) {
document.documentElement.scrollTop = amount;
document.body.parentNode.scrollTop = amount;
document.body.scrollTop = amount;
}
function position() {
return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop;
}
const start ... | 1 |
694af85d1b14cc1f454079b9dd46c4a1 | 94a42d1537f068f18894ab4883ec7f29 | u'''获取表格中的所有行对象 | result = []
rows = self.get_lines()
if rows != None:
for i in range(rows):
col = self.table.row_values(i)
result.append(col)
return result
return None | 1 |
acf12b0648112129b006cf9a2ff2108a | ba8d930a634fc35f76d5fa3faad98449 | 显示游戏通关界面 | showGameDone(){
Util.showLoading();
cc.director.loadScene('QaDown',_=>{
});
} | 0 |
ae51772af4aab53ef0ad77e8193b1cad | a73061eeb6c318977657058de022766b | Donne la position du boss | {
var xr = -2.5f - boss.transform.position.x;
var yr = 3f - boss.transform.position.y;
if (boss.transform.position.x > -2.5f)
{
if (xr < -3.5f)
{
x = Random.Range(0f, -3f);
}
else if (xr < -2.5f)
{
... | 0 |
a5960a3b5459003b0e905d5755c6c7e4 | 387d6ebd023624f3a7d9514412bc536e | 推出一副52张的新牌 | String[] colors = {"♥","♠","♣","♦"};
String[] numbers = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
String[] kings = {"大🃏","小🃏"};
int index = 0;
for(int i = 0 ; i < numbers.length ; i ++) {
for(int j = 0 ; j < colors.length ; j ++) {
poke... | 1 |
41116761b369adb9b28a56072a63b93b | 400d7c70f3fc82f9570f4bedda7f5870 | Adds a word to the word list and sets the current score
the word to be added | void insertWord(){
} | 0 |
3b9ebed940c891feda5e2462f4772f45 | bbfbca9c5665c8e6c9fd258eeb06c892 | Valida que haya periodos para mostrar en pantalla | @ManagedBean(name = "notasRecuperaciones")
@ViewScoped
public class NotasRecuperaciones implements Serializable
public boolean isBanderaPeriodos() {
return banderaPeriodos;
} | 0 |
61dbd96d6bac2df602e082be2c693696 | c058b81abc2e0e754508d0bcf7037070 | function gets the subcategories of the current $category_id and puts them in the category_count_array and iterates for each
returns the count total for itself and its subcategories (and an array of the contributors to the count) | class categories_parser_v4 extends categories
function fetch_recursive_categories($parentid = 0, $level = 1, $ctypefield = '', $ctype = '', $dbtable = '', $seotype = '', $detailpage = '', $showcount = 1, $slng = 'eng', $cidfield = '', $cidtitle = '', $iscatmap = 0, $subcatdepth = 0, $displaycolumns = 3, $itemspercolumn... | 0 |
8b06b8571f006b16b95e5bbdd9639c67 | b47cf33fc73249e32af5922f57df0974 | Get file paths with missing frame-level features. | return f'Unable to {task} {dataset} filenames text file' \
f' (i.e. {filenames_frame_txt_filepath}).' \
f' Please make sure it is downloaded and not corrupted.' | 0 |
6937b46212d9deace03b2db85d349b0d | d7fe38430aa724148d884abb3a8d5f37 | Transforms the input argument channels to a list of integers. | outs = [outputs[signal] for signal in outputs]
return [[int(signal[i]) for signal in outs]\
for i in range(len(outs[0]))] | 1 |
cf27dd7979fe2c28adf5bc21d2795774 | b4ccf8dfefd062c2b7951defa2d1811e | 生成json格式参数
<p/>
将 id,1,limit,9类似的字符串转换成json字符串 | public class BaseBean implements Serializable
public String getToStringParam() {
return ", limit=" + limit +
", offset=" + offset +
", queryBeginDate='" + queryBeginDate + '\'' +
", queryEndDate='" + queryEndDate + '\'' +
", orderBy='" + orderBy + ... | 0 |
2c23f6e68abac9625db31ed81688f3d8 | 9ca3802863e1beace72d1605644cf261 | 表单字段列表 | {
return [
'key' => '表单分类(来自form_category)',
'content' => '表单配置项目值',
];
} | 0 |
3763fedca66a449c81e4d4d3cb5e9ef6 | cae191112d5a1802f5821f6ebdf2a10a | Funcion para encontrar el area de una esfera | public class Funciones
public static double sphereArea(double radio){
return 4 * Math.PI * Math.pow(radio,2);
} | 1 |
f5056d418fa62ac9231617633eeb46fd | f838b8831f96bb4e3eb7877326944e82 | Set Database type of the source instance. Valid values for database migration: `mysql`, `redis`, `percona`, `mongodb`, `postgresql`, `sqlserver`, `mariadb` | public class DescribeMigrateDBInstancesRequest extends AbstractModel{
public void setDatabaseType(String DatabaseType) {
this.DatabaseType = DatabaseType;
} | 1 |
cf961fdbcffd80df359b241d8bba8634 | 5c4f88e642f0314df9428de181fe76a5 | The column index of the nth cell. | function colIndex(cellNumber) {
return Math.floor(cellNumber % 9);
} | 1 |
817d2cc5fdf7bc79d724bdb0dc7a41b5 | 6e49327e25f867c42f3c6f2d2e5bcacc | Returns dictionary with mapping: vertexIndex -> clusterIndex | dict = {}
numberOfClusters = len(centroid)
for i in range(0, numberOfClusters):
dict[i] = centroid[i]
return dict | 0 |
c342d0586956de8f3ee70cc1c961d532 | ea2ecf4fc7c027f83f813b39d2740bb5 | 利用坏字符,计算下一个需要移动的距离 | void BMHBadChar(string &p, vector<int> &badChar) {
for(int i = 0; i < p.size() - 1; ++i)
badChar[p[i]] = p.size() -1 - i;
} | 1 |
154a156644469d92d7ff15ce587db11e | ab114b42fa080677698b3b587091f211 | Sends event to DB to retrieve terms | {
global $wp_query;
$terms = "";
if (isset($_POST["postsearch"])) {
$terms = trim($_POST["postsearch"]);
} elseif (isset($wp_query->query_vars["event_query"]) && trim($wp_query->query_vars["event_query"]) != "") {
$terms = trim($wp_query->query_vars["event_query"]);
}
return $terms;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.