query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
dcefae718530a6acc40cb9a4d43fd2fb | 4f7fe7b78c35ccc84e1cb6256d1d49dd | Checks if a card that fits the filter is "blown away". | {
boolean returnvalue = false;
Card card = cards.get(id);
if (card.velocity() > 0)
{
returnvalue = true;
hitboxboard.delCard(card);
double x = card.fx();
double y = card.fy();
x += card.velocity()*Math.sin(card.angle());
... | 0 |
276390856395d5c9601f47e78fa0ef07 | dbddfa537e65740595e67c1bfd07a593 | Tests the throughput with medium buffer size.
Tests the throughput over a series of data transfers with medium buffer
size. | constexpr uint64_t kEndOffset = kLargeBufferSize - kSmallBufferSize;
DoTest(kLargeBufferSize, 0, kSmallBufferSize);
DoTest(kLargeBufferSize, kSmallBufferSize, kSmallBufferSize);
DoTest(kLargeBufferSize, kEndOffset, kSmallBufferSize);
} | 0 |
1947f349eea88c30b73e9c42afe41f0b | bbe7172d4682f3f18d0c7681379d0544 | generate a new transaction and add it to the memory pool | class Blockchain(object):
def createTransaction(self, sender, recipient, amount, timestamp, privWifKey):
transaction = {
"sender": sender,
"recipient": recipient,
"amount": amount,
"timestamp": timestamp,
}
signature = Blockchain.sign(privWifKey, j... | 1 |
0f8d5fb050bd2ee7244d05c514dcc8ab | a5288a5dd78ef351a4e3c73b64a5939c | Add a post to the news feed.
@param post The post to be added. | void addPost(PostBean new_post); | 1 |
f6c45d01cbc5a68ed31b2b3f59a0f149 | dced170f7462c9001619d29b2f040ed7 | Initilizer method to set up the required resources for singleton,
A queue is initilized to broker between receiving and writing into the file. | self.pid = os.getpid()
self.pipe_path = self.pipe_path_prefix + str(self.pid)
self.message_list = []
self.pipes_written = {}
self.queue = queue.Queue()
self.arrived_condition = threading.Condition() | 1 |
4310c740aabfd3d9074b54fe972850bb | 3d01a14343dcd077e019fea8ded4a095 | css to include with all mailers | email_css(
"font-family: #{FONT_FAMILY}",
"line-height: #{LINE_HEIGHT}",
'padding: 2px 4px 3px',
'font-size: 11px',
'font-weight: bold',
'color: #ffffff',
'text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)'
)
end | 1 |
ef7bd48d0640248af0e861942909d3f1 | 3bd4b8446639175d6490e4e84716f9f9 | Добавляет дату в конец коллекции | void Skupina::addDate(QDate date)
{
this->date.append(date);
} | 1 |
8ef1d8147c50aff640377b761a7a7408 | eb23677a903027d9e6880a10d314b0de | Méthode permettant de modifier le text qui va être affiché à la position de la souris | public void saisir(String texte); | 0 |
da88da114dd92ff08be1874d711c071b | 8e86db91cf6a8a93ef1b2c7c5ecc324d | 密码重置表格 返回表格对象(整理) | public class LoginObject
public static ReSetPass getRepassData(ResultBean resultBean) throws JSONException{
ReSetPass reSetPass=new ReSetPass();
reSetPass.setResultBean(resultBean);
return reSetPass;
} | 0 |
eb50070132910409cbc6d0290e98a4fc | 507f543765bfec0fb5ba05bd082ac597 | Aldığı parametreleri sınıfın objesine dönüştüren conversion constructor. | class ExplicitExample
ExplicitExample(int _a, int _b) : a(_a), b(_b) {} | 0 |
568c5e4731db0cedab27ef0a22aa4558 | 5e1cf70c036adca3ca1befabe51ef778 | Initialize a value function. | class QValue:
def __init__(self, state_size, actions):
self.state_size = state_size
self.actions = actions
self.q_values = {}
for i in range(self.state_size[0]):
for j in range(self.state_size[1]):
self.q_values[State(i, j)] = [0] * len(self.actions) | 1 |
4841f7f5dffc86e9ee3816b84ad5f5d7 | 3809143c5545c0d99f32ab7e911cdf77 | 设置input的baseinfo值,如果返回false说明这个类型找不到 | class PersonInfo{
function submit_base(){
} | 0 |
d72ebba6817b472b43ae3e96ad057545 | d44c28d50ddcf7bdbb43f13678a1b96d | Sets new value of apellidoMaterno | class Persona
public function setMaterno($materno)
{
$this->materno = $materno;
return $this;
} | 1 |
2d7b03f6d1078f1edc820dc8bb8d81ee | 9a4f0f121fb82ea1245b75017cfde892 | Hook to handle special cases when registering a backend module. | if ( function_exists( 'wponion_' . $this->module . '_registry' ) ) {
wponion_callback( 'wponion_' . $this->module . '_registry', array( &$this ) );
}
} | 1 |
a3ee7f052ac974a032fe798590e1176b | ccc8af634e8cdbb75767f4a990b577ba | Plays a LEDshow. There are many parameters you can use here which
affect how the show is played. This includes things like the playback
speed, priority, whether this show blends with others, etc. These are
all set when the show plays. (For example, you could have a LEDshow
file which lights a bunch of LEDs sequentially... | {
Animation anim = LoadAnimation(animPath);
if (currentlyRunningAnim != null) currentlyRunningAnim.Cancel();
currentlyRunningAnim = new CancellationTokenSource();
CancellationToken token = currentlyRunningAnim.Token;
return TaskRunner.RunAsync(Task.Run... | 1 |
5d1837508221b52060b6ee89dc10eda8 | f6ee519205745f9890602129f2758f0c | Create an instance of {@link GetArtistaByIdResponse } | @XmlRegistry
public class ObjectFactory
public GetArtistaByIdResponse createGetArtistaByIdResponse() {
return new GetArtistaByIdResponse();
} | 1 |
ee682180e373858fae493a60aff556a4 | 5cf96b6d0bbf3380ff2bc7b4946f3507 | Return the menu JavaScript template. | {
return $this->grav['twig']->processTemplate($this->template(), [
'name' => $shortcode->getParameter('name'),
'url' => $shortcode->getParameter('url'),
'menu' => $shortcode->getParameter('menu'),
'icon_type' => $this->findParameterInCascade($shortcode, 'icon_... | 0 |
8f2be4f226fe50789d02d9afa42156cd | 4a308e073f053b8bf60efa3e5fedb210 | Xóa sách | class bookController extends Controller
public function destroy($id)
{
Book::fine($id)->delete();
return redirect()->route('book.index')->with('success','Xoá thành công!');
} | 1 |
6f99b5963dac1a8314461d38a5956018 | 6a1cd898485a1d2ee6537939e0f0e373 | Decorator for unary operation. | class Unary(Funsor):
def __init__(self, op, arg):
assert callable(op)
assert isinstance(arg, Funsor)
output = find_domain(op, arg.output)
super(Unary, self).__init__(arg.inputs, output)
self.op = op
self.arg = arg | 0 |
d7ecd66163d67b29a25780bd9bf2dd77 | 01d54c94cca78838a836c8f6c9b2aa55 | Cannot update anything with wrong body | class TestDepositAPI(unittest.TestCase):
def test_update_wrong_body(self):
id_ = RANDOM_ROW['id']
response = app.test_client().post(
f'/api/v1/deposit/{id_}',
data={'amount': 'lkjuytfghj'},
headers=HEADERS)
self.assertEqual(
response.status_code, 4... | 1 |
76d48ce37382cc95f804a16339a01f42 | 17f7707ca3911d2dedc043df4848fae5 | Returns the total memory available to the JVM process. This is measured in bytes. | public class MiscUtil
public static long totalMemory() {
return Runtime.getRuntime().totalMemory();
} | 1 |
27f5ab43ad26c7190b5721ed044a92b3 | 9efd93466f5592480bfcda3191ba5c24 | Serivicio que obtiene una lista de Reportes de Marca usando un filtro determinado | namespace Trascend.Bolet.ObjetosComunes.ContratosServicios
IList<Marca> ObtenerMarcasFiltro(Marca Marca); | 1 |
75b8f46c54cd02585767f6d367d9c485 | a8e84b0ff7c9458c4a8a5732928e61f9 | Return final options after read from config and double merge | {
if ($this->options === null) {
$this->dispatch(new BuildOptions($this));
}
$topOptions = array_get($this->getConfig(), 'top_options');
if (!is_array($topOptions)) {
$topOptions = array_filter(array_reverse(explode("\r\n", $topOptions)));
}
fo... | 1 |
b75a3d5d52a8b111d37985bc4b8a81c1 | 187f7b84f12685d6eac45fedb06eb3d3 | Get human readable number from large number. | if (isNaN(x)) return x;
if (x < 9999) {
return x;
}
if (x < 1000000) {
return Math.round(x / 1000) + " thousand";
}
if (x < 10000000) {
return (x / 1000000).toFixed(2) + " million";
}
if (x < 1000000000) {
return Math.round(x / 1000000) + " million";
}
if (x < 1000000000000) {
re... | 1 |
d9ffd0ed6d9766f251065721cb7adf21 | 7ffb7c4f365c10ecd7386fb1e4ebae46 | Return the method resolution order for ``cls`` -- i.e., a list
containing ``cls`` and all its base classes, in the order in which
they would be checked by ``getattr``. For new-style classes, this
is just cls.__mro__. For classic classes, this can be obtained by
a depth-first left-to-right traversal of ``__bases__``. | def Mro(cl):
cls=GetList(cl)
cls.insert(0,cl)
if cls.count()<=2:
return cls
else:
clsList=[]
cls.append(cls)
for childClass in cls:
clsList.append(Mro(childClass))
cls=MyMerge(clsList)
return cls | 1 |
b8b63c358004ba678ded6723e125613b | 460e5e1e45256fc916f2e2d01fa57a33 | 解析sql的异常信息,正常的异常信息非常多的信息,把这个异常信息返回给请求端,不太友好,此方法尝试解析,如果无法解析,则原信息返回 | @Controller
@RequestMapping("/login")
public class LoginController extends BaseController
private String parseException(HttpServletRequest request) {
String errorString = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
Class<?> error = null;
try {
if (errorString != nu... | 0 |
20ae54649069ffc5c03bedbc021b2c93 | ada5aeb263f3c1ec23eb777ff61a4a91 | Loads the postprocessor for the data labeler. | class PostProcessor:
def import_processor(processor_type, processor_config):
return importlib.import_module(
f"viseron.post_processors.{processor_type}.{processor_config['type']}"
) | 1 |
52014b45f6d2431b723533cd042ee956 | db58c08ca8ee95b30dc30ab541312400 | function to apply sort as selected by user either by "Column Sorting" option in sidebar filter or by clicking on header of table | function FunctionsController($filter, $interval, $q, $rootScope, $scope, $state, $stateParams, $timeout,
$transitions, $i18next, i18next, lodash, CommonTableService, ConfigService,
DialogsService, ElementLoadingStatusService, FunctionsService, GeneralDat... | 1 |
e295a65082efd9b7a794111e7f81cd5f | f95a1e353513216304a9f93f051d8e5b | 取得所有Shipper | {
DataTable dt = new DataTable();
string sql = @"Select ShipperID As CodeId,CompanyName As CodeName FROM Sales.Shippers";
using (SqlConnection conn = new SqlConnection(this.GetDBConnectionString()))
{
conn.Open();
SqlCommand cmd = n... | 1 |
be90c0f448241f92dcdfc071460955a4 | 61aeea5944f3b6d62884c3c3fcc7c65a | Check if <hands> has a value | class Hand(object):
def __lt__(self, other_hand):
return self.value < other_hand.value | 0 |
e1ca1d8eaf9c0bbb073d1cc808e68a0f | 36f3b3ecd95c6eedeb896cd2539af075 | Toggle checkbox and save choice to shared preferences | SharedPreferences sharedPreferences = getSharedPreferences(SharedPref,MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
if (mCheckTView.isChecked()) {
editor.putString(prefemail, email.getText().toString());
editor.putBoolean(checked, mCheckTView... | 1 |
91c2ffa38732566c9a5f5dfc2945a391 | 2035a4f104de55c688b55046db787d57 | Função para mostrar o trailer do filme numa janela modal | class FilmeView
mostraErroTrailer(modal) {
$(modal).html(`
<dialog class="modal-content bg-dark text-light shadow">
<header class="modal-header border-bottom-0">
<h4 class="modal-title text-uppercase ff-roboto" id="trailer-filme-label">
<span class="fw-bold clr-primaria">Trailer:... | 0 |
398f2053e9ef8a50dfa21c2e413ab026 | f233922b7800b0605f34e4b9e1db7997 | Run any pending transactions. | foreach($this->txs as $tx) {
if ($tx->isStarted() && ! $tx->isClosed()) {
$tx->commit();
}
}
return;
} | 1 |
af8f72ba768d4ca4ff530e37d4545505 | df86f6e97052ee6e94d0f0c65defa7b8 | Perform matrix multiplication between two 3x3 matrices | function multmm(a, b) {
var c = Array(9)
for (var i = 0; i !== 3; ++i) {
for (var j = 0; j !== 3; ++j) {
var cij = 0
for (var k = 0; k !== 3; ++k) {
cij += a[3 * i + k] * b[3 * k + j]
}
... | 1 |
f11a9677a2d010616742903b068ae61b | 441a61f10ce7919bb4459a4638ccc301 | fits the sellmeier equation to given data to find coefficients for transparent material | F = np.c_[data[:, 0], data[:, 1], np.ones(data.shape[0])]
array, _, _, _ = scipy.linalg.lstsq(F, data[:, 2])
return array | 0 |
6770cb43f3c211f323e447e398116194 | 2cecfcff98be0bb456abc1dcdef42715 | Initialize position and state indices to -1 as they are empty | {
int size = row*col;
for (int index = 0; index < size; index++) {
openSet[index].x = -1;
openSet[index].y = -1;
}
} | 1 |
9ea692c3d3c48c8557bbe237eb1fffd1 | 4b1bd1179b12005ee8f4ae33b6404122 | For unshortening short URLs | def unshorten_url(url):
return requests.head(url, allow_redirects=True).url | 1 |
7c5bb185a84fead1312c2175996d0338 | 4dd9d45c042a34a5271f6de117c9f24f | 선택한 paCode에 맞는 pm 정보 가져오기 | namespace Business.Common
public class AsileHelper
public int GetPaIndex(string paCode, out int paIndex)
{
int intErrCode = -1;
bool blnIsPa = false;
paIndex = 0;
int intPalistCount = AsileList.Count;
for (int i = 0; i < intPalistCount; i++)
... | 0 |
2d3850dee974b3d1b1b3acb0b06feeda | c2c0f3131623de59893f98bf8886e8a7 | Draw a square on an OpenGL canvas. | void CTwoDScene::drawSquare()
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3d(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
glVertex2d(SquareX[0], SquareY[0]);
glVertex2d(SquareX[1], SquareY[1]);
glVertex2d(SquareX[2], SquareY[2]);
glVertex2d(SquareX[3], SquareY[3]);
glEnd();
} | 1 |
0be5ab80f10b9e747805426d6684967b | 50d861e956d527b2bc6f5c44a8af0d8d | Zwraca obiekt w którym do kluczy są przypisane wartości ustawień. | export class SettingsService
public getSettings() :Settings
{
return this._settings;
} | 1 |
eab9d69ce25a18cb1b954aa471b48e93 | c0234c808315f443922fb14022a319c4 | Returns the week number of the year | class SessionCalendarViewlet(browser.BungeniItemsViewlet):
def get_week_no(self, Date):
return Date.isocalendar()[1] | 1 |
0fefe14e50b69acdecb844f492225d48 | 096c6af11f125c9c281b895d4c567973 | Calculates empty data pages of all partition data stores. | void
pmem_drain_pm_stores_fit(void)
{
} | 0 |
0256c110bba4154b11a3687e073fdfab | 10b358c49fec794f1c375623c507c19d | <p>Get group owner for a group</p> | global $Db;
$sql = "SELECT *
FROM users_groups ug
JOIN users u
ON ug.user_id = u.user_id
WHERE ug.group_id = $get_group_id AND ug.is_group_owner = 1";
$req = $Db->query($sql);
$res = $req->fetch();
return($res);
} | 1 |
4ebad678a4408fc52f7fa2f15dcb539e | 01184ded5501a9f28e6087657ee43da5 | Returns the '<em><b>Temperature Kind</b></em>' literal with the specified literal value.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public final class RedhatLinuxStartOrKillType extends AbstractEnumerator
public static RedhatLinuxStartOrKillType get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
RedhatLinuxStartOrKillType result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
retu... | 0 |
3b22fcd451a551e4fead9a60575f4364 | 517cf442c354bae20b3afad847356e77 | Instruccion sql para consulta de puntos de control no registrados. | $sql = "SELECT COUNT(idcontrol) as contador FROM controles_pap_ivaa
group by idcontrol order BY contador DESC LIMIT 1";
return $sql;
} | 0 |
c7fc76703f36278fd05452c4956005e5 | 04b96561fabd14122943fc1d78abdc4f | 设置提示图标和提示文字 | if (TextUtils.isEmpty(txt)) {
tipTextView?.text = ""
tipTextView?.visibility = View.GONE
} else {
tipTextView?.text = txt
tipTextView?.visibility = View.VISIBLE
}
if (drawable != null) {
tipTextView?.visibility = View.VISIBLE
... | 1 |
eb720341d2a062a8ad728ae5f016bd17 | 0d976b5eb869959f0d2df7a215f454c5 | アンセーフな型変換の仕組みでコンパイラのイントリンシック(組み込み関数)として表現されている。メモリ上のサイズが同じならどんな方でも変換できる | let _ptr_i32_transmute = unsafe { transmute::<usize, *const i32>(usize::MAX) };
let ptr_i32 = usize::MAX as *const i32;
let _ptr_i8_transmute = unsafe { transmute::<*const i32, *const i8>(ptr_i32) };
let _ptr_i8 = ptr_i32 as *const i8;
let slice_ptr = &[0, 1, 2, 3] as *const [i32];
let _ptr_to_u... | 1 |
b3ffde5cb792bb9a47bc169e09e58b06 | 88a9294540dd5e29c7daa2844aa038dd | @brief eMIOS Channel 4 interrupt handler.
associated callback pointer is not equal to @p NULL in order to not
perform an extra check in a potentially critical interrupt handler. | ISR(GMAC0_CH4_RX_IRQHandler)
{
GMAC_RxIRQHandler(0U, 4U);
} | 0 |
57e77b19016e2b7fdbc211ff90a0c172 | 3b847987b7b8ceb3a95509744810c4a1 | Add carousel images based on product info from API | var windowWidth = $(window).width();
var isSmallScreen = windowWidth < 0;
$(' .carousel-inner > .item').each(function(i, item) {
var $item = $(item);
var imgSrc = isSmallScreen ? $item.data('image-xs') : $item.data('image-lg');
$item.css('backgroundImage', 'ur... | 0 |
4acde3d1641fc1d226e207a8136b7ef1 | ba543eebe910a2caad43223cdba7c68c | # fill na value with last non-NA value | x <- as.numeric(x)
if(is.na(x[1])) x[1] <- x[!is.na(x)][1]
xsub <- x[2:length(x)]
for(k in 2:length(xsub)){
if(is.na(xsub[k])) xsub[k] <- xsub[k-1]
}
x <- c(x[1],xsub)
return(x)
} | 1 |
4e830558ddaa3f8b7a2d28c5d3d3d60f | 3a05326e63a46994dd79f9be5b8e3888 | Metodo para ligar e deligar a calculador. | class Calculator{
public void changePower() {
isPowerOn = !isPowerOn;
} | 1 |
d5c1eafd33d7b5ef15d8e9ba828619d4 | 045bcc65f3c30c9934d72e2223ec04cf | [PRIVATE] Returns the current max order number | class Order
public function get_insert_order()
{
++$this->max_order;
return $this->max_order;
} | 0 |
0570e89ed196ad9826f693da4ebd7d6f | 8e0523fbda3c9b7c1691ccd069287ab0 | 查找下属无权限 | HashMap<String, Object> inParam = this.getInParam();
HashMap<String, Object> outParam = this.getOutParam();
TMStaff tmStaff = (TMStaff) this.getSession().get("managerAuthBean");
if (null == tmStaff) {
outParam.put("errorDetail", "登录超时");
this.setLogicView("managerLoginPage");
return RETURN.SES_TIME_OU... | 1 |
621be616e636d2d3b9acf2f244f4f664 | 86da7e250fe8d493f5a0ee98fedb1d1f | Creates build element for a build output, saves it and returns it | BuildElement createBuildElement(); | 0 |
aea26d7301257de0acc22a7c71196be5 | 87041e9db0b32a97382703bcbf7395c9 | https://atcoder.jp/contests/abc148/tasks/abc148_c | func main() {
var s, t, u string
var a, b int
fmt.Scanf("%s %s", &s, &t)
fmt.Scanf("%d %d", &a, &b)
fmt.Scanf("%s", &u)
fmt.Println(abc154A(s, t, a, b, u))
} | 0 |
852baf298e9acef2303f510d22805ec3 | 8243561b42fdc90d488b0dd5d1cf3564 | Registers this application master with the resource manager. On successful
registration, starts the heartbeating thread. | class ConnectManager:
def start(self):
self.client.connect(MASTER_URL)
result = self.client.reg(self.message.reg())
logger.info('Agent registration successful.')
while not self.event.wait(HEARTBEAT_INTERVAL):
msg = self.message.heartbeat()
result = self.client.h... | 1 |
b7b7cade23e7bf1688220cab37ed7a08 | 218ebcaf32bbba91bb2e3a8299181bde | Funcao que prepara e formata os dados para a insercao
na tabela veiculos. | {
if($row[0] == 'Id'){
return null;
}
$register = TmpTransport::where('id', '=', $row[0])->exists();
if($register){
return null;
}
if(strpos($row[13], '/'))
{
$dataEmissao = ($row[13]) ? (new \DateTime(substr($row[13],6,4).'... | 0 |
8d5dba7942ba49a4c1fe2295da8e92f8 | dada2e6f4065b19890644fc29815f864 | Définit la valeur de la propriété totalTtc. | class DecTva3514
public function set09TotalTvaBrute(?float $_09TotalTvaBrute): DecTva3514 {
$this->_09TotalTvaBrute = $_09TotalTvaBrute;
return $this;
} | 0 |
58b826994b2a6b1d32dcc4a1639c8cc3 | 27863bd7618217cac9732799a1d369f8 | Returns the result of performing a componentwise reversal of the byte order of a <see cref="half2"/>. | namespace MaxMath
unsafe public static partial class maxmath
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static short8 reversebytes(short8 x)
{
return (short8)reversebytes((ushort8)x);
} | 0 |
e77f490fe15efb19b8e6ce4a1a93e9fe | c3f35f90f81f36cf37ce2ef7d24109fc | 获取短url记录 | namespace Tunynet.Common
public class ShortUrlService
public ShortUrlEntity Get(string alias, string urlDomain = "")
{
if (!string.IsNullOrEmpty(alias))
return shortUrlRepository.Get(alias);
return null;
} | 1 |
65f61f13d2dbff03ea6eeb713086f585 | 7196648a8ff0a6d8a18503130d1b3a56 | Función para verificar que no haya seleccionado un turno ya tomado | var calendario = document.getElementById("Calendario_CM");
var turno = document.getElementById("Tur_1");
if(calendario.value ==""){
alert ("Indique una fecha");
document.getElementById("Calendario_CM").value = "";
document.getElementById("Calendario_CM").focus();
return false... | 0 |
476033a29baf9d6c5e0eae29664b0873 | 683cbb3a194c194319edeb548f4d5faf | Adds the specified error with the following markup
<p class='help-block error'>[message]</p> | function addError(messages, error) {
var block = document.createElement("p");
block.classList.add("help-block");
block.classList.add("error");
block.innerHTML = error;
messages.appendChild(block);
} | 1 |
794728e60e676c87c1d68139f34a53c4 | e76a104c243b3f31ab44ba8f7da06fce | SENDS MESSAGES TO CONTROLLER TO UPDATE STATE OF RECORDING/KICK DIRECTION | class KeyKompleteKontrolBase(): #used a class to sheild against crashes
def OnUpdateBeatIndicator(self, Value):
if ui.getFocused(2) == True:
self.UpdateOLED()
else:
pass
if transport.isRecording() == 0:
if Value == 1:
nihia.dataOut(nihia.buttons["PLAY"],... | 1 |
abad7eca5dfbe3de63d67c32d765f4d0 | 82d0cc2191c703e266f36b849e617cf2 | Find the IR node corresponding to the instruction at the given address
in the original function.
Returns the pointer to the node if found, NULL otherwise. | for _, r := range insns {
if uintptr(r[x86asm.RIP].(memaddr)) == addr {
return r
}
}
return nil
} | 1 |
680c6c05fcf788989b1329b829ed7b62 | dae57a2e75ad9d072051ec0833f66609 | 如果同时插入大于10条,采用sqlbulkcopy(目前只实现了SQLSERVER) | namespace Sakura.Common.Dapper
public static class DapperEx
public static int InsertWithBulkCopy<T>(this DbBase dbs,List<T>entity)where T:new()
{
Stopwatch stopwatch = CommonHelper.TimerStart();
var result = 1;
using (var destinationConnection = (SqlConnection)dbs.DbConne... | 1 |
ab83fa5b2b90bf3520f2a4cdeb5a696a | f7d0ad30a97b08e71ed17d6c015cacee | A simple method to group all occurrences of individual elements | def group_equal(els):
return els | 0 |
1f86deec0a8f24487fb0f844d20bf44c | 40f7a35efec43178430c638236c521e6 | print the layers present in the graph | i=1
for cache in caches:
print("%dtd Layer" %i)
print("input:%s" % cache[0])
print("w:%s"%cache[1])
print("b:%s" %cache[2])
print("input_sum:%s" %cache[3])
i+=1 | 1 |
68150b70d319724734da6c84ecda7479 | caf5233743c0e1e3e02e26429887403c | Open Tile Editor | {
TileType newType = (TileType)EditorGUILayout.EnumPopup("Type", m_selectedTile.Type);
if (GUI.changed)
{
m_selectedTile.Type = newType;
}
} | 0 |
5e8eb2a45a66a81e431de32a1d3e9124 | ab07c0e977d6831610e64a717957aa7a | Creates a redo log starting at the current state of the
<code>index</code>.
the log cannot be created for some other reason. | try {
instance = storage.redo();
return true;
} catch (CannotRedoException | IOException e) {
return false;
}
} | 0 |
2ee8ecc092c4c58e7aa118bb6ef37cdc | 9622e0c896ab5a770c16386a450fcc10 | Generalized Jaccard index of similarity | result = np.atleast_1d(result.astype(np.bool))
reference = np.atleast_1d(reference.astype(np.bool))
intersection = np.count_nonzero(result & reference)
union = np.count_nonzero(result | reference)
try:
jc = float(intersection) / float(union)
except ZeroDivisionError:
jc = 0.0
... | 1 |
b22a75a9317e972aba2d0c9eec99bf8d | 18a9ae7c0d0628cf59f745617b25a607 | Returns the meta object for the attribute '{@link uk.ac.kcl.mdd.cw2.pageGenerator.pageGeneratorLanguare.Section#getRpadding <em>Rpadding</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | org.apache.xmlbeans.XmlDouble xgetRPer(); | 0 |
9d1fa47b5491e453edee3865b9587210 | 1911c5fe13833eb51fc88befd7fc6633 | マウスを押下しているかを返します。 | namespace GeonBit.UI
public class DefaultInputProvider : IMouseInput, IKeyboardInput
public bool MouseButtonDown(MouseButton button = MouseButton.Left)
{
return GetMouseButtonState(button) == ButtonState.Pressed;
} | 1 |
c0717623c466f8ed2a4248741e9e642a | 88f7549302b77a20f7bfdf1218beb2a7 | # Modificar un inmueble existente | foreach ($inmo_data as $campo=>$valor) {
$$campo = $valor;
}
@$this->query = "UPDATE cont_inmo SET inmo_name = '$inmo_name', inmo_op = '$inmo_op', inmo_type = '$inmo_type', inmo_size = '$inmo_size', inmo_habit = '$inmo_habit', inmo_wc = '$inmo_wc', inmo_info = '$inmo_info', inmo_price = '$inmo_price', inmo... | 1 |
dc57c2a107383744845f210a73f068b5 | a11f8542d9b54443f436acef09ace10e | Called when the entity the extension is attached to is saved in the manager
interface. | abstract class EntityHook
protected function saved($uid, $dirty)
{
} | 1 |
a72bf6c5e7971d7c30c72273016b2bee | 125e60f73439aab7e3f97fc40edaa22c | 3: Errors + informational + debug | logging.info("this is info")
logging.debug("this is debug")
logging.warning("this is warning")
logging.critical("this is critical")
logging.error("this is error") | 1 |
772e4959e428194f8cf55c72d0835d09 | f48f1213a79cf72efc40e5096e29e0b9 | @brief Wait until thread has terminated.
X... | namespace TELNET_NVSHARE
void OdfThread::ThreadWait(void)
{
if(m_hThread)
{
WaitForSingleObject(m_hThread, INFINITE);
}
} | 1 |
04f3066762d4f0b9ee6ca2fd62cc7a66 | bae54517cb32e81f6deae24bbc8d0a25 | Konstruktor ładuje statystyki z pliku | namespace Microsoft.Tts.Offline.Htk
public class StatisticFile
public void Load(string statisticFile)
{
using (StreamReader reader = new StreamReader(statisticFile))
{
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
... | 0 |
0077810edfa7a5a758608666f4a6772a | 946b96752a55c0f95db17f474b12d849 | Display details for an ascribed cultural identity | def display (request, id):
if not is_user (request): return redirect ('/')
page = 'humans/display.html'
context = default_context (request)
context ['human'] = Humans.objects.get (id = id)
return render (request, page, context) | 0 |
f0c06053c1aa4f51d03212c22c1ab011 | 38e3cf4820dd79113701df244da2ad5f | Retorna uma lista com os registros da tabela de metadados USER_CONSTRAINTS. | class Table extends RecordSet\Buffered
public function getConstraints()
{
return $this->constraints;
} | 0 |
8ee4975f6c757dba432fe1d43c87a688 | 962049e53c704088f5b9fe536de015e8 | !
Formats a Mifare Classic card to store NDEF Records | PICC_Type piccType,
MIFARE_Key *key
) {
uint8_t no_of_sectors = 0;
switch (piccType) {
case PICC_TYPE_MIFARE_MINI:
no_of_sectors = 5;
break;
case PICC_TYPE_MIFARE_1K:
no_of_sectors = 16;
break;
case PICC_TYPE_MIFARE_4K:
no_of_sectors = 40;
break;
default:
break;
}
if (no_of... | 0 |
2d7b601f4edd0d8c6196e34b0b1b44e7 | 8bb08e7980f946fdb1e7d15baa09fa46 | Function to read temperature in raw format | def read_temp_raw():
file_name = open(DEVICE_FILE, 'r')
lines = file_name.readlines()
file_name.close()
return lines | 1 |
396630585826e50a6d3f56eb056553c3 | 493a85e319884885d0d8500cff287370 | Unseals the vault. | def cli_unseal(name):
server = get_server(name)
client = server['client']
for key_obj in [k for k in list_keys(server) if k['key']]:
unseal(client, key_obj['key']) | 1 |
b354764f25065061fb02c9a2c8bc7f71 | 27a1008bde65fd34cd51ee36bb60bd34 | Specifies how the output should be decoded | class AbstractModel(ExecEnv):
def decode_output(self, encoded_output: str) -> any:
raise NotImplementedError | 1 |
cdb49733248b0ac14a21598b7f46a140 | 5b59657cee8a7b2ba2508cdc191a47ae | Returns the meta object for class '{@link org.m2ling.domain.core.Stakeholder <em>Stakeholder</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getProject_Stakeholders(); | 0 |
87650ad9e0dd4f100b24563568f7a6d1 | 798cfc1dc4b2da5884a95df2d33fa033 | FLATTEN-REPRESENTATION-HANDLE | Object flatten_representation_handle(representation_handle_hash_table)
Object representation_handle_hash_table;
{
Object result_1, subtree, temp;
SI_Long index_1;
x_note_fn_call(93,53);
result_1 = Nil;
index_1 = (SI_Long)0L;
next_loop:
if (index_1 >= (SI_Long)109L)
goto end_loop;
subt... | 1 |
c20b8430412e9dbe9b3a31f2fb5c3516 | bdbb2776817553cb665f53f2e25c572a | 查询我的套餐 | class HomeMakerPackagesController extends Controller
public function HMPMyPackages(Request $request)
{
try {
$user_id = \Auth::user()->id;
$home_maker_packages = HomeMaker::join('users', 'users.id', '=', 'homemaker.UserId')
->join('homemakerpackages', 'homemaker.HMId'... | 1 |
e371a0418293607b28d4a88747b42111 | 584244e1600caffc5b89d0f576a55e03 | Compares two hdf5 files | datasets = pydicom.read_file(file1), pydicom.read_file(file2)
rep = []
for dataset in datasets:
lines = (str(dataset.file_meta)+"\n"+str(dataset)).split('\n')
lines = [line + '\n' for line in lines]
rep.append(lines)
diff = difflib.Differ()
for line in diff.compare(rep[0], ... | 0 |
af02c7bd26ab09defa3b37f5f4f098a7 | 32800b2364806c3f08b96591c8247de9 | Test V2iVectorData resizing | class V3dVectorDataTest(BaseVectorDataTest, unittest.TestCase):
def testResize(self):
BaseVectorDataTest.testResize(self) | 0 |
64db7b2b7975a0221b7281ac44b1f9c7 | 339182e1b46aba13f9ed56a820e61385 | 夜間特殊攻撃の種類・および倍率を返す | function getNightRange() : String
{
return NightRange.ToString();
} | 0 |
9fac8b6402bf16074234aab35f9f3905 | 4495f7bc0da8a3b617bc04ee0d327441 | Initiates the asynchronous execution of the UpdateMulticastGroup operation. | namespace Amazon.Omics
IAsyncResult BeginUpdateRunGroup(UpdateRunGroupRequest request, AsyncCallback callback, object state); | 0 |
e020950951527220cfbfbde1fa73a978 | 2bff33c650b8979ac600fece10a90f48 | POST: odata/Tickets | namespace Housie.Controllers
public class TicketsController : ApiController
[ResponseType(typeof(tb_tickets))]
public IHttpActionResult Posttb_tickets(tb_tickets tb_tickets)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
... | 1 |
15735295150edccbbb77f3936181ccd9 | 8ee9f7f1870f2c3467641144b3aed0a0 | set the index/id of the physical joypad controlling the joykey | if (index.length == 0)return;
Object[] buttons = {
"dpad_up",
"dpad_down",
"dpad_left",
"dpad_right",
"left_stick_button",
"right_stick_button",
"a",
"b",
"x",
... | 0 |
eec38e26ce252bc1db812e0377fa3542 | 4b63185091e204ef312593084a7131fc | The GetSecurityDescriptorOwner function retrieves the owner information from a security descriptor. | {
if (!Win32NativeMethods.ConvertStringSecurityDescriptorToSecurityDescriptor(sddl, 1,
out SafeLocalAllocHandle handle, out int return_length))
{
throw new NtException(NtObjectUtils.MapDosErrorToStatus());
}
using (handle)
... | 0 |
1ec2a6d7301f7218c23620f84aacaa11 | 39f6bb769dd2e45be2f0f3e91a8fa481 | 将Cart中商品及其对应数量的数据格式化成字符串,用来保存在cookie中。 | function setCartCookie(cartMap){
var cartCookieValue="";
var i=0;
cartMap.forEach(function(value, key) {
cartCookieValue+=(key+DELIMITER_CART_ITEM_INFO+value);
if((++i)!=cartMap.size){
cartCookieValue+=DELIMITER_CART_ITEM;
}
})
$.cookie("cart", cartCookieValue, {expired:2, path:'/'});
setCartSize();
} | 1 |
c187fef7ccc597a0aade161777e54b47 | e55167200ba75c443b780f800eb88d26 | Default Undertow's response code (200) was changed in order to avoid situations in which something wrong happens and Hermes-Frontend
does not publish message but return code 200
Since the default code is 500, clients have information that they should retry publishing | public class DollarException extends RuntimeException
public int httpCode() {
return 500;
} | 1 |
c65b5100def1e51378b8abf7b9a6be40 | dee412b2c530d65317aea2390343a818 | #最新順に記事が出るかテスト | qs = NewsItem.objects_published.get_latest()
self.assertEqual(qs.count(), 7)
self.assertTrue(qs[0].date >= qs[1].date)
self.assertTrue(qs[1].date >= qs[2].date) | 1 |
f5fe6c439e199d775cec86109e4bd6b3 | 5fca2a9cd95321bdfd3b75874bde2dc4 | Round a datetime object to any time lapse in seconds
dt : datetime.datetime object, default now.
roundTo : Closest number of seconds to round to, default 1 minute.
Author: Thierry Husson 2012 - Use it as you want but don't blame me. | def round_to_minute(dt):
res = dt.replace(second=0, microsecond=0)
return res | 0 |
e19c68c448bf73d7d7692961cafea857 | 6bb8dd7c93ed9739c0cd4196ab2df327 | Create a new instance, with the specified message body.
The body MUST be a StreamInterface object.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return a new instance that has the
new body stream. | class Request implements RequestInterface
public function withBody(StreamInterface $body)
{
$new = clone $this;
$new->stream = $body;
return $new;
} | 1 |
02f229bbccf775010c2002af1f612ed5 | e989bd8a33e9d144d8cb78b6e050cbad | 野生动物属性管理 | $where = array();
$keyword = input('get.keyword');
if (!empty($keyword)) {
$where['name'] = array('like', '%' . $keyword . '%');
$this->assign('keyword', $keyword);
}
$count = $this->behavior->where($where)->count('id');
$page = $this->page($count,... | 0 |
d7a1b65eafe1a54c226f152542b9a686 | 255a30e7324bb9af03073fd06098b7bb | To handle the event when players land on "Chance" point | namespace Monopoly
class Player : IPlayer
public void BeOnNothingCase()
{
this.state = 12;
this.Notify(0);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.