query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
cf147a356e80e0f37d0d296e7b25d3f6 | 97802bafa2b5f31e75ffb54434d91749 | Called when this sync object should start. The sync that is started should always be started on a
new thread to not block other sync objects to run in parallel as this is called from the sync loop thread. | stopSyncLoop();
isSyncing = true;
stopSyncing = false;
s32 prio = 0;
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
syncThread = threadCreate(startSyncLoopWithoutClass, this, 8*1024, prio-1, -2, true);
} | 1 |
c6220a22683db70ca81c7b281d6ddbe7 | cebe6cab68bb67943549aa58dcf61f5a | Assign correct waveform to waveform dropdown | {
Button button = sender as Button;
selectWaveButton = button;
string[] tags = button.Tag.ToString().Split(',');
waveCategoryIndex = int.Parse(tags[0]);
waveSelectedIndex = int.Parse(tags[1]);
if (waveCategoryIndex == 0)
{
... | 1 |
a129b13ac178616ccdfa17905a511912 | 3c2d2a644a4e697e6482bb176e4355d5 | Called when a user is timed out by a moderator. One of these parameters
is the moderator and the other is the receiver of the timeout. | static void
timedout_runic(struct runicast_conn *c, const rimeaddr_t *from, uint8_t retransmissions){
DEBUG_MSG(1, "RUNICAST TIMEDOUT!! TO: ", from);
} | 0 |
60fea09271f5428aa3b4ebbb58999b95 | 4346a9e0a011983d4c15346b9c852a97 | Adiciona sombras ao objeto do parâmetro | {
DropShadow Shad = new DropShadow();
Shad.setOffsetX(4);
Shad.setOffsetY(6);
Shad.setColor(Color.rgb(0, 0, 0));
PnIngressos.setEffect(Shad);
PnBilheteria.setEffect(Shad);
PnSelecionar.setEffect(Shad);
PnBotoes.setEffect(Shad);
} | 1 |
e5bda529ec201fa1703d14d941d30f6d | 2ea21558477eba6c1b3a1785f85b5f3d | Get diabetesFeeling | class FacebookPipeline(object):
def process_item(self, item, spider):
def get_feeling(max_min):
feeling = ['great','ok','bad']
feeling_great_max = self.feelings['great']['max']
feeling_ok_min = self.feelings['ok']['min']
feeling_ok_max = self.feelings['ok']['max']
... | 0 |
087b701cba4740215b23f04ce7eeecbb | 0077bfe6d0a48f373bf94b327c548543 | clearBuffer
Treats pbuf as a pointer to an array of 'size' bytes and clears them all to zero. | void ARMCII_Bzero(void *buf, armci_size_t size) {
memset(buf, 0, (size_t)size);
} | 1 |
d8ca22b0b00007c0f27acfbe4d10f2f2 | 88e9dd1fe6d656895671a1ee57d04056 | 클릭할때마다 색깔을 파란색으로 변경 | function changecolor() {
let selectedItem = document.getElementById("even");
selectedItem.style.color = "red";
} | 0 |
ce05545826a1e85a2a5564f6606d3c6f | fb6b073863f9a36a86569751fdb12319 | List remote libraries | LOCAL_LIBRARY_DIR.mkdirs()
val remoteLibrariesFile = File(LOCAL_LIBRARY_DIR.parent, "remoteLibraries.txt")
with (remoteLibrariesFile) {
if (!exists()) {
writeText(BetterUtils.getResourceFromJar("assets/betterrecords/libraries/remoteLibraries.txt").readText())
... | 1 |
33336459c2a1a3a56b41b127be029924 | 43157cb9c8a44ce3bfd11fd281d7f2de | when player hovers over the agent with the mouse, let the GUI appear | void senSAE::mousePressed(int x, int y, int button){
if (button == 2) {
if (showGui) showGui = false;
else showGui = true;
}
} | 0 |
9df1a84a2bd96690db272ecf66fa1ed5 | 1469f6a89ff146869c3201882f311f44 | Do a normalization precess on words. In this case is just a tolower(),
but you can add accents stripping, convert to singular and so on... | def normalize(word):
if word.isdigit(): return NUM
else: return word.lower() | 1 |
c9fe59add5c71bbf1f604188b1e42872 | 1fc4623e675b49398329588e53ef7b2a | Gets the factor that is multiplied by all time period specifications. Defatult value is 1, meaning normal
running speed for the animation. | double getFactor(); | 1 |
1a3b94eac6655f067eba8a7be123c9cf | 97b501f1918f310b4719e97b84b6c176 | 16-bit unpacked samples => RGBA w/ unassociated alpha | void __glSpanPackRGBA8ToARGB4(__GLcontext *gc, __GLpixelSpanInfo *spanInfo,
const GLvoid *inspan, GLvoid *outspan)
{
GLint i;
GLint width = spanInfo->width;
const GLubyte *inData = (const GLubyte *) inspan;
GLushort *outData = (GLushort *) outspan;
GLuint invalue, outvalue;
#ifdef __GL_LIN... | 0 |
1706f7906ba6175a5c97ef0647c339e6 | e5e4020846599c172fb5ed0bb8af3673 | load any enabled A/B test sessions for the current_user | final class AnalyticsClient
public function getABTests($requestOptions = [])
{
return $this->api->read('GET', api_path('/2/abtests'), $requestOptions);
} | 1 |
ada6aa4eae510a2cdc776e637ba95434 | edcc0d01fd5c2c9e79b5bbf11589706b | filter with date form => to | class KnowledgeTourController extends Controller
public function FormateDate(string $date)
{
$newDate = "";
$tmp = explode("/", $date);
$newDate = (int)$tmp[2]."-".(int)$tmp[0]."-".(int)$tmp[1];
return $newDate;
} | 0 |
9b2323cb9d1d6a2a5f8048e4264bb2dc | a7ece7b0a33a0539dd4eeb9cb99e7825 | 检查卖出书籍价格变化情况 | namespace TaoBaoGuanJia
public partial class MainForm : Form
private void chk_SalePrice_CheckedChanged(object sender, EventArgs e)
{
} | 0 |
a695b9de0986b8b31bb132a16a7c1f86 | cc505deee871158a3f113474e33482c7 | エラー時は空のページを表示する | function gotoTopPage(res) {
res.render('index', {error_messsage: "ログインしてください"});
} | 0 |
ec1ae7cf646804e3f5d7357db8e2bdab | 13ee1351470dcee4c4e198a38969e8f4 | Get treatmentTotal | class Player(BasePlayer):
def treatment(self):
return self.session.vars['treatment'] | 0 |
21f881dbb6b513c2a38dc0e3ecf21355 | 1223a80ac59fc73440e62b622f73a013 | 导出MD文章 | let linkSs = p.links.map(linkToStrS(opts.images))
return kefir.combine(linkSs, function (...links) {
return post_md(p.day, links)
})
} | 1 |
c33802be58ab37ef6e467eb6cca4c807 | 91bd102ef08f76300d8df098f54a3a47 | prints a table that shows the content of the eeprom as a table
the number of bytes per row can be configured | void eeprom_read_table(void) {
unsigned char *eeprom_table_ptr = (unsigned char *)&eeprom_table;
for (unsigned int i=0;i<sizeof(eeprom_table);i++)
*(eeprom_table_ptr+i) = eeprom_m24_read_byte(i);
} | 0 |
5d14fc3a977e6d805b72b89acc5b7bb3 | 452cce7f82037878f3e6af354bb79a47 | Узнаем самое длинное значение для каждого столбца таблицы | {
if (matrix.IsEmpty()) return default(T);
T longest = matrix[0][0];
for (int i = 0; i < matrix.Rows; i++)
for (int j = 0; j < matrix.Columns; j++)
if (longest.ToString().Length < matrix[i][j].ToString().Length) longest = matrix[i][j];
... | 0 |
c0c0591f47aa6994e38c7c12874c5e5c | 320ae1aa348775fee3211d15d6019217 | Timing experiments with baseline, serial, and parallel versions. | def main():
sample_size = [500, 1000, 10000]
tests = {'Sequential': 0, 'Ordered': 0, 'Binary Iterative': 0, 'Binary Recursive': 0}
for sample in sample_size:
counter = 0
while counter < 100:
test_list = generated_list(sample)
tests['Sequential'] += sequential_search(test_list, -1)[0]
tests['Ordered'] +=... | 0 |
1ca720542f0dfb6ba3a018ff00342d31 | ad529fe039af1a44a1251f76c546cd49 | Calculate the point spread function of the array. | def calcPointSpreadFunction(steerVecType, distGridToArrayCenter, distGridToAllMics, waveNumber, indSource, dtype):
psfDict = {'classic' : _psf_Formulation1AkaClassic,
'inverse' : _psf_Formulation2AkaInverse,
'true level' : _psf_Formulation3AkaTrueLevel,
'true location' :... | 1 |
ace54a0217e46c15d82a5229b9bf94f1 | ff9b10b4bce09d8da362fc8af00d5802 | Add to Redis all records required to represent new SMS mailing. | $defaultLangId = Service::LanguageCollection()->getDefaultLang()->getId();
$defaultDomainId = Service::DomainCollection()
->getDefaultDomain()
->getId();
$mailNotifications = Service::MailNotifications();
$mailNotificationsMap = $mailNotifications->getMap();
$mailTemplates = Service::MailTemplate... | 0 |
5edd738433ae43388b1f79788a14871c | 8e47490799a7ae7c7ef2b2e9972e4f56 | Given an iterable sequence and a template renderer, returns a Python
generator yielding the rendering of the template for each item of the
sequence, plus a comma after every generated block but the last. | class NumPyPrinter(LambdaPrinter):
def _print_seq(self, seq, delimiter=', '):
return '({},)'.format(delimiter.join(self._print(item) for item in seq)) | 0 |
45a022adde355bb76c5dcaa58091c82f | 511c8031631b27fbdba19a11211f51d6 | Intersects two postings list, adding their ranking values at intersections. | list_doc = []
while posting1 != [] and posting2 != []:
if posting1[0] == posting2[0]:
list_doc.append(posting1[0])
posting1.pop(0)
posting2.pop(0)
elif posting1[0] > posting2[0]:
list_doc.append(posting2[0])
posting2.pop(0)
else... | 0 |
887080c88479d9550f06b651aca6a222 | 2a35c36abfedae43bb90326066141a7c | Takes an integer n and a long k as command-line arguments, and prints
a permutation of length n with exactly k inversions | public class Permutation
public static void main(String[] args) {
int totalNumberOfSequence = Integer.parseInt(args[0]);
int numberOfSequence = 0;
RandomizedQueue<String> randomizedQueue = new RandomizedQueue<String>();
while (!StdIn.isEmpty()) {
randomizedQueue.enqueue(StdIn... | 0 |
b404b18a7da4ba421b00e0d6b8159326 | c6f7f5269b9aa22c75cdfa40ec946bcb | @brief Get the type of an invoked @c target from the BPS event
The @c navigator_invoke_event_get_target() function extracts the target type
of an invoked target application. The @c type member allows the target to be
identified as a viewer, aplication, service, or card.
The possible values that you can receive from thi... | ub4 size, ub4 attrtype, KCIError *errhp)
{
return KCI_SUCCESS;
} | 0 |
2fe6ef8ee4eea8b0b0bdf98ffec53726 | 6749eec530247f671f607c07d0600325 | Attach a file to a fulfillmentLayoutPosition by URL. Adds a file to an existing fulfillmentLayoutPosition by URL. | namespace Infoplus.Api
ApiResponse<Object> DeleteFulfillmentLayoutPositionFileWithHttpInfo (int? fulfillmentLayoutPositionId, int? fileId); | 0 |
e9f6ead47db0fa4962e2ab86a1365e31 | 64e10a6a6a249fc877b9a7ecb6c8b3b0 | set OCP limit | class DPS_Handler:
def Set_OCP(self, amps):
res = self.__cmd_write_reg(self.SLAVEADD,self.REG_M_SOCP,round(amps*1000))
return res | 1 |
22e218d222df6428d262d121afcca589 | b4f3f078b3621b56bc9443de647fdb1d | Method that prints the current line | class BlockText(object):
def printLine(self):
print self.line_separator | 0 |
813238e7409322e679d686e6fa5bb5b5 | 9746264844931aec099c777d87851e52 | Convert kilobytes to bytes | export class ConversionUtil
public static kilobytesToBytes(kilobytes:number):number {
return kilobytes * 1024;
} | 1 |
fddb5a70aed5543573cb00bd9b177d23 | 81d578c220561cca9aa347fdac195120 | 根据名字和身份证查询政法委列表 | @Controller
@SessionAttributes("commissioner")
@RequestMapping("/commissioner")
public class CommissionerController
@RequestMapping(value = "/findCommissionerList")
@ResponseBody
public Iterable<Commissioner> findCommissionerList(String commissionerName) {
Iterable<Commissioner> list = null;
if ... | 0 |
e3be93afd5c913eea33ce225261705f7 | 0c9a28978708959baf4084752472a652 | Generate way points that can be used for checkpoints or IA. | {
List<Vec2D> waypoints = new List<Vec2D>();
waypoints.Add(start);
switch (shape)
{
case ShapeTypeTable.kDownTurn6:
waypoints.Add(new Vec2D(start.X - 32, start.Y + 180));
waypoints.Add(new Vec2D(start.X - 96,... | 1 |
b484035eacf54bb1d0e9caff00180f76 | a10d8b8cd98e7f88cbb127697abcd962 | 入力項目(「まとめの目標文字数」)のHTMLを出力します。 | class toolbox{
function kontyokuSiteremianingHtml($kontyokuSiteremainning){
if(count($kontyokuSiteremainning) == 0 || $kontyokuSiteremainning["SITEREMAINNING"] == ""){
echo '<td><center><input type= "text" name="zentyoku_zan" size="4" value="0" /></center></td>';
}else{
echo '<td... | 1 |
fc44314b4c7b75fa2c0a062478bdae70 | 6666211b0d0a03ba6f7d69204ac82ec8 | get all the neighbours which is not appeared yet | class Dijkstra:
def return_near_neighbor(self):
nn = []
for index, edge in enumerate(self.network[self.currentnode]):
if edge > 0 and not self.nodetable[index].visited:
nn.append(index)
return nn | 1 |
774cbe20fc20d1d717f62b2181c1d82c | a5549c09b44470bcea6aa10f7b447be0 | Perform the MAC and PHY actions needed to enable a "port" (Virtual
Interface). | static int link_start(struct net_device *dev)
{
int ret;
struct port_info *pi = netdev_priv(dev);
ret = t4vf_set_rxmode(pi->adapter, pi->viid, dev->mtu, -1, -1, -1, 1,
true);
if (ret == 0)
ret = cxgb4vf_change_mac(pi, pi->viid,
&pi->xact_addr_filt,
dev->dev_addr, true);
if (ret == 0)
ret =... | 1 |
9ebd2a84fb86979c0dae9d22f9f9fb4a | c4ade6dfddbab97cf24b7e02f0165192 | Hide progress bar and show section of bandwidths. | class PageGo(LbxPage):
def _cb_show(self, widget):
widget = widget
get_widget_r(self, "%s_progress_bar" % self.mode).set_text('')
get_widget_r(self, "%s_progress_bar" % self.mode).set_fraction(0) | 0 |
c7c85f24ddb3af06e32c37f632cae4fd | 42ae935f3da4de9c8461d718177c93f1 | Voltage source with changing value, given by specified function. | class AlternatingNode(SourceNode):
def __init__(self, Vt):
self.Wires = []
self.Vt = Vt
self.V = Vt(0.) | 1 |
e188e05d7a9839eddc76e502643babac | cfad7b220567e60c20c14c690b716a40 | Gets all group start end location. | class PresenceAnalyzerUtilsTestCase(unittest.TestCase):
def test_group_by_start_end(self):
data = utils.get_data()
start_end = utils.group_by_start_end(data[11])
self.assertEqual(
start_end,
{
0: [[33134], [57257]],
1: [[33590], [50154]],
... | 1 |
8ce2a27f841eed98af2bb3ef6fe0317e | c4f684dbd94c4edf990a05f5026c36c0 | 删除不是闭合的曲线 | {
for (int i = 0; i < Rim_Curves.Length; i++)
if (((WCurve2D)Rim_Curves[i]).Meshed_Check == false) return null;
StreamWriter Sw = new System.IO.StreamWriter(Path + Name + ".rim");
int[] Sorts = Geos2D_Other.Sort_Curves(Rim_Curves);
int Num;
... | 0 |
213d4a37fb5f28d4d2a7b81e8b658876 | 59be6cf04dd0fe15ced55174c7ac545b | 将用户点击列表转换为物品的倒排索引 {key: item, value:[user1, user2 ...]} | def calc_item_sim(dataSet):
users_item = dict()
for user, items in dataSet.items():
if user not in users_item:
users_item[user] = set()
for movie in items:
users_item[user].add(movie)
return users_item | 0 |
005e9200bf18e34e4ac27b3abcb78d5f | cc881942a63516231e96c1f9dc2190a9 | Indicates if rm should just unstage and remove paths only from the index while leaving the working tree files
alone.
tree files alone. False indicates rm should also effect the working tree files (normal operation). | @Beta
public final class MirrorCommandBuilder
public MirrorCommandBuilder setIgnoreLfs(boolean ignoreLfs) {
this.ignoreLfs = ignoreLfs;
return this;
} | 0 |
0f8000e74936ab38907c5509132d2a45 | e710786abb69f583bf0f9bfb06ecf949 | Método que devuelve el nombre del usuario al que va dirigido el mensaje. | try{
InternetAddress address[] = (InternetAddress[]) message.getFrom();
String who = address[0].getPersonal();
if (who == null)
who = "";
return who;
}catch(Exception e){
return "";
}
... | 0 |
e024add5f37bc9c8d7be38987e95643a | 16f96f1c2fcc617183919c5f01f4acb1 | @brief Get the STHS34PF80 temperature data ready bit value | class ds1631(i2cDevice):
def getTHFlag(self):
return(int(self.getConfig()) & 0x40) | 0 |
aa6a9103925d53796ec2daadbba0172b | 4aa462a58f9cf10e6b83124458b9ad82 | Lista los clientes en el combobox. | public class IntAltaReserva extends javax.swing.JDialog
public void cargarClientes()
{
ArrayList<Cliente> listaClientes = gesCli.getListaClientes();
String cliente = "";
for(Cliente cli : listaClientes)
{
cliente = cli.getId() + " - " + cli.getApellido() + " " + cli.getNo... | 1 |
5a9eb4b08607ef9d8de3867235d232be | 37699614a03ab5474ddae3e4a8e170aa | 设置最小高度,单位是dp | public C setMinimumHeight ( int minimumHeight ); | 1 |
6d5305dfa1379c6fa7c1117a1b6fc1c7 | fe954a0fb16a90bd23a12eab0af12820 | 如果该角色属于管理员则不能删除(管理员角色表) | @Service
public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implements IRoleService
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteById(Long roleId) {
if(Constants.ADMIN_ROLE_ID.equals(roleId)){
throw new UserException(UserErrorCode.ADMIN_ROLE_C... | 1 |
d73bd4dbdbd89823193f9e1e11239d77 | 2cce1e7b1ecf19ac13342822374e9a6c | Retrieves all excursions by TripId. | class TripsTable extends Table
public function findByTripId(Query $query, array $options)
{
$trip_id = isset($options['query']['tripId']) ? $options['query']['tripId'] : null;
if ($trip_id == null) {
throw new BadRequestException('invalid or missing parameter tripId');
}
... | 1 |
65e12511d5eb09ad45eba3ccab774d7f | 08e3bc8a202aa7cc868219f2df82e358 | POP交易商品明细列表 | class weipinhui_trade_model extends x_trade_model
public function x_get_trade_detail_list($filter = array()) {} | 1 |
6ce13c905cdc1d4ca5e3d772c08e9bf3 | c8fcd70954018da989b33510440e1eb1 | 去掉树形数组 长度为0的children 属性 | if (arr.length <= 0) return false;
for (let i = 0; i < arr.length; i++) {
if (arr[i].children) {
arr = arr.slice(0, i + 1).concat(arr[i].children, arr.slice(i + 1));
}
}
return arr;
} | 0 |
e5849261dd3e92f92ab9c4031ce189b1 | 96515e3c1ab05f0effb57a5a5f022bde | 导出银行文件为txt 新 | def generate_bank_info(data):
out_file = "../../resource/cnap/BUPPS_BANKS_INFO.sql"
count = 0
with open(out_file, "w", encoding="UTF-8") as f:
for row in data:
sql = "INSERT INTO \"BUPPS_BANKS_INFO\"(\"INNER_BANK\", \"INNER_BANK_NAME\", \"BANK_SHORT_NAME\", \"INNER_SETTLE_BANK\", \"PARTI... | 0 |
72a6d96f4d396cf20b1ac8a3f491ace3 | a2d6cb3df5266216afba86fef930bdf3 | Stampa il nodo sul file ff in formato dot
\retval 0 Se tutto ok
\retval -1 In caso di errore
errno == EINVAL parametri errari
errno == EIO Errore di I/O | void DepGraph::toDot(std::string s) {
this->toDot(s, &errs());
} | 0 |
e0e749ed707c199232acef8f84915a93 | 06d241ade60740075fa0f258e43d92a5 | Finds the number of unchosen squares. | {
int count = 0;
foreach (int square in board)
{
if (square == 1)
count++;
}
return count;
} | 0 |
63f9f1c0a2190275913eb42e13daf66d | b6b93acdcb5883293b747f5c18acdba0 | 当键不存在时才设置值 | public class JSONObject
public void put(String key, Object value) throws KeyExistException {
try {
Object v = getValue(key);
throw new KeyExistException(key + " exist");
} catch (NullPointerException ignored) {
}
jsonObject.put(key, value);
} | 1 |
3b7d336196e5732a8ee477757ead4f5f | bbf1831469ed56b39139915d95956d99 | 创建指定对象撤消点 | function createNotationPoint(obj) {
var notationPoint = notationPoints.get(obj.end);
if (notationPoint == null) {
notationPoint = notationPoints.add(obj);
return notationPoint;
} else {
notationPoint.notations.push(obj);
return notationPoint;
}
} | 0 |
b1df2e45b1d4ae88231ee0ee0c5a625c | 84561d952f23eccb6da26ad5982b88a9 | Returns the cyclic group Z_n of order n. | class AlgebraicField(Singleton, AlgebraicField_common):
def zeta(self, n=4):
if n == 1:
return self.one()
elif n == 2:
return -self.one()
elif n == 4:
return self.gen()
else:
nf = CyclotomicField(n)
p = nf.polynomial()
... | 0 |
f6aea20c814f99ab9c24ca3ec3238bd6 | cb26fc1dc8e5fb4b41b4d1d88af7a10a | Notify event managers and request managers about a withdrawn request. | class ShowRequest(RequestHandler):
def _withdrawRequest(self):
self.data.request_entity.status = 'withdrawn'
self.data.request_entity.put() | 0 |
00576b97bccbb7c0f668efecc670eaaf | 2fb0e4a2fe8dc4c867d51b446cb396b2 | Sets the fill of currently selected views. | public class SVGEditorViewController
implements SVGEditorSelectionsController, SVGEditorFileController, SVGEditorComponentsController
@Override
public void setFillForElement(SVGPainting fill, SVGGenericElement e) {
e.setFill(fill);
touchDocument();
} | 1 |
1a7223d6120c6569f6be7e7d957475cb | 396edc62c0699c8ffa1946117b1971e4 | Vérifie si l'adresse MAC du paquet est bien celle qui est recherchée | bool_t OtapIsFrameDestAddress(rxPacket_t *pRxPacket, uint16_t u16OtapDestAddress)
{
return(((uint8_t)((u16OtapDestAddress>>8)&0x00FF) == pRxPacket->smacPdu.u8Data[3]) &&\
((uint8_t)((u16OtapDestAddress)&0x00FF) == pRxPacket->smacPdu.u8Data[4]));
} | 1 |
9f0ed50341cba850b8558525d27b50fd | 0659d96fc546beda8759e90f4a52b4e6 | 计算每种类型节目的观看次数 | {
Dictionary<string, int> scheduleNum = new Dictionary<string, int>();
foreach (var item in AutoScheduleDics)
{
if (scheduleNum.ContainsKey(item["MovieName"]) == true)
{
scheduleNum[item["MovieName"]] += 1;
}... | 1 |
4feed1481ae683625d2e6b6d5ba88ffd | cf886e14b4dacf1f40978af940693f9c | Optional. The current number of workers. | class FlexTemplateJobArgs:
def num_workers(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "num_workers") | 1 |
66e70d5f617d7edd1f9d2be1feff1eb7 | 9101e0986e1fb2ae9d687d7b35c65201 | Retrieve a list of image paths from the given URL. | def get_all_images(url):
soup = BeautifulSoup(requests.get(url).content, "html.parser")
urls = []
for img in soup.find_all('img'):
img_url = img.attrs.get('src')
if not img_url:
continue
img_url = urljoin(url, img_url)
try:
pos = img_url.index('?')
... | 1 |
51794387ca7b3cc5bf96a1496a567301 | ba2a94bd84d9dbed030002e7dc9953c0 | Sets connect_debug_log | class ConnectLog implements ModelInterface, ArrayAccess
public function setConnectDebugLog($connect_debug_log)
{
$this->container['connect_debug_log'] = $connect_debug_log;
return $this;
} | 1 |
60f2d1ac15474422d3db3ab3dcef98c2 | 874a459911093970f20e765cb1236816 | Only set the replicated db id if the replayDbId represents a
newer, later value in the replication stream. If the replayDbId is
earlier than this node's lastAllocatedReplicateDbId, don't bother
updating the sequence; | if(_logger.isLoggable(Level.FINE)) {
_logger.fine("in " + this.getClass().getName() + ">>putInReplicationCache id: " + sessionState.getId());
}
String id = (String)sessionState.getId();
if(replicatedSessions == null || id == null) {
return;
}
Repl... | 0 |
02b9f7245726e37f80086d4de149c364 | f67fc7f3be80874f9951c8f2bc081079 | 优惠率、合计的统计方法 | @SuppressLint("ValidFragment")
public class MainContent2 extends BaseFragment
private String[] getTotal(ArrayList<StoreChildItem> is){
String[] strs = new String[2];
int COUNT = 0;
double total = 0.00;
for(int i=0;i<is.size();i++){
if(is.get(i).isCheck()&&is.get(i).isShow()){... | 0 |
2407f05456f2672b7773574c5e214e65 | 51e62d7ef6cd029dae1c03a668a836bf | Test of parent method, of class ArrayListTree. | public void testSize() {
MyTreeList<String> list = new MyTreeList<String>(2);
list.add("Hello");
list.add("World");
assertEquals(2, list.size());
} | 0 |
2b1282b46b4c8168ccc00f309947a956 | 386eaa975c9a1eb70dd1d3f2c3032edf | Marks an item as needing (re)indexing.
Like with Solr itself, there's no add method, just a simple update method
that handles the adds, too. | $transaction = $this->getDatabaseConnection()->startTransaction();
try {
$ids_chunks = ($ids !== NULL ? array_chunk($ids, 1000) : [NULL]);
foreach ($ids_chunks as $ids_chunk) {
$update = $this->createUpdateStatement();
$update->fields([
'changed' => $this->getTimeService()-... | 1 |
48420252d5630eb795bb795400e308e1 | 2dfb4438bc1a0b94b8dbb61e49561579 | Включено ли условие кликрейта | if (!is_null(self::$isEnabled)) {
return self::$isEnabled;
}
if (!TargetingFactory::isSuitable(self::TARGET, $this->User)) {
return false;
}
$limitView = VulcanFeature::get('limit');
$currentView = VulcanStorage::getInstance()->getViewCount();
... | 1 |
f2bca16acd895ddb22c50bfbc62ccd13 | 5d1f1015d1c1b3e6ebf7fbfbb9d41eef | Render quick search form by ajax | class EmployeeController extends Controller
public function searchAjaxEmployee(Request $request)
{
$this->is_fast_search = 1;
$this->setParams($request);
$employees = $this->getEmployees();
$total_count = $employees->count();
$this->setManagerOrder($employees, $request);
... | 0 |
916ba825de21567271cead9625cff95d | 47662a63901c9a0fca7a7a57ffe3f875 | adds an edge to the graph going from start to end and having weight "weight" | if (graphContainsVertex(start) && graphContainsVertex(end)) {
edges.insert(new Edge(start, end, weight, this.directed));
if (start != end) {
adjacencyList.addEdge(start, end);
}
}
if (weight < 0) {
hasNegativeWeights = true;
... | 1 |
c795433c79dddf600d370863916a9c5d | b60a3a46741d17ef581e56a9f3ff6d8e | Generate a homogeneous transform from a position vector and a (yaw, pitch, roll) triple.
Note: (yaw, pitch, roll) are assumed to be in *degrees* in this library. | lat, lon, alt, roll, pitch, yaw = metadata
er = 6378137.
ty = lat * np.pi * er / 180.
tx = scale * lon * np.pi * er / 180.
tz = alt
t = np.array([tx, ty, tz]).reshape(-1,1)
Rx = rotx(roll)
Ry = roty(pitch)
Rz = rotz(yaw)
R = Rz.dot(Ry.dot(Rx))
return transform_from_rot_tran... | 1 |
cf41c8d68d957d5ddc4ab05d4f7ae8ce | 0cfcd5a7528223bb9245b7d71b114a58 | Получить наибольшее абсолютное значение ключевого поля | float maxValue = Math.Abs(m_c[0]);
bm = 0;
if (Math.Abs(m_c[1]) > maxValue) { maxValue = Math.Abs(m_c[1]); bm = 10; }
if (Math.Abs(m_c[2]) > maxValue) { maxValue = Math.Abs(m_c[2]); bm = 12; }
if (Math.Abs(m_c[3]) > maxValue) { maxValue = Math.Abs(m_c[3]); bm = 18; }
if (Math.Abs(m_c[4]) > maxValue) { maxVa... | 1 |
d28529511dd0f045f276d0091d73bf84 | ebcdcf73b0740ee195e48aa77323c399 | 重置头部文字颜色 | public class MainActivity extends FragmentActivity
private void resetTextView() {
mTabChatTv.setTextColor(Color.BLACK);
mTabFriedTv.setTextColor(Color.BLACK);
mTabContactsTv.setTextColor(Color.BLACK);
} | 1 |
67977eccf88b37e719ad5b6efc770c4f | 8d8753b66394616bbb3bd8efe2da0b1c | 设置登录失败几次需要使用验证码。默认为3次。 | @Table(name = "t_kx_xtyh")
public class KxXtyh
public void setLoginFailCount(Integer loginFailCount) {
this.loginFailCount = loginFailCount;
} | 0 |
07be67e872633e1dec4bc8b91afc9631 | 3419b3d9852187ae8bc080f0c45c256e | This method should be executed once some clustering algorithm was executed (i.e. after runSCAN() or runModularityOptimizer()).
It generates the {@link Cluster} instances corresponding to the cluster IDs assigned to the nodes in the graph and transfers
them to the Terracotta clusters cache (provided in the constructor). | Map<Integer, List<Report>> clusterMap = new HashMap<Integer, List<Report>>();
for (int id : graph.getNodeIDs()) {
Node n = graph.getNode(id);
int clusterID = n.getClusterID();
if(clusterID == Integer.MIN_VALUE)
throw new IllegalStateException("Failed to assign valid cluster ID to at least one node");
... | 1 |
0bd6fc2fa74e94f8e751d3e9aeb3f216 | 10817dc77faa8ea6464c0d4c48004f25 | #通过xpath删除html标签属性 | try:
nodes = self.tree.xpath(xpath)
for node in nodes:
node.getparent().remove(node)
logger.debug(f'删除节点成功')
except:
logger.exception('未找到该节点') | 0 |
11eb735229562a73c0f113e2189029e7 | 5dd76bd7b250ef13c58d68d54407afd6 | Permet de stocker dans un tableau $content les différents contenus à afficher sur la page.
Les contenus sont stockés dans le tableau par nom de la vue générée par le controleur concerné | class CompanyManagerModel extends UserModel
protected function _getPageContent(int $index) {
switch ($index) {
case 0:
$data = $this->_getTabCompaniesIndex();
break;
case 1:
$data = $this->_getTabUsers();
break;
... | 0 |
c369ca5115e2c06844c323ea50043679 | 6dbbd5a92d9eca832ccd6c9eca2ee229 | Draw the path length for all active photons.
Free path is exponentially distributed (and drawn with the inverse
sampling method). | class AcqViz2D(Base):
def plot_exe_path_samples(self, exe_path_list):
exe_path_list = self.reduce_samp_list(exe_path_list)
for exe_path in exe_path_list:
self.ax.plot(
[xi[0] for xi in exe_path.x],
[xi[1] for xi in exe_path.x],
"-",
... | 0 |
9cbc0592dd4249fba9437f3d733f91af | 6113bbc031bf27f5b12a6884d7fd7338 | T-Time Crochetを開く関数.<br> | function C101_KinbakuClub_RopeGroup_AmeliaTies() {
PlayerClothes("Underwear");
PlayerLockInventory("Rope");
CurrentTime = CurrentTime + 120000;
} | 0 |
554ab838d7568a35cd864135fab7c821 | 7b5e430377415f5c5afa930773df0916 | Função para setar as gap junctions longitudinais (na mesma fibra) | initLengths(Lengths[0],Lengths[1],Lengths[2]);
kon0 = konin;
koff0 = koffin;
cl_cut = cl_cutin;
} | 0 |
915b08d12c54ec42e3be4c564f465c1b | 913224496bf5aaa3fdd1e1f86c05422a | Verify that the read at a specific offset in a stream
matches that expected | idBytes = [b'\x75',
b'\x45\x41',
b'\x25\x41\x42',
b'\x15\x41\x42\x43']
ints = [0x75, 0x4541, 0x254142, 0x15414243]
for i, (id, numOut) in enumerate(zip(idBytes, ints)):
self.mockStream = BytesIO(id)
val = readInt(se... | 1 |
faac7f837bd785a7af366aab3fcf91ef | f9f8f2eb24337035cfe44fa556571b48 | Переводим время в минуты и секунды | namespace ConsoleApplication1
internal class SolvingSequence
private static void writeAsMinuteSecond(double time)
{
Console.WriteLine((int)time / 60 + " minute(s) and "
+ (int)(60 * ((double)(time / 60) - (int)(time / 60))) + " s.");
} | 1 |
627766f30f052ea82436940f4da7e6c9 | 7b9d8c5c53ae1501677510441644b9e7 | Make batch API call to Facebook graph API end point | class Facebook(object):
def post(
self,
endpoint,
access_token=None,
params=None,
headers=None,
graph_version=None,
):
return self.send_request(
method=METHOD_POST,
access_token=access_token,
endpoint=endpoint,
... | 0 |
349734b23b9ac1f4c7bc626868f0a216 | a8f21d34d404a2ee029bbbb7e521974d | Creates a BatailleBean automatically linked to this Cases | {
for($i=0;$i<10;$i++) {
for ($j = 0; $j < 10; $j++) {
new CasesVide($this,$i,$j);
}
}
for($i=2;$i<=3;$i++)
{
for($j=4;$j<=5;$j++){
new Lacs($this,$i,$j);
new Lacs($this,$i+4,$j);
}
... | 0 |
d4bb94b58779b6a631cd6b827e3a71b5 | c33e9cb4de329a64f856f2ef9220c67f | !
Returns the list of light nodes. | {
switch (_lightingType)
{
case kLightingFog:
return m_pFog;
case kLightingGrayscale:
return _grayscaleNode;
case kLightingDepth:
return _depthImageNode;
default:
return NULL;
}
} | 0 |
337e80752e5b6084c62eac19db15caff | 8bc5e7487e65ba45aa5924bdc43ceae0 | Set up the Modbus Thermostat Platform. | def setup_platform(hass, config, add_devices, discovery_info=None):
name = config.get(CONF_NAME)
serial = config.get(CONF_SERIAL)
accesskey = config.get(CONF_ACCESSKEY)
password = config.get(CONF_PASSWORD)
holiday_temp = config.get(CONF_HOLIDAY_TEMP)
holiday_duration = config.get(CONF_HOLIDAY_DU... | 0 |
8629b5e4d1d864ccef1088b9f6f45561 | b196c05dc583342fadb61ddbcd966df5 | 安全的获取DataRow指定列指定版本的值 | namespace Easyasp.Framework.Core.Utility
public static class SafeReaderUtil
public static T SafeReaderValueFromDataRow<T>(DataRow dr, string columnName, T defaultValue)
{
if (dr[columnName] == System.DBNull.Value)
return defaultValue;
else
return (T)dr... | 1 |
9b0eb0ab1b69c8b490cfd16ce9375c2b | 38f57491b8dcc14da8eee2ffd4c70746 | RC4算法加密函数 | {
$data = '';
$str = join('', explode('\x', $str));
$len = strlen($str);
for ($i = 0; $i < $len; $i+=2) {
$data .= chr(hexdec(substr($str, $i, 2)));
}
return self::RC4($data, $pwd);
} | 1 |
45072076e8cf01b968c99742eeb19579 | 3858589d73273256ed5862daa1654140 | Testa que a página inicial existe e contém um formulário | class PaginasController extends TestCase
public function testIndex()
{
$this->visit('/')->seePageIs('index');
} | 0 |
fcdf9eac501fe20c09dc48deb7d29339 | c1f1bfcee9ebb2a12d4129f2453aa8e0 | Called by the Vsync callback method and queues the corresponding DFC. | {
if(IsConnected())
{
VSyncPacket packet;
packet.timestamp = nanoseconds;
AsyncStream::Acquire()->WritePacket(packet);
}
} | 1 |
4a3fee307736483aa283845994c8b0b1 | 3e46f6d9ae589052874a31cc31d7ae82 | last layer does not connect to anything | public class NetworkBuilderHelper
public static void connectLayers(NeuralLayer sourceLayer, NeuralLayer destinationLayer) {
connectLayers(new Random(), sourceLayer, destinationLayer);
} | 0 |
763e67b7ce448becdc0baf0577faec1c | b956177397bc8235df3f7c2a0e8e6569 | Test the logic-based branch and bound algorithm. | Task.InitLogCommand(None, None, 'output')
specs = self._GenerateFlagSpecifications()
generation_tasks = _GenerateAllFlagsTasks(specs)
generations = [HillClimbingBestBranch(generation_tasks, set([]), specs)]
_TestAlgorithm('sum(values[0:len(values)])', specs, generations, 0)
cost_function = 'sys.... | 0 |
34f9e903d885107f5ebfafe1e2af4e16 | 1bd490bcce999df5a509217035323b69 | Updates an existing Push model.
If update is successful, the browser will be redirected to the 'view' page. | {
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => (string)$model->_id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
... | 1 |
e4d414289160a2ae365e949723dd7b67 | e499f1ad45a3f4b030baf7affcc0dfae | @brief 获取模型中的数据数量 | class ModeldataModel extends AdminModel
public function get_model_count(){
return $this->db->count('model','*');
} | 1 |
f25afdbe63195769ab0c62c7679498b1 | b48fd34e68bd1786a109cd0573a03d39 | Sets the number of writer workers for the socket (TCP) which are using to send packets to
clients side. | class Client
function setW($w) {
$this->w = $w;
return $this;
} | 0 |
61d3e806e7bfcdc916d2cd2223f3ca03 | 825b768ba10b5dd80bcfa4da453fab83 | 设置采样率,采样率越高越精确,但是也越耗时
注意:采样率必须为2的指数倍 | {
if (!is_int($sampleRate) || $sampleRate < 0) {
return false;
}
$this->_sampleRate = $sampleRate;
return true;
} | 0 |
1356ee3b2ce48985d5f9962469bae008 | ea761b400ac775b06dafe6ee61928952 | 获取创建表的脚本语句 | public abstract class AbsBaseTable
protected abstract String getCreateTableSql(); | 1 |
45baab3a9799299fac11f7a9e3d8bace | ace59235f2f7d4506bb0c882637194c8 | Set orientation mode estimator | static int8_t set_orient_int(const struct bma400_orient_int_conf *orient_conf, const struct bma400_dev *dev)
{
int8_t rslt;
uint8_t data_array[10] = { 0 };
data_array[0] = BMA400_SET_BITS(data_array[0], BMA400_INT_AXES_EN, orient_conf->axes_sel);
data_array[0] = BMA400_SET_BITS(data_array[0], BMA400_INT_DATA_SRC, o... | 1 |
803e403641085623450405e68f48a11d | 8cde07ecf70a67ec45efb005dbcd8928 | Change the default profile. | {
$this->authorize('removeImage', $user);
$success = $user_service->setDefaultProfileImage($user);
if ($success) {
return back();
} else {
return back()->withErrors(['msg' => 'Error']);
}
} | 1 |
77fedd11eea5b5fba0bacc1aa61d76fa | 8c4e4b6c78d6a4d506c82490cb15e228 | Gets the value of the effects property.
possible object is
{@link Effects } | public List<String> getEffects(); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.