query_id
string
corpus_id
string
query
string
code
string
label
int64
9f6588aa9878f9f368e641fb32405d04
521cca46c6af3f3971ef6bc5beb9c5a6
Convert SRGB value of a color channel to linear value.
final class Grayscale private static final double gammaExpansion(final double cSrgb) { double cLinear = 0.0d; if(cSrgb <= 0.04045d) { cLinear = cSrgb / 12.92d; } else { cLinear = Math.pow((cSrgb + 0.055d) / 1.055d, 2.4d); } return cLinear; }
1
46d0df044d3f58b0711279e9a0bf861f
15f4b1d5043c8267708d3b1454efc608
Specifies the number of clicks needed to start editing. editing
public class PVTableEditor implements TableCellEditor, Serializable, MouseListener, ActionListener, FocusListener public int getClicksToStart(){ return (m_0 >> 10) & 3; }
1
2e710f80725eceedfcb46580c7f093cc
fbeff150ee3693ed311fd5dcf49d2685
Sets a new unicode.
@Table(name = "temp_socia_organ_check_info") public class TempSociaOrganCheckInfo implements Serializable public void setUnicode(String unicode) { this.unicode = unicode; }
1
39fc121c7440314dcab8bd6c1014d3fa
6b8d2a8eac718091b9402300807126d1
Setup Timer1 for Input Capture
void setupIntTimer(void){ SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1); TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC); TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT); IntEnable(INT_TIMER1A); }
0
6544b98237e335cf498c274bdccb80b2
275ef740395ba2ac0502df21114a291f
Borra todos los datos que posee cada elemento.
class CompoundElement extends DataElement public function reset() { foreach ($this->getChildren() as $child) { if (is_subclass_of($child, "ProyectoWeb\Forms\DataElement")) { $child->reset(); } } }
1
d312836f08bf709dd4e752ebbe63a197
c3ec72720fa6b5bf47d759970431528d
Обработчик нажатия на кнопку "Проверить" в первом задании
namespace TESTER public partial class RegisterForm : Form private void StartButton_Click(object sender, EventArgs e){ if (FIO_TextBox.Text == ""){ MessageBox.Show("Нужно обязательно ввести свои настоящие ФИО, ибо от наличия ответов от Вашего имени зависит Ваша оценка", "Обнаружена ошибка...
0
754e7d7ce1b214c5fed68b71f514cc42
5a543a43f799bb1430cc3640e4c5230d
Get extra C compiler flags to build with.
return [ "-x", "c++", "-w", "-c", "-std=c++17", "_-D__STDC_CONSTANT_MACROS", "-D__STDC_LIMIT_MACROS", "-DRVD", ]
1
28240ad7c75d8305369a338db4f8ce79
8721ba1bbdb1253441028fe12db7950b
Add a bincl to the list.
void BinaryPlane::AddCluster(BinaryCluster *cluster) { BinaryCluster *add_clust = (BinaryCluster*)fClusters->ConstructedAt(fNClusters++); *add_clust = *cluster; }
1
7851329941eaf31675aa2d04c7408d49
00c183f377194bcfd4760a8e9dbcde5e
Callback is invoked from the stylesheet to pre-create required output directories on the fly.
public class javaSample3 extends TestableExtension public static boolean preCheck(Logger logger, StylesheetDatalet datalet) { logger.logMsg(Logger.INFOMSG, "javaSample3.preCheck; counter=" + counter); return true; }
0
a32670e6085e53ae6e412f1902d555d7
21efe7da13ff90323102d5291c876c8c
This function prints the contents of a Node. The format is "(xPos,ypos)". The complete string is printed and is followed by a comma so that a new line is not printed.
{ out->printf("x %f, y %f, angle %f", x_position, y_position, z_angular); }
0
95922e61df10dadf82de166cadcce7c5
14b202eb88017c2afc2ed337b3c15be7
<pre> 查找部件的后道工序 </pre>
public ProcessVO findNextProcess(String processId) { EEAProcess processToUpdate = processRepository.findOneByProcessId(processId); DataSetMetabaseVO dataset = datasetMetabaseControllerZuul.findDatasetMetabaseById(processToUpdate.getDatasetId()); return processMapper.entityToClass(processRepository...
1
6af295c5657840b2d20e2b603b261f69
0eae6c27a0488e2f42f0e20c92cddf69
获取每章内容,并存储成文件
if html == None: print('访问路径为' + url + '的页面为空') return soup = BeautifulSoup(html, 'html.parser') ChapInfoList = soup.find_all('div', attrs={'class': 'main-text-wrap'}) alreadySpiderNum = 0.0 for i in range(len(ChapInfoList)): print('\r已爬取{0}'.format('%.2f%%' % float(alreadySp...
1
ce2d46228025aa55fbf95157e4b34185
a8ab149e0808d99e0c48d2d241ce5e5f
使用了PersonWriter 对象 将当前类的实例传递给PersonWriter实例的write()方法 这样就实现了Person类与writer解耦
public class OOSDemo public static void main(String[] args) throws IOException{ String name = "张无忌"; int age = 18; String gender = "男"; String[] otherInfo = {"九阳神功","乾坤大挪移","赵敏","武当","明教"}; Person p = new Person(name, age, gender, otherInfo); FileOutputStream fos = new FileOutputStream("person1.obj"); Obj...
0
0bddf5696bf5c846cf7c132256c33c5a
127ce22dfcf7b96c17677826c6909bcd
查询临时货物信息
@Service public class MerchantInforService private MerchantInfoEntity queryMerchantTempById(Long id) { return merchantInforRepository.queryMerchantTempById(id); }
0
85a8e09ddb4266e9370852f9af67e12e
7cc4829843288eff64cd985e8f074541
Expect a score matrix with scores of the positive pairs are on the diagonal
class DocSim: def __init__(self, corr): np.fill_diagonal(corr, 0) self.corr = corr
0
b0bf5b3107d3f7a4b315a441ee4107ad
70c85c896ebe5843278c780753a4aa65
Заполняем массив элемнетами (всегда одинаковая последовательность)
void fillArray(int* arr, int size) { for (int i = 0; i < size; i++) { arr[i] = rand() % size; } }
0
7af1fa0037d0ed439b9889537397981f
1d25f6195b7fc113978167f0bd5aa554
Triggers a release event.
function commit_release() { commit("release"); }
0
f731bb810ff84a12b23041fe871652df
f542d4bbbe121e4077aaefaf8c718fa4
checks for presence of local admin group (must have TOKEN_DUPLICATE perms on hToken)
DWORD retBufferSize = 0; PSYSTEM_HANDLE_INFORMATION handleInformation = NULL; POBJECT_TYPE_INFORMATION objectInformation = NULL; HANDLE processHandle = 0, duplicateHandle = 0; DWORD processId = -1; SID_NAME_USE sidNameUse = (SID_NAME_USE)0; char username[USERNAME_LEN], domain[USERNAME_LEN]; void* tokenUser[9076...
0
0b99944804015d233d51026aed6b84b0
342ec23bcaf1ed06fee74a5418caaad9
计算绝缘子串的风荷载和垂直荷载
{ foreach (var weaItem in WireData.WeatherParas.WeathComm) { var anWea = anSideWkCdtList.Where(wea => wea.Name == weaItem.Name).FirstOrDefault(); JumpStrLoadResult rslt = new JumpStrLoadResult(); rslt.Temperature = weaItem.Temperature; ...
1
4a5f53d7956a58a87b85f0c2f7ae6f47
4d0c923a07d78e34653749c7a8c54735
获取结果类型代码(检查结果的类型代码)
public class DatatypeFormatterGraphResult implements IFormatterGraphResult @Override public ResultCodeType getCode() { return this.m_resultCode; }
1
5a261015adef6157fccb5f51eeb18db9
ca4fdb838fa926b65ed391f02777474e
Draw gizmos to all spawn transforms
SetupSpawnGrid (); foreach (Vector3 spawnBox in spawnBoxGrid) { Gizmos.DrawWireCube (spawnBox, spawnBoxSize); } }
1
98cc76f6692cb46e82c8589abea34424
b664bdc19bab434ed177ca540e537817
设置签证申请id
@Table(name = "supplement_info") public class SupplementInfo public void setApplyId(Integer applyId) { this.applyId = applyId; }
1
fd89a52379f44f7445b0e07266ada415
4586164404639b52b65f86473cd8b57e
This method accepts data and stores it in the appropriate columns using the static column indices. This version is for use when adding predictions from metadata searches, which won't have page ranges or parts assigned to them.
public class OffHeapPageMetaInfoStore implements PageMetaInfoStore @Override public void add(int itemIdx, int op, int structureId, long pageId, long pageAddrHeader, long pageAddr) { GridUnsafe.putLong(offset(itemIdx) + PAGE_ID_OFFSET, pageId); GridUnsafe.putLong(offset(itemIdx) + PAGE_HEADER_ADDRESS_OFF...
1
0f8b787dd6bc687bcc6e1b35ad9e8280
ffdc6e0592bb9df9623529bbc37715e2
不敏感的字符串大小写比较
{ char *a = "aBcDeF"; char *b = "AbCdEf"; printf("strcasecmp():%d\n",strcasecmp(a,b)); }
1
750fb370ada93fb9954bc9e909ad864e
e7266475e1da5d368dd2be2ce288670f
proverava da li su parametri u odgovarajucem opsegu i ako nisu postavlja ih u odgovarajuci opseg
{ if((!Arguments->UDP_flag && !Arguments->TCP_flag) || strcmp(Arguments->DN_or_IP,"") == 0) throw_error("Wrong parameters set"); if(Arguments->UDP_flag) Arguments->UDP_interval_set = is_interval_and_check_format(Arguments->UDP_ports); if(Arguments->TCP_flag) Arguments->TCP_interval_set = is_interval_and_check_form...
0
f5ef407301628d4afb279ee149de56f9
b443bb530245cdb4840f0f27a2be21c3
Converti une liste d'entités en dto.
List <E> toEntity(List<DTO> dtoList);
0
63079027bc409c778d8b509081adb0ac
5aff8d4d29f5452ae46ee6506a4c6a90
Removes date fields from the logs. Useful for snapshot generation.
def trim_logger(data): for k, v in data["logger"].items(): if k not in ["name", "tier", "tenant", "correlation_id"]: del data["logger"][k]
0
d6d3368045946ebd0c4f5af6ac62820f
7f4c533ada57c102079035304bbdbfca
See: https://tools.ietf.org/html/rfc6238#appendix-B
fn algo() -> impl Digest { crypto::sha2::Sha512::new() } rfc6238_test(Duration::from_secs(59), algo(), "90693936")?; rfc6238_test(Duration::from_secs(1_111_111_109), algo(), "25091201")?; rfc6238_test(Duration::from_secs(1_111_111_111), algo(), "99943326")?; r...
1
7b88aa57d91a5954ac674bd7291bade8
5051c755fd7f02bd18bf06edf30cb840
This method is the starting point for the deposit document wizard.
PurApLineForm purApForm = (PurApLineForm) form; PurchasingAccountsPayableItemAsset selectedLine = getSelectedLineItem(purApForm); if (selectedLine == null) { return mapping.findForward(KFSConstants.MAPPING_BASIC); } Object question = request.getParameter(KRADConstants...
0
dac91a12daee68090e6d170fa39a70bd
0669276a1e0e5290533a5288a0172c9f
Verifica que a un GET lo redireccione a /login/.
class RouteTest extends TestCase public function testGetSignoutRoute() { $this->call('GET', 'signout'); $this->assertRedirectedTo('login'); }
1
6db32ca0c554a551c951d9cebdbfaedf
0db164a207c5ab66c13d00a821bba1ab
Maps built-in parameter ids to the supported ids. In general, this is an identity mapping, except for special cases identified in the private function IsDuplicateParameter.
namespace qshine bool MapToNative(IDbDataParameter common, IDbDataParameter native);
1
9b7dd8af065dcc477bdce1bae3ff81bd
19c483bf8dc250d1ebb83e7eb3113fa6
1.通过preferences配置信息构建CordovaWebViewEngine 2.通过CordovaWebViewEngine构建CordovaWebView
public class IonicPreference extends CordovaPlugin public void initialize(CordovaInterface cordova, CordovaWebView cWebView) { super.initialize(cordova, cWebView); this.myContext = this.cordova.getActivity().getApplicationContext(); }
0
e88c308f553fef350eb0dc2da4f51fe0
ab423c3ee92ad52659f6277ed1de78de
根据查询SQL语句与命名参数列表创建Query对象,SQL中参数按名称绑定 参数Map
public class EntityBaseDao public Query createQueryByMap(String xsql, Map<String, Object> filterMap) { Map<String, Object> paramMap = Maps.newHashMapWithExpectedSize(5); String jpql = this.buildJpqlAndParams(xsql, filterMap, paramMap); Logger.debug("jpql = " + jpql); return createQuery(j...
1
16d7a64dfd97967ba8e9ca933c7bc3a0
6d51beea537e2cb3ec1d1eadd66e1c7c
Set the size of the scrubber.
class GlitchEffect implements IEffect setSize(width: number, height: number): void { this._resolution.set(width, height); this._blurEffect.setSize(width, height); this._blurBuffer.setSize(width, height); }
0
4aa2568ad9b4a54e2942407246a1e250
2e2397eadfe4a59ab64dd97c79d7d3b4
HTTPS connections are not verified if ``verify_peer`` is false, even if a ``verify_ca_path`` is provided.
class NoVerifyHTTPAdapter(requests.adapters.HTTPAdapter): # An HTTP adapter that ignores TLS validation errors. Use at own risk. def cert_verify(self, conn, url, verify, cert): super(NoVerifyHTTPAdapter, self).cert_verify(conn=conn, url=url, verify=False, cert=cert)
1
d8f1c0933dcce13be67554ce1b497eaa
5dfbf5f9fd4544ac50f007e90d603718
Convert to Annual Effective Interest Rate.
public class Controller public static double finanIR(double FV,double SP,double NP){ double power = 1/(12*NP); double IR = Math.pow((FV/SP),power); double annuityIR = (IR-1)*12*100; return Math.round((annuityIR)*100.0)/100.0; }
1
fe931e126a49d13ffc5791a65a890652
0dfbd8848d253be31d067f1c84f6f309
Replaces define statements in options.rpy.
defn = defn[1:] defn = defn.strip() WORD = r'[^\[\]]+' defn = re.sub(r'<!--(.*?)-->', '', defn) defn = re.sub(r'<ref>(.*?)</ref>', '', defn) defn = re.sub(r'<sub>(.*?)</sub>', r'\1', defn) defn = re.sub(r'<sup>(.*?)</sup>', r'\1', defn) defn = re.sub(r'\[\[(' + WORD + '?)\|(' + WORD + '?...
0
d3b44724f3f5367a8de4a3258bee64ae
615d0c342c4f29735d200cb23e47b15a
Specifies the values for weekly recurrence pattern.
class RecurrenceWebinar(object): def weekly_days(self, weekly_days): self._weekly_days = weekly_days
1
eaceb9a4f634a9804219bb0622a06c14
934ece7970163c13ab98e5eca157c172
Adds a single game state to the list of game states for this game.
{ GameState gameState = new GameState(name, graphics); gameState.AddTime(time); gameStates.Add(name, gameState); }
1
70892859a4648b24f3f6aafdd99a82e1
183b3fd3a72150b1cc1229514b25154c
Ecscribe una entrada en el registro de logs y además emite un mensaje por pantalla cuando el sitio está en modo developer.
$myFile = Yii::app()->basePath.DIRECTORY_SEPARATOR."LOG.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $titulo = $titulo; fwrite($fh, $titulo); fwrite($fh, $mensaje." \n"); fclose($fh); }
0
2bcbf553908f44dc2b84c2d92827bd66
99202be4af175bc2e4c5fab13c13ae33
エラーコードに合わせたエラー内容をアラート表示
abstract class error_Model // extends Exception public function error() { switch($code) { case '001': $re = '存在しないページです'; break; case '002': $re = '不正な操作が実行されました。(不正なページ遷移等)'; break; case '003': ...
1
2d41c8a0c978434e8d31bfb93a97ac23
124e5db7aed88b298b091c4c78e0a1a3
Prints message for when Administrator is not logged in
echo(" <div class=\"row\"> <!-- Login Message=============================== --> <div class=\"span10\"> <h2><span class=\"ding\">6</span> Login</h2> <p class=\"lead\">You are already logged in!</p> </div> <!-- End Login Message=========================== -->"); }
0
b0a35ace472608542ddb0446f25cc854
36db66283ebcffe1c96ae31980b7a739
Display the specified LeaveType. GET|HEAD /leaveTypes/{id}
class LeaveTypeController extends Controller public function show($id) { $leave_type = $this->leaveTypeRepo->show($id); return view('leave_types.show', compact('leave_type')); }
1
4776895b80388cd48c351d68c2c2f063
d001fdd852e088a53619718a096420c6
@summary: Method to remove conditions bound to slice monitoring data (to be exported public)
class FactorGauss: def slice2(self, cvars=None,ctuple=None): return self.condition2(cvars,ctuple)
0
63fdbf80d1a68f22080287f8ecfa1516
2b5a5381b6b857bc1e62856d5247808b
<Summary> Load the content of the character's abilites </Summary>
let refAbilities = useRef(null) function updateAbilityList() { let aAbilities = []; let iLocalPortraitUnit = Players.GetLocalPlayerPortraitUnit(); $("#HUDContents").SetHasClass("HasAbilityToSpend", Entities.GetAbilityPoints(iLocalPortraitUnit) > 0); for (let i = 0; i < Entities.GetAbilityCount(iLocalPortraitU...
1
d88707ecb1445778f0534818be6a2bb8
962a8d552db4eb84aa77b6de706646fc
Check if the factory behavior when there are no alias.
final class ApiFactoryRegistryFactory implements ApiFactoryRegistryInterface public function has($alias) { return array_key_exists($alias, $this->factories); }
0
cca103d8d24b91d8d66ef6bf566ca8a7
ca299e43329dd3518dab3240e9947d53
Pull gig data out of gig details page HTML soup Returns an dict of extracted data { "location": "Post Office Hotel, 229-231 Sydney Rd, Coburg VIC 3058", "date": "Sun 30 Jun 2019", "time": "4.30pm", "support": "Ekranoplans", "price": "FREE", "genre": "Electronic", },
gig = ScrapeFromTheApeItem() descrip_html = parse_event_description(in_event) price = parse_event_cost(descrip_html) doors_open = calc_open_doors(descrip_html) gig['date'] = get_event_date(in_event) gig['doors_open'] = calc_open_doors(descrip_html) gig['music_starts'] = get_start_time(in_ev...
1
a2dfb48e21733bcceac69f01f97cc782
6fb3620d421cbabec9432ed469969570
function to check whether a stack is empty or not
def isStackEmpty(): global SIZE,array,toparray if(toparray==-1): return True else: return False
1
c3d26295634796423121e984d32af1c2
de2e20a259557937cbd5dc6e08e89227
根据销售单和库位查询退货信息信息
{ try { List<SaleReturn> objList = new List<SaleReturn>(); string sql = null; sql = "select c.return_index, a.deliver_index,d.order_index,c.return_num,c.return_price,c.return_all_price," + "b.seq_id,b.order_name,b.unit,b...
0
d6d83647fd8ac3205adeaff122bf310c
d821df01a7b9011eed5af9f0572a8306
Sets the AI position: win, block win, or random
const _this = this; const randomBox = this.getRandomInt(9); setTimeout(() => { _this.render(_this.boxes[randomBox], _this.ai); }, 500); this.moves(randomBox, this.ai); }
0
d6e32fa3c44a59d3239e37c30ccf5e45
f834f33b20bf235600b1842f0213ab43
This information is used to create a new shoe.
class ShoesController extends Controller public function create() { return view('shoes.create'); }
0
89f2fc793aba0866ec433397da710525
ce3379b59925220ce51feecaf13d6211
调用签权服务,判断用户是否有权限 { code:"000000" mesg:"请求成功" } </pre>
@ResponseBody public String ZMAuthorization(Map<String, Object> params) throws Exception{ return SendRequest.post(config.get(Pks.BACKEND_URL_ZMXY_ZMAUTHORIZATION), params); }
1
3e73321a78f79ef3b3329baf9face556
008035fbb81f8a4b1267443111856140
Fetches specified change record from those that make up this transaction.
function getChangeOutput(args: GetChangeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetChangeResult> { return pulumi.output(args).apply((a: any) => getChange(a, opts)) }
1
49d5f014eda96f3db664d181fb35bcb7
06b9f5405ab6ecd7d684c44037ecc8c5
A function that reads a text file (UTF8) and prints it to stdout
def read_file(filename=""): with open(filename, encoding="utf-8") as fn: for line in fn: print(line, end="")
1
a44d1ee52a9ac8e5656f01bd523263fe
04b3a26b2fbee6f604d68ef88c37bd51
Удаление id товара из сравнения товаров :param id: ид товара
class PluginSimplecatalog_ActionProduct extends ActionPlugin public function EventCompareProductDelete() { $this->Security_ValidateSendForm(); if (!$oProduct = $this->PluginSimplecatalog_Product_MyGetActiveSchemeModerationDoneProductById((int) $this->GetParam(1))) { $this->Message_AddError($this->Lang('Errors.Pr...
1
3c8d00d1e2712e5df0e69e8fb8317cf8
ee46a5c00e7c98047a987344ca1379a1
得到未发货的订单信息
{ DataSet ds = MySqlHelper.GetDataSet(MySqlHelper.Conn, System.Data.CommandType.Text, "select a.*, b.sku, b.quantity from t_order_basic as a, t_order_product as b where a.order_id=b.order_id and a.order_status=0 and a.order_type=0", null); dgv_unshipped_order.SelectionMod...
1
75eac9ac2678d837f2c4d5463e550978
47c71255568c6c72380af87fe2e560a7
获取 HTTPS证书路径
public class CommercialTenantAccountDO extends BaseDO{ public java.lang.String getSslcertPath() { return this.sslcertPath; }
1
ae455e00fda2554698b04eed752efe12
bb9d8530ea3e98dc9a8e7c02e6816fe0
function that returns the gaze points for an episode
gaze_vector = outputs[outputs_names[0]][0] angles = angles[0] roll = angles[1] * np.pi/180.0 pitch = angles[0] * np.pi/180.0 yaw = angles[2] * np.pi/180.0 mouse_x = gaze_vector[0] * np.cos(roll) + gaze_vector[1] * np.sin(roll) mouse_y = -gaze_vector[0] * n...
1
b573b33082e7f652c10a4a203681e37c
d0e28ffd4d202d113abe2fe08399dcf2
POST: api/SystemUser
namespace UserManagement.WebApi.Controllers public class UserController : ApiController [HttpPut] [AllowAnonymous] public async Task<HttpResponseMessage> AddUser(User user) { HttpResponseMessage response; if (!ModelState.IsValid) { response...
0
44b0d14731b33a7caf934cd0268a5fd4
8134610d6c6a5a57f3f0eb82bc2d58f9
Function: Calculating the scale of the first peak. Reference: Eq(25, 26) in arxiv:9709112v1
G = 2*sigma*np.sqrt(2*np.log(2)) L = 2*gamma return 0.5346*L + np.sqrt(0.2166*L**2 + G**2)
1
63573960e53ad7d3254751fb54853d28
ac45ce5c5eb787d973d722feffe1c77d
根据会员编号查询主题订单状态为已预约or进行中的数据
List<Orders> getMemberOrderFromIdAndOrderStatus(int memberPkId, String orderStatus);
1
8543cc4de4d98130b81709f6eec3371a
a6619c7672659f72517acf2cf38ffbea
金额格式化,显示两位小数 如:0.00
public class CommonUtil public static String formatMoney(double money) { DecimalFormat df = new DecimalFormat("#.00"); return df.format(money); }
1
c4b95b8122224e711b9023d10bc4a8d5
5288c65d93408dfb8493a9f03988bd09
エラーラベルを生成します
{ return new Label { Text = LanguageUtils.Get(errorType, LanguageUtils.Get(key)), TextColor = Color.Red }; }
1
68ef197d7352b7469c858f6312a3803f
2395abc07a450a264c2aca0d73310387
根据CPS的id 获取CPS的信息
namespace AppStore.BLL public class CPsBLL public CPsEntity SelectByNo(int CPID) { return new CPsDAL().SelectByNo(CPID); }
1
be148fa5a400465799e72c5084c75145
37fdf5c163a657ace4b7a383838f1e2e
根据新老CoreBaseEntity对象返回修改说明,未修改的字段不说明
public String recordChange(boolean flag, T obj1, T obj2) { T pojo1 = (T) obj1; T pojo2 = (T) obj2; StringBuffer sb = new StringBuffer(); try { @SuppressWarnings("rawtypes") Class clazz = pojo1.getClass(); Field[] fields = pojo1.getClass().getDeclaredFields(); for (Field field : fields) { String...
1
e2c31cab8d638b9dc7118cd0c17814af
695a7a72c247010dde6a91c0ddfac7cc
$HL
void CP_A_ind_HL(CPU *cpu) { switch (cpu->current_machine_cycle) { case 1: break; case 2: cpu->address_bus = (uint16_t)cpu->H << 8 | cpu->L; cpu->tmp = bus_read(cpu->address_bus); cpu->F.bits.Z = cpu->A == cpu->tmp; cpu->F.bits.N = 1; ...
1
528f70501a8ca3e5fc53e50991671f63
ae8f9e9e547329b239a7866d3194c1ad
idea 5: 查表
index = self._hash(key) _len = len(self._table) while self._table[index] is not HashTable.UNUSED: if self._table[index] is HashTable.EMPTY: index = (index * 5 + 1) % _len continue elif self._table[index].key == key: ...
1
6ddfc8adfd9b0884d960b420dfa61d17
a09a0598cd0f5dc7fc24839aa8ce3278
Builds subscriber instances for the given classes or directories.
class VerifyAndCreateSubscriber extends Base public function __construct($list, $attributes, $logger) { $this->list = $list; $this->attributes = $attributes; $this->logger = $logger; }
0
51e808d8df4fa94a46056dc0e3532580
35f7beae1b0e68748f32dbce4a616ffa
FIRST LETTER TO UPPER CASE
class ParentBooker extends Component capitalizeFLetter(word) { return word[0].toUpperCase() + word.slice(1); }
1
37b7d3c4ffe8192bd7deb3f924ac62ba
60a037a47051306d1bb3dd0cc0bb2a6a
RPush append one or multiple values to a list
class BalanceRedisBase extends BalanceBase public function rPush () { $phpExecStr = '$result = $this->cacheWrite->rPush(\''.implode("','", func_get_args())."');"; eval("$phpExecStr"); return $result; }
1
d09324df9425e5065e85042c114a8f7a
fffc352f76033baf71895a67c5842080
修改成功后转到用户列表页面展示修改后的信息
class UserChangeView(UpdateView): def get_success_url(self): return reverse("users:detail", kwargs={"username": self.request.POST.get('username')})
0
58e1fba444de81bb558a9203ecab5f34
387d0e4872b4ae79ec543e189bcea355
Get Dhpay Args for passing to PP
{ $fields = [ 'cmd' => $this->transaction_type, 'business' => $this->merchant_id, 'amount' => $this->amount, 'currency_code' => $this->currency, 'custom' => $this->order, 'notify_url' => $this->url_notifi...
1
c46e7cd10d554939b60a9fba2d1f7094
739b31a67a8e8ba214aacd7ff0368230
时间转时间戳方法
getDate2Time(date){ let val = new Date(date).getTime(); return val }
0
4489148fdaef6ef16e17e237e4d7e949
c2a4f536f7eb095fcd41b01e13458db1
Mode matching between two elliptic beams.
free_amplitude=1.e-9, free_phase=np.pi/2., near_amplitude=1.e-9, near_phase=np.pi/2., Q=1., k=1., omega0=1.): self.amplitude = amplitude self.free_amplitude = free_amplitude self.near_amplitude = near_amplitude self.phase = phase ...
0
6ffe0eb01b914825c25c4a79211c17c9
6898728a774dfbe1eb437d8e2437cc17
获取用户推送消息列表 默认获取最近60天的记录
queryPushListReq = new QueryPushListReq(); queryPushListReq.setCurrentPage(currentPage+""); queryPushListReq.setPageSize(YhmallConstant.PAGE_SIZE); queryPushListReq.setSort("desc"); queryPushListReq.setUserId(getUserId()); queryPushListReq.setType(YhmallConstant.USER_TYPE...
0
79d2d1bd17eb150a9d57667e9b223520
c9b5aeb1956cfe94fcaedafef4e64165
changes the hasSoftwareTester value when it is changed in the ui.
{ isHardwareSupportClick = true; if (isSoftwaveSupportClick) { isSoftwaveSupportClick = !isSoftwaveSupportClick; softwaveSupport.BackColor = Color.FromArgb(255, 51, 63, 75); } hardwareSupport.BackColor = Color.White; ...
0
8d718be1ae041d47ce5095088bdc7a80
e62185b43f28b7bf98a0e4a71a2a472f
Parses response for Indy request with fees.
return new FeeData() .setNodeData(feeData.hasNodedata() ? FeeComponents.fromProtobuf(feeData.getNodedata()) : null) .setNetworkData(feeData.hasNetworkdata() ? FeeComponents.fromProtobuf(feeData.getNetworkdata()) : null) .setServiceData(feeData.hasNodedata() ? FeeComponents.fr...
1
3135444f7944092e975887598891acf3
ff6540f93ee1cf258a326bfc2a53c2a7
Merge Positions from all_rank into hitters_stats and pitchers_stats dataframes
def impute_combine_stats(df): cols = ['pos', 'age', 'height', 'weight', 'forty', 'vertical', 'broad', 'bench', 'threecone', 'shuttle'] stdev = df.loc[:, cols].groupby('pos').std() mean = df.loc[:, cols].groupby('pos').mean() imputer = (mean - stdev).dropna().to_dict() for metric in imput...
0
af4bebe5baa717339b151dd2e97318de
ae9edc4fae524dda6c3be12aab830f9a
0. Nhập thông tin một sinh viên
{ Console.Write("Nhap ten SV: "); tensv = Convert.ToString(Console.ReadLine()); Console.Write("Nhap Dia chi : "); diachi = Convert.ToString(Console.ReadLine()); Console.Write("Nhap lop : "); lop = Convert.ToString(Console.ReadLine()); ...
1
82a46d0a3f3561c399b97d5420031a04
71a576a08295bd0663c7ea2397c3a63c
Checks if a file name exists in Saves folder.
namespace BasecodeLibrary.Utilities public static class SaveManager public static async Task<bool> FileExists(string filename) { return await ApplicationData.Current.LocalFolder.TryGetItemAsync(filename) != null; }
1
0c3a220dd751d5de2ceb9c6934977660
2b57f5dc885be3bb1d0322f517973d2c
Invalidates all items tagged with the given String.
void invalidate(Iterable<String> locations);
0
594ee2dc6a7592b79c440621eabd8daa
7a94d522a3d69461099ccd5eefddcf9a
.. "\n"
r#" /\ /\ {==} You Must Construct Additional Pylons! {==} \/ \/"# }
0
c91b6cb35b2f1e6d413bf1c6d9aaa1d7
647614d2dcb878302822deedc44cbccd
Determines maximum integer limit to prevent overflow.
{ $dbType = self::castDataType($column->dbType); switch ($dbType) { case Schema::TYPE_TINYINT: $max = $column->size >= 3 ? 127 : str_repeat('9', $column->size); break; case Schema::TYPE_SMALLINT: $max = $column->size >= 5 ? 3276...
1
edc05dc32e4c28b973b7b8a95d0fdf28
7a6bb80be1ae108a3aa2e9b260d15081
Gets the user-visible description of the route. <p> The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device. </p>
@Nullable String getDescription();
1
dbb1633f2ae902b333aa241fa50eabd3
e0e57a1ef12bc852accfc3ef37dc0853
Adds caption to the thumbnail
class ImageMagick createCaption (dest, { text='Hello, world!', backgroundColor='black', fillColor="#ffffff", borderColor='black', size='740x280', borderSize='30x30', font='ArialUnicode' }) { dest = path.join(this.rootDirectory, dest); return new Promise((resolve, reject) => { const child = spaw...
1
25ed87ca3827225e3795aa8e6c7031de
c1bfc6d2c43afab1a558bd979bc354b7
NewSender constructs a Sender
impl Sender pub fn new(sender: async_channel::Sender<Connection>) -> Self { Self { sender } }
1
3e691a8213f9d751b3d1aa5036f6256b
88904b4de16a5d7d1b407e2b89001527
returns name of primary key field Returns: string: primary key field name
def get_primary_key_type():
0
5f616ca75adc10f00c3e39ba1b44bb88
02adc727de3ef827cd26325099bb245e
To find the number of trips with exact hops given.
acc = 0 for key in routes: if iata in routes[key]: acc += 1 return acc
0
16e6fe521148f486c8f362df4a241033
cc646fc304406d44f9c0da736b339c08
Register a field to be spatially indexed
public void addSpatialLocationFields(Coordinate coordinate, Document document) { document.add(new Field(IConstants.LAT, NumericUtils.doubleToPrefixCoded(coordinate.getLat()), Field.Store.YES, Field.Index.NOT_ANALYZED)); document.add(new Field(IConstants.LNG, NumericUtils.doubleToPrefixCoded(coordinate.getLon()...
1
8222e46930ef4b15e4582eddba0da126
ec8471e6813c54926fe129ebcd302d6f
output the next category that should be fed to the yelpAPI based on user preferences
current_user = request.user user_interests = current_user.profile.user_interests industry = current_user.profile.industry cuisines = current_user.profile.cuisine max_price = current_user.profile.max_price radius = current_user.profile.radius user_liked_location_placeID_set = FeedbackRecomme...
0
fdb240528f9a85cca17a7203ff07730b
b6201e8d29e0b8c6c78f464e5005a8aa
根据解析的报文中的功能码,组织报文并发送
namespace DES.Protocols.BYDQ public class ParserManager public byte[] GetBytes(BaseEntity protocol) { var functionId = protocol.FunctionCode; if (functionId == 7002) { var responseSign =protocol.ResponseSign; functionId = Convert.ToUInt16(r...
1
df4fc30bbe752b468820e38f23c4c8cb
4657a124af91cd6bff967aa1e3c51037
output: dictionary that maps keylist[i] to L[i]
def L_twoLtoADict(keylist,valuelist): if not keylist or not valuelist: return return dict(zip(keylist, valuelist))
1
feed88b695f84357d73df731ab8ed58c
a2c421bf4a3533f251dc035aed464d92
Gets the next node of this node in the order of the post-order depth-first traversal (DFT). Note that, postorder DFS visits the parent node only AFTER when their children nodes are traversed.
{ if (this._node.Count <= this.Index + 2) return null; return this._node[this.Index + 2]; }
0
06bf54a107ae788f5a9f365f6c68fbbd
71ad1ef2f26c2be9e954f1fbdd80dfd1
Create a new instance using an OpenSSL cipher string.
class X509Certificate(signature.SignatureMixin): def from_buffer(data): return X509Certificate.from_open_file(io.StringIO(data))
0
66b31926b40aae0ff27ea3de5b4b4106
aa74759e9957300235a1bd024f02ecb5
Get a list of files that need to be checked based on which files are managed by git.
def _get_changed_files(): changed_files = set() filenames = git_diff('--name-only') for filename in filenames: filename = filename.strip() filename = filename.replace('misc/requirements/requirements-', '') filename = filename.replace('.txt', '') changed_files.add(filename) ...
1
142c71bcacf39729b1734636ded5acc7
d1856e4b94760c9a7d61c13992ea6fe3
Stores an integration ID
class Integration extends Model public function getId() { return $this->id; }
0
0b44848e58614d8cc8e81f4fe020b492
8a4ac34150c9a3394085f39c1714381f
Since all instances are the same, the ID can be same for all instances.
public abstract class SingletonPE extends ProcessingElement @Override public ProcessingElement getInstanceForKey(String id) { return this; }
1
7954604190dda78c84eebcde87dabf28
4cc7dead27d542c7df2d3c5ea3e5d060
Desactiva la pausa del juego
class Button_Pause(Button): def pause(self,control,settings): if self.rect_button.collidepoint(control.mouse_x, control.mouse_y) and control.flag == "CLICKED": settings.play_game = False
0
aef93909c300684b016ca744ff0d5107
e09ea2c792869a2bb0f9c8a4e9f14c8f
============= Get list of available columns of a table returned by a user defined function ===================//
{ QString tableName; for (const QString& table: tables) { if (table.contains(ver)) { tableName = table; break; } } if(tableName.isEmpty()) { return QStringList(); } QStringList functions; QSqlQuery query(m_Db); QString strQuery = QString("S...
0
58f7624109fb015e363ead0cbb313a17
01d92504748f51a45fe2ec86462b13bf
获取上一次加载的时间
public class SharedPreferencesUtil public long getPreUpdateTime() { return sharedPreferences.getLong(PRE_UPDATE_TIME, 0); }
1