query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
3b99c87f50f9601a0238f70f52cf9bbc | dfac639a7fd3b2e5c9737109d968e144 | Create an expression node for a 64-bit integer constant | class ConstExprNode(private val value: Int) : ExprNode()
override fun generateCode(): ByteArray {
return byteArrayOf(0x41).plus(Leb128.toSignedLeb128(value))
} | 0 |
68d37d95342ed55e8a0052a1b7978a6d | b65a91cc6dd298cd38f1328fd28b9089 | This function renders all the assets currently have, and categorized by
asset type. | def assets_list():
_assets = assets.get_list()
return render_template('assets.html', assets=_assets) | 0 |
07556ddf21579efdbda8edea91de7f03 | d057f297066d5b8a89712429e0b47a0c | ! @brief Clears all the transformations for input and output | {
m_currentEvents.clear();
for(set<EVENTID>::iterator it = m_inputEvents.begin(); it!= m_inputEvents.end(); it++)
{
m_currentEvents.insert((*it));
}
m_processInput = false;
m_inputEvents.clear();
} | 0 |
a4c81906b06058abf316fcc66c5a1b64 | 2ccfaba647035985141865382945d03c | Refreshes the selection of site | public partial class CMSModules_AdminControls_Controls_Class_ClassSites : CMSUserControl
protected void usSites_OnSelectionChanged(object sender, EventArgs e)
{
SaveSites();
} | 0 |
cbf9a6fc9f1b665175a550c00f3f0da4 | 96216464cd22f97bf6948604cc32fd70 | Sets security setting (iptables:port) if needed. | class HttpRequest extends Component{
public function setSecurePort($value)
{
if ($value != $this->_securePort) {
$this->_securePort = (int)$value;
$this->_hostInfo = null;
}
} | 0 |
e5eb4c2c1f48917daac11207c11bcc83 | e6e8c339b8e773e2d08c3f3f4c99e127 | Get collection of Group instances sorted by their weight | namespace Umbraco.Core.ObjectResolution
public abstract class ManyObjectsResolverBase<TResolver, TResolved> : ResolverBase<TResolver>
where TResolved : class
where TResolver : ResolverBase
protected IEnumerable<TResolved> GetSortedValues()
{
if (_sortedValues == null)
... | 1 |
b1d16277673b26bcb30190c069f9a763 | 76586f6cd8db7810e3ace283bf9c338f | By default those errors contain an `X-Cascade` header set to `pass`,
which allows nesting and stacking of routes
(see Grape::Router for more
information). To prevent # this behavior, and not add the `X-Cascade`
header, one can set the `:cascade` option to `false`. | super do |builder|
builder.use *authentication_middleware(options[:authenticator])
builder.use Psc::Faraday::StringIsXml
builder.use Psc::Faraday::AcceptPscTypes
builder.request :json
builder.request :url_encoded
builder.use FaradayStack::ResponseXML, :content_type ... | 0 |
bef2681b01e89ee151f4a81b23faaedc | 43e4d63d7cf338ce3acad88cc838fff7 | Mixin to set both access and refresh token to cookie securly.
アクセス・リフレッシュトークン共にクッキーに安全に保存します | set(
"token",
{
access_token,
refresh_token,
},
{
secure: useSecureCookies,
sameSite: (useSecureCookies && "strict") || undefined,
}
);
} | 1 |
710b003fd71f30c8468b8a96d642af0c | b7c54a81ea45c18df3fedc2c97e9fde3 | 根据用户名和日期查找日记 | public class DB implements ServletRequestAware{
public String findDay(HttpServletRequest request,String userName,String date){
try{
ArrayList listName=null;
HttpSession session=request.getSession();
listName=new ArrayList();
rs=selectDay(request,userName,date);
... | 1 |
36110cc563a67796af2dcd56cd344e46 | 43f96153955048ccb7ea2b7ec73b2291 | 使用HttpClient将字符数据post到url上 | public class HttpUtil
public static String sendPostByHttpClient(String uri, Map<String, String> map) {
HttpClient client=new HttpClient();
PostMethod postMethod=new PostMethod(uri);
try{
if(map!=null){
List<NameValuePair> params=new ArrayList<NameValuePair>();
for(Map.Entry<String, String> enrty:map.en... | 1 |
1c22f22594de9abd55e96447588f7381 | 78e292a0ceac7eeec5d551945920e8cf | Jump back a character. | void kscm__backchar(kscm_t* kscm)
{
kscm->currentline--;
} | 0 |
d09e3bf9a3fbbadb46087aa9bd5bdb99 | 941fa486607dca7ecdb76c03d89a1249 | Before we do anything complicated, check whether we even need to update our position to start with. | bool ISOOptimizedTileLayer::beforeUpdateContent()
{
CCPoint startMapCoord=isoViewToGamePoint(m_tOffset);
m_iStartX=(int)startMapCoord.x;
m_iStartY=(int)startMapCoord.y;
return m_iStartX!=m_iLastStartX || m_iStartY!=m_iLastStartY;
} | 1 |
9dccc7923e402a6ae3828532f76ee924 | 524ae4c75d4d4912c154c3c196ac3bcf | returns whether a provider can provide the given resource | public class Community implements Serializable, Changeable
public boolean hasProvider(String providerName) {
return this.providers.get(providerName) != null;
} | 0 |
f9663f5cd84fcdcabd1bbe83b1d6453e | 6aaf28578f569a1a55630b42052e1121 | Creates augmented Sigma points for the predicion steps | void UKF::AugmentedSigmaPoints(MatrixXd* Xsig_aug_out) {
VectorXd x_aug = VectorXd(n_aug_);
MatrixXd P_aug = MatrixXd(n_aug_, n_aug_);
MatrixXd Xsig_aug = MatrixXd(n_aug_, 2 * n_aug_ + 1);
x_aug.head(n_x_) = x_;
x_aug(n_x_) = 0;
x_aug(n_x_+1) = 0;
P_aug.fill(0.0);
P_aug.topLeftCorner(n_x... | 1 |
46e1f95c82c78ab7832ff8e7ea0becb9 | 1033513ae69a97fc59c8cfa3b30bab23 | Crea una instancia de linea de factura | $LINEA_FACTURA_ID = 1;
$LINEA_FACTURA_CONCEPTO = $_REQUEST['LINEA_FACTURA_CONCEPTO'];
$LINEA_FACTURA_UNIDADES = $_REQUEST['LINEA_FACTURA_UNIDADES'];
$LINEA_FACTURA_PRECIOUD = $_REQUEST['LINEA_FACTURA_PRECIOUD'];
$FACTURA_ID = $_REQUEST['FACTURA_ID'];
$linea_factura = new Linea_Factura($LINEA_FACTURA_ID, $LINEA_FA... | 1 |
c7fe5cf5f04977d463e4985f9a918180 | b7314654f43ca230e68b5d3564737390 | functia afla lungimea unei liste dublu inlantuite 0.5p | int sizeLC(TLista l) {
int nr = 0;
TLista x = l -> urm;
while(x != l) {
nr++;
x = x -> urm;
}
return nr;
} | 0 |
ce6b1b21c1cd82e0830217a77a8498f2 | 8c821e4d862ca334c2cd5cd18a5bd0c3 | 功能说明:
函数delTimer用于移除一个注册的定时器,移除后的定时器不再执行。只执行1次的定时器在执行回调后自动移除,不必要使用delTimer移除。如果delTimer函数使用一个无效的id(例如已经移除),将会产生错误。
到KBEngine.addTimer参考定时器的一个使用例子。
参数: | int del_timer(timer_id id)
{
if (id <0 || id > timer_list.max_num) {
return -1;
}
struct timer *node = timer_list.header.lh_first;
for ( ; node != NULL; node = node->entries.le_next) {
if (id == node->id) {
LIST_REMOVE(node, entries);
timer_list.num--;
free(node->user_data);
free(node);
return 0;... | 1 |
258ba6eb4fb854ee8b70fd0cea599ba7 | 67c469efc259f21a12e60e4ffebe0c16 | 存储比赛欧赔数据 | public boolean saveSizeOdds(List<OddsSizeResponse> list); | 0 |
2f01cd3744ac490f2eb9e9b858d38653 | a240e7bb1423ab9e8f6763fc79f8c9e1 | List of backup path. e.g. `["/home", "/var"]`. | impl LightningFilesystemPersister
pub fn backup_path(&self) -> Option<PathBuf> { self.backup_path.clone() } | 0 |
d879d5fcca24c5615f1c3966b8f21ec5 | bd49c053219c1848e22457f03e195dff | 从QUESTION对象中提取USER放到User仓储中 | @Repository
public class QuestionUserMetaDao
public void insert(List<QuestionUserMeta> list) {
Multimap<Long, QuestionUserMeta> data = ArrayListMultimap.create();
for (QuestionUserMeta questionRecord : list) {
questionRecord.setId(generId(questionRecord.getUserId(), questionRecord.getQuestio... | 0 |
2e19fde13deac41186db89c7faeee65c | 78cebd1aa8c8dd38709cfec072c2379f | Test whether two strings are identical after trimming, lowercasing. | abstract class BaseTestSuite extends \PHPUnit\Framework\TestCase
public function assertSameTrimmed($needle, $haystack)
{
return $this->assertSame($this->trimContent($needle), $this->trimContent($haystack));
} | 0 |
1df8b056b7b35cd9582d73ad59806fab | 487205648b08524dc56c9f3f0890e9a4 | 读取jpg数据解析放进rgb结构体里面 | {
struct jpeg_decompress_struct cinfo;
struct my_error_mgr jerr;
FILE *infile;
JSAMPARRAY buffer;
int row_stride;
if (NULL == (infile = fopen(filename, "rb"))) {
printf("can't open %s\n",filename);
return NULL;
}
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_e... | 0 |
93859ce7f0eaa673ec0a7d0eec7e8b76 | 0807c409ce8884d4e2cb1829aa989702 | Locks the door | vehicle = self.player.vehicle
if vehicle:
if lock:
vehicle.lock_door()
else:
vehicle.unlock_door() | 1 |
36f303a953412c48222f9770107fac65 | a66b1178916e65c153766f4db6dd7cab | Resets a behaviour to its initial state. | public abstract class ThoughtBehaviour : MonoBehaviour
public abstract void ResetBehaviour(); | 1 |
fcbb01cbd49ea48555dc80b25925a383 | 1cb02ee3a30b4f81a9944a829f471996 | 获取某状态的所有ECS实例集合 | class getAliCloundEcsListSet(APIView):
def get(self,request, *args, **kwargs):
PageSize=request.GET.get('pageSize') or 15
Page=request.GET.get('page') or 1
RegionId=request.GET.get('region') or 'cn-shenzhen'
tagkey=request.GET.get('tagkey')
tagvalue=request.GET.get('tagvalue')
currAccount=reque... | 0 |
5d53c28a483dbe8691037b45cb00063f | 784b4ce20591dacbb84afc5ffd196150 | 是否显示输入验证码的付款界面 | if (isShow) {
document.getElementById("cash").style.display = "block";
document.getElementById("cash1").style.display = "block";
document.getElementById("qrcode").style.display = "none";
document.getElementById("qrcode1").style.display = "none";
document.getElementById('cash'... | 0 |
54f26b72a08c25d82ba465730fa0a27c | 3b7ec3ee56fd8e14afb31a6a73af34d7 | 打印日期: yyyy-MM-dd HH:mm:ss | System.out.println(new java.sql.Date(new Date().getTime()));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date = sdf.parse("2109-7-30 11:11:20");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
}
} | 1 |
d52fe6759712c1689c6259e00ae272b0 | b1631fae0c7399a273104e6351f94c51 | <pre>
Process a workload SSO AuthNRequest. If the user is already authenticated
an appropriate authn response will be generated to the workload SSO. If not,
an appropriate authn request will be generated to either cloudera-sso or
to one of the customer defined identity providers.
</pre> | throws AuthenticationException {
logger.debug( "New authentication" ) ;
Timer.Sample ssoTimer = CsapMeterUtilities.supportForNonSpringConsumers( ).startTimer( ) ;
Authentication result = super.authenticate( authentication ) ;
CsapMeterUtilities.supportForNonSpringConsumers( ).stopTimer( ssoTimer, "csap.securi... | 0 |
ff033e226690aaf3d9b4eb4e9ad1344e | 0cb26aa80be646dddf981968987c97c6 | Функция определяет находся ли одна точка севернее другой | {
return (line.a * p1.X + line.b * p1.Y + line.c) *
(line.a * p2.X + line.b * p2.Y + line.c) > 0;
} | 0 |
10aa62984eb6a647239cca7ba8d6721f | 713c76272e7b9eb1450da6b54b0524c2 | Aşağıdaki fonksiyon datPersonel tablosundaki bir kayıdı günceller. | {
SqlConnection conn = WorkingContext.GetConnection();
SqlCommand sqlCommand = new SqlCommand("UpdateEmployee", conn);
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.Parameters.Add(WorkingContext.CreateParam("@EmployeeID", SqlDbType.Int, "Employe... | 1 |
a51df8e31ee4ffa3ec9ccf925c953b6d | f12fdf1052c26d73105ec2bc0afb62a9 | ค้นหา access_token จาก user_id กรณีได้มีการลงทะเบียนรับข่าวสารทาง LINE ไว้แล้ว เพื่อนำไปส่ง LINE Notify | {
$this->selected_user = $this->attenders->where('user_id', $user_id)->first();
Log::debug(sprintf('【%s】LINE:%s selected_user:%s', __METHOD__, __LINE__, $this->selected_user));
} | 0 |
aac58f90f449e30a6f0892b82eeccf8a | 8d2f0ebb6a5929747210514509d3097b | Python to C++ enum conversion. | static void QX11EmbedContainer_Error_PythonToCpp_QX11EmbedContainer_Error(PyObject* pyIn, void* cppOut) {
*((::QX11EmbedContainer::Error*)cppOut) = (::QX11EmbedContainer::Error) Shiboken::Enum::getValue(pyIn);
} | 1 |
a8b5b48e9a13bf5e94f9e750c0583d46 | 999352a3a2cd5bcc837fecb224951c51 | Inject authorization key into all requests. | if (authentication.getPrincipal() != null && authentication.getPrincipal() instanceof AccountUserDetails) {
AccountUserDetails userDetails = (AccountUserDetails) authentication.getPrincipal();
response.addHeader(API_KEY_NAME, userDetails.getAuthenticationKey());
}
} | 1 |
0a0496e7704813cdeea81ffd5e9ff35d | 9d2d88a440692ae28171a6abcc8eacda | Gets the rowCount property value. Returns the total number of rows in the range. Read-only. | public abstract class
AViewBean<T extends Object, ID extends Number, S extends IGenericService> implements java.io.Serializable, ILoadable
public Long getRowCount() {
return rowCount;
} | 1 |
37115b27198cdb8f54fd8d1faf5b83b4 | 1c0b61dc1b1cc54e70806ec513d68bf6 | Get a DirectInput-compatible Guid
(equivalent to DIDEVICEINSTANCE guidProduct field) | class radControllerDirectInput
:
public IRadControllerDirectInput,
public radRefCount
virtual const char * GetType( void )
{
return m_DirectInputDeviceInstance.tszProductName;
} | 0 |
7858ad9a6d4688413f932039b3b633f3 | 47267c1027af59239590b4b10d58257f | 按照openid删除数钱游戏结果 | public void delResults_dt(ApiResponse<Object> listApiResponse, String msg) {
try {
if (listApiResponse.getErrorCode() == 0) {
if (GameGcActivity.type.equals("xhdt")) {
CommonUitls.showSweetDialog(this, msg);
mXhdtPrensenter.getXhdtList();
... | 0 |
6ceea624e31b239df22b9a08e56ccb66 | df276a81dcabdd9f17c05869ff433f0a | Updates the lobby screen. | public class LobbyActivity extends AppCompatActivity implements ICommListener, ILobby
private void updateUI() {
if (uiChanged) {
if (newPlayer != null && openOnlineSlots>0) {
for (int i=1; i<MAX_PLAYERS; i++) {
if (playerSelection[i] && playerTypes[i].equals(ONLIN... | 1 |
865c2a0e1e00c173cd44f0782526eba7 | d0360ce4afcdf762f19580bd2871c257 | Calculate tasseled cap transformation | const Vector3 & I,
const Vector3 & N,
const float32 nI,
const float32 nT,
Vector3 & T,
float32 & coeffT,
Vector3 & R,
float32 & coeffR
) {
const float32 n = nI / nT;
const float32 cosI = Dot(I, N);
const float32 cosTSq = 1.0f - Sq(n) * (1.0f - Sq(cosI));
R = I - ((2.0f * cosI) * N);
if (cosTSq ... | 0 |
4d2ef6c08e48ca23edd5cca7cff3e402 | c12cacd3d36286cedaa554e0f48e2b2a | Test behavior when passed a filename only. | def test_file(filename):
td = environment.Tide(filename)
assert td.filename == filename | 1 |
4b1833ef7097ed5343f496efa7d96ce7 | 99121452c6d148e0da94aa1b7503aa16 | counts number of empty tiles | int row, col, num, count = 0;
for (row = 0; row<len; row++){
for (col=0; col<len; col++){
for (num = 0; num<len; num++){
if (cube[row][col][num] == 0){
count++;
}
}
}
}
return count;
} | 1 |
9fb42c2d891c2420d85db0d3744f49c3 | e87526bc37f3b57fac0404f0d166fd21 | Simplified method form for invoking the DescribeReservedCacheNodesOfferings operation. | namespace Amazon.Redshift
public partial class AmazonRedshiftClient : AmazonServiceClient, IAmazonRedshift
public virtual IAsyncResult BeginDescribeReservedNodeOfferings(DescribeReservedNodeOfferingsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
... | 0 |
3e5d5950572e1def8a1bd605af673f94 | b602c13eba6e7b08315d9bcbbb7c61cb | CheckIfConnectedToNetwork returns true if connected to a network | func CheckConnection() error {
_, err := StatusAll()
return err
} | 0 |
6cc6a537b0e56ac62f7e9c461e27a80e | 0e24181c3f0ed0854dbb651089851789 | Returns an SVG path string of a cubic bezier curve. | const oneThirdX = round((targetPoint.x - sourcePoint.x) / 3) + sourcePoint.x;
const twoThirdsX = round((targetPoint.x - sourcePoint.x) * 2 / 3) + sourcePoint.x;
const sourceBottom = sourcePoint.y + thickness;
const targetBottom = targetPoint.y + thickness;
con... | 1 |
d9fced2e369ec6d83b3854627ced499c | d05d5053975a6e8c65ba80e1aab3ec91 | 得到一个菜单的所有记录 | class M_Menu extends Model
public function getMenulist(){
$data=$this->Select();
return $data;
} | 1 |
4bee455c44b5ba8dfb5ba5a5f8910d2c | 20d4d64edc1525e22c45d0aa46858747 | Coin flip game with a 50/50 chance to win.
Pick heads or tails and place your bet. | class AlwaysBet(HeadsUpStrategy):
def __init__(self):
super().__init__() | 0 |
99cdcea26a4a9c0d1454cda4c3e338d0 | 585d5ca56f87fbd957c0ed76d5ec888f | Each inbound doorbell bit can be masked from generating IRQ by setting
the corresponding bit in inbound doorbell mask. So this method returns
the value of the register. | uint8_t Haptic_Driver::getMask(){
uint8_t regVal = _readRegister(IRQ_MASK1);
return regVal;
} | 1 |
9583a7f5a1ca608ec9704c5bc166080e | 11597897f587b48083cee33398fa0d14 | Initializes the store with the starting url from request. | use_set = self.settings.getbool('REDIS_START_URLS_AS_SET', defaults.START_URLS_AS_SET)
add_urls = self.server.sadd if use_set else self.server.lpush
add_urls(self.redis_key, *self.start_urls)
return self.next_requests() | 1 |
838218f0d54ff3e670d1142ebc6ea3f8 | 53b97eb8b3b628db9dc3b568ed4c7910 | 获取所有的桥梁隧道信息表 | {
try
{
List<TrunkInfo> trunkInfos = new List<TrunkInfo>();
string sql = "select trunkid, trunkname, opcid, opcnname, dpcid, dpcname, cic, pcm from t_b_trunk ";
using (DbDataReader reader = DataHelper.ExecuteReader(CommandType.Text, sql))
... | 0 |
a6c89c382e4583bfbce30514e685977a | fa7934d6c51dc261fa3866375cdcf443 | Returns a new object of class '<em>Information Arc</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | void createArc(IWfnTransitionAndPlace source, IWfnTransitionAndPlace target); | 0 |
33d07e4602ff410956fcb76e7d7962ab | 63246a9036d14a12d59db2668e595701 | @brief Enables or disables the SEQB Start. | {
int32_t ercd = E_OK;
uint8_t retval = 0;
MRF_CHECK_EXP(spi_check_obj(mrf24j40) == E_OK, E_OBJ);
MRF_CHECK_EXP(mrf24j40_read_short_ctrl_reg(mrf24j40, MRF24J40_SECCON0, &retval) == E_OK, E_SYS);
retval |= accept ? MRF24J40_SECSTART : MRF24J40_SECIGNORE;
MRF_CHECK_EXP(mrf24j40_write_short_ctrl_reg(mrf24j40, MRF24J... | 1 |
970684cc62521304c05a265a83703119 | b965526caddbc12927b4640e27331d82 | Test case for get_self_addon_by_id | r = self.client.get(self.addon.get_url_path())
assert pq(r.content)('#detail-relnotes .compat').length == 1
a = Addon.objects.filter(type=amo.ADDON_SEARCH)[0]
r = self.client.get(a.get_url_path())
assert pq(r.content)('#detail-relnotes .compat').length == 0 | 0 |
c63cb148fccedc3fd4cd3fa711ed29e2 | 732d85db935041ba10045efd9a6665de | This should be called when changes have been made to the server,
but the list has not syncronized yet | class ServersController
def update_list
msg = Server.update_list
render :text=>msg and return
end | 1 |
5f4567516fe8f4b25d35ee43c78ce008 | c7d6cbcceb78a7641b14ffa47fefa929 | Tests the multiple HTTP POST functionality of the RestClient. | class TestCVEsCorrect(object):
def test_post_multi(self, rest_api):
self.post_multi(rest_api, rh_data_required=True) | 1 |
7c01636d3506574cbb1d6979002d84f4 | 365b55a76d808943e273309a66c10644 | 得到方法的参数列表 并转换为json | Signature signature = joinPoint.getSignature();
String[] parameterNames = ((MethodSignature) signature).getParameterNames();
Map<String, Object> map = MapUtil.newHashMap();
Object[] args = joinPoint.getArgs();
for (int i = 0; i < args.length; i++) {
if(ObjectUtil.isNo... | 1 |
ce41f670a270592bb28ad71ab9bccf24 | f156bce68e419aa1f8813d3f935d6074 | Iterate over the reactions in the set. | {
for (int i = 0; i < Reactions.Length; i++)
Reactions[i].React();
} | 1 |
2b0b7f137281fa89e41c538601ed9cc2 | 9709846aeb0458e1d9c4297f7f74330b | Sets the gpu of this InlineResponse2002DataNodeRequirements. | public class EdgeNodeResourceInfo extends AbstractModel{
public void setAvailableGPU(String AvailableGPU) {
this.AvailableGPU = AvailableGPU;
} | 0 |
20b925133d50e45f1d70db2c306e7f87 | 2d91b51e951820156c9a86451ba85b41 | destroys drawer when component closed | public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleMap.OnPoiClickListener, SchedulerEvent.SchedulerEventListener, ILoadingSaving{ public void initDraw(){
public void onDrawerClosed(View view) {
} | 0 |
73a431397b8258bc3b7c926ca52e074e | a79f34148487ede84c8c1e9496f6b6c6 | Fuehrt eine Dreieckszerlegung nach Gauss durch. | int m = a.length, n = a[0].length;
for (int h = 0, k = 0; h < m && k < n; k++) {
if (a[h][k].compareTo(BigFraction.ZERO) != 0) {
for (int i = 0; i < m; i++) {
if (i != h) {
BigFraction q = a[i][k].multiply(a[h][k].inverse());
... | 1 |
3f01c149e947ee9a4efc91b640e7802d | e60b214d53f66b51ee7b162d7aa809ea | Test l1-regularized logistic regression create under particular | tf.reset_default_graph()
K.set_session(tf.Session())
x = np.asarray([[0, 0.1], [-0.3, 0.6], [0, 0]])
x_keras = K.variable(x)
L21_reg = L21(1.0)
l21_norm_x = L21_reg(x_keras)
self.assertAlmostEqual(l21_norm_x.eval(session=K.get_session()), \
... | 0 |
320f001843bdb725b205072aa5449150 | 0be134a3f31cc4d7d305794fd58c6431 | set the scale of the confirmation dialog to be 0 (ie. disabled) | public class StatsMenu : MonoBehaviour
public void ShowConfirmationBox() {
confirmationDialog.transform.localScale = new Vector3(1, 1, 1);
} | 0 |
cc732a71522b8303f1dfb9b40ac117b4 | 7571629c97479dc7370f690dd45d53c8 | コストを支払う | public class GameManager : MonoBehaviour
public void spend(int cost){
money-=cost;
moneyText.text = money.ToString();
} | 1 |
8f20aeaa99c60881812a2ed10c31b53b | fe5e520b29b83dcfa031e5bad13099d5 | Populate the address based on the user's location. | if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(position => {
this.latitude = position.coords.latitude;
this.longitude = position.coords.longitude;
this.zoom = 8;
this.getAddress(this.latitude, this.longitude);
});
}
} | 1 |
a02d2e9f789d22661acadd3f97dd4ee3 | a2020aa6572271b34614b98f852bd377 | จำนวนนิสิตในแต่ละชั้นปี ตามหลักสูตรและระดับการศึกษา | {
$newstd_result = mssql_query("SELECT A.[std_enrollyear],count(A.std_stdno) as num FROM [SOAA].[SoAA].[dbo].[vw_bigdata_student] A left join [SOAA].[SoAA].[dbo].[vw_bigdata_student] B on A.pid3 = B.pid3 where A.std_depno like '$dep_no' and A.std_enrollyear >= $start_year and A.std_schoolid <= 2 and B.std_degree = 2... | 1 |
33e7ab007a7b61bfe70bdbee1be819c3 | ee012757bf51668f75729b19ba363ce4 | Update nutrition based on new quantity | $scope.results = data;
$scope.nutrientValue = $scope.amount * data.amountPer100Grams * $scope.foodWeight.gramWeight / 100;
} | 1 |
1b729a2c3e9d9822905d0824991e044f | 1ca5bed6e4c86295e66174d570b87fcb | Creates links to other methods within the module. | include_once('vtlib/Vtiger/Module.php');
$moduleInstance = Vtiger_Module::getInstance('Accounts');
$moduleInstance->addLink(
'DETAILVIEWBASIC', 'LBL_ADD_NOTE',
'index.php?module=Documents&action=EditView&return_module=$MODULE$&return_action=DetailView&return_id=$RECORD$&parent_id=$RECORD$',
'themes/images/boo... | 1 |
cb6b88db522ccf8fec593d2696e47704 | 6a91a37b59f0321b5bc8fbec08fd5c21 | When digit reach to its maximum reset the digit and increase following digit | {
number->max++;
sprintf(&name->str[0], "%d", number->max);
name->all_length = strlen(&name->str[0]);
name->digit_qty = name->all_length;
return 1;
} | 0 |
c228f4724a129c4f364f7b84729d3038 | 3ef9e7cd04d8dd576f45f8b5f5b4b9b2 | Pops the specified tagname off of the stack, and returns the number of tags with the same name left on the stack. | {
$mtag_index = NULL;
if (!is_null($this->mtag_index))
{
$mtag_index = count($this->opened_tags) - $this->mtag_index;
}
foreach (array_reverse($this->opened_tags) as $i => $otag)
{
array_pop($this->opened_tags);
if ($this->tag_match... | 0 |
a3b200711c2c84b392be7045937b430a | 6a9ea6fb51ccd8cbdac405f5df3392c3 | 恢复slot为正常状态 | public class Slot
public void clear() {
tokenCache.clear();
restore();
} | 1 |
7ef55c60794fbbe0957fc95a84d86af7 | 89411c79a3686d21e53a50dcfc60cd18 | Get MySQL based database server IP address | class Servers
def getMysqlServer()
if @@serverList.nil?
output = RunCommandOnMailbox.new('zmlocalconfig mysql_bind_address').run[1]
@@serverList = output.to_s.split('=').last.strip
end
@@serverList
end | 1 |
b0aed918d2eca72895a712a21e55d87d | 7255316af2566b818dd6d180c8795910 | 再構成対象節点(ノード)の親要素(セル)を探索し、部品要素を作成する. | List<Component> nodeList = new LinkedList<>();
SectionInnerPanel nodeInnerPanel = createNodeInnerPanel();
if (nodeInnerPanel != null) {
nodeList.add(nodeInnerPanel);
}
Node[] nodes = getChildren().getNodes();
for (int i = 0; i < nodes.length; i++) {
... | 0 |
eb1c56d1c174586d881b312685b34b2f | 7e6947eafe84de9eeb0310bef4c2c957 | 获取图片宽和高,不能将整个图片加载 | return new Promise((resolve, reject) => {
const image = new Image()
try {
image.src = url
image.onload = () => resolve({ url, width: image.width, height: image.height })
} catch (e) {
reject(e)
}
})
} | 0 |
f1285fb92cb510f1840568039b71e70f | 9054f3cc007385aca9a6ec1defd1692e | #extract matches and mismatches from MD tag | format_matches <- function(PDB_matches){
sseqid_PDB <- rep(0, nrow(PDB_matches))
sseqid_chain <- rep(0, nrow(PDB_matches))
for(pos in 1:length(PDB_matches$sseqid)){
id <- as.character(PDB_matches$sseqid[pos])
split_list <- strsplit(id,'_')
sseqid_PDB[pos] <- split_list[[1]][1]
sseqid_chain[pos] <-... | 0 |
ca15d4b0ca7c1ad915151ff9e0d8cd26 | 4e90fa21452e54d09d98600ab6e985bd | 根据历史记录寻找之前点击过的书的相似书籍 | String queryStr = "select * from " + bookmarkHelper.TABLE_NAME_BOOKMARK + " where fileName = " + "'" + record + "'; ";
List<bookmarkResponse.DataBean> similarRecords = new ArrayList<>();
Cursor cursor = bookmarkHelper.getReadableDatabase().rawQuery(queryStr, null);
while (cursor.moveToNe... | 0 |
b35c6a706f0f8a4f08055fcc5564a8f4 | 86df6ee62d3ea376f205480349089366 | 返回一个小于或等于maxValue的随机正整数 | function randomValue(maxValue: number) {
if (maxValue > 0) {
return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0;
}
return 0;
} | 1 |
e7e1d93a1a53b88d15b23d81969240b7 | 13045352c9d17db87ed4a7625ca8093a | 一个参数,求1到n的和 | def sum(n):
if n==1:
return 1
else:
return n + sum(n-1) | 1 |
cc651a09089fe1f9811c61b9ad23af44 | a5965fadd24b655f5b2af8eda7e90dad | Build the WHERE clause
Method will build the WHERE clause from either an ID, an array of IDs or an associative array
array of fields to match up againt (fields must be in the record schema) | abstract class Mode
function createWhere($id_string)
{
$where = '';
if (is_numeric($id_string)) {
$where = $this->_table_id . '=' . (int)$id_string;
} elseif (is_string($id_string)) {
$where = $id_string;
}
return $where;
} | 0 |
47c775641a7da86c870273810f16d05f | ecdff214d4e7e36bdfb4d6b2ef1e1857 | Select a camera type fixed free or other by passing in ( Basic3dExampleCamera. CAM_TYPE_ options ) | namespace DeveMazeGeneratorCore.MonoGame.Core
public class Basic3dExampleCamera
public void CameraType(int cameraOption)
{
cameraTypeOption = cameraOption;
} | 1 |
74f80a3aad9b2c9a4ad57d4e43ac5bc1 | df6bb5f77c252f1add3603dd33969507 | BGMを速くする関数 | public class audioManager : MonoBehaviour
void fadeIn()
{
if (bgmAudio < 1)
{
FadeIN = true;
bgmAudio += FadeSpeed * Time.deltaTime;
bgmSource.volume = bgmAudio;
}
else
ChangeBGM = false;
FadeIN = false;
} | 0 |
e7b5760df379f84d0e2e4a4baf42ecd8 | fc3f6a2161077eb54a10d250ad87b53d | Helper function to write out phase file for the light curve and the aggregated curve if requested | def make_clean_curve(path, outfile, phase, flux, error=[]):
writeTo = open(path + outfile, "w")
for i in range(len(phase)):
writeTo.write("%lf %lf %lf\n" % (phase[i], flux[i], error[i])) | 1 |
d2a88f67effa14b067e06733c4724294 | 9de6d2dfeee4f895fd5f242ada6272c2 | Integrates a filter_transmission profile against a spectrum to obtain the flux of the bandpass. | if isinstance(filter_name, TransmissionCurve):
vlam = filter_name.lam
vval = filter_name.val
else:
fname = find_file(filter_name, silent=True)
if fname is None:
fname = find_file("TC_filter_" + filter_name + ".dat",
silent=True)
... | 1 |
c2b43a307ac2cccadced45ddf7f0d323 | 36c65fffe3a68d4f1c2a16e54707b177 | Regular expression callback to fix serialised string lengths | class FileProcessor
static uint32_t mapFunc (string inString)
{
uint32_t length = inString.length();
return length > 5 ? length*2 : length;
} | 0 |
242759a6b1e5f2cb57f5d3c121682999 | 4203dfb037fd92899ce74164210d8c49 | 生成征信授权书 | $unsure_text = '**订单生成后可见**';
$this->view->title = '授权扣款委托书';
$order_id = StringHelper::auto_decrypt($this->request->get('id'));
if (!StringHelper::verifyNumber($order_id)) {
throw new UserException('无效的订单号');
}
$user_order = UserLoanOrder::find()->where(['id'... | 1 |
041508d8ac6d288a7328f56a457986d5 | f946381b41a77b012b58fcc9280d0a40 | Returns a hostname pattern. If the pattern matches the hostname the command is allowed on the host | {
$urlHostRule = !is_null($urlHostRule)?$urlHostRule:$this->getHostRule();
$handledStr = str_replace(['*', '/'], ['(.*?)', '\/'], addslashes($urlHostRule));
return '/^' . $handledStr . '/is';
} | 1 |
999b185578b455a05ce5e4348bd6b74b | 6a5a76c665f37cf9e4ec0594017e7c2b | Toggles all elements while the application is processing. | let waitForToggles = setInterval(function() {
if (window.parent.hxGlobalOptions) {
clearInterval(waitForToggles);
JSProblemState.currently_open.forEach(function(n) {
if (
window.parent.window.$('.hx-toggletarget' + n).css('display') ===
'none'
) {
console.... | 1 |
5fd1fbb99e3cce6dc4a6043066cca58a | 4b24635ce084ed2bfa6c29b55466a42c | Override sidebar widget area for INB template | function template_generic_menu_sidebar_above()
{
global $context;
echo '
<div id="main_container">
<div id="menu_sidebar">';
$context['cur_menu_id'] = isset($context['cur_menu_id']) ? $context['cur_menu_id'] + 1 : 1;
$menu_context = &$context['menu_data_' . $context['cur_menu_id']];
foreach ($menu_context['sect... | 0 |
881715e65328789f8db7a61ed9fa208b | b37b8bd2749f75d80a286e127e45c361 | 客户案例生成静态HTML | Channel channel = content.getChannel();
String path = ElianCodes.SHAFT;
if (channel.getContentTemp() != null) {
Map<String, Object> dataMap = StaticServiceImpl.getConfigDataMap(channel,channel.getContentTemp());
Doctor doct = doctorService.get(content.getEntityId());
StaticPageUtils.putResInMap(dataMap);... | 1 |
d5c430df3281804ee1beaa07cb4f4160 | 09cd98753fba463e10aaed513bc93522 | Вывод всех не повторяющихся работающих мастеров которые используют ВК | return Single.fromCallable {
val map = HashMap<String, String>()
map.put("id_work", workId)
map
}.flatMap { requestThingWorx("workers_for_work", it) }
} | 0 |
c51d22078c552fb3b6f2c6b81667482c | 28ce0c9013e8ab548101cb4da857d599 | dp到px的转换 | public class Util
public static int pxTodp(Context context,float pxValue){
float scale =context.getResources().getDisplayMetrics().density;
return(int)(pxValue / scale +0.5f);
} | 0 |
4d5e9dc7917e5c18f73361724489551d | f1eb7140194a51aa91f616bfaf7a8206 | 测试激活服务凭证方法 | {
$passport=$vars->p;
$activekey=$vars->r;
$res=AuthSvc::active($passport,$activekey);
if($res)
$xcontext->status = "suc";
else
$xcontext->status = "fail";
return XConst::SUCCESS;
} | 1 |
b5baa7ab2ccfe863788d0d39c95cee2b | f53b520f954759f7aefba4c42b1765c2 | ## From: https://github.com/joey711/phyloseq/issues/418 | keep.extra.columns=TRUE,
ignore.strand=FALSE,
seqinfo=NULL,
seqnames.fie... | 0 |
a99d09967ad07096f84d0f8ecc1b8da3 | bf7736de42c7552388ada81612436988 | Delete a single user claim value | public class RemoteUserStoreManagerServiceClient
public void setUserClaimValue(String userName, String claimURI, String claimValue,
String profileName)
throws RemoteUserStoreManagerServiceUserStoreExceptionException, RemoteException {
remoteUserStoreManagerServiceSt... | 0 |
9e143ef5137448f5d6588d229de021a8 | 0bc845d9d7a691c34c9227d7186f0324 | Return the libraries defining which elements are included in the scope. | public function getLibraries($included = NULL); | 1 |
0f235ba57e3cabc27bbba2209685206f | 643ad055ebf617d51e8c23a0daac1b4b | El autómata AFN básico está compuesto de solamente dos estados conectados
por una transición, en donde el símbolo que los conecta es el leído | FSM fsm = new FSM();
for (String symbol : R_LIST) {
fsm.addTransition("S2", symbol, "S1");
fsm.addTransition("S4", symbol, "S1");
fsm.addTransition("S3", symbol, fsm.ACCEPT);
}
for (String symbol : CD_LIST) {
fsm.addTransition(fsm.START, symbol, "S8");
fsm.addTransition("S2... | 0 |
9da9f3fc302bb44a773497d0b884b064 | 64dd26563960e5119d40bdef2e67f348 | Función para mostrar el componente para redactar un correo teniendo en cuenta de mostrar
una advertencia o error si alguno el correo, asunto o mensaje no han sido escritos | var nombre=$("#txtNombre").val();
var asunto=$("#txtAsunto").val();
var correo=$("#txtCorreo").val();
var expresio_letras=/^[a-zA-Z]*$/;
var expresion_correo=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
if (nombre=="" ) {
mensajeValidacion("txtNombre");
}else if (nombre.search(expresio_letras)) {
mensajeVa... | 1 |
033cea60db31d75dbe19affec1992186 | 1efc8f8b8ca5a74a1a0ee36bf8ba9326 | Обрабатывает нажатия на пункты в боковом меню | public class MainActivityProp extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
return super.onOptionsItemSelected(item);
} | 0 |
6ce31e53a77526482ebc13fe0e8dd53c | 7867b1ca3386946397c26b3dc1f02b54 | 根据库位和物料,查询盘点单行项详情 | public List<DeliveryMaterielVO> selectListForDetailForStockCheck(Map<String,String>map); | 1 |
8b1dcff9e3dc8b36c8b13aa4f7a61154 | 2743cd27f9660859b42e7de25b972125 | Test the property 'WorkspaceName' | class TestRolandGp8(unittest.TestCase):
def test_property_name_reset(self):
self.p.name = 'This is 16'
del(self.p.name)
self.assertEqual(self.p.name, '*Untitled ') | 0 |
091a70f66d3f770a1ba2ff2a81ff734a | e6953d3b21ddf93a10c3a35b0f4d23af | Returns the directory the running osu! executable is in.
Requires osu! to be open. | def get_dir():
return Logger.CURRENT.get_dir() | 0 |
7bea7279f550f1aee287b52b44d5a63c | 76c213c1c6da00c58f5d9009615102a0 | Sets all fields of a TCP stream listener to their initial values. | address = null;
port = 0;
localport = 0;
} | 1 |
55671c9f07c1b80fae341e8b21b05315 | 2140046c30cdde25a38b9ef6d20c50a1 | Disable use of singleton pattern. | public class ManagementDbActorContext
@Deprecated
public static void unsetSingleton() {
_singleton.forceSet(null);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.