query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6f71bda6b9041395f89f96416231c76e | c5799d9087f946eda3f24f69ffeafa68 | hàm xuất phân số | os << f.num << "/" << f.den;
return os;
} | 1 |
99679758b4c9f17b56906bdc6586561b | 2b6cf659361d7da51a18ca90837465ca | Return a string representing the value of the voter record. | class Record(object):
def ToString(self, type_):
if type_ == Query.Type.STUDENT:
return '%s, %s, %s, %s' % (self.studentLast, self.studentFirst,
self.grade, self.classroom)
elif type_ == Query.Type.STUDENT_BUS:
return '%s, %s, %s' % (self.studentLast, self.studentFir... | 0 |
44e49c227d5c6fd58d3d8b9ebb3ac937 | 56fa6b02398dbef472f0313946fe3bec | 计算下页的开始索引(索引从0开始). | int nextPage = this.currentPageIndex + 1;
if (pageCount < nextPage) {
nextPage = pageCount;
}
return nextPage;
} | 0 |
46ddcc3236e60100529adc7c08c30df3 | 98e138a86521876ed7109d5574d2fdaa | A rectangle with a chunk taken out, making a concave shape | if len(rect) != 4:
print('clipped :','rect takes from 4 arguments but',len(rect),'were given.')
return tuple()
self.data = self.data[rect[1]:rect[3],rect[0]:rect[2],:] | 0 |
9a0703c49f42a413b5299949c84b22ce | 74c076442f3a2107fefef7beabfe5534 | Handle requests for /tag/<tag string> | func tagSet(w http.ResponseWriter, r *http.Request) {
tagdata := mux.Vars(r)["tagdata"]
fmt.Println("New tag data ")
fmt.Println(tagdata)
fmt.Println(" ")
if ( !strings.Contains(tagdata, "@") ){
w.Write([]byte("Error, expecting tagName=newValue@plcName"))
}else{
KK_Tag_DB.TagDatabase.QueueTagSet( "TAGUPDATE: ... | 1 |
9fdb9fcba9d289eb0c2175d963ffc568 | 1e6e4f51ba7e8c98bfacc9542e2072fc | 从用户登录触发节日活动礼品派送 | for user in get_users_by_birthday(date.today().strftime('%m%d')):
distribute_welfare_gift(user, happy_birthday_package)
if user.has_mobile():
sms = ShortMessage.create(user.mobile, birthday_package_remind_sms)
sms.send_async() | 0 |
5694cfb8b7855e9118aad08762293ae3 | 79326116dc2377635924274cac71999f | Returns the list of packages of the library. | public function getPackages(); | 1 |
29f2561cf4ed26d4311afe3586112034 | fddf3928ba970813024435fe5eeef4c5 | 編輯遊戲角色和寵物名稱 | if ((pet == null) || (name == null)) {
throw new NullPointerException();
}
final int petItemObjId = pet.getItemObjId();
final L1Pet petTemplate = PetTable.getInstance().getTemplate(
petItemObjId);
if (petTemplate == null) {
throw new NullPo... | 1 |
a8f306ede1a00594e39aef50fd7ddd13 | 6f4a05c78d4fbdfe371e85f81731b308 | Gets jsXe's icon that is displayed in the about menu,
taskbar and upper left hand corner (where appropriate) | namespace Microsoft.PythonTools.Project [PackageRegistration(UseManagedResourcesOnly = true)]
[ProvideProjectFactory(typeof(PythonProjectFactory), PythonConstants.LanguageName, "#127", "pyproj", "pyproj", ".\\NullPath", LanguageVsTemplate = PythonConstants.LanguageName)]
[ProvideObject(typeof(PythonGeneralP... | 0 |
493de424aac445a71996e5004489baa1 | 172ba1959d1b2a68a5fcf3c0f3ad1030 | 获取审核状态(0未通过/1通过/2待审核) | public class EngageResume implements java.io.Serializable
public Integer getCheckStatus() {
return this.checkStatus;
} | 1 |
ae199a8710ce5ba2c999e6958c3b1bad | 431c7e29a97cb7721e6d8d9c9b1ae675 | расчет положения точек для случая 2 | public class WallScreen implements Serializable
private float[] calculationStart2(float mAngle, float bevel, PointS endPoint) {
float[] xy = new float[2];
xy[0] = (float) (endPoint.x - MathUtils.cos(mAngle) * bevel);
xy[1] = (float) (endPoint.y - MathUtils.sin(mAngle) * bevel);
return xy... | 1 |
f61916d48bf204e18382efaf2ee6f72e | 367fba92d1c5bf2b074528e8ebaea79b | 隐藏登录提示信息 | namespace LoginSample.ViewModels
public class LoginViewModel : ViewModelBase
private void HideLoginResult()
{
ResultDescription = String.Empty;
IsShowResult = false;
} | 1 |
6105b2002a7a9edf0c15324fddab878b | 328c1db1cd4e0c6e71c626311a0a6842 | TestCase to test playlist ID retrieval.
Tests to make sure the function returns a list of playlist IDs and tests to ensure the list has two parts. | query_string = '''
{
trackList {
totalCount
results {
id
time
}
}
}
'''
executed = self.client.execute(query_string)
data = executed['data']['trackList']
results = data['resu... | 0 |
e7b1b6cb475428b16750fd3d882f5efb | d83be5f43a4321a6e15c9996213e414a | Sets whether this parameter is passed by reference. | class RParameter extends Wrapper implements \Hoa\Visitor\Element
public function getReference ( ) {
return $this->_byReference;
} | 0 |
c53d0186c4ea09c0c0b0e37feae5c747 | 8264631663b7e48d2378a65cbf654c04 | Sets the amount of time required for closed loop control of the [internalMotorController] to go
from neutral output to full power. | class MotorController:
def setT(self, period_ms, tau_ms):
if self.serial_conn:
self.ser.write('t')
self.writeFloat(period_ms)
self.writeFloat(tau_ms) | 1 |
87b428c05d964de63b541d182df72d04 | 0aca0dd142e2bc5c5a0a31699edecefe | Set a new transcription. | if new_transcription_config != self.transcription_config:
self.transcription_config = new_transcription_config
self._transcription_config_needs_update = True | 1 |
7b818918f9a56c9f8297eaff758b23fb | 798d85d19c6873629fbe69b80be7bfa3 | 占い師行動処理 | $speakerList=$gameInfo->seekAliveAgentNamesExceptMe();
$speaker=$speakerList[array_rand($speakerList)];
$targetList=$gameInfo->getAllAgentNames();
$target=$targetList[array_rand($targetList)];
$speciesList=array("人間","人狼");
$species=$speciesList[array_rand($speciesList)];
$roleList=array("村人","占い師","霊媒師",... | 1 |
64240d17344687b6e7881f4f68e72607 | 8fb2aae64305bd3115da574787e97628 | 형제 리스트의 순번을 다시 셋팅 | function refresh_table_no(tableid){
$('#' + tableid + ' tr:nth-child(n+2)').each(function(){
var trSeq = $(this).parent().find('tr').index($(this));
$(this).children('td').eq(0).text(trSeq);
});
} | 1 |
e9bfc64a338006536df022d52643196a | 1f30b08d20d216daedfb62c5816572fb | Initialise les semences (seeds) à l'aide des fabriques (factories) | {
Vehicule::factory(10)->create();
Particuliers::factory(10)->create();
Modele::factory(10)->create();
Fournisseurs::factory(10)->create();
Chauffeurs::factory(10)->create();
Employes::factory(10)->create();
Marques::factory(10)->create();
Factures::fa... | 1 |
1b82042e6826b48cd0bedf5739b1ca02 | bfaea30e34e90e36ca0c9fc71b2a6980 | 通过session.setAttribute()被绑定到session上时,则这个对象的valueBound()被调用。 | public class User implements HttpSessionBindingListener
@Override
public void valueBound(HttpSessionBindingEvent event) {
HttpSession session = event.getSession();
ServletContext servletContext = session.getServletContext();
@SuppressWarnings("unchecked")
Map<User, HttpSession> userMap = (Map<User, HttpSession... | 1 |
ac33593840ad6d741c284974f0ed547a | ac9a7477be41d1fae2ea5a0220bb5713 | Unsets the "characterSet" element | void unsetQuoteCharacter(); | 0 |
ead8c0ea22a2d0c666fbb0c6a7b8a32f | 00655925e5fb526937a75f56055d2f78 | Apre il modale dell'impegno copiando i dati forniti dall'utente. | var intershipModal = document.getElementById("intershipModal");
intershipModal.style.display = "block";
document.getElementById("company_1").value = company;
document.getElementById("intershiptime_1").value = time;
document.getElementById("position_1").value = position;
document.getElementById("description_1").va... | 1 |
80760a6025b899450f680fae061ed1d2 | 6b0aa56e67c1a4f2856c30c72658540e | get the current date from the OS | {
TRACE_EVENT("mfw_td_get_date");
#if !defined (WIN32) && !defined (EMO_SIM)
#ifndef NEPTUNE_BOARD
rtc_get_time_date(¤t_date, ¤t_time,RTC_TIME_TYPE_CURRENT);
#else
rtc_get_time_date(¤t_date, ¤t_time);
#endif
#endif
return ¤t_date;
} | 0 |
e81316e06ffd3513a41ba4b44cf0ae39 | c915a73211ca485b3091a05cf5328650 | Test create client with valid URL, | {
$responseCode = 201;
$mock = new MockHandler([
new Response($responseCode),
]);
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$crawler = SwiftypeCrawler::create($client);
$this->assertTrue($crawler->send('... | 1 |
39f4e91937b4482823f1f3e9edd5d90d | ba1d5d0991e5096603adf71b6821e1c7 | Get field group list from build master table yaml config for GDC. | if "oed_fields" not in summary_set:
return None
elif isinstance(summary_set['oed_fields'], str):
if summary_set['oed_fields'] in SUMMARY_GROUPING:
return SUMMARY_GROUPING[summary_set['oed_fields']]
else:
raise OasisException('oed_fields value Invalid: {}'.format(s... | 1 |
ac66dab70f51727f0dd78bf651982788 | 633b79dfa3ad4ff4b10860ab31bb2ccb | Count the number of positive and negative points in the data set. | {
double ary[5000];
int sizeAry = 0;
int count = 0;
int ix=0;
double val;
while(fin >> val)
{
sizeAry++;
ary[ix] = val;
ix++;
}
for(int i = 0; i < sizeAry; i++)
{
if(i > 0)
{
if( ary[i-1] > 0 && ary[i] < 0 )
{
... | 0 |
3a7d9f293788e588d7122be09b9bfebb | 66708cad33800fc273ff4395f38fd9c2 | Recursion递归测试, 求x的阶乘 | def fact(x):
if x == 1:
return x
else:
return x * fact(x - 1) | 1 |
04aa897e2bf856bb54a927ecb772fd1d | c791041301ab67c5a84576fa4b4545e0 | Returns the meta object for class '{@link com.example.goodreads.model.BookShelf <em>Book Shelf</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getFamilyBook(); | 0 |
905f74aeb9cd225e640dce91c51d592f | a7a6ecddf8821931db2773960353b238 | Get Invoice Type from Parameter Bag | class m_invoices extends CI_Model
public function get_bill_types() {
return array("0" => "Fresh Bills", "1" => "Invoice Generated", "2" => "Both");
} | 0 |
7bba1d8f636cf6bf99c40c0985e34f0c | 389c7c63958e2a2cf77d6f2bbffa548f | Фабрика для заказов. | class Factory extends BaseService
public static function getFactory($orderSource = OrderSourceEnum::MASTER)
{
static $classObj = [];
if (!isset($classObj[$orderSource])) {
$classObj[$orderSource] = new static::$class[$orderSource];
}
return $classObj[$orderSource];
} | 1 |
c0916704926cdf38872838a0614bd536 | 6a853e764c1929795c8f4b1804b46f6b | 移除所有的摄像头 | {
foreach (Camera camera in cameras)
{
if (camera != null)
{
camera.enabled = false;
}
}
} | 0 |
308ab01191e029206512f67d99d15b93 | ef10c5d4760176430363b68ca9a865ec | Get all apps in an App Service Environment.
Get all apps in an App Service Environment. | function getAppServiceEnvironmentOutput(args: GetAppServiceEnvironmentOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetAppServiceEnvironmentResult> {
return pulumi.output(args).apply((a: any) => getAppServiceEnvironment(a, opts))
} | 0 |
915f0fe6f953aa82d493d783d6ea89a9 | fc05bbf783f4c8d09ed1cd9af6856911 | Check to see if method names are correct | class TestAllowDeviation(unittest.TestCase):
def test_method_signature(self):
try:
sig = inspect.signature(allow_deviation)
parameters = list(sig.parameters)
self.assertEqual(parameters, ['tolerance', 'kwds_func'])
except AttributeError:
pass | 0 |
d0b59be36901420a260bba15038856e9 | ab5b4c3217cb097b01e72778e866a33a | Don't record this update in the ref's associated reflog. | namespace GitSharp.Core
public abstract class RefRename
public void disableRefLog() {
destination.setRefLogMessage("", false);
} | 1 |
a68a04ba0f94d60bea3526efc1d20eaa | 507f543765bfec0fb5ba05bd082ac597 | Construct with explicitly typed arguments | class ExplicitExample
ExplicitExample(int _a, int _b) : a(_a), b(_b) {} | 1 |
3daf5be927bef3ea79718f16f044b40b | a5143d25d968d247ba056a633e29f66d | Update the tournament. | def update_tournament():
tournament_dict['identifier'] = 'r56f0430409b488e99880c4e1fd22cd5'
tournament_dict['startDate'] = time.strftime("%Y-%m-%d %H:%M:%S GMT-0000")
return tournament_dict | 1 |
dc954373ef6ed62f5121c593b91eb973 | 17f0ae272203069c0dd4433558924444 | 查询收据数量 | int findBillCount(); | 1 |
b5e4c17741dc620ba124073799ab3a24 | 0fca47961a83ed73cd99a2f22f0048d8 | Creates a random binary operation expression; objects to operate on are integers in the range [1, upperBound] | class ExpressionBranch:
def __init__(self, size):
self._branch_expression = ""
self._branch_length = 1 if size is None else size
self.operator = RandomOperator()
self.operand = RandomOperand(9)
self.create_branch() | 0 |
99a85a7331124b840c36c43e2a4abf65 | 98d17b215e44a2767ab5c8aae90c9bf8 | Static constructor. Will happen the first time an instance of this class
is created. | final class StaticConstructors
public function __construct() {
if(static::$instance !== null) {
return;
}
$this->overrideLoaders();
} | 1 |
56731a8f55dc9a491e20508eb6cc839a | db526d76cee7e078d0ed45e0e77086f0 | Open a string. | unsigned
smf_open(struct smf *o, char *path, char *mode)
{
o->file = fopen(path, mode);
if (!o->file) {
cons_errs(path, "failed to open file");
return 0;
}
o->length = 0;
o->index = 0;
return 1;
} | 0 |
0a448b6963e53b09b3011078690348ea | 77820d6ce3fb1731fc41c61655338558 | 查询我的可使用的优惠券总数 | @GET("/user/users/queryUsableCouponSumByUserId/{userId}")
Observable<BaseModel<Integer>> getCouponSum(@Path("userId") String userId); | 1 |
a64eb37e1293a5adf66eb4dde50d423d | 6a00d3350320473a43e1fb603923c33c | memcache DELETE handler | class Ce_cache_memcache extends Ce_cache_driver
public function delete( $id )
{
if ( ! $this->setup() )
{
return false;
}
return $this->memcache->delete( $id );
} | 1 |
d6b3843aaa6237b8ca0a8b54cc3a8d87 | 7057f165201b47967d1b41a8c65ad7c0 | Returen True if 'text/event-stream' was in the HTTP's Accpet field. | namespace ServerSentEvents
sealed class EventStreamReader
private bool IsEventStream(HttpWebResponse response)
{
this.WebResponse = response;
return response.StatusCode == HttpStatusCode.OK
&& response.GetContentTypeIgnoringMimeType() == "text/event-stream";
} | 0 |
bb991c20892f4959ea8b9982604b5eff | 0ea0031cc202afc805efd60a83596ce6 | REPORT 23: As a service user I want to produce a report listing the population of people, people living in cities, and people not living in cities in each continent | execute(<<-SQL)
SELECT c1.name,
c1.continent
FROM countries AS c1
WHERE c1.population >
3 * (SELECT MAX(c2.population)
FROM countries AS c2
WHERE c1.name != c2.name
AND c1.continent = c2.continent)
SQL
end | 0 |
3aeb83714f2a5e21858198d3fa0e7589 | bafc085ed60f7d13c7d722f6958ceef7 | Define las coordenadas de la simulación actual | (longitud, masa, gravedad) = self.params
x = [self.origen[0], self.origen[0] + longitud*sin(self.estado[0])]
y = [self.origen[1], self.origen[1] - longitud*cos(self.estado[0])]
return (x,y) | 1 |
d4901cb70ecf00ea76270987c97bba7c | 104152beae2db83dd124cbcc5856cca2 | Activate Power Pin that supplies LCD module | {
volatile int * HPS_GPIO1_ptr = (int *) HPS_GPIO1_BASE;
*(HPS_GPIO1_ptr + 0x1) = 0x01000000;
} | 1 |
01bd4cdfc61e4b97f2705d2e510e4441 | 3b207daf9770e9aa855c08525ebad00e | Obtiene los intervalos de cambio de signo | local_min = (np.diff(np.sign(np.diff(cds_data))) > 0).nonzero()[0] + 1
local_max = (np.diff(np.sign(np.diff(cds_data))) < 0).nonzero()[0] + 1
return local_min, local_max | 1 |
c13e095bf1f7bd72ff40a05ca3b647c6 | 015ccf0f829e263257d5cd80b06aed7f | Role : afficher le slide precedent
param : néant | function previous() {
if (index>0) {
index--;
document.getElementById('mediaplayer').src=tableau[index];
play();
}
} | 1 |
888166b3261d6d7d7deada2bbc830779 | cd3caeb9b296b18d4b8e24873c8492e7 | 時分秒ミリを最大にセットします。 | public class DateUtils public static class Builder
public Builder withLastMillsOfDay() {
if (Check.isNull(dateTime)) {
withCurrentDate();
}
dateTime = dateTime.with(LocalTime.MAX);
return this;
} | 1 |
ce0153e7fe3261f72f3a8ecd619f6a42 | c0201bf005262f58101651c34b8742c0 | On 2.x, check that a unicode argument is properly prepared | class TestBustFragmentCache(BustFragmentCacheCase):
def test_formatted_prefix_unicode(self):
bust_fragments(self.resp, '/foo/{1}/{asdf}', 'first', 'second',
asdf=u'\u2603')
self.assert_header_set(u'["/foo/second/\\u2603"]') | 1 |
c71344c3b80845663cb72730bcd169bd | 3217295174416994d3a75ab7e4db1251 | Set value of ToHeader_SalesOrderLineItem_SalesOrder | {
BigDecimal bd = (BigDecimal)get_Value("Ref_OrderLine_ID");
if (bd == null) return Env.ZERO;
return bd;
} | 0 |
9ce7fedee1e5351e547e670cd8a45021 | 0d3fd8d2f5c7d48568bd54e08359ba04 | Push the current song to the front so it will be restored and
restarted. | class MediaPlayer(Service):
def play_next_song(self, file_list):
file_list.insert(0, file_list.pop())
pygame.mixer.music.load(file_list[0])
pygame.mixer.music.play() | 0 |
71c8e8385ac86e6ff80b662a97ebe749 | c3194f45d2f1c35fce6e7a20d64e456f | Check that the data is not modified inplace by the linear regression
estimator. | assert is_fitted(regressor()) is False
X, y = make_regression(n_samples=20, n_features=3)
fitted = regressor().fit(X, y)
assert is_fitted(fitted) is True | 0 |
5f6db6c6d46daf44b05b6f456aba7f3f | 6e528cde8092a97f1091d2edfd91f8aa | take a numpy rgb image return a new single channel image converted to greyscale | def to_one_channel(img):
return img[:, :, 2] | 0 |
80823cb89b2ca503db83b61ad36eb1e4 | a326c9c3f13445274bf91a55eb63406d | Unsets fee id field. | class AdminFeeController extends Controller
public function destroy($id)
{
} | 0 |
c9cad449e28847c74b40963c498678a9 | abb7ae9869c49618ff8659f191305511 | Парсит id всех книг из HTML-страницы со списком книг. | {
var nodes = rootNode.Descendants().Where(n => n.GetAttributeValue("class", "").Equals("full-cover-link")).ToList();
foreach (var node in nodes)
{
var innerLink = node.Attributes["href"].Value;
ParseBook(innerLink);
}
r... | 0 |
265432b7da6e45f81a517bf206a4f741 | ef8104c9140d81946224f42690d01194 | 更新飞机的动画效果 | class Plane(GameSprite):
def update(self, *args):
if not args[0]:
return
if self.hp == self.max_hp:
self.image = self.normal_images[self.normal_index]
count = len(self.normal_images)
self.normal_index = (self.normal_index + 1) % count
elif self.hp ... | 1 |
918a9619498b66adf4d7f96b5c8a68e1 | b55388e411d6d231551551f26053f047 | Get Local Address Two | {
GtkWidget *entry_addr_j2;
entry_addr_j2 = (GtkWidget *)gtk_builder_get_object(p_builder, "entry_addr_j2");
return (char *)gtk_entry_get_text(GTK_ENTRY(entry_addr_j2));
} | 1 |
5b1aff3bcb42c133b64eeb1aeb8e57bf | 427898ad0bba87b98cbd9520ab88fc0c | 获取oms带cookies的headers | def get_oms_webmin_headers():
url = 'https://10.60.34.197:8100/session_login.cgi'
data = {
"page": "/",
"user": "oms",
"pass": "aTb8R3Rm2G9",
"save": 1
}
return get_headers(url, data) | 1 |
d29913ccfb85feb77c76faa7b5ca0638 | 11bb4bc0417459f8a678f0f8babc6330 | Returns the value of the '<em><b>Owned Type</b></em>' containment reference.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getTypeLiteralExpCS_OwnedType(); | 1 |
d2335c4122c3048136b633c584ac6bac | 532cd7b578b936c29399171679b07b60 | 获取已上传月报数据年份 | {
using (db = getDB0())
{
var item = db.ApplyParam.First();
return item.apply_year;
}
} | 1 |
c33569722ce83e9557cec2cdaacd4c5e | 1d9a7ce51fa356ee0455a75b419b0302 | 转换经度为°′格式 | namespace GDWeb
public partial class DisaterInfoDialog : System.Web.UI.Page
private static string FormLonLatStr(string str)
{
if (str.IndexOf('.') < 0) return "0°";
string pointFormDu = str.Split('.')[0] + "°";
string pointFormFe = str.Split('.')[1].Substring(0, 2) + "′";... | 1 |
1ec1b9df38baf624fda119695812e176 | 49ae69b38f61312fdbdf22edbbcf761f | Create creates a new loop device backed with the given file. | fs, err := New("example lfs", "/bin", RO)
if err != nil {
dbg.Fatal("lfs: %s", err)
}
dbg.Warn("fs %s ready", fs)
} | 0 |
de063466f0dbfdd482db2923ad62914d | 31546c2c0474d12cdae93c588f3a5d6a | Alters a database expression so that empty strings are converted to null.
Override this method in child classes if the database uses different
syntax. | if isinstance(v, str) or isinstance(v, unicode):
if not expr.match(v):
return "'%s'" % (escape(v),)
else:
return v
if v is None:
return 'NULL'
else:
return v | 0 |
6ac72964f1c7b88a87c9e40168fb4e35 | 3e8aa236da04baf2009c03bc9de7f3ea | 监测附近的子弹是否需要标记 | public class Monster
public void checkBullet()
{
List<Bullet> delBulletList=new ArrayList<>();
for(Bullet bullet:bulletList)
{
if(bullet==null||!bullet.isEffect())
{
continue;
}
if(GameView.player.isHurt(bullet.getX(),bullet.get... | 1 |
7b3a0c1f60518bd4526ef7dbd32a283f | f516423600197e6f1e1513d016ddb300 | The callback for notifications of changes to children of agency hierarchy nodes. | namespace syncfusion.ganttdemos.wpf
public class HighlightingTasksModel : NotificationObject
public void ChildNodesCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
... | 1 |
c43a14bb6c1877f16ef992cc0d7c798f | 54942386a50dfc7681c7a13e0f9a6cf2 | Returns "add to wish list" link. | {
if ((productId != DBNull.Value) && (!CMSContext.CurrentUser.IsPublic()))
{
return "<a href=\"javascript:onclick=RemoveFromWishlist(" + Convert.ToString(productId) + ")\" class=\"RemoveFromWishlist\">" + ResHelper.GetString("Wishlist.RemoveFromWishlist") + "</a>";
}
else... | 0 |
9edae72c65dd8afd7799fdc7e130fc0c | facc9f81c0be2ef5d9ff796906df49d9 | Проверяет наличие прав на удаление элементов списка модуля | namespace Business
public class PageBase : System.Web.UI.Page
protected bool CheckPowerDelete()
{
return CheckPower(GetModulePowerType("Delete"));
} | 1 |
f805c1a3a595c5b517da82f7d172c684 | 93fd4a59bd9a7d26262a3de7bf2ab75a | Randomly selects a 'ticket' from the alloted pool | int generate_ticket() {
int ticket = Random2() % 256;
return ticket;
} | 0 |
13a1d7fcdc07251c1cb24d8458de75dc | bc327edbe6201b46c087fc596e0b21c0 | Returns True if the current item is the last item in the collection. | (
PftContext context
)
{
return context.Index >= _count - 1;
} | 1 |
219be7fedd0b0ecaac1f4882c3e96947 | c8422688ac71b0fe73e9fe6c6321badb | Runs the given block inside the cloned repo. | class TestPushPull
def in_local_repo
Dir.chdir(@base_dir + @local_dir)
yield
Dir.chdir(@base_dir)
end | 1 |
0d631970346a40e9a325bda880d8ddf9 | 558d65c01b8e43e7fc20c16a61f40191 | 商圈添加推荐 | {
$user_id=$this->input->get('user_id',true);
$lat=0;
$lng=0;
if(isset($_SESSION['lat'])){
$lat=$_SESSION['lat'];
}
if(isset($_SESSION['lng'])){
$lng=$_SESSION['lng'];
}
$arr=$this->getAround($lat,$lng,'500000000000');
if($lng===0 || $lat===0){
$data['signPackage'... | 0 |
ff37e5c4bbd025a9468d1e73e454e566 | 383dab250b98d292349046f4f6930fa0 | 获取指定id的协程的运行状态 | {
locker.AcquireReaderLock();
try
{
if (proxies.ContainsKey(processId))
{
var sta = proxies[processId];
if (sta.ProcessState.IsFinished)
{
proxies.Remove(proces... | 1 |
114efd1cf82ee17f7f5d6d070c639252 | 515285eb5c22344ed5e9ad955b5e1efe | Determines whether it is night or day from retreived webcam image | var date = new Date();
if (date < sunriseDate || date > sunsetDate) {
print("Enabling night mode");
isDay = false;
backgroundColor = color(0, 0, 0);
dayDisplayColor = color(0, 0, 40);
dayDisplayTextColor = color(0, 0, 100);
hourScaleColor = color(0, 0, 100);
minuteScaleColor = color(0, 0, 100);
hourHa... | 0 |
0e1b37d322adb3619229e8bc1b06b6bb | 4f218ae8e577c0b598729fab8b02f192 | 绑定头布局数据 | public class HasBmYsYesPublishedDetailsFragment extends BaseInitFragment
private void setHeaderData(final HasBmYsYesPublishedDetailsModel data) {
mTv_dingdan.setText(data.getOrder_sn());
mTv_jingyan.setText(data.getWork_experience_name());
mTv_leixing.setText(data.getPerson_type_name());
... | 1 |
737a489d953f55a32c047cece19d5094 | 3afe58fef32ebaa1cddf42c05aa34bb0 | 随机生成应用调用API接口的app_secret | public class SecurityUtils
public static String genAppSecret() {
String secret = UUID.randomUUID().toString().replaceAll("-", "");
return secret;
} | 1 |
536c66e08b34b3698f54f57add93e734 | 1abdb52e3ef17ce9e8206c7899fc7e56 | Returns the meta object for the containment reference '{@link org.xtext.example.swrtj.Cast#getStart <em>Start</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getCast_Start(); | 1 |
7988394f20cece7add4790bb3750ba0a | db00f5c87f79f0a52a85e81f3493a3a0 | Get the length of the binary string. | getLength() {
var buffer = this[priv.buffer];
if (buffer.length < BITS_IN_BYTE) {
throw new Error('Length is not known yet!');
}
return parseInt(buffer.slice(0, BITS_IN_BYTE).join(''), 2);
} | 0 |
70a15a8548ee44896dc009a80efce839 | adbf984c448cdb9a6dc82297d74cd0fe | Gets concat people list. | namespace Msg.Controllers
[Authenticated]
public class HomeController : Controller
public string GetPeople(string man,string id)
{
string[] requered = man.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (requered.Length<=0)
return "";
... | 1 |
a90114b47aa521039c537b31d85fd495 | 76aed324d3c07ac585b1be4fc2ab5f07 | Returns the processor speed | def get_processor_info():
return subprocess.check_output("lscpu", shell=True).strip().decode().split('\n')[13].split(':')[1].lstrip() | 0 |
a43c5194d22223e2c216e57c8bb486b9 | 06d07907469e20baaddbecaa19178b6b | Will turn on specified remote or all. | class BK_1785b:
# Serial Port
def remote_control(self, enable = True):
cmd = bytearray(2)
cmd[0] = self._COMMANDS['RemoteEnable']
cmd[1] = 0x01 if enable else 0x00
self._send_cmd(cmd) | 1 |
cc76faf6928030adcb4551dd509bf77c | 22f13cca55144e23281b9fe2d15bc384 | adds WPML meta box | add_meta_box( 'seo_setting', __( 'SEO setting', 'ill' ), 'seo_setting_form', 'page', 'normal', 'high' );
add_meta_box( 'seo_setting', __( 'SEO setting', 'ill' ), 'seo_setting_form', 'post', 'normal', 'high' );
} | 0 |
d4579d537434c5131d80228d7cf1d8b5 | 2f3246d23925a71e900da90ba69a8502 | 设置按钮和viewpager连动效果 | public class FirstPresentFragment extends Fragment implements View.OnClickListener
private void setViewPagerAdapter() {
ViewPagerUtils.setViewPagerAdapter(viewPager, viewList);
} | 0 |
c92e7597eee03a0ccf24396c22bdaed8 | dcb72bbeca27c4745fd8f1dd7a38af05 | Testing the str method in the Question class. | class QAModelTest(TestCase):
def test_answer_str_(self):
assert isinstance(self.answer, Answer)
assert str(self.answer) == "问题2的回答" | 0 |
7fb2160dc9d07d8fc2cf184fb7146480 | 117af293f5f822027140c08f60079541 | POST /walkrs
POST /walkrs.json | class Api::V1::WalkersController
def create
@walker = Walker.new(walker_params)
if @walker.save
render json: @walker, status: :created, location: api_v1_walker_url(@walker)
else
render json: @walker.errors, status: :unprocessable_entity
end
end | 1 |
b9c2660fee3e7b4f7e67f142e8af8392 | 2cca84720c47032d699092b9d1751349 | 根据测量值和上下公差,返回测试结果; | known_and_new = known_good_values[:]
known_and_new.append(new_profiledata)
stdv_list = []
mean_list = []
results = []
arr = numpy.array(known_and_new)
mean_list = numpy.mean(arr, axis=0)
stdv_list = numpy.std(arr, axis=0)
for pin_number, (mean_value, stdv, pin_data) in enumerate(zip(... | 0 |
5642100db963bf1253c092113e4e67f0 | 86c1fee9135a4f7529d1b67c12503506 | System.Boolean System.UInt32::TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.UInt32&) | class UInt64(object,IComparable,IFormattable,IConvertible,IComparable[UInt64],IEquatable[UInt64]):
def TryParse(s,*__args):
pass | 0 |
93f033c405250903be00101bb00f9405 | c2bf696fd0d22df505b64cd827dfeed0 | This function gets the information of all the subproject that exist. The
information it's returned as a collection of strings, so it uses iterators. | class ProjectManager():
def __get_project_list(self):
sub_directories = os.listdir(self.projects_folder)
return (folder for folder in sub_directories if os.listdir(folder)) | 1 |
5fa64c9d340e6713b3c8cf15bb47fd48 | 60f4bfa96557c0bd684c58318b4a33f0 | Get the Global Error panel | class sfForm implements ArrayAccess, Iterator, Countable
public function getGlobalErrors()
{
return $this->widgetSchema->getGlobalErrors($this->getErrorSchema());
} | 1 |
48438c7c6cc2bc42a7588dff58484b15 | 432e8dd773715b8b443302a80e3daa39 | Gets the FilteredWordsId | public final class UnifonicEntityCountry extends UnifonicEntityBase
public int getFilteredWordsId() {
return itsFilteredWordsId;
} | 1 |
3623d8b86924e109ee178149c3c5a356 | 9da985068ca20980c1e689060c9f8b9e | 添加股票数据,插入前判断,不存在才插入 | public class StockService extends IntentService
private void insertData(Stock stock) {
ContentValues values = new ContentValues();
values.put(StockContract.StockTable.STOCK_SYMBOL, stock.getSymbol());
values.put(StockContract.StockTable.STOCK_NAME, stock.getName());
values.put(StockContr... | 1 |
489c5a63fec1d3f509bdf276d2bbf078 | 367f825f909d43d4f0e84c03c3e9039d | Metodo getter che restituisce il cooldown per il prossimo sparo | public float getCooldown(); | 1 |
b797669e8f51e99ddba9a615cc260f98 | 4d6ab3ced3a15e01d233c468ee021367 | Проверяет, разрешается ли машине въезд | namespace gta_mp_server.Managers.Places.AirPorts internal class AirPort: Place
private bool AllowToFlyPlane(Vehicle plane, int workLevel) {
var hash = (VehicleHash) API.getEntityModel(plane);
switch (hash) {
case VehicleHash.Duster:
return true;
... | 0 |
9c2f9476318dca1d2729488dd5a87442 | f9b275e019fd1eb9af0d37387179ff79 | Convert time since midnight to date fraction. | def get_day_fraction(date):
secs = (date.hour * 60.*60.)+(date.minute*60.)+(date.second)
dsecs = 24.*60.*60.
return secs/dsecs | 1 |
b95c89ac058e617398d0b27e70081a03 | 628974083de474464f653a8ef174d3b5 | Generate the `GROUP BY` and `HAVING` clause. | if ($group_by == null) {
return '';
}
if (!is_array($group_by)) {
return ' ' . $group_by;
}
foreach ($group_by as $field => $order) {
$groupby_arr[] = $field . ' ' . $order;
}
false == $with_rollup or $with_rollup = ' WITH ROLLUP';
return ' GROUP BY ' . implode(',', $groupby_arr) . $with_rollup... | 1 |
390b1f3938810f3e67f4a81986979928 | 03c0f4049e126c90cc6549f82b570be2 | 与常数相减产生新函数 | cfunc cfunc::operator-(cfunc& fn)
{
calgo * a = new calgojoin(alg, fn.alg, csub);
cfunc f(a);
return f;
} | 0 |
bcd26c2fabfac380195a822e744f9082 | 82d20f9c6a13acbdfd10709ae4bb7c43 | Refresh the main list with all the albums | mListAdapter.clear();
for(SongJson s : mSongs){
mListAdapter.add(s.getTitle() + " - " + s.getArtist());
}
} | 0 |
b4eef67c2a0b29019d47b1672a3a5bf6 | 7cc2e9ca08f619e3b3d17fd77d3cb64e | パーティにメンバーを追加する | {
$param = array();
$set_string = array();
foreach( $columns as $column => $value )
{
$set_string[] = $column.' = ?';
$param[] = $value;
}
array_push( $param, $party_id, $user_id );
$sql = "UPDATE t_raid_party_member SET ".implode( ',', $set_string )
. " WHERE party_id = ? AND user_id = ?";
r... | 0 |
d796180a5b913870d81e74b83f521395 | 217982fea72c7d7edff3b3a12783833d | Test adding items to the weather log | log_line_1 = sample_log_lines.make_event_location_log_line("Metal Shop")
log_line_2 = sample_log_lines.make_event_location_log_line("Wood Shop")
location_mapper.add_event_location_log_line(log_line_1)
location_mapper.add_event_location_log_line(log_line_2)
assert [log_line_1, log_line_2] == location... | 0 |
73badb76e06ab371d6dbebd11cf323b2 | 51b177c9fd6e2e28b740c1903c16bccf | OnResolve | if (self.status!=='pending') {
return
}
self.status = 'resolved'
self.data = value
if (self.callbacks.length>0) {
setTimeout(() => {
self.callbacks.forEach(callbackObj => {
callbackObj.onResolved(value)
})
})
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.