query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1bb1df9be1395c9b649320be690de382 | cedbe93bb65237b59e8f0d5aff7d98f9 | Initializing the JPake Parameters | {
Pk = getParam("Pk");
Q = getParam("Q");
R = getParam("R");
A = getParam("A");
B = getParam("B");
H = getParam("H");
} | 1 |
ec5ba8bbb5ba6657be992d176409ffee | fd0b746b19209e6114ad1a0efec1c50c | get all the twits from the database | class tweets_model extends CI_Model
public function GetTweets() {
$query = $this->db->order_by('id','desc')->get('tweets');
$result = $query->result_array();
return $result;
} | 1 |
7a4febc71a727c270d32577dd37741fa | 8045831427014f27e23fc99d10a6c80b | if someone asks for html, redirect them to the home page, we only serve json | def catch_all(path):
if app.debug:
return requests.get("http://localhost:8080/{}".format(path)).text
return render_template("index.html") | 0 |
dc6ded8c15552f23d2e6d039bc637e04 | c9e166329195cc1543c4421bbc48cb9b | 把excel表写入到数据库(附加到数据库表末尾) | db=DB_ENGINE.connect()
if file_path_name:
try:
data_to_write.to_sql('value',db,if_exists='append',index=False)
if os.path.splitext(file_path_name)[1]==".xls" or os.path.splitext(file_path_name)[1]==".xlsx":
shutil.move(file_path_name,MOVE_RECORDED_EXCEL_TO)
... | 1 |
e8448b73d5331abdf5e942403d999924 | d16b7e90d8bbed4bb3df103af8b0bc1b | sets all squares in the delta field to the specified value | public class DataTilesFragment extends Fragment public class TilesAdapter extends RecyclerView.Adapter<TilesAdapter.DataTilesHolder> public class DataTilesHolder extends RecyclerView.ViewHolder implements View.OnClickListener
public void setQtyDelta(Integer qty_delta) {
this.qty_delta.setTex... | 0 |
03a7c5ef90b951c0e3bb74e74975352c | ca455072329e60fedad3f284d70d067c | 查找"材料"操作记录,通过子库最近操作数据模型对象. | {
var filter =
string.Format(
"workid in (select max(w2e.workid_r) from wmswork2entity w2e inner join wmswork w on w.workid = w2e.workid_r where w2e.work2entityentity = '{0}' and w2e.work2entitykey = '{1}' and w.operationcode_r = '{2}')",
entit... | 1 |
57c1fbaa1b754481e24e92a3bf1ebafe | e17c150c0221217ca76f07789773bd24 | Поиск замещаемого элемента по алгоритму FIFO_SC | char elem) {
char find_elem;
for (string::size_type i = 0; i < queue_container1.size(); i++) {
find_elem = queue_container1.front();
if (find_elem == elem) {
queue_container2.push(find_elem);
queue_container1.pop();
continue;
}
queue_container1.pop();
queue_conta... | 1 |
bb7be4c031f5645735dfbe1b7c665a62 | 43fdc08bd3f0b80baba2363f41b0ee42 | Get the HEX color from an XY value | class API
pget(x0, y0) {
let p = this.cr.renderer.getImageData(Math.round(x0) * this.cr.options.scaleFactor, Math.round(y0) * this.cr.options.scaleFactor, this.cr.options.scaleFactor, this.cr.options.scaleFactor).data;
let hex = this.rgbToHex(p[0], p[1], p[2]);
let l = this.palette.length;
... | 1 |
99560ab4ba7a60bf9992d760ae730002 | dd3340d3602c9bf85f0d289fea1a9dba | Converts a numerical label vector into one-hot matrix | def one_hot(y, n_labels):
mat = np.zeros((len(y), n_labels))
for i, val in enumerate(y):
mat[i, val] = 1
return mat | 1 |
104f1473e9ab9f28fb7792a06a8d1f41 | 45f04555ba4a150c65c51d1b987fb641 | Tests that we accept proxy method based on a whitelisted IP using the
wildcard asterix notation. | class WhipTest extends TestCase
public function testValidWhitelistedProxyMethod($remoteAddr)
{
$lookup = new Whip(
Whip::PROXY_HEADERS,
array(
Whip::PROXY_HEADERS => array(
Whip::IPV4 => array('127.0.0.1'),
Whip::IPV6 => array('... | 0 |
b2030af2f265f3eb3fd6a5d30dd24f0b | e5f779ce0859b3ee3e14716e397e772f | This function checks whether the state is the target(goal)
state or not. If it is a target state it returns true otherwise
false. The target state should have all the clauses satisfied. | public abstract boolean meetsGoal(S theState); | 1 |
42fc77b31367a7813e2ee276060820f2 | d6c26357cda01ef2478621a140db9182 | <p>
インポート定義から継承元の取得。
</p> | class Derived extends BaseAnnotationDefinition
public function getFrom()
{
return $this->from;
} | 0 |
9ce1e28efc700b7f7cb5ec9172683108 | 9603401933a3a2cb2c5c3f2b287eef51 | 全部答题记录 | class answer_module extends admin_module
public function history_action () {
$list = RGX\OBJ('quiz_table')->get_all();
$this->assign('list' , $list);
$this->display('answer/history.tpl');
} | 1 |
81f491c19b8eb293762c6d67137aa0d7 | 6a9c39344f366cddbfb3cceedc9f0c97 | (WIP) Random roll-out function, to estimate the wining chance
at current postion. | class Network_UCT_With_Playout(AlphaZeroPlayer):
def rollout(self, node):
winner, terminal_state = node.state.is_finished()
if terminal_state:
if winner == 1:
return 1
else:
return -1
end_game = False
game = node.state.clone()
... | 1 |
86bd220f3f2ff93fbc7c1e145f16a6d1 | 23b18ff9e2439aa04c61bf5558ab9d10 | Asserts that when a field's clean method is called with given arguments,
a ValidationError is thrown containing the specified error message(s).
be contained in the resulting ValidationError. | function cleanErrorEqual(field, message, var_args) {
if (!(message instanceof Array)) {
message = [message]
}
try {
field.clean.apply(field, Array.prototype.slice.call(arguments, 2))
}
catch (e) {
if (!(e instanceof forms.ValidationError)) {
throw new Error('clean() did not throw a Validatio... | 1 |
d1d6881c2498517bdb8b208d2f9ca7ea | 0b6a24c3a17d8b1826ef36e249e8ab13 | A pd.DataFrame() containing all arrivals in the pick-view data marked 'false'.
Duplicate datetimes are removed and the index is reset. | class PickViewData:
def correct_arrival(self):
arrival = self.arrival()
correct_events = self.correct_events()
correct_arrival = arrival[arrival["orid"].isin(correct_events["orid"])]
correct_arrival.reset_index(inplace=True, drop=True)
return correct_arrival | 0 |
9329924b47bf0376537bf914a17080d5 | f1a1d874ba2442d49fc3bb5ccc9f1350 | FUNCTION
DESCRIPTION
Draw a vector font by the ABM decoder
PARAMETERS
offset_x [IN] x offset
offset_y [IN] y offset
abm_header_ptr [IN] ABM header
font_data [IN] font data
RETURNS
void | {
gdi_handle dst_layer_handle, src_layer_handle;
gdi_handle orig_src_layer_handle = GDI_NULL_HANDLE;
MMI_BOOL force_src_layer = MMI_FALSE;
S32 width, height;
gdi_layer_get_active(&dst_layer_handle);
gdi_get_alpha_blending_source_layer(&src_layer_handle);
gdi_image_abm_get_dimension_mem(abm_h... | 1 |
538a9730e999b1ff15587cdcdb841899 | 0a379544344415aeed872c9e7225ce3e | Formats the ZIP Code inputed to its expected format | function formatZipcodes(slcspData) {
slcspData.forEach((slcsp) => {
let zipcode = slcsp.zipcode.toString();
while (zipcode.length < 5) {
zipcode = `0${zipcode}`;
}
slcsp.zipcode = zipcode;
});
return slcspData;
} | 1 |
078983a917d39ed2cb4582627036823f | 42f659a5debf5920d6ce095163ade328 | Defines the profile attribute as system_name/profile_name | class SystemProfileResource(SecureResource):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._logger = logging.getLogger(__name__)
self._param_schemas = (
SystemProfile.get_schema('parameters')['definitions']) | 0 |
7cf33cc4e77b4b82fd34852cc78f1b33 | d947cd8ecfdf02260f4c415f714dc937 | Update a linkifier
Update a [linkifier](/help/add-a-custom-linkifier), regular expression patterns that are automatically linkified when they appear in messages and topics. `PATCH {{ api_url }}/v1/realm/filters/{filter_id}` **Changes**: New in Zulip 4.0 (feature level 57).
<table summary="Response Details" ... | namespace Org.OpenAPITools.Api
System.Threading.Tasks.Task<ApiResponse<JsonSuccess>> RemoveLinkifierWithHttpInfoAsync(int filterId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); | 0 |
d151dd80e9f0f8d77d3ebdefadbc06e5 | 34573e4ba0a478f1f0eab4f45cff5e6e | '
Automatically retrieve the lecture on initialization. | def lecture(login_user):
from models.lecture import Lecture
_lecture = Lecture(professor_id=login_user.id, name="SWE", lecture_code="12364")
_lecture.create()
yield _lecture | 0 |
4e81b1e38dc2b18902aad44cfe689531 | ca39569c07ac5e7d381c0e55779e1dd2 | 檢查帳號.名稱是否重複,並回傳最後一筆資料id | class Transportation_Ajax extends MX_Controller
public function check_cusdata_name_and_user_id() {
try {
$account = $this->input->post('Account', true);
$UserID = $this->input->post('UserID', true);
if ($UserID != '') {
$user_id_count = $this->TransportCpyModel->check_user_id($UserID)->ro... | 0 |
23073a0aa781d4ad6000a05155e87b81 | 6067b8d334c26b6e99d1c792ce9fc1b8 | 获取当前日期,用于保存文件前缀,格式为yyMMddHHmmssSSS | public class DateUtil
public static String getDateFileName(){
Date dt = new Date(System.currentTimeMillis());
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
return sdf.format(dt);
} | 1 |
e08694a532c5329fbb191285464459b6 | c0b58127f933ec2456ccf6a160ee657c | 直接以密钥来签名,事先从证书拿到密钥,约定密钥算法为RSA,加签算法为SHA256withRSA | public class RSAHelper
public String signSHA1WithRSA(String content) throws Exception {
return sign(content, SHA1WithRSA_SIGN_ALGORITHMS, DEFAULT_CHARSET);
} | 0 |
cebc1b10ceeeb084addbcb83735ccdd4 | 4642f14d9d0aed5da01ae6bcae57c2be | Convert `image` from [0, 255] -> [0, 1] floats and then de-mean. | class MSI(object):
def deprocess_image(self, image):
image = (image + 1.) / 2.
return tf.image.convert_image_dtype(image, dtype=tf.uint8) | 0 |
58dbdab472da2fe87feff7c12bd1c74c | 4a0bd9b62dbf63ea8ce8acb02e37e667 | Exchanges the specified <paramref name="authorizationCode"/> for a refresh token and an access token. | Task<TokenInfo> GetTokenAsync(string authCode, string clientId, string clientSecret, string redirectUri = null); | 1 |
367f9a3d12808cedf2bcf7f4d309c3ca | c806f84673cfa5fee762a550d28dafd4 | Getter of the POS tagger. | class PosTagger(object):
def __init__(self, tokens):
self.tokens = tokens | 0 |
6129961ff607e998bc61c9c2ee8e7676 | ec2b4dbd680d9ea7ead6b924b0dcb810 | Returns the set of books checked out to this patron. | public Medium[] getBooks(); | 0 |
e173f93ec53cb97c79e5a5bf250aa9b1 | 32590f2c205c4bd4dabd35ee9d8a0d5b | 根据银联规范格式化MAB
<ul>
<li>所有小写字母转换成大写字母</li>
<li>除了字母、数字、空格、逗号、点号以外的字符都删去</li>
<li>删去所有域的起始空格和结尾空格</li>
<li>多余一个的连续空格,由一个空格代替</li>
</ul>
带有参与MAC预算的域数据的缓冲区,每个参与运算的域之间添加一个字符空格 | public class MarketCodeConvertUtil
public static String transferAll(String paramValue) {
return paramValue == null ? null : FullHalfAngleChange.QBchange(
getSafeSqlInputParam(paramValue)).replaceAll(" ", " ")
.replaceAll(" ", "").trim();
} | 0 |
74d223444c5a2c9a64738d8567a99f61 | 1f7373800e5f2d53bf005a7d0c119746 | Find the job ids of all jobs matching the filter.
The filter argument must be a JSON-serializable Mapping of key-value
pairs. The ``filter`` argument can search against both job state points
and job documents. See
https://docs.signac.io/en/latest/query.html#query-namespaces
for a description of supported queries. | class TriggeredJobBroker(Broker):
def find(self, **kwargs):
return self.api_list_request(self._get_method_fullname("find"), kwargs) | 1 |
68cbb863860250d0b2ea3d8beb0bab0f | 3d16a06a6cdce95618b85554cce110cb | Event handler for the show results button, shows the results for this user | function showResults(response) {
var dropdownResults = document.getElementById('dropdownResults'),
i = 0,
msg = '';
for (i; i < response[1].length; i += 1) {
msg += '<div class="result"><a href="' + response[3][i] + '" target="_top">' + response[1][i] + '</a></div>';
}
dropdownRe... | 0 |
d06cbc3bb853686141618436a1c1e032 | 6f9161d0e7aa941cdce2eaa34e3c6feb | 设置记录本段上报的数据在金融机构自身系统中的更新日期,格式为YYYYMMDD 。 | public abstract class BaseTblOnlConsignInfo implements Serializable
public void setRecUpdTs (java.util.Date recUpdTs) {
this.recUpdTs = recUpdTs;
} | 0 |
c68bdd7a50604c5cc6302ac0b309ca60 | 3d6f253e459b2b0211722c93df47ff39 | Количество строк в таблице процессов. | {
var text = GetTableNodes()[0].ChildNodes[1].FirstChild.FirstChild.InnerText;
if (string.IsNullOrEmpty(text))
{
return 0;
}
return int.Parse(text);
} | 0 |
daf21106147cee773b38ec7238502d10 | 8d9ffba812f477cd126bdd4ae9847d2b | définit les cases du contour jouables, à partir de l'etat du jeux et de mon symbol | liste get_case(CASE board[L][C], COORDS pos, liste list, JOUEUR joueur)
{
COORDS pos2, pos3;
COORDS tab[3];
empty_tab(tab);
add_tab(tab, pos);
list = ajoutDebut(list, tab);
empty_tab(tab);
if (has_ally_next(board, pos, BG, joueur)){
add_tab(tab, pos);
pos2 = next_coord2(pos, BG);
add_tab(tab, pos2);
... | 1 |
5becdb511ed159a8cab8c26f4043c959 | d11293fafe01625bc24778488669dda1 | Reads the given values and sets a notification through an alarm manager | for (int i = 0; i < updateTriggerMilliTime.length; i++) {
Intent timeIntent = new Intent(CurrSongActivity.this, AlarmReceiver.class);
timeIntent.putExtra(FB_LIST_UPDATE_TIME_INDEX, i);
alarmPendingIntents[i] = PendingIntent.getBroadcast(CurrSongActivity.this,
... | 1 |
804ca759c0c043be96d89544aef7a13b | 3c5d2b70ab6fc39722a51e2f66323b20 | handle redirect from BaseSpace's OAuth dance and initiate our BaseSpace client | function officeClickHandler() {
var redirect = encodeURIComponent(window.location.href.split('#')[0]);
webutils.redirect('//www.zendesk.com/app/office-auth?redirect=' + redirect);
} | 0 |
6ce052153566aaee557f331f8ea2f3c6 | ee7706558895d54f905596714b73f65f | Returns the number of related Area objects. | by = request.query_params.get('by')
if not by:
return Response({'detail': _('Missing parameter `by`.')}, status.HTTP_400_BAD_REQUEST)
if by not in self.group_by_related_models:
return Response({'detail': _('Invalid `by` value.')}, status.HTTP_400_BAD_REQUEST)
grou... | 1 |
98afe40d7ec739fedb80f148bc569eda | 8fc0f4e80a67b35e95522335bbb89a4b | r'''Evaluates a polynomial defined by coefficienfs `coeffs` at a specified
scalar `x` value, using the horner method. This is the most efficient
formula to evaluate a polynomial (assuming non-zero coefficients for all
terms). This has been added to the `fluids` library because of the need to
frequently evaluate polynom... | def polyeval_Horner(x, poly_coeffs):
ncoeffs = np.alen(poly_coeffs)
p = np.zeros(np.alen(x))
for n in np.arange(ncoeffs-1,-1,-1):
p = poly_coeffs[n] + (x * p)
return(p) | 1 |
a02c2f4b0273c13d37a38973c9b12008 | 7b5209bdc37266d5c1a3e73fd099cc8a | AJAX异步加载API控制列表 | class ControllerController extends CommonController
public function ajax_controller_listAction() {
$this->parse_login(true);
$controller_file_dir = WEBAPP_ROOT . 'application/controllers';
if (!is_dir($controller_file_dir)) {
exit();
}
$file_list_data = file::readDir($control... | 1 |
4ef860b983adf3aec6ebcabf759ae1a1 | 21e87fb84726576a32c8dd5e563bb36d | Sets minimum length of String representation of date allowed.
0 implies no restriction on minimum length.
0 implies no restriction on minimum length. | public void setMinLength(int length); | 1 |
a1f547418ef264e3f8865f6b06601456 | 47cde3a585254be0a49c8a54d0762740 | 后台启动Activity | interface IActivityManager : IAddOn
fun onStartActivity(baseActivity: BaseActivity) | 0 |
818b2ceb8d1d942ebfdd87d92822c026 | 4904336991ee3cb01b7fea2c63eda8d7 | <p>Minimum total price of a Cart for which a shipping rate applies.</p> | public function getBaseNegotiatedTotalPrice(); | 0 |
4598cace1a9fed7b9f20a5b2567306d0 | db454b9ec4c89d96cebad71b32523830 | envia as vendas processadas para o websocket | export class ListaPedidosComponent
initializeWebSocketConnection(){
$(".buttonload").css("display", "block");
let access_token = this.cookieService.get("accessToken");
console.log("access_token:"+access_token);
this.pedidoService.listaPedidosPendentes(access_token).subscribe(p =>{
... | 0 |
2160311d3b9e5981659ce717f8623464 | 7bfdcaaaa5c8681e909659009cf6566b | Methods for Company Contact Information Accordion
Method to click Company Contact Information Accordion | public class NVDCompanyProfilePage extends CMAbstractPage<NVDCompanyProfilePage>
public NVDCompanyProfilePage verify_company_contact_information_accordion_title(String msg){
return verify_element_by_text(company_contact_information_accordion_title, msg);
} | 0 |
8a1cdb0539cce6941660b23e6ab8d88e | d66ce890aad3554c368192ae7cc076d7 | Calculates the matrix of co-presentation of different pathogen species
by simply counting in how many hosts two species of pathogens were
presented together.
============== ==========================================================
argument info
============== ==================================================... | mtx = np.zeros((sppNumber, sppNumber))
for i in range(sppNumber):
for j in range(i+1, sppNumber):
for itm in LL:
if i in itm and j in itm:
mtx[i, j] += 1
mtx[j, i] += 1
return mtx / float(popSize) | 1 |
eafb6c03bdc8dfe8627735e965652e80 | b85f1304e67c944949f035c1acc2e409 | 等待BUSY位清零 | void lcd_busywt()
{
unsigned char bf;
#ifdef NIBBLE_HIGH
PORTD &= ~LCD_Data_D;
DDRD &= ~LCD_Data_D;
#else
PORTB &= ~LCD_Data_B;
PORTD &= ~LCD_Data_D;
DDRB &= ~LCD_Data_B;
DDRD &= ~LCD_Data_D;
#endif
PORTB &= ~(LCD_E|LCD_RS);
PORTB |= LCD_RW;
do {
... | 1 |
897ed40377d5bd04341fa7dac247a020 | 826cccaedd1f3d2746649db71f888983 | ## 初始化 | function ItemRecruit:myInit( )
self.tCurData = nil
end | 1 |
8ce44f7ab96af786333c5a43a3cfa52f | 71df53d8f8bdc7e490bc008674c655ed | Returns a list of popular words sorted by frequency | frequencies = (WordFrequency(word, self.frequencies[word]) for word in self.frequencies)
frequencies = sorted(frequencies, key=lambda wf: (-wf.frequency, wf.word))
return frequencies[:n] | 1 |
c82145c1a0dd40dc010f28dd3aa4b38f | b2ec013fcfcfaf33d36ded386785cba5 | 限购和团折产品检查. | class Weidengru_index_page_handle(object):
def check_tejiaqianggou_product_huiyuankejian_handle(self):
return self.weidr.check_tejiaqianggou_product_huiyuankejian() | 1 |
63475a384b8d38204e109908625238c7 | e0ac2e6cecad495aee25cd889fa6a7e1 | 读取yaml用例 | with open('test_api.yaml', encoding='utf-8') as f:
data = yaml.load(f, Loader=yaml.FullLoader)
return data | 1 |
0532e4a09dbea865b197414696cf1470 | 81472eb4d37f3f06cccfd1f7c41c8faa | Método que busca un Interesado dentro de una lista de interesados | namespace Trascend.Bolet.Cliente.Presentadores
public class PresentadorBase
public Interesado BuscarInteresado(IList<Interesado> interesados, Interesado interesadoBuscado)
{
Interesado retorno = null;
if (interesadoBuscado != null)
foreach (Interesado interesado in in... | 1 |
7da4b3e1dba0fe621a901e2b1788f8a5 | e2270c8eae343a484b8268dd08488ef5 | Returns config and data for dashboard item. | export class DashboardComponent implements OnInit
createDashItem(title: string, desc: string, type: string, labels: string[], data: any, options: any) {
let chartData: any = {
type: type,
labels: labels,
data: data
}
if (options)
chartData.options = options;
return {
title:... | 1 |
fce705464e2b92fc1488e68426243c8a | 72408afc1f79271f105337fa9a71c8a2 | Represents dependencies of a roslaunch file. | self.package_path = package_path
self.tree = tree
self.source = source
self.file_name = file_name
self.bindings = bindings | 0 |
1c8ef54bc1712fd7c59f2d13c6a29cef | 0b9f6f7ff59fb2fc5bf7ca36eb9e9571 | 取得某个整数的位子集 | final List<Integer> positions = new ArrayList<>();
int position = 0;
while (number != 0) {
if ((number & 1) != 0) {
positions.add(position);
}
++position;
number >>>= 1;
}
return positions;
} | 1 |
6d987916dc3271a82de046ed367d3ed8 | 6c03638d0feb3ab23572f0826a0a8e9b | A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
忽略Symbol.toStringTag值的获取baseGetTag的特殊版本,
有自定义的Symbol.toStringTag时则忽略
getRawTag(1) "[object Number]"
getRawTag(true) "[object Boolean]"
getRawTag('') "[object String]"
getRawTag([]) "[object Array]"
class ValidatorClass {
get [Symbol.toStri... | function getRawTag(value: any): string {
const isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
let unmasked;
try {
value[symToStringTag] = undefined;
unmasked = true;
} catch (e) {}
const result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {... | 1 |
394224a138e0f313de898c1edac07d4f | 7fcd7ddc8e77c5820a29e4216a20d505 | Remove page layout folder | {
$this->setLayoutParams();
if (file_exists($this->layout_file_path))
{
unlink($this->layout_file_path);
$this->report['status'] = true;
$this->report['message'] = 'File removed';
$this->report['layout'] = \JFolder::files($this->layouts_folder_path, '.json');
}
} | 0 |
01f85093d0df1afbf25a45551c745218 | 1b7abf409ef81a33884553d7b2ac2d78 | Is the given date yesterday?
If today is 6 October 2014, is 5 October 14:00:00 yesterday?
var result = isYesterday(new Date(2014, 9, 5, 14, 0))
=> true | function isYestday(timeValue) {
var date = (new Date());
var today = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
var yestday = new Date(today - 24 * 3600 * 1000).getTime();
return timeValue < today && yestday <= timeValue;
} | 1 |
0560f47ae9f64fc6c244626840b54b7c | 784ce12252e486c5684b1ddf9a8dd693 | вывод фермы пользователя | class FarmController extends BaseController
public function index()
{
$farms = Auth::user()->farms;
if ($farms->isEmpty())
throw new NotFoundHttpException('no farm found for this user');
return ResponseHelper::success(FarmResource::collection($farms));
} | 1 |
874999dccab559bba4f98f9ddbf18cbe | 3960082064f13cacb6da5ffab045497b | 计算平均周转时间和平均带权周转时间 | def average():
s = os.sep
tc_result = r'E:' + s + 'VNDN' + s + 'Beijing' + s + ' Long Trip Cruise'
trip_average = 0.0
cruise_average = 0.0
trip_count = 0
cruise_count = 0
trip_flag = 1
trip_last_time = 0
list = os.listdir(tc_result)
for line in list:
trip_flag = 1
trip_last_time = 0
filena... | 0 |
7c253fff7e36d06f44ff41b37e1b7e07 | fa53ca1bdb357f473011e48cf4b62d73 | 根据杆塔id查询杆塔信息 | $.ajax({
type: "post",
url: path+"/towerLoad/getTowerInfo.action",
data:{
id:projectId
},
success:function(data){
var tower=data.data;
column_a=JSON.parse(tower.column_a);
column_b=JSON.parse(tower.column_b);
column_c=JSO... | 1 |
4cea60a39ba2b7d35b8fdb2daed80a00 | 10cd7f3e02d014bafd381977c3ee7c66 | Окно для добавления авто дилерцентру | {
if($catalogAuto->getUser() != $this->getUser()) {
return $this->redirectToRoute('catalogAuto', ['catalogAuto' => $catalogAuto->getId()]);
}
$addautoForm = $this->createForm(AddAutoFormType::class, $catalogAuto);
$addautoForm->handleRequest($request);
if ($adda... | 1 |
6fc8d975a1872e15b1396e30d8203351 | 637f13b29b93153d3b9091c4bfd50598 | compares filetimes to some epsilon | function SVI_TimesClose(t1, t2)
return (math.abs(t1-t2) < 0.1);
end | 1 |
e766b33bbd721b0d6ce7dab798050623 | 09603ac639b9440301b75c91a70b125b | Show "loading..." page in attachment iframe | function ajax_loading_image(div) {
$j(div).html('<img src="/img/ajax_loading.gif" alt="Ajax Loading Image"/>');
} | 0 |
05283152f546d7ed55567c7d7a172755 | 301bf60f84344f2e85db0a7ba21c4839 | 获取对方手卡 | [Hotfix]
[LuaCallCSharp]
public class MahjongManger : MonoBehaviour
public Mahjong GetOtherPlayerHandCard(Transform parent, int index)
{
Mahjong mah = null;
if (parent == null)
{
return null;
}
PlayerPlayingPanelData pppd = MahjongGame_AH.GameData.Instance.PlayerP... | 1 |
b70c7ea6251be28ad51511e7c629df04 | ea7c694633244f9916f970aacdb8656d | Signing In with HUAWEI ID (Authorization Code) | {
HiHealthOptions hiHealthOptions = HiHealthOptions.HiHealthOptionsBulider()
.AddDataType(DataType.DtContinuousStepsDelta, HiHealthOptions.AccessRead)
.AddDataType(DataType.DtContinuousCaloriesBurnt, HiHealthOptions.AccessRead)
.AddDataType(DataType.Dt... | 1 |
42018111b0bf7767b32f1961b42affc0 | b86e8c0f5596585a4ce00092934b0a86 | 创建主从表并写日志 | {
$time = time();
$sid = I('get.server_id');
$logicInfo = $this->mServerList[$sid];
$exec = 'mysqldump -h' . $logicInfo['master']['db_host'] . ' -u' . $logicInfo['master']['db_user'] . ' -p\'' . $logicInfo['master']['db_pwd'] . '\' ' . $logicInfo['dbname'] . ' > ' . $this->mDBPath . ... | 0 |
4d13d3b6ed0aeee488eb98707461fdca | 98d89dfc86fe24e5d952989a029d2c12 | 设置该月的所有日期 | mCal.set(Calendar.MONTH, month);
for (int i = 0; i < mCal.getActualMaximum(Calendar.DAY_OF_MONTH); i++) {
dayList.add("" + (i + 1));
}
} | 1 |
daf187e143f75e0fa7cc9cdb6230a443 | a1c51b3c14f50112121fec5053c44119 | Обработчик загрузки шаблона из web-страницы. | {
$template = $servletRequest->getServletPath();
$webappPath = $servletRequest->getContext()->getWebappPath();
if (!file_exists($pathToTemplate = $webappPath . $template)) {
throw new \Exception(sprintf('Requested template \'%2\' is not available', $pathToTemplate));
}
... | 1 |
2bb882f2854ca4b944184a8e3b8b740d | a482b8887232515bdab04f875509a27a | 如果请求参数中有id,直接返回id所在的行 | sql = "select * from {} where {} = {}".format(self.table, self.pri_colnum, id)
rs = self.mdb.query(sql)
return rs[0] if rs else 101 | 1 |
07b3d40a9077dfd09eb3f94028c2cf16 | 1265e998e9e261c30eee81459ed13d2a | 根据采样格式,采样率,声道类型以及采样数分配一个AVFrame | int ret;
ret = av_image_fill_arrays(mImageFrame->data, mImageFrame->linesize, data->image,
getPixelFormat((PixelFormat)data->pixelFormat),
data->width, data->height, 1);
if (ret < 0) {
LOGE("av_image_fill_arrays error: %s, [%d, %d, %s], [... | 0 |
52936650803be2d54c73ca491072fc65 | feabf06ef4d71d8b82f35fa10ea001e5 | Checks whether two solutions are actually the
same, up to the threshold. | def sameSpecies(gone, gtwo):
disjoint = deltaDisjoint * disjointDifference(gone, gtwo)
weights = deltaWeights * weightDifference(gone, gtwo)
return disjoint + weights < deltaThreshold | 1 |
7e818fe479824b71abd14f6a948389f7 | ca420d25ef7e85dfa2daa99bcb1edea8 | Sets the ASM data bean for the ASM associated with this sample. | public class SampleBean implements javax.ejb.EntityBean
public void setAsm_note(java.lang.String newValue) {
this.asm_note = newValue;
} | 0 |
b7f1b914fcb19863caa13b316044e0a4 | f122540d7687b592aeaa0e2b7f321107 | 设置预估状态达成时间(并表类型) | public class CPVIVS01Entity extends BaseEntity
public void setEta(Date eta) {
this.eta = eta;
} | 1 |
a0e8173de82a54c853c59c2fef803fc4 | 410a33a05cef8987ab667580ed12470b | 桌面IP地址列表。 | public class BuyDevicesRequest extends AbstractModel{
public String [] getLanIps() {
return this.LanIps;
} | 1 |
40b600502ee543cdf84d15dc3a355a37 | f58cc511462a64cd2aab7a4e0e5ea256 | Function Name: LCD_1_LCD_SPI_ReadRxData
Read the next byte of data received across the SPI.
None.
The next byte of data read from the FIFO.
Global variables:
LCD_1_LCD_SPI_rxBufferWrite - used for the account of the bytes which
have been written down in the RX software buffer.
LCD_1_LCD_SPI_rxBufferRead - used for the ... | {
char retVal;
digitalWrite(SS, LOW);
delay(10);
SPI.transfer( READ_RX_BUF_1_DATA);
retVal = SPI.transfer(0xFF);
delay(10);
digitalWrite(SS, HIGH);
delay(10);
return retVal;
} | 1 |
09bdfd4c80759a03a0baf818f6238ead | 76b83ea0a6f8f8e1fcf6a11eadff54be | GET: SuiviExercices | {
var model = new IndexExamenViewModel();
model.Fill(_CargarDatosContext, 0);
return View(model);
} | 0 |
878006e5788cef4722b432987908f30e | b39ef8ddb0db1933c903518e9f39521c | Sets which of the identifiers (:class:`log.logger.LogLocation`) should NOT have
their debug messages suppressed. | def suppress(type, subtype): | 0 |
ae8ea52bd85ce8acf6929d5efa2aed58 | 28c462c5b982a7854abb84f33615c2cb | GET /admin/products/count.json
Retrieve a count of all products. | class ProductsController extends ControllerBase
public function queryAction()
{
return $this->response->setJsonContent(
[
'results' => Product::getAllProductsWithSoldAmount()
]
);
} | 0 |
fe9deef0a82a46d70435276efe920482 | f60ac8f4a44078aebff6d98568b79f8f | helper to remove data length in array
@ilustration [5,0,0,0,90,87,67,34,1] became [90,87,67,34,1] | val vlen = `val`.size
var keep = 0
while (keep < vlen && `val`[keep] == 0) {
keep++
}
return if (keep == 0) `val` else `val`.copyOfRange(keep, vlen)
} | 1 |
7b2bb7c4a42afa2a7245aa271e57139e | 2183494d3f084fc3b38e8441f6cc9260 | 각 문자열의 길이를 요소로하는 배열 반환 | c = []
array.each_with_index{|elem, i| c[i] = elem.length}
return c
end | 1 |
fec718c76cdb06f293121c89032687e1 | 85bb74503fb9eb1ca988b9defce218fc | 後置函式,將在呼叫動作後執行 | func doSomething() {
defer fmt.Println("Do something like closing a resource")
fmt.Println("Working on a resource")
} | 1 |
24ac5fef7fe0650b36513dbd8a121d4f | a1fa96d61ca272704abd7d5c615f86f4 | vraci celkovy pocet partii daneho hrace | public int totalPartie(String pseudo) {
Connection connexion = null;
PreparedStatement statement = null;
ResultSet resultat = null;
int count = 0;
try {
connexion = daoFactory.getConnection();
statement = initialisationRequetePreparee(connexion, SQL_COUNT_TOTAl, false, pseudo);
resultat = statement.... | 1 |
22c91cb24730e25ee6a7df414ab8e9e4 | 6739ccfb2beb5b9775db34e8641f59f1 | 中奖号码随机生成 | def random_num():
num_gl = range(1,34)
num_gl = random.sample(num_gl,6)
num_gl.sort()
num_gl.append(random.randint(1,17))
print("中奖号码为:",num_gl)
return num_gl | 1 |
51f3fb47f468a238935ff291f13cd23c | 8a4ca420845a00949e252464354ec78e | 删除一年前的数据 | class LogAdminModel extends Model{
public function deleteAMonthago() {
$status = $this->where(array("time" => array("lt", time() - (86400 * 30))))->delete();
return $status !== false ? true : false;
} | 0 |
3e90d8a3b6a299eaab937b9e9ba18c56 | 5d3db0efb5e20361ed28b270bbb9e653 | metodo para vincular una licencia con un usuario | @Repository
@Transactional
public class UserRep
public User getUserWithLicense(long userId) {
User user = em.find(User.class, userId);
Hibernate.initialize(user.getUserLicense());
return user;
} | 0 |
c948d6c6a84ba4ec339f63567a42556f | 9ad95fac0cd4cb62edc4590218e9d824 | 根据用户ID列表获取该用户列表信息,用","隔开 | if (userIds == null) {
return null;
}
StringBuilder sb = new StringBuilder();
for (int n = 0; n < userIds.size(); n++) {
if (n > 0) {
sb.append('|');
}
sb.append(userIds.get(n));
}
return sb.toString();
} | 0 |
4359608de561a5f0d4e7988753387780 | 655b6b9a1683772d76200a3973d693f7 | this function is for timing how long the player has been in super mode | {
return (millis() - timeSinceStartOfMode) / (60 * 1000);
} | 1 |
669425d1c663460db88bea63c6eb9b3d | 3db97a4f6ba327abbbbe8ca3ae2713e3 | Tests new types can be registered and built | class TestCMDB(cmdbTestCase):
def test_register_type(self):
p = CMDB()
p.registerObject(self.cmdbobject, None) | 1 |
9162e3042f9f9fcaa3b5e0a319fb8af3 | 27d72f61e4d7800cb9f3758d4e786a90 | 保存人脸识别token | class UserService extends Vue
getFaceIdToken(params) {
return this.$post('getFaceIdToken', params)
} | 0 |
b7591374031c216715db5a53a4368a5e | 879a5fb6a49ab09a573a48e2bcc8d338 | Example of having multiple asterix messages being received in one packet, this requires one to
parse the first messages, and parsing until the rest.len() == 0 | let input = "retry:1000\ndata:test1\n\nid:test\ndata:test2";
let mut reader = decode(Cursor::new(input));
assert_retry(&reader.next().await.unwrap()?, 1000);
assert_message(&reader.next().await.unwrap()?, "message", "test1", None);
assert!(reader.next().await.is_none());
Ok(())
} | 0 |
16d54dd5dd8d9ecb1fa404a719b7d114 | 9e70d1a9aaf0cd186c051b0ddaa89d4f | Method used to update the particle filter if no observation is provided | void particleFilter()
{
std::lock_guard<std::mutex> lock(g_mutex);
if (g_newCmd) {
Eigen::MatrixXd e = g_normMatGen.samples(g_nParticles);
Eigen::MatrixXd sq = g_Rmat.array().sqrt();
auto noise = sq * e;
Eigen::MatrixXd thetas = g_particles.row(2);
g_dPart.row(0) = (g_Umat(0) * PERIOD) * thetas.... | 1 |
61e2c10f99c035b6550edfcf1236c774 | 0f032187a28ccf9f3c833ab4029f0673 | Compute and set the many moon and sun quantities. | class chancetable
void MoonPS(int mode, double mjd, double dt,double lat, double lng){
double y = CalcLambda(mjd);
double b = CalcBeta(mjd);
double e = CalcEpsilon(mjd);
double rb = b / lib.rd;
double ry = y / lib.rd;
double re = e / lib.rd;
double xs = Math.cos(rb)*Math.sin(ry)*Math.sin(re) + Math... | 1 |
2da7882518551a202aa5e80a3515850e | 6c8be11bd3a7ea299f1f63fc5a062d81 | Get the value of a setting from a document. | class Documents(PropertyLists):
def _get(self, name):
if name in self._config:
return self._config[name]
else:
return None | 1 |
dfea6cf98e36950884e8559808c32049 | 7555d39d3a96c117306950573d37c4c8 | Determine the index of the top of climb altitude.
Returns | class BasicProfile(Profile):
def get_top(self):
return np.where(~self.tmpc.mask)[0].max() | 1 |
7a1947216b4ea0909277725d059f79f1 | 1dbf9d381c9674cce76e0f5f235bf7a7 | Returns the current time in the time zone of the tenant. | class LocalTime implements DateTimeAccessor
public static function now(TimeZone $timeZone)
{
return ZonedDateTime::now($timeZone)->getTime();
} | 1 |
cf5556605394a5f8e42c73ea29149f1c | 719c2c0e4bf9eefcaba1252d468acb5a | 网上订餐根据类型筛选出商家 | $data = $_POST['datami'];
$datami = trim($data);
$datami = json_decode($datami,1);
$cityname = trim($datami['cityname']);
$category = trim($datami['category']);
$search = trim($datami['search']);
$where="pa.flag=3 AND pa.revorkflg='N' ";
if($cityname){
... | 1 |
2b4b0ee3984893f2aadff17775a095a7 | 596ae9d566e2c92b5e54319ac2396ab7 | 迁移任务到失败队列 | class Facade():
def save_imgs_failed(self, task_mq_name, urls_failed_info):
if len(urls_failed_info) < 1: return
logging.info('下载失败的图片任务重新入队列, num:%d, detail...' % (len(urls_failed_info)))
task_col = Collection(self.mongo_task, task_mq_name)
for url,item in urls_failed_info.items():
fail_item = {'... | 1 |
8de041b526e79d3a559ab379a2c95370 | ed546db12616009cab5a9fd8edded5a1 | Retorna los puntos perdidos. | public class RankingMethod
public int getLosePoints() {
return losePoints;
} | 1 |
1c0ef651251698812f0a2601eac4db44 | 5bab6541d08b1c8582fb3da3dfece84e | Get quality value for a given preview size. | String previewSizeValueString = params.get("preview-size-values");
if (previewSizeValueString == null) {
previewSizeValueString = params.get("preview-size-value");
}
Point cameraSize = null;
if (previewSizeValueString != null) {
Log.d(TAG, "preview-size-va... | 0 |
8f2fc74b0ceb4cc192540a04fa2694e4 | ba0d9d1621ab57204df9b6428ee2946c | r"""Save the sentencepiece vocabulary (copy original file) to
a directory. | class PreTrainedTokenizer(object):
def save_pretrained(self, save_directory):
if not os.path.isdir(save_directory):
logger.error("Saving directory ({}) should be a directory".format(save_directory))
return
special_tokens_map_file = os.path.join(save_directory, SPECIAL_TOKENS_MAP_... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.