query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ccaa6795fd292074bd6b6d4c10422835 | b5c92e7467a91a37c278f25d8ac8face | Metoda koja dohvaca ime tima. | public class Team
public String getName()
{
return this.name;
} | 1 |
4d11756a4cad8fe8c986c4e0ea4f1a2c | 2e9a3187da9dadd2113a5a657d7dc735 | 输入搜索内容并提交,注意最好每次输入之前先清除内容。 | public class ANDROID_CommunityBaseView
public ANDROID_SearchResultsView inputSearchText(String q){
this.driver.findElement(btnSearch).sendKeys(q);
this.driver.sendKeyEvent(66);
return new ANDROID_SearchResultsView(this.driver);
} | 0 |
8c0c8ea0ebe9c7f3972c506d0b03f588 | 683843cffd1b747916b5f162c6820d6c | Returns a tuple with the distance dictionary and path dictionary.
The first one determines min distance to this vertex from the beginning and the second determines from which
vertex one should come to this one | class ShortestPathGraph(Graph):
def dijkstra_get_tree(self):
if not self._dijkstra_computed:
self._dijkstra()
return list(map(lambda x: (x[1], x[0]), self._d_prev.items())) | 0 |
0f949bfaac4b31f888ff5d3e46e2698c | 1b554e80b2104e1ab76d70e8dfd1107f | WebSocket IDを取得します. | if ($_SESSION['ws_id']) {
return $_SESSION['ws_id'];
} else if ($_GET['ws_id']) {
return $_GET['ws_id'];
} else {
return '-1';
}
} | 1 |
ef5e52e7428bf05459db6b89e1842f95 | 0e07ac1f50e4d9cd8600b587a6a00cc2 | Obtiene el valor de la propiedad idDistrito. | @Entity
@Table(name = "TC_USUARIOS")
@NamedQuery(name = "TcUsuario.findAll", query = "SELECT t FROM TcUsuario t")
public class TcUsuario implements Serializable
public Long getIdLocalidad() {
return idLocalidad;
} | 0 |
7a2298fcef1f3678c0d4fadb8e3917b4 | 5ed7f2e9cc97b86a8c7bae259aea6b66 | Getter for the production power of the player | public int getPower(); | 1 |
373a074271211695ce13fb58dc435502 | b3ae4ae6addc532c0a8250ed2a79d9fb | Use a dummy function to get rid of pylint's R0903 (too-few-public-methods). | def DummyReport(test, **kwargs):
pass | 1 |
e4ef973865e9ac961e33d1fe57a8db15 | 0d54299b6d4bd02e5777f26bf993cb92 | Rechercher un Ouvrage par son idOuvrage
false dans tous les autres cas | class ModeleOeuvre extends ModeleGenerique{
function get_oeuvreby_id($id){
$req_oeuvre = self::$connexion->prepare ("SELECT * FROM mtvlist.oeuvre WHERE idoeuvre=? LIMIT 1");
$req_oeuvre->execute(array($id));
if (! $oeuvre = $req_oeuvre->fetch()) {
return false;
}
return $oeuvre;
} | 1 |
0f1b888bdcbf0a7c365c735359e1711b | aa54c7f47498e91a85b1724b741a5e18 | Remove the genome from the cache. | with self._cache_lock:
if not self.path in self._cache:
return
os.remove(self.path)
fcntl.lockf(self.fp, fcntl.LOCK_UN)
self.fp.close()
self._cache.remove(self.path) | 1 |
6994eb6be427a9d7a6a618c44346ea8c | f251415ae8a0d8afe660e5c5ad20749e | Returns the current set permission holder. | public class SecurityUtil
public static PermUser getCurrentPermUser() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
return (PermUser) authentication.getPrincipal();
} | 1 |
5c18c54fa49825c9131ddb00822dab6d | 350fa9e2635efef1aa3816a0c0985b6a | Add scoped predicates to this optimizer's predicateList. This method
is intended for use during the modifyAccessPath() phase of
compilation, as it allows nodes (esp. SelectNodes) to add to the
list of predicates available for the final "push" before code
generation. Just as the constructor for this class allows a
call... | public class SMTFile
public void addPredicate (String pred) {
preds.add(pred);
} | 1 |
ca9f8d1182cefecf7e86a5c2f084d8ce | 7bdbebfcdbcdabf328c14a63715142e0 | 输入传感器编号,返回传感器中文名称 | class DSSDLL:
def sensors_read_name(self):
result = ctypes.c_char_p(self.dssObj.SensorsS(ctypes.c_int32(0), ctypes.c_int32(0)))
return result.value.decode('ascii') | 0 |
da32d7e6d4ce3d76805a1b15ddc1e268 | a320c4c3f9e2c22045e5815c933e593e | Start a database backup (used by WP cron) | class MySQL(Strategy):
def start_backup(self):
self.download(self.config.get('db_name'), self.config.get('db_host'), self.config.get('db_user'), self.config.get('db_pass'), self.backup_path, self.config.get('db_port')) | 1 |
e59baddf7aa4f9564c2c77bbaaad53f3 | be346993d6487ed5127ad0d9c5bc541e | Adds a food to the foods created array | class Field():
def addFood(self, food):
self.food.append(food); | 1 |
4e5703bc2f90a23322ad3bbc1f9e1dd5 | 7c0e9d539e2964946f9699115a01ee1b | 返回指定 int 值的二进制补码表示形式的 1 位的数量。 | public class Main
private int numOf1(int n) {
int count = 0;
while (n > 0) {
count++;
n = (n - 1) & n;
}
return count;
} | 0 |
67aeb7b42e1fb88e25c9609f0c0687c7 | 7efafb7d857e7a37cddc189817a0bd5b | Detaches a coupon from a course/group. | namespace com.ultracart.admin.v2.Api
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteCouponAsyncWithHttpInfo (int? couponOid); | 0 |
5ab037159175cf41efa59711e8fa3968 | c03cbee30636d939ab41fdee9d0e835a | 用validkey到链上取加密的IPFS哈希 | let valid_vectors = [
("BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4", "0014751e76e8199196d454941c45d1b3a323f1433bd6"),
("tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7", "00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262"),
("bc1pw508d6qejxtd... | 0 |
9abbe99163f02660548e798da05b17b9 | 440cbf81193c1faa7074ced8acd1e732 | package command context with defaults | fn default_command<T, S>(mut self, target: Option<T>, shell_command: Option<S>) -> Self
where
T: Into<Cow<'a, str>>,
S: Into<Cow<'a, str>>,
Self: Sized,
{
self.push(Self::Setter::default_command(target, shell_command));
self
} | 1 |
7768f10a7d6959f69c87438a848c499a | b5a2107e84c18f342dbab142943dfe15 | 获取报告头部文件 | public static function getHeader()
{
$header = phpQuery::newDocumentFileHTML(self::$HEADER_PATH);
return $header;
} | 1 |
09a9d1eaf6d6dd1761f9ba814db6589f | 6c60d514be1a819d71479f7d1c341de8 | the maximum number of slabs that can fit into the tray. | int vertical_fit(int tray_len,int tray_width,int slab_len,int slab_width){
int row=tray_width/slab_width;
int col=tray_len/slab_len;
return row*col;
} | 1 |
023eb4132d1740cfc9dfd177f4e1dc17 | 1428d0a3c4ba5fcf25df625a8b5b7b05 | Calculates a move execution time based on the normal distribution. Modeled
behavior was determined from testing on the CSMS Testbed (see ./timing_analysis/),
and is defined by the mean and stddev.
https://docs.python.org/2/library/random.html#random.normalvariate | rand_x_scale = normalvariate(mu=1., sigma=self.max_scale_pct / 3.5)
rand_x_scale = min(max(rand_x_scale, 1. - self.max_scale_pct), 1. + self.max_scale_pct)
rand_y_scale = normalvariate(mu=1., sigma=self.max_scale_pct / 3.5)
rand_y_scale = min(max(rand_y_scale, 1. - self.max_scale_pct), 1... | 0 |
a0b422c38ddc1285bdb7fa753488b9fb | cc9848209990f64dcd9eb3a9de84cca1 | Создание таблицы "Полная применяемость" и ее заполнение | class m201215_190110_create_table_complectations extends Migration
public function safeUp()
{
$this->createTable('{{%complectations}}', [
'id' => $this->primaryKey()->notNull()->defaultValue("nextval('complectations_id_seq'::regclass)")->comment('ID'),
'name' => $this->string()->notNull()->comment(... | 0 |
05caa2e6e39bc7baf45b1ebc1fdffc68 | 944f724a33c2e41987bfe5854c1e5b52 | Get the ECC Control Register contents of the DDR device. This function can
be used to determine which features are enabled in the device.
The value read from the register which consists of constants named
XDDR_ECCCR* for each bit field as specified in xddr_l.h.
None. | uint32_t dev_num = 0;
uint32_t mode;
drv->SendCommand (dev_num, ONFI_CMD_READ_1ST);
drv->SendAddress (dev_num, 0x00);
drv->SendAddress (dev_num, 0x00);
drv->SendAddress (dev_num, (uint8_t)(row));
drv->SendAddress (dev_num, (uint8_t)(row >> 8));
drv->SendAddress (dev_num, (uint8_t)(row >> 16));
drv... | 0 |
0b71b66a5d618d64273d22ad699592bb | 0b3c87624e05c9f9bf16d577db4fcc0f | Validates given basket id and product id, calls repo to remove product from the basket | namespace ServiceBus
public class BasketService : IBasketService
public Result RemoveProduct(Guid baketId, Guid productId)
{
return Result.Fatal("Not Implemented");
} | 0 |
44d47bf626f618920e6f025c41d8d212 | 4aea581f5705e4ceac24220dcf762eff | MD5 test suite from RFC1321 | void
test_md5(FILE *fp)
{
printf("MD5 test suite:\n");
print_md5string("");
print_md5string("a");
print_md5string("abc");
print_md5string("message digest");
print_md5string("abcdefghijklmnopqrstuvwxyz");
print_md5string("\
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
print_md5string... | 1 |
7dea11cc36ca9268b59cbbe55b52d37e | 85373661ad4f6dc0be8e933bfc0173ac | 创建热门排行类 | function HotList(){} | 1 |
c19f718d3d9997a4c4b2e16277c7bde2 | 8eed1a2fa26e50109e95e84bff4b469f | creates a new timer to schedule the blinking | void SophisticatedListControl::SetNewInterval(const int &newInterval)
{
if (m_blinkEnabled)
m_blinkTimer->Start(newInterval);
} | 0 |
cd865cf727af7fdddb201625a3d30fd7 | 4e0d896b90a0cb50f84aa6bf7f75427e | Test that `remove_uref` removes Key from both ephemeral representation
which is one of the current RuntimeContext, and also puts that change
into the `TrackingCopy` so that it's later committed to the GlobalState. | store, err := NewLunaKeyStore(ret)
require.NoError(t, err)
for k := range store.ListKeys() {
err := store.RemoveKey(k)
require.NoError(t, err)
}
} | 0 |
7a1aaec51ab32bfe91f69d7b27071fcd | 7b56700f047bfc74c1ba5f0181dba547 | Sets the visiblity of column containing <see cref="ObservationState.Unknown"/> state indicator. | namespace ClipFlair.CaptionsGrid
public partial class CaptionsGrid : UserControl, ICaptionsGrid
protected virtual void OnIndexVisibleChanged(bool oldValue, bool newValue)
{
ColumnIndex.Visibility = (newValue) ? Visibility.Visible : Visibility.Collapsed;
} | 0 |
adf4d823a3773c86de3afe92156e16c0 | 26b8d9865ac650d156ecb9f9ecc6fe77 | basic check so that it's not loaded on the front-end. | class SiteModel extends ExtendedModel implements NodeType
public function isAvailableInFrontend() {
return false;
} | 1 |
8cfafd2715d025f9acc244be2b2ee1c1 | 2a1cd123e0b070519746fd11e758c1b6 | Возвращает общее количество записей (постов) блога (во всех категориях) | const query = gql`
query totalPosts {
totalPosts
}
`;
const promise = await clientBlog.query({
query: query,
});
return promise.data.totalPosts;
} | 1 |
0100e70d4ae7dfe739b0f48c8e218b21 | ebae3dacf187b35e6846fb7a119dc431 | Add custom attributes to data dictonary depending of the deformer type | def addCustomAttrs():
selected = pm.ls(sl=True)
for sel in selected:
if sel.getShape().type() == 'mesh':
pm.select(sel, r=True)
smooth = pm.polySmooth(dv=0)
pm.rename(smooth, 'autoPS#')
pm.addAttr(smooth, ln='div', at='long', min=0, max=3, k=True, dv=1)
pm.addAttr(smooth, ln='level', at='long', min=0... | 0 |
a5618c964307123cd060ca8033b9f01f | 09f3a51d29643aa40cdf757a6ce4a322 | 利用WebClient 远程POST数据并返回数据 | {
byte[] responseData = null;
var postData = encoding.GetBytes(postString);
using (WebClient web = new WebClient())
{
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
try
{
re... | 1 |
30f1662eec49b2014e82b087355d05a4 | 241910b2950313028679233bb600ea6d | <p>Sets the fade out length of the fade. This is an optional property that can be omitted
by calling {@link #setFadeOutType(FadeType) setFadeOutType(null)}.</p> | namespace L2DLib.Framework
public class L2DMotion : L2DBase
public void SetFadeOut(int msec)
{
HRESULT.Check(NativeMethods.SetFadeOut(new IntPtr(Handle), msec));
_FadeOut = msec;
} | 1 |
274d979ae3606e7bfa7f2bc0b5578ae8 | fc4507c7b48241245da71648554a727c | Geeft de tijd die nog te gaan is voor de beurt. | class Game
get timeUntilSkip () {
return Math.max(0, this.turnTimeLimit - Math.ceil(((new Date()).getTime() - this.countdownTime)/1000));
} | 1 |
dde2f29e3a0631328b5f33b2fcf76c52 | 5ddde9b751a26ebd09cbe7fa716585fa | 指定されたキーに対応する値を取得する。
キーが存在しない場合は KeyNotFoundException がスローされる。 | namespace XPFriend.JunkTest
[TestClass]
public class ResiTest
[TestMethod]
public void Get_key_は指定したキーに対応する文字列が登録されていない場合キーをそのまま返す()
{
Assert.AreEqual("xxx", Resi.Get("xxx"));
} | 0 |
98dfd577c064305b90e53c62562dfcad | 7b68fea9d0eb413627af9189135b6d2a | Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space
characters.
Please note that the string does not contain any non-printable characters.
Runtime: 28 ms, faster than 51.13% of Python3 online submissions for Number of Segments in a String.
Memory Usage: 12.7 MB,... | public class LeetCodePart2
public int countSegments(String s) {
if (s == null || s.equalsIgnoreCase("")) {
return 0;
}
final char[] chars = s.toCharArray();
final int length = chars.length;
boolean isT = true;
StringBuilder sb = new StringBuilder();
fo... | 1 |
a5fc7746ae3151801599a65e7910137b | 416e1472e250e63de263d99961ada89b | JMA 설정을 관리하는 클래스 | if (this.majiClassLoader == null) {
this.majiClassLoader = majiClassLoader;
}
} | 0 |
d9a78b38bbcfb64e750cf384e21bc307 | 5f0c4fb032ba7df1fe29684be654b1ab | Change logging level for request package. | set logLevel(value) { tpack.builder.logLevel = value; } | 1 |
36e656bccf5844a72b49c1d2eb939362 | f951416443910768fe16c07e9284f16a | Create a new {@code KTable} that consists All records of this {@code KTable} which do <em>not</em> satisfy the
given predicate, with default serializers, deserializers, and state store.
All records that <em>do</em> satisfy the predicate are dropped.
For each {@code KTable} update, the filter is evaluated based on the c... | namespace Streamiz.Kafka.Net.Table
IKTable<K, V> Filter(Func<K, V, bool> predicate, Materialized<K, V, IKeyValueStore<Bytes, byte[]>> materialized, string named = null); | 0 |
be2945b811cc1cce1eab6a19fe50e502 | c7d134d4adf35e84c7749d2341be6d11 | Handles the AppointmentEdit event of the calendar control. | namespace Client.Views
public partial class AppointmentView
private void OnEditAppointment(object sender, RoutedEventArgs e)
{
var appointmentGuid = ((AppointmentItem)e.OriginalSource).AppointmentGuid;
var vm = this.DataContext as AppointmentViewModel;
if (vm != null)
... | 1 |
f136112110f6db19529c55cf9179d928 | 23d3d0794915ac41dd33797953bf0c5d | 设置顶部View可见性 | if (isVisible == View.VISIBLE) {
show(-1);
resetTopBottomLayout(View.GONE);
resetSideLayout(View.GONE);
resetLeftSideView(View.GONE);
if (videoView != null) {
sb_light.setProgress(videoView.getBrightness(videoActivity));
... | 0 |
172ab25393c2e7a3b8c813129392daf7 | 0d3c03e9f277266f78b45e0ec43700d9 | Set callbacks and private data for decoded audio. This only works in<br>
combination with libvlc_audio_set_callbacks().<br>
Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()<br>
to configure the decoded audio format.<br>
or NULL to apply volume in software<br>
\version LibVLC 2.0.0 or later<br>
<i>na... | namespace IMOS_SDK_DEMO.sdk
public class AVCallBack
public static UInt32 SetDecodeAudioDataCB(ref USER_LOGIN_ID_INFO_S pstUserLoginIDInfo, byte[] pcChannelCode, IntPtr ptrSplitInfo, bool bContinue, long lUserParam)
{
return IMOSSDK.IMOS_SetDecodeAudioDataCB(ref pstUserLoginIDInfo, pcChannelCode,... | 0 |
8ceb2b35b4f6f98fdd6f239e107ea740 | 849615227df2a98b08ca11b003e057bf | Send a message to all channels we are in | class BotBase(LazyDict):
def broadcast(self, txt):
for chan in self.state['joinedchannels']:
self.say(chan, txt) | 1 |
ed974aea8c2cac1fe79a2ae1295770e8 | 2bdaa2ed2f8c6c7bf102f0fe8daa7482 | Move our slightly templatized pre-built project files into place --
these projects include zlib, serf, locale, config, etc. | super(proj, self).install()
cmd = ['cp', '-vf'] + glob(P.join(self.workdir, 'src/*.h')) + \
[P.join(self.env['INSTALL_DIR'], 'include')]
self.helper(*cmd)
unpack_folder = os.path.join(self.env['BUILD_DIR'], 'proj', 'proj-datumgrid-1.7')
share_folder = os.path.join(... | 0 |
532158b535d537fb1311843a63723bd3 | b4871dd1b70f4600903e357540f94802 | Méthode renvoyant le nombre de dislike total. | class Pub
public function getNbDislike()
{
return $this->nbDislike;
} | 1 |
fb056adff11a6c8c967c259fb2f536a9 | 5326a4a2a03a5f6e026267fb36d916f1 | Creates a Value* of integer type with specified width from the value passed. | VXIVALUE_API VXIInteger *VXIIntegerCreate(VXIint32 n)
{
return new VXIInteger (n);
} | 0 |
469c42ebe65bce94f9dd9a39f0204d36 | c2042ba1789431124811e8361724ec04 | Set custom oAuth authorization server URL, will be used as default one.
Can't be null when {@link #setAuthEndpoints(Map)} is used | void setAuthServer(String authServer); | 1 |
eb5a74c7d73a37bbeb49ea67299c409a | f6cac56d24d94266f1dd5a70668d7980 | Sets a filter object for validating whether the documents can be pushed
to the remote endpoint. | class BaseEventExtractionWorker(queue.ItemQueueConsumer):
def SetFilterObject(self, filter_object):
self._parser_mediator.SetFilterObject(filter_object) | 1 |
b5df87251ee7f1ba311266a7661547f3 | 7503f150ed0e1b162797a511ac07dba7 | Retorna o objeto com suas informações no formato JSON | class Payment extends Common
public function getDataJSON(){
$aux = array(
'id'=> $this->getId(),
'user'=> is_object($this->getUser()) ? $this->getUser()->getDataJSON() : NULL,
'event'=> is_object($this->getEvent()) ? $this->getEvent()->getDataJSON() : NULL,
'cardBrand'=> is_object($t... | 1 |
27fc45a78aa7c7f168db803182f7f176 | 369750fad27d31bf8e97353a05b67a00 | Gets the size of a line specified by it's line number. | int getLineSize(); | 0 |
a9b799b556647cfd6008597b15220e28 | bf4485d997b42cb789e61ee2a85e74d8 | Write Distination Address for Channelx. | void EDMA_TCDSetDestAddr(DMA_Type * base, uint8_t channel, uint32_t address)
{
#if defined (CUSTOM_DEVASSERT) || defined (DEV_ERROR_DETECT)
DEV_ASSERT(channel < FEATURE_DMA_CHANNELS);
#endif
DMA_TCD(channel).DADDR = address;
} | 1 |
0b8589d1d461ef0315b25e804770ee0c | 823619aaf75d755e215e8edade7123c5 | Greets a person and returns a hello based on a persons name and last name | System.out.print("Please enter your first name: ");
String name = s.next();
String n = name.toUpperCase().substring(0, 1);
System.out.print("Please enter your last name: ");
String lastName = s.next();
String lastNameCapitalized = lastName.substring(0, 1).toUpperCase() + ... | 1 |
99d2f3c0213ea808fb4333b5e95f42c5 | 21433b1866a1dc73b86e7648bb8682b8 | Teste l'égalité sur les données internes de cette classe. | class MonstreFacile
public function equalsTo($obj)
{
return true;
} | 0 |
5bca89b0f98a798acd4c31fcb2f8f627 | 012281e3f44ab6e8b1f7fdc8f8b4e32e | Computes lower bound for size filter.
Specifically, computes lower bound on the number of tokens a string must
have in order to obtain a similarity score that satisfies the input
threshold with a string containing number of tokens, specified by
'num_tokens'.
References:
* String Similarity Joins: An Experimental Evalua... | if sim_measure_type == 'COSINE':
return int(ceil(round(threshold * threshold * num_tokens, 4)))
elif sim_measure_type == 'DICE':
return int(ceil(round((threshold / (2 - threshold)) * num_tokens, 4)))
elif sim_measure_type == 'EDIT_DISTANCE':
return num_tokens - threshold
elif sim... | 1 |
29cb6f1c3220c87938c30ad02d7ac92d | 859ac4730338285000a0ec6ca3e5bf38 | ボール中心のy座標のsetメソッド | class ellipse:
def setf1y(self,y1):
self.f1_y = y1 | 0 |
0560de5fc7904cadbb91fbf8bb0d0656 | f47632f71250dd87cd816cd4100a71b6 | Retrieve service id objects for a particular service type. | public class NamingServiceThrottleDecorator extends NamingServiceDecorator
public Vector getServiceIds(String serviceType) throws ServiceException {
GetServiceIds req = new GetServiceIds(serviceType);
p_processRequest(req);
return req.getResult();
} | 1 |
6f68a50bed84f570f4f1cbe2f83edc0c | 5015a057c4cfcb8782d4e32bcfb41e72 | Corrects overflowing nanoseconds | int rounded = (int) Math.round(val.getNanos() / (double) datePrecision);
long time = val.getTime();
int nanos = rounded * datePrecision;
if (nanos > 999999999) {
time = time + 1000;
nanos = 0;
}
val = new Timestamp(time);
val.setNanos(nanos... | 1 |
5452377817a127e6d46caf5be20be41c | 6e2de3d602dac8f30e520b16d781d702 | Obtiene el plan marco de formacion con sus objetivos respectivos de acuerdo al estudiante | namespace SACAAE.Controllers
[Authorize]
public class CursoProfesorController : Controller
[Route("CursoProfesor/Cursos/{pIDCurso:int}/Sedes/{pIDSede:int}/Modalidades/{pIDModalidad:int}/Planes")]
public ActionResult getPlan(int pIDCurso, int pIDSede, int pIDModalidad)
{
if (HttpConte... | 0 |
cce9df42432ae6d5c7ee7c46a3808bef | de969187ff6111c000e9d937464b6b1e | 功能码转ascii码 | {
QString hex;
if(bin=="1111")
{
hex="F";
}
if(bin=="1110")
{
hex="E";
}
if(bin=="1101")
{
hex="D";
}
if(bin=="1100")
{
hex="C";
}
if(bin=="1011")
{
... | 0 |
f585c11b9349e36b1444e84c19de97b2 | 50daa146cc8ffa275fd97b30f9437998 | Disable the Enriched call capability check after the timeout | public class EnrichedSearchAdapterHelper implements
EnrichedCallHandler.DialtactsActivityListener
@Override
public void onHideDialpadFragment() {
if (mEnrichedCallHandler.isEnrichedCallCapable()) {
mHandler.obtainMessage(
EnrichedCallHandler.MSG_ENABLE_RCS_CHECK_PROGR... | 0 |
a9376c2a67ef1bd226e31c9ea518846c | 0858b4e93ade358d47a440c6159dfe31 | Retrieves (without removing) the first element of the queue. | public class ClientQueue<T>
public T element() {
return storage.element();
} | 1 |
5bec3db2c88483633df72804385c15b2 | 50fb4cbf925026e24480c3a361d41599 | increase speed, spawn rate, score multiplier every 5 sec | void testApp::spawner() {
spawnCount+=0.5;
spawnBackgroundParticles = true;
_boss.readTime();
if(_boss.getTime() > 0) {
t.resetBar = false;
}
if(_boss.getTime() > 400) {
spawnOne = true;
spawnTimer = true;
}
if(_boss.getTime() > 800) {
spawnTwo = true;
spawnOne = false;
}
if(_boss.getTime() > 1600) ... | 0 |
d0ae5f98c709631a01e57ffac31a4fa9 | 121754e7887cfd73a598d2867d91afd6 | 转换图像,可以指定大小和是否进行中心裁剪 | public class ImageUtil
public static byte[] adjust(byte[] data,String type,int w,int h) {
return toBytes(adjust(data, w, h), type);
} | 0 |
fbaa3b4c2c3ec74e9e03df6a4009dfe6 | 8a91f34d0d714fae46612006c960f083 | Create a zipfian generator for items between min and max(inclusive). | function thunkGenerator(min, max) {
if (min === void 0) { min = 0; }
if (max === void 0) { max = 140; }
var min = Math.max(0, min), max = random.number(min, max), result = produce();
while (result.length < min) {
result += produce();
}
if (result.length > max) {
result = result.s... | 0 |
b6148670bdba0840f72387865c806db8 | 50fee553ad1181f960ead40a92b3bc53 | \brief Add a byte to the outgoing HDLC frame being built.
\todo escape 0x7e and 0x7d. | static void rbyte (char c, chkiss_t *k)
{
if (! k->rxloc && bfree) alloc(k->rxloc);
if (k->rxloc && (k->rxindex < MAXLEN))
{
k->rxloc->inhalt[k->rxindex++] = c;
k->rx_crc = (k->rx_crc << 8) ^ crctab[(k->rx_crc >> 8) ^ c];
}
} | 0 |
ad995d28417ed4c9d951960acfe5b3de | 517fcec6c9f4d114525e2890441c5cbe | Did You Hit Function | function hitOrMiss() {
if ((mouseX >= (molePicOffset + arrayX[randIndex])
&& mouseX <= ((molePicOffset + arrayX[randIndex]) + molePicWidth))
&& (mouseY >= molePicOffset + arrayY[randIndex])
&& mouseY <= (molePicOffset + arrayY[randIndex] + molePicHeight)
&& molesBeenHit === false) {
numPoints++;
... | 1 |
a062c340e038794d6021bbdfc17bc159 | c627c65f416bbe8c43d096ca39e5d233 | convert from SJIS to JIS(X0213 first plane) | unsigned int hib, lob;
hib = (sjis >> 8) & 0xff;
lob = sjis & 0xff;
hib -= (hib <= 0x9f) ? 0x71 : 0xb1;
hib = (hib << 1) + 1;
if (lob > 0x7f) lob--;
if (lob >= 0x9e) {
lob -= 0x7d;
hib++;
} else
lob -= 0x1f;
return (hib << 8) | lob;
} | 1 |
f1041524ff929d984d28b399fb7fe2bb | 468d516cff7f24025246adb4ee1dead6 | 从BlockState对象上获取id | public class Block implements Comparable<Block>, Serializable,Cloneable
public final int getId() {
return id;
} | 0 |
241358f5f1334c50105a76f8baaf47d5 | a0fd7453762fa64460ed34777e2e50f0 | 启用代理商状态 | {
$id = $request->param('id');
$result = TotalAgent::where('id', $id)->update(['status' => 1]);
if ($result) {
return_msg(200, "启用成功");
} else {
return_msg(400, "启用失败");
}
} | 1 |
c86ba981222a78f8d3102b131c32bc6b | 5c3d13d9c60a38f09c4fde4ab2ae9d28 | 转发艺文。 | public JsonResult ForwardMoment()
{
RequestContext<ForwardMomentRequest> request = null;
ResponseContext<ForwardMomentResponse> response = null;
try
{
string json = GetInputString();
if (string.IsNullOrEmpty(json))
... | 1 |
e312d99592d01bd6fbea9db43ef176c6 | ae8a252a6a8a1e84f5cb6586f375930a | draws the shape of the blade from the object it's attached to | public abstract class PlayerController : MonoBehaviour
public abstract void drawObject(); | 0 |
b337cf5dda83f1de2b8bd863731c0c33 | e8706aa13c234dd8b9f2b0531ae22762 | Vrátí informace o cenách jídel, ubytování, služeb a příplatků. | class ShopController extends Controller
public function paymentInfoAction() {
return array(
'variable' => $this->variableRepository->findOneBy(array('alias' => OtherData::PAYMENT_ALIAS))
);
} | 0 |
5ed14008c0021af65ba45e29435d2184 | 02bc2f25aaac9aacb6246b70da9b562d | 添加车辆,car为Car的对象 | @Insert("insert into car values(null,#{cname},#{cimg},#{cimg2},#{ctype},#{cprice},#{discount},#{mileage}," +
"#{ctime},#{colour},#{crank},#{speed},#{pailiang},#{transmission},#{fueltype},#{fuelEconomy},#{bid},null,null)")
public int carAdd(Car car); | 1 |
e693f55672cbdf2e2da230def975648b | 420b6f48d971b05fa5f99d2aca4554a6 | Switch that specifies whether the third thumbnail should contain EXIF metadata copied from the original file. | public LoadOptions setThumbnailMode(boolean thumbnailMode) {
this.thumbnailMode = thumbnailMode;
return this;
} | 0 |
866533ef286a22f286bfe630a6e95946 | 7f7855600ed206e7c423fe38816fd6b0 | 设置背景图像,传null将取消背景图片显示 | if (drawable == null) {
ivBack!!.visibility = View.GONE
return
}
ivBack!!.visibility = View.VISIBLE
backImageRes = drawable
ivBack!!.setImageDrawable(backImageRes)
setCenterTitle(isCenterTitle)
} | 1 |
af21b37b80b405e478f5e1b93ce4718f | 20b5f10e85cf5946c0f2e14cf2aecccb | Ends the application after sending the crash report | public class UIHelper
public static void sendAppCrashReport(final Context cont,
final String crashReport) {
} | 0 |
e4612254cd16150642f464c0e0f3585d | b65a4e016e33832dbc149d8a9fd0d22c | Aborts the bucket's worm | class OssClient
public function abortBucketWorm($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[OssConst::OSS_BUCKET] = $bucket;
$options[OssConst::OSS_METHOD] = OssConst::OSS_HTTP_DELETE;
$options[OssConst::OSS_OBJECT] = '/';
$opti... | 1 |
d6cc1981f1e8ff927e1dbf3137449121 | ad8ee2df113e50653bb6a8711d0830a4 | 左联表 | class Builder
public function leftJoin($table, $first, $operator = null, $second = null)
{
return $this->join($table, $first, $operator, $second, 'left');
} | 1 |
9b75dab67b9e5bb2bbe4406d491ec816 | 7bac81a3f2197e93ec25763294b5db1d | Overrides the model's :meth:`~django.db.models.Model.save` method to
provide custom functionality. | class ModelAdmin(BaseModelAdmin):
def response_post_save_change(self, request, obj):
return self._response_post_save(request, obj) | 0 |
c81c56873e26d9c18ebaae8f214f6307 | 888a58d014239422b894cac96910f0f2 | Compara si un numero racional es menor que otro | class Fraccion
def <=>(other)
self.to_f<=>other.to_f
end | 1 |
e68fb64535cafe2d3e1b0dd5333126ee | 1bfd30460d46c313f1978e55fb92943c | Получить отчество. | class UserEntity extends BaseEntity
public function getPatronymic(): string
{
return isset($this->patronymic) ? $this->patronymic : "";
} | 1 |
6e337113e2883eccb8957102175f1ca1 | 2ef3349eee92d1f1e39edc9cc71eb926 | Add Three Point to Team A | public class MainActivity extends AppCompatActivity
public void AddThreePointB(View view){
TeamB+=3;
displayB(TeamB);
} | 0 |
0035a43bbd33de09aa86de8e7cae3303 | 1e95761c269d79cefc6011be5026a11d | 判断用户是否具有项目数目统计权限 | namespace Srims.Server.Business.Statistics
public static class ProjectCountStatisticPermissionExtension
public static bool HasPermission_ProjectCountStatistic(this User user, IDatabase database)
{
return user.HasPermission(PermissionItem.Statistic, database)
|| user.HasPermission... | 1 |
83cfc070e8421c3ca92c1906bc0a1318 | c0a8534aeedfa5ef547f87b844db304e | Just a Gaussian-smoothed version of the zero-masked image used
in the MID calculations. | def smooth_gauss(masked_image, sigma, nsigma=7.0):
width = (int(sigma*nsigma + 0.5) // 2)*2 + 1
gauss_func = afwMath.GaussianFunction1D(sigma)
gauss_kern = afwMath.SeparableKernel(width, width, gauss_func, gauss_func)
convolved_image = masked_image.Factory(masked_image.getBBox())
afwMath.convolve(c... | 1 |
1cb8e5a4316c8f389cd7b13cf5086696 | e108e50dd1b6eaac6dbb4721431c4864 | 设置时间段最短间隔, | @Table(name = "time_interval")
public class TimeInterval
public void setTime_inter(String time_inter) {
this.time_inter = time_inter == null ? null : time_inter.trim();
} | 0 |
dd715b088d576c424c81e3db1bf94556 | 7f61448ad6da3ef0f9cb03f40c5be655 | Reference: http://kitchingroup.cheme.cmu.edu/dft-book/dft.html#orgheadline8 | cases like (1) | 0 |
36e86bcd3d925a4fd5dbbf936698f218 | b20572052f1bdfbed94d61ae300e5b49 | 26.We create a method for sending a message, in the parameters we specify the line we want to send. To safely access methods from different threads, we set the method synchronization. | public class Service public static class SignalInterface implements ChatInterface, BusObject
@Override
public void send_message(String message, String nick) {
throw new UnsupportedOperationException("Not supported yet.");
} | 0 |
7df1661c06747c06fcda55b26601cec8 | 9b73fc7915e58e0b57029fdb847b6270 | Sets the value of the '{@link jmeterscenario.MedidaRespuesta#getOperador <em>Operador</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public void setOperator( String value ); | 1 |
61a2135c8f0c17f353413a61e78e0b4d | a4d93fe9d50874f52c4aa6d9e2a4cb35 | Determines if the reservationtype has been initialized.
<br>
It is useful to determine if a field is null on purpose or just because it has not been initialized. | public class CheckinreservationsettingsBean
// extends+
// extends-
public boolean isGuestnamereservInitialized() {
return guestnamereserv_is_initialized;
} | 0 |
41fc6e03cb875fb2147cc514192ae784 | c679590284b674978e86fbd72540fae9 | This method initializes the language. If the locale field has a value, it
is used to select the LanguageResource. If not, the locale value in frostSettings
is used for that. | try {
fallback = I18n.createInstance(plugin.getResource("languages/en_US.lang"));
} catch (Throwable t) {
plugin.getLogger().warning("Couldn't load fallback language. This can cause problems if Language module is unloaded.");
t.printStackTrace();
}
} | 0 |
ff935a7cc24862b187c9ffa8f0207eba | 52f3c70a513c2b36988eb05f95e06618 | set position and dimension to minimize. | class CNNGenome():
def set_to_min_size(self):
self.set_genome([1,1,9,1,4,1,0]) | 1 |
ed7b9674f4c06fdeb75e1cb527941245 | 5e91515392abda9aa45ff7852a3ae6ae | Function for getting the name of the animal | if (document.getElementById("animals").checked){
return "animals";
} else if (document.getElementById("fruit").checked){
return "fruit";
}
} | 0 |
6bd1a9f0d2acb9a210483cfa4bf98753 | de0a8624d2f50742106f2c7d7a5aec53 | return pre-computed feature vectors one at a time (generator function) | q = self._fc._q
for i in range(0, self._fc._q.npred(self.id)):
yield self._fc[q.pred(self.id, i)] | 1 |
c5e1ca8e63280f26e5d6def0c4a71120 | aedce0cfce90269e6a69e587aa0e969b | finds action by id or name | function findActionById(actionId: string, metadataOnly=false) : contextActions.IExecutableAction {
return contextActionsImpl.findActionById(actionId);
} | 0 |
dfd739c0ce4f6522a353482d25df940e | 8f36c5b1bb5701a6a79977269fa94a3f | reads trips.txt, creates dict of each line and the trip id's that can be used to determine their stops at morning, noon, afternoon, evening, and night | organisation = 'Warwickshire'
mobiles = []
alphabet_list_html = requests.get(WEBSITE + LOCATIONS_SOURCE)
alphabet_list_soup = BeautifulSoup(alphabet_list_html.text, 'html.parser')
for alphabet_link in alphabet_list_soup.find('ul', {"class": "alphabet_group_links"}).find_all('a'):
stop_list_h... | 0 |
bddf4ae71341c86aea0462518c30e3c0 | 17d5e466d3ef3de205253895b81c6de8 | Create a new connection to the APN service. | var options = { cert: './' + platform + 'cert.pem',
key: './' + platform + 'key.pem',
passphrase: '1234',
production: false
};
return new apn.Connection(options);
} | 1 |
b25a2b94a8c550510fdbc71a698e92cb | acaa931bc8aaaa7d17cc78776a07b1b0 | 重命名小节 | namespace MRsystem.Collections.MRI
public class SectionNode
public void Edit(string key, string nkey)
{
KeyNode node = keyHead.Next;
while (null != node)
{
if (node.Key == key)
{
node.Key = nkey;
brea... | 1 |
cd01150cb1707f0794e2870c92de281b | 338a685a129387714100c0a89593ce11 | Given:
Some attack patterns to retrieve, with and without sub-technique
When:
Running attack-pattern reputation command
Then:
Returns the wanted attack patterns | def test_sonar_policies_list_success(client, requests_mock):
from RubrikPolaris import rubrik_sonar_policies_list_command
raw_response = util_load_json(os.path.join(os.path.dirname(__file__),
'test_data/sonar_policies_list_success_response.json'))
with open(os.... | 0 |
967ff1998726914cf5ffe5c210fdcca5 | 0deeb7de1140ce3ae3f80e17375c7626 | Fetches a user's record from the database.
If `discord` is set to True, the matching row with provided discord ID will be returned. | async def get_duser(client, discord_id):
return await client.discord_users.find_one({'discord_id': discord_id}) | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.