query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e18789ee62ca51e35390cc1f58456511 | 92c62640fa541be37d0b4817282c6b31 | Sets the activity status of a Player to False. | class Player
public function leaveField()
{
$this->activity = false;
} | 1 |
34aa8fed07de5920742a033e7d1b261f | 9b2b9d50704698c99c988d4aad9333a1 | 得到short值的哈希值. | short shortValue(); | 0 |
eaecaa562cf50750dda63937c15b2cd6 | 6c785a310b186f7bcef8437837ecbee1 | traverses the topology multiple times. The topology is saved before and
restored after traversal. | static int sttraverseLoop(const A3DTopoLoop* pLoop, TiXmlElement* setting)
{
A3DTopoLoopData sData;
A3D_INITIALIZE_DATA(A3DTopoLoopData, sData);
TiXmlElement* loop = new TiXmlElement("A3DTopoLoopData");
traverseSource(pLoop, loop, NULL, -1, -1);
A3DInt32 iRet = A3DTopoLoopGet(pLoop, &sData);
if(iRet == A3D_SUCCE... | 0 |
51e9a5a5d2c582a21474cca456f15406 | 17ad0931fb5f24ceaf94e39def1f00df | Este método selecciona un nuevo destinatario, lo agrega a la lista de los seleccionados y
limpia el "input" en el que se ha escrito para filtrar usuarios | @ManagedBean(name = "controllerCorreos")
@SessionScoped
public class CorreoBean extends AbstractBean implements Serializable
public void addDestinatario(ValueChangeEvent e) {
menuOption = e.getNewValue().toString();
if (!menuOption.equals(" ") && !menuOption.equals("1")) {
if (inputDestinatarios.equals(""))
... | 0 |
b45afe1e6dc398678928b84d185b9a72 | 6fbd803aa84119dee8e6ccac8d633d5a | Returns the values of TP's pace table in microseconds. | int GetTPS(lua_State *L)
{
lua_pushinteger(L, ::GetTPS());
return 1;
} | 0 |
be62b1f4002a3e62735472c5260154ba | 936d08892f9109ff48dd4dd3c37a0d71 | 根据账户id和活动id查参赛数据 | public UserActivityReg getByUserIdAndActivityId(UserActivityReg userActivityReg); | 1 |
a9aa9714be2c9d9a18fdff8da01f7203 | bb52589b37eca0423ade9e4ac63dda6c | 绑定事件触发脏值检查 | {
foreach (DataGridViewRow dr in this.dataGridViewEvent.Rows)
{
if (dr != null)
{
IWarningable warningable = dr.DataBoundItem as IWarningable;
if (warningable == null)
continue;
... | 0 |
482ee8d0e63995c8f6ecd657702e4941 | 15d47a3b01ef2c40b8413f5a948173f0 | 是否存在专题 | if(empty($topicId) || !is_numeric($topicId)){
$this->setError('专题id参数错误');
return false;
}
if(!in_array($type,array(1,2,3))){
$this->setError('专题类型有误');
return false;
}
$data = $this->appContentModel
->where('`topic_id` ... | 1 |
263343ea773e7b1b287d9d3e68b7a3bc | be3b8cdb44f870b5a6650d750a4a95fc | Get size of node based on attribute. | namespace ODB
class DBType
public static int GetSizeType(Attribute T)
{
if (T is VarCharAttribute)
{
VarCharAttribute varchar = (VarCharAttribute)T;
return varchar.Length;
}
if (T is IntAttribute)
{
I... | 1 |
e45d0095601128fb3c813ae3c3283ffa | 6128fada6f388960e9703781adef956e | Converts a Array<int>[4] to a single |Big Endian| int32 | result = (ary4[0] || 0) << 0
result |= (ary4[1] || 0) << 8
result |= (ary4[2] || 0) << 16
result |= (ary4[3] || 0) << 24
return result
end | 1 |
59bb2ca482f21601f64de8291d69dd5f | e56612cde00d694caec778d77c5c12db | Returns the unique characters of a string as an ordered array | const uniqueChars = [...str].filter(
char => str.indexOf(char) === str.lastIndexOf(char)
);
return uniqueChars;
} | 1 |
7cd226a6f37965c9423d8b5358fd73c2 | c350641eb10160a0c287f71d0a552a52 | tdx行情接口状态监控 | def get_trade_status(exchange=HK_exchange):
asyncio.get_event_loop().run_until_complete(
future=api.QueryTradeStatusMsgReqApi(exchange=exchange, productList=[], recv_num=0)) | 0 |
a4d4cce861eb758b2ffa18178a0d5c48 | d88f97988cf5227cc32131c2464bc1d1 | 设置完权限回到界面再次请求权限用来检查是否全部允许了 | public void onResume() {
super.onResume();
if (isToSettingPermission) {
if (!TextUtils.isEmpty(mSpecialPermission) && !PermissionUtils.isAppSpecialPermission(getContext(), mSpecialPermission)){
mIsSpecialPermissionStatus = false;
}
isToSettingPermi... | 1 |
e8e92f2ea9f585392152b076937ab504 | 356b24a731a2a60a11e982487d4fa4ec | Checks the database for any redirects | {
$redirects = $this->findAllRedirects(true);
foreach ($redirects as $redirect)
{
$to = false;
if (trim($redirect['uri'], '/') == $path)
$to = $redirect['to'];
elseif ($uri = $this->_isRedirectRegex($redirect['uri']))
if (preg_match($uri, $path))
$to = preg_replace($uri, $redirect['to'], $p... | 1 |
38ee5784b9a0f893320a3b2cd0523e7c | e7a3e4f23e9f36e779605aad61f54649 | Formats the DateTime to the correct culture string value - date portion only.
This is useful for display date values in strings | namespace CustomDatePicker.DatePickerControl.Extensions
public static class DateTimeExtensions
public static string ToDateCurrentCulture(this DateTime date)
{
return date.ToString("d", CultureInfo.CurrentCulture);
} | 1 |
a22d9877f2cebe24aa771397f71655b8 | 14b3025002544c1dea91928342f89d41 | 关闭性能参数面板 | @ResponseBody
public Response cancelPerfScreen(@PathVariable("wlid") String wlid) throws MonitorException {
screenService.cancelScreen(wlid, TaskType.PRO_SCREEN.getDesc());
screenService.deleteScreen(wlid, TaskType.PRO_SCREEN.getDesc());
return new Response("ok");
} | 1 |
bca4dc8bf44f90efbe20c54d9c459698 | 96f75cb26de12b8f1236af2627d75e0f | GET: /CounterpartyType | class CounterpartyController extends Controller
public function index()
{
$id = Auth::id();
$array = Counterparty::where(['user_id' => $id])->get();
return view('backend.Counterparties.CounterpartiesIndex')->with(['array' => $array]);
} | 0 |
540062fb962f67d690fdfc78d50fd78d | cec08770783ff66cf7f4e46cd61163d1 | Set file access permissions of FILE relative to<br>
the directory FD is open on.<br>
<i>native declaration : x86_64-linux-gnu/sys/stat.h:3181</i> | @Deprecated
int futimens(int __fd, Pointer __times); | 0 |
11cff8f44bc72dea705898173b026bf9 | 546dc5fb2ef070a4e0a750e602ad3f26 | Check if at least one in a given list of buttons has just been pressed (transition 0->1). | boolean isButtonPressedOnce(ButtonID buttonID); | 0 |
b4748bd4d26928eb6e54e8601ad6f4e0 | d1b0e3b253b3133e64dffa89c6b1a768 | 将成员移除聊天室黑名单 /单个 | function removeBlockUser(arg) {
return post(`${livepcHost}/chatroom/chartroom/RemoveBlockUser`, {
...arg,
});
} | 1 |
d967d35f0ddf09d9ca692f2915544d5a | 83e06204961c06470c5d348daa7e0649 | Calcula el Arbol de Expansión Mínima por método Kruskal Inverso | Agm Prim::getAGM() {
std::vector<std::vector<std::pair<int, int>>> adjacencyList(n_);
for(int i = 0; i < m_; ++i) {
const Edge& e = edges_[i];
adjacencyList[e.getA()].push_back(std::make_pair(e.getB(), e.getCost()));
adjacencyList[e.getB()].push_back(std::make_pair(e.getA(), e.getCost())... | 0 |
a645ff7b5a5df393c88cd04686b414dd | 10c8ab878ce9d757debbe72e1a16d9c3 | Diese Methode setzt sämtliche Meldungen des Einstellungstabs zurück. | double resetValue = 0.0;
halterhoeheField.setValue(resetValue);
stosserhoeheField.setValue(resetValue);
armkurzField.setValue(resetValue);
armlangField.setValue(resetValue);
drehpunktFensterField.setValue(resetValue);
fensterWinkelField.setValue(resetValue);
fensterUeberstandField.setValue(resetValue... | 1 |
002be265a20e95c8c2566339f60be309 | 668130a28b773520721e695a2fa6bc06 | randView returns a random view for testing | view_model = self.__layout_model[2].split("@---sep---")
views = ""
for i in range(0, random.randint(1, max)):
view = self.__rand_item(view_model)
views += self.__set_values(view).replace("${attributes}", self.__create_attributes())
return views | 1 |
8f7033219e9f45e91b50e2712d6efc14 | a1c6a9d341ae14246bee5a8dd20f5f93 | Tries to convert <paramref name="sourceValue"/> to target type <paramref name="targetType"/>. | namespace TB.ComponentModel public static partial class UniversalTypeConverter
public static bool TryConvert(object value, Type destinationType, out object result, CultureInfo culture, ConversionOptions options) {
if (destinationType == typeof(object)) {
result = value;
r... | 1 |
1c1271c560d1a908455641b806ebaa6d | a50264f4a41634ef750eca06ddc0c388 | Updates the client lob group. | namespace Css.Api.Setup.Business.Interfaces
Task<CSSResponse> GetClientLOBGroup(ClientLOBGroupIdDetails clientLOBGroupIdDetails); | 0 |
77724332ff845e5ed330168d9a9026de | 2efcb01ad072865b1d56ec96f7e45c37 | 显示未完成的数据 | class User extends Controller
public function notFinished()
{
$list = Project::where('issuccess', '=', 0)->select();
$this->assign('list', $list);
$this->assign('listcount', count($list));
return view();
} | 1 |
61c5912f0418cd6f6de93dd8fed3f5b3 | bf1ea40bd5a4e4b6e0a2f0175b7d999c | buildCommonLogLine builds a logline entry for req in TCP Log Format. | func NewApacheCommonLog(t time.Time, every string) string {
return fmt.Sprintf(
ApacheCommonLog,
RandIPV4(),
RandUser(),
gofakeit.Number(0, 1000),
t.Format(time.RFC3339),
gofakeit.HTTPMethod(),
RandResourceURI(),
gofakeit.StatusCode(),
gofakeit.Number(0, 30000),
every,
)
} | 0 |
10d74952844ad1e69bb71f3105e8d05d | 010ae44c63b2f1dd3ca5521483f59c9c | 根据小程序会员id查询 | @Query("select bean from MiniprogramMember bean where 1 = 1 and bean.hasDeleted = 0 and bean.appId=?1")
List<MiniprogramMember> getMember(String appId); | 0 |
483b2a1085b2cf886bf1349e892491f3 | c92e1a47fc602013592dceed3508074a | Check MyUserinput is an integer and between 1 and 10, unexpected values are handled by exceptions | throws NumberFormatException, OutOfBoundException
{
int n=0;
try
{
n=Integer.parseInt(str);
}
catch (NumberFormatException e)
{
throw new NumberFormatException(
"Error: You should enter an Integer");
}
if (n<minVal || n>maxVal)
throw new OutOfBoundException("... | 1 |
07e9399df65afb3feee925943fe00530 | 31e903354e34b676c42287a8165a4844 | 获取被推广玩家充值列表 | class ClientController extends BaseController
public function getVIPList()
{
$list = (new Query())
->select('*')
->from('t_vip_recharge')
->where(['status'=>0])
->all();
return $list;
} | 0 |
18b1374697e7f33b7b5f73b48a8fc757 | 70f4390a26e4364a6663b78f67fbe9d0 | 单选按钮控制是否要新添加父菜单 | {
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectMonthPlanMenuId);
if (buttonList.Count() > 0)
{
... | 0 |
0709f51c1e8ea883a291fda2c4607c30 | f6f21843ec24718412ba0f0338c5e974 | Public method to get the data for the fetch operation. | class APIModel(abc.ABC):
def _get_data(self):
raise NotImplementedError | 0 |
14f7a6f415d169e8b9c8c63de3935794 | 57ecc24d936de241d0886395d1db020d | Optional, default is No-op | fn notification(&mut self, _notification: Notification) {
} | 1 |
1fb4121277cdf1cd72da2fde4d8f6db9 | bada7166065153b89d17a39ad1e38acf | Create a recordset while a nameserver is down. Check the zone goes
to ERROR. Bring the nameserver up. Check the zone goes to ACTIVE. | NAME = "readdrec.%s" % self.get_dns_domain()
p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
updates = []
name = self.get_dns_domain()
u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
updates.append(u)
self.finish_name_packet(p, updates)
... | 0 |
bfdefe52102ca169fe97f18b84e00b09 | 035889e42d2e748849f49f406139bff9 | The error on the reference magnitude. | public class MrnWatchem2 extends Tables
public int getMagnesiumError() {
return magnesiumError;
} | 1 |
7fa78a5b9c81070e5a0827067a378210 | 39c5e72f56d653ae25c9804477888884 | This method works with incoming overall distances of the right wheel | public class Intake extends Subsystem
private double getRightDistance() {
return rightDistanceSensor.getDistance();
} | 1 |
6235c4436f8f8e7ccb999596ab0b3053 | 9265a28101058612d0261f838a32c150 | The customized divider of carrier text. | abstract class BaseUIKit
abstract public function navDivider(); | 0 |
aa909b5eb13ba45c6fca342e0bcf15f4 | b2c9ecb2bd20e1e7192a015ea0a6a736 | Função que faz inserção no bd de um novo banco. | $numero = $this->input->post('numero');
$tipo = $this->input->post('tipo');
$banco = $this->input->post('banco');
$sql = "INSERT INTO tarjeta_bd (tarj_numero, tarj_tipo, cf_tarj_banco)
VALUES ('$numero', '$tipo', $banco);";
$return = pg_query($this->conn, $sql);
... | 0 |
e7ef0cfc6a0d848da525fdd2128291bb | 0b285ef4a879694acbce5745f68986c0 | Sets the arm directions of the robot. Parameters can be
{@link Constants#DIRECTION_NONE}, {@link Constants#DIRECTION_CLOCKWISE} or
{@link Constants#DIRECTION_COUNTERCLOCKWISE}. | void setDirection(int direction); | 1 |
175edb045f8fca03cc1a125745500321 | 40fd7b4a4cc91cc23e237e3c2f9f6865 | Our logging strategy is to always log on stderr and allow to log on
either syslog or a file, depending on user configuration.
stderr mean either console when launching in a terminal, file when stderr
is piped or systemd output. Thus we adapt stderr to these cases depending
on systemd an isatty(). | if terminal is None:
self.terminal = sys.__stdout__
if not log_to_terminal:
f = open(os.devnull, 'w')
self.terminal = f
else:
self.terminal = sys.__stdout__
self.log_to_file = log_to_file
if log_to_file:
self.log = open(... | 0 |
bb8dc7f5132d1bf2075611a1ab2dddc5 | 375a3259f5b8e238fd3f8475e5caa98f | Sortarea prin selecţie (Selection Sort) | {
int i, j;
for (i = 0; i < getDim(iaTot(serv)) - 1; i++)
{
for (j = i + 1; j < getDim(iaTot(serv)); j++)
{
if ((reverse == 0) && (getPret(getProdus(iaTot(serv), j)) < getPret(getProdus(iaTot(serv), i))))
{
swapElem(iaTot(serv), i, j);
}
else {
if ((reverse == 1) && (getPret(getProdus(iaTot(s... | 0 |
54564f8ed77cdc2c2efd86048ca4e04d | 39d3febc230d2505151a94e775465ccc | LayerMapper constructor. | class Map implements \ArrayAccess
public function __construct(array $map = [], array $aliases = [])
{
$this->map = $map;
$this->aliases = $aliases;
} | 0 |
c0abf609b4a8e08822a83f741dd0a328 | bda1f65c6f8a2a464b71c7032d46f484 | Reset the CacheStore statistics. | @SuppressWarnings("unused")
public class RedisCache extends AbstractValueAdaptingCache
public void clearStatistics() {
getCacheWriter().clearStatistics(getName());
} | 1 |
370c20f662f05bd9e943962feac37d36 | 441c2d0805392f6fb69592f16c95ddc4 | Gets the mouse wheel X delta. | {
MouseEvent mouseEvent = getMouseEvent();
WheelEvent wheelEvent = (WheelEvent) mouseEvent;
return wheelEvent.getDeltaX();
} | 1 |
5783be3799a1c82ac1e67bf810740a62 | 652a2460a28879430c5d40ba7449e0fe | Computes sum of squared differences.
Inputs should be of same shape. | actual, predicted = _preformat_inputs(actual, predicted)
data_size = actual.shape[0]
return (1 / data_size) * np_sum((predicted - actual) ** 2) | 1 |
3dbdfe8f5290d9b48e8e906ce92fbb46 | ac429cc7f3594b9e0d799c0310f087bc | 数值根据 1600*900 进行适配. | return (dpvalue * Ktx.app.getResources()
.getDisplayMetrics().xdpi / 160 + 0.5f).toInt()
} | 0 |
ad2c15727c0471a012cff288868a1798 | 7cf524d74bb0539e15eb5855eb1066bc | 停止AI分析线程 | public class MainActivity extends AppCompatActivity
private void stopAutoData() {
if (mThreadAutoData != null && !mThreadAutoData.isInterrupted()) {
mThreadAutoData.interrupt();
}
} | 1 |
5764ffc072a5dab4d0553043049fd14e | 3801c9cd8d10a3eadb3ed4440b1420ee | map primitive types to their boxed types | public abstract class Primitive
public static Class<?> inbox(final Class<?> clazz) {
if (clazz == null) {
return null;
} else if (!clazz.isPrimitive()) {
return clazz;
} else if (int.class.equals(clazz)) {
return Integer.class;
} else if (double.class.... | 1 |
ffd4f7b2abe5636e4db7f5e770525dfc | 646032098f06189b32f7bae80534a2b3 | Test case for get_exact_matches_to_concept_list | class TestBeaconApi(unittest.TestCase):
def test_get_concepts(self):
pass | 0 |
052dbe1b3f71fa05da1f25ce69dcf5bd | 6ed3abf504ee63b907b90d6235e3ffe1 | {@code POST /organisateur-meta-groupes} : Create a new organisateurMetaGroupe. | method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public ResponseEntity<Editeur> createEditeur(@Valid @RequestBody Editeur editeur) throws URISyntaxException {
log.debug("REST request to save Editeur : {}", editeur);
if (editeur.getId() != n... | 0 |
e7d5335336982f15bd87f5d7e56a6d65 | 9c458e04d77231736385813a539d1ac2 | list长度超过限制时,移除其中第一条数据 | public class RedisTokenStore extends TokenStoreAbstract
private void listMaxLimit(String key, int max) {
Long userTokenSize = redisTemplate.opsForList().size(key);
if (userTokenSize > max) {
for (int i = 0; i < userTokenSize - max; i++) {
redisTemplate.opsForList().leftPop(ke... | 1 |
ff057141391b3e395a4844b83dab784f | b1b8f467fceb36e430a10ad119e97956 | relocate first point by extending the first segment by the specified length | float excess = _lengths[idx] - size;
_lengths[idx] = size;
switch (idx) {
case 0:
_offsets[1] -= excess;
_lengths[1] += excess;
break;
case 1:
float half = excess * .5f;
_lengths[0] += half;
_lengths[2] += ha... | 0 |
d59d511b436e80a6c51ae314db7751d7 | 2a973d8c4a46620f3284071a1529718a | 更新單筆成績計算規則記錄 | namespace Platform.Evaluate.Dao
public class GradeRuleDao : MapperDaoSupport, IGradeRuleDao
public void Update(GradeRule GradeRule)
{
MapperTemplate.Update(GradeRule);
} | 1 |
6b733d86578bbac467118a1737d4f13c | 41f48827997c36a6c7011741c254ca0d | 取得某公司某類報表由資料庫中的資料判別後下一個需下載的年度及季別 | {
try
{
int year = Convert.ToInt32(rcs.CurrentNd);
int zq=Convert.ToInt32(rcs.CurrentZq);
switch (rcs.ReportType)
{
case "01":
rcs.CurrentNd = (year - 1).To... | 1 |
3939c6c640c427e5ebb81d53652ea773 | 817b4c78f52217ad7f81fabbf6ca6eea | Asserts whether the left hand side is equal to or greater than the right hand side | $this->ruleFor( function( $lhs ) use ( $rhs ) {
return $lhs <= $rhs;
});
return $this;
} | 0 |
94f4620c7c23b894eca1fd8204c95230 | 04b0b5eda58a32cf02d247961e761212 | 자신이 가지고 있는 패널을 활성화. 나머지 패널들을 비활성화 시킨다. | public class BuildingMaster : MonoBehaviour
public void ChangePanelView(int indexOfPanel)
{
foreach (GameObject go in panelList)
{
go.SetActive(false);
}
panelList[indexOfPanel].SetActive(true);
} | 1 |
8f6c9b22ad11c769c0d73cfcc30744ef | e6399878f8911e7969c12879c370a5eb | 根据地址获取当前地址下的所有目录和文件,并且排序
</File> | public class FileActivity extends ListActivity
public static ArrayList<FileInfo> getFiles(Activity activity, String path) {
File f;
File[] files = null;
try {
f = new File(path);
files = f.listFiles();
if (files == null) {
Toast.makeText(activity, String.format("无法打开: %1$s", path), Toast.LENGTH_SHOR... | 1 |
78c0d441b9cf628e383513352e32b420 | 33ac41eff021a2fda05d09309915b600 | Fonction pour modifier un projet donné | {
$current_user = $this->session->userdata('id');
if (is_numeric($current_user) && $current_user > 0) {
$data = array();
$name = $this->input->post('name');
$main_picture = $this->input->post('main_picture');
$description = $this->input->post('description');
$short_description = $this->inpu... | 1 |
4ac008ad63ceb9b2f378833d2c8dcb8a | fe48368ebc03c21434d4ad90a219e80d | 잘못된 서버 URL 로 설정되었을때 오류를 확인한다. | public class AppTest
@Test(expected = IOException.class)
public void shouldNotValidURL() throws IOException, SQLException {
controller.startController("asdddasd");
} | 1 |
77150daa3fb34b78ce1c37cae5e3609e | 4a424088f2ab589eb258f3b29b1d8abb | 【欧几里得算法】求两个数的最大公因数。 | if (a >= b) {
while (a % b !== 0) {
let c = a % b;
a = b;
b = c;
}
return Math.abs(b);
} else {
while (b % a !== 0) {
let c = b % a;
b = a;
a = c;
}
return Math.abs(a);
}
} | 1 |
7482f9afad644bbc36a6cb92df84f004 | 39deba4372ab47a477a1c1cc0af62c81 | Creates a new adapter for an object of class '{@link org.gemoc.gexpressions.GEqualityExpression <em>GEquality Expression</em>}'.
<!-- begin-user-doc -->
This default implementation returns null so that we can easily ignore cases;
it's useful to ignore a case when inheritance will catch all the cases anyway.
<!-- end-us... | public class GamaAdapterFactory extends AdapterFactoryImpl
public Adapter createEGridAdapter() {
return null;
} | 0 |
81a91ba98f15c36cba95b5556522e7e7 | 8f6a568b1647940242adce4afb3c8d15 | @brief Get DMA Rx descriptor datagram type.
The payload type may be one of the following values: | en_result_t ETH_DMA_GetRxDescPayloadType(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32PayloadType)
{
en_result_t enRet = Ok;
if ((NULL == pstcRxDesc) || (NULL == pu32PayloadType))
{
enRet = ErrorInvalidParameter;
}
else
{
*pu32PayloadType = pstcRxDesc->u32ExtendStatus & ET... | 1 |
441ad3b9db15fb263a3eef3a7df27310 | 7116e16b142ccf59d8fde2a35d107a2f | Configures clock division factor for dead time | {
uint32_t hrpwm_outr;
uint32_t hrpwm_dtr;
assert_param(IS_HRPWM_INDEX(TimerIdx));
assert_param(IS_HRPWM_DEADTIME_SDTF(pDeaTimedCfg->FallingSign));
assert_param(IS_HRPWM_DEADTIME_SDTR(pDeaTimedCfg->RisingSign));
hrpwm_outr = Instance->PWM[TimerIdx].OUTR;
hrpwm_dtr = Instance->PWM[TimerIdx].... | 0 |
ebcee8612eb9bc16e2123e9c67a848e1 | 32b4c6286d87ac2471d532ff63ae0a11 | iterate over empty table | function table.empty(t)
return next(t) == nil
end | 0 |
02166ef76c59badd8ee0e57501fa1af4 | bdcb1cbdc1b2902142dabaa7af909991 | создает массив из доступных для удара ячеек | public class Grid
ArrayList<Cell> getAvailableCells() {
ArrayList<Cell> availableCells = new ArrayList<>();
for (int xx = 0; xx < field.length; xx++) {
for (int yy = 0; yy < field[0].length; yy++) {
if (field[xx][yy] == null) {
availableCells.add(new Cell(... | 1 |
978f072856622ec055f47201a9ed7fc1 | 4f179224002bd94b76ffe3c9b7a5e396 | Set the sort direction for field: EndDt (CUSTOMER_CONTRACT_VIEW.end_dt) | public class ETCQuoteResponseObjectFilter extends ETCQuoteRequestObjectFilter implements Serializable
public void setContractEndDateSortDirection (boolean ascending)
{
this.ContractEndDateSortAscending = ascending;
} | 1 |
d9690f0706968b29a19207184055bad1 | 571740e74293e139621ef0151b043182 | Renders the portlet as html. Have to be implemented by sub classes. | abstract class AbstractWidget implements ServiceLocatorAwareInterface
protected abstract function _render(); | 1 |
7db63e73300ba8ac4945615a931a3ea7 | 13336ab9023c14fade7bb5feb0498b98 | Update an existing merchant log. | class ApService extends \SoapClient
public function RetrieveMerchantLog(RetrieveMerchantLog $parameters)
{
return $this->__soapCall('RetrieveMerchantLog', array($parameters));
} | 0 |
69ebd26cb83e2196583a09b0b427e654 | 09514c271c293856398fc75274a9f360 | Notify the user there are no changes. | namespace Webbshop.Views
internal static class SharedError
internal static void UnChanged()
{
SharedView.PrintWithRedText("\tIngen ändring har gjorts.");
Thread.Sleep(2000);
} | 1 |
26fc81edc4fcb6e2d961f0f433da229a | 244fb46fcd2fa696f7292c2a193af767 | Adds UIKit functionality to the WordPress default gallery shortcode | function gallery_shortcode_edit($attr) {
global $post;
static $instance = 0;
$instance++;
static $img_instance = 0;
$output = apply_filters('post_gallery', '', $attr);
if ( $output != '' )
return $output;
if ( isset( $attr['orderby'] ) ) {
$attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );... | 0 |
e378eed0d36840c84f93e02ee418cb6e | 31c9e9bd258cf505c3e3c813b4d0c5d9 | find first char that is unique and return its index. | def find_first_uniq_c(string):
n = len(string)
c_num = {}
for i in range(n):
if c_num.get(string[i]) == None:
c_num[string[i]] = 1
else:
c_num[string[i]] += 1
tmp_list = [ k for k,v in c_num.items() if v == 1]
for i in string:
if i in tmp_list:
... | 0 |
b8e653d6e588819485730b3ca2871ce5 | de0b027636f2b0ff7ee79bcf305f1dae | Retorna a descrição da situação da instrução de pagamento. | class Payment extends ResultObject
public function getDescription()
{
return $this->description;
} | 1 |
ef212019e1bc5e076497eb8eede222c2 | e81a0cd13861a2e4251e87c29a4f777c | Set the ID for the Data Set Template. | class DocTemplate(object):
def doc_template_set_id(self):
return self._doc_template_set_id | 0 |
9ed1331cc2838fcb060ff3ec1991417b | 7f61448ad6da3ef0f9cb03f40c5be655 | nothing, this is an empty message | cases like (1) | 0 |
d6b23d3b1a0af2d86298cb2f844c6e14 | 1a7e0aa75c08bfe8c74fdb4c415b86fa | Return instance with empty route table | {
route_table rtable = (route_table)malloc(route_table_capacity * sizeof(struct route_table));
DIE(rtable == NULL, "malloc");
route_table_size = 0;
return rtable;
} | 1 |
8c83a158deb1578e7868c56667b1901e | 803e8cb5a6dd29c818c09f86cda85266 | 获取移动数据网络ip | NetworkInfo info = ((ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
if (info != null && info.isConnected()) {
if (info.getType() == ConnectivityManager.TYPE_MOBILE) {
try {
for (Enumera... | 1 |
6422bc16bdf27d47b7532b00f0e7ab51 | 1fbfe26d36230bc0b96b077bd31afae5 | Resets the attribute :attr:`image` to the original image. | for attribute in image_attributes:
if hasattr(instance, attribute):
attr = getattr(instance, attribute)
if attr:
try:
if os.path.isfile(attr.path):
os.remove(attr.path)
except ValueError:
... | 0 |
fb12f586d8fd7de048b44f1e5a7b04ae | 6a311d7367e2d5157bb17f4ee8eb5353 | 用于判断是否是第一次点击 | public class ChessActivity extends Activity
boolean isFirstClick() {
return isFirstClick;
} | 1 |
bd182d3f260cebcccccf4b0bc744cb4f | e1c310d41c35808380ce2a4a7aa2bfa1 | Makes sure that we are not attacking | bool CDefendingLeader::canAttack(int cur_x, int cur_y, int new_x, int new_y) const {
return false;
} | 1 |
dda93f0f862d1e0231716aec3ba958ca | ba4319e1712e185887fc4b1fd97548d6 | A centred plus sign to help the player aim. | return OnscreenText(text=text, style=1, pos=(-0.1, 0.09), scale=.08,
parent=base.a2dBottomRight, align=TextNode.ARight,
fg=(1, 1, 1, 1), shadow=(0, 0, 0, 1)) | 0 |
4a716a0bfdb1b45d45a2d12012be23a8 | 4a178e0ce165ef45467421f598ca109e | Send notice to myself | {
$uri = '/im/user/sendMsgToMyselfs.action';
$result = $this->postWithCookie($uri, 'msg='.urlencode($message));
return $result;
} | 1 |
d92c8f09744f814828f612f2a9acbddf | 8bb88916598593ef9522915646c233d0 | IHash构造函数 | class MD2 extends HashFunc
public function __construct()
{
$this->_length = 16;
} | 0 |
7bc7f11161dae3606d0c1167ae2064fc | 4416feb69e6ea468f3a067f28133bd7c | Get the Memberships of a user from domain or local computer. | namespace Listen360API
IMembership[] GetMemberships(); | 0 |
fc12e04397c3706f34aac04ed24484a4 | db7155e07cf921c2422a216dd72002db | requests a new JSON, starts progress dialog | def selectNewJson():
jsonVar.set("new")
startBtn.configure(state="disabled") | 0 |
b68dcbb2ea2cc690ddcd911e0f832d84 | 93ce89758f722ce14037d904b12e1caa | Get a transform given a source code and a destination code. | def calculate_transform(src, dst, model=AffineTransform()):
model.estimate(dst, src)
return model | 1 |
5159f03f6ca35b4625bf6428ba525d1a | 5c9b3b130c2e10f8c60b6b1b2fa8eade | 空页面布局点击事件 | if (null != viewUtils_WR && showStateLayoutChecked()) {
LogUtil.d("BaseViewObserver", "onEmptyLayout()");
viewUtils_WR.get().getStateLayout().showEmptyView();
} else if (null != context) {
DialogUtils.dismiss(context.get());
}
} | 0 |
cd8635d2048ec69fdebc2d38e30ec4cd | e549471da9a382923ec0258039778d5e | Retrieves archive link items of pages. | {
$root = $this->getPageChildRecords($pid);
$processed = [];
$time = Date::floorToMinute();
$pages = [];
$archiveRepository = $this->repositoryManager->getRepository(NewsArchiveModel::class);
assert($archiveRepository instanceof ContaoRepository);
... | 1 |
1c6640cdb3446164a6810f1504dea050 | ed3f06ac2adef31ca3c5b2e8b2f8d01d | Parses all subcommands in line and preserves original line indices. | commands = []
offset = 0
while line:
command = self.parser.ParseCommand(line)
if not command:
break
if offset:
for arg in command:
arg.start += offset
arg.end += offset
offset = command[-1].end + 1
line = line[offset:]
commands.append(c... | 1 |
ef4a3580234385f4d925e8f377387ac4 | 0630504473adbd026a184571a0da2488 | Get or create (without pubkey) the related tinc object | if self._key is None:
keyObject = None
else:
keyObject = self._key
return defer.succeed(keyObject) | 0 |
4404de82bd336815940e024fafe0d562 | 47a8832d65b010cf4e5d807e23daa2ed | 获取指定借出单行的已归还数量 | int doRepaymentCount(long borrowId); | 1 |
b566686b7586c788567ad621dbcc8a88 | bd4bac4ee92a747f622c9341ca5071a4 | Gets an iterator for all nodes in the mesh that are nearest to a plane.
The equation for the specified plane is a*x+b*y+c*z+d = 0.
<p>
Nodes nearest the plane are those with Voronoi polyhedra that intersect
the plane. In other words, a node is nearest the plane if there exists
some point in the plane that is nearer to ... | public Iterable<V> findNeighbours(V start, int atDepth); | 0 |
5cca454ff2130122a343ba1cf0e06a0c | f7a9badf7d5a89aad259e63cfb176bb5 | Рекурсивна функція визначення шляху між заданими точками | {
Queue<IStation> searchQueue = new Queue<IStation>();
List<IStation> searched = new List<IStation>();
ITempStationsContainer pathContainer = new StationsContainer();
int currentLevel = 0;
IStation stationFrom_Temp = stationFrom;
searchQueu... | 0 |
f539c62e0cd281301e7740b43aff5e06 | 647d82f48d935bf0712633d554415f45 | 한 번에 weight만큼 옮길 경우, 도착 지점까지의 이동이 가능한가? | int cur = 0, cnt = 0;
int n = weights.size(), i = 0;
while (i < n) {
cur = 0;
while (i < n && cur + weights[i] <= cap) {
cur += weights[i];
i++;
}
cnt++;
if (cnt > D) {
return false;
... | 0 |
f82f6aaba8099f47dd51a6f9eaca402d | 5b80f8d5f61c2a0f2f998b772a6b78c2 | function to update inventory from file | FILE *fp;
drug new_drug;
pharmacist person;
fp=fopen(fname,"r");
fscanf(fp,"%s %s",person.mobile,person.password);
if(feof(fp)){
fclose(fp);
printf("\nInventory empty!!! No stocks to be displayed...");
return;
}
while(fscanf(fp,"%d %s %d %d %d %d %d %d %d %d",&new_drug.id,new_drug.name,&new_... | 0 |
01561f77f344f653b4d509814af416ea | 129428b7dd04f98314da6b728f4b5260 | 查询门店菜单数据 | request = self.session.get(URLS['store-menu'])
if request.status_code is 200:
if is_json(request):
return request.json()
else:
print 'failed to get store menu' | 1 |
1a9a741f156de1899593e3d153f95967 | f4b7a99ae1a5387495f862c767445301 | Builds up the drm config object to be passed to requestMediaKeySystemAccess | namespace AdaptiveStreaming.Droid.Exo
public class AdaptivePlayer : FrameLayout, View.IOnClickListener, IExoPlayerEventListener,
PlaybackControlView.IVisibilityListener, TextRenderer.IOutput
private IDrmSessionManager BuildDrmSessionManager(UUID uuid, string licenseUrl, Dictionary<string, string> keyRequestPropertie... | 1 |
c6369c5eca980be6f71cf3c71512de3f | 5e7116059254dd729269b065bb2b110d | This works out the year directories for all my posts
and creates a unique source node call for each directory.
This approach avoids having the year in the URL but lets me keep my posts organised
in year directories.
Just using one source of `/src/posts` would be /posts/{YEAR}/{SLUG} rather
than what I want: /posts/{SLU... | const posts = getAllPostsFrontMatter();
const range = (start, end) =>
[...Array(end - start + 1)].map((_, i) => start + i);
const pages = range(1, Math.ceil(posts.length / PER_PAGE));
return {
paths: pages.map((p) => ({
params: { page: p.toString() },
})),
fallback: false,
};
} | 0 |
902f51633a060869aa68936c81f9f5eb | b44fdcb9d3c6254719a4fb8fe46981f5 | Find the shortest path using a recursive algorithm.
You could speed this up with a cache. | def shortest_path(data, start, end, has_sword):
forbidden = []
if 'walls' in data:
forbidden += data['walls']
if 'dragon' in data and not has_sword:
x, y = data['dragon']
forbidden += [(x + i, y + j) for i in range(-1, 2)
for j in range(-1, 2)]
position = st... | 0 |
433ad1b2d3a50949019cc64e9430081f | 18575a263e19d97eced1bd4efbb555c4 | Provide a reference to the vector of indices that represents the input data. | class Batch(object):
def indices(self):
return self._indices | 1 |
08932352f2431bdabb40326c0df6b1ea | 321138f6eea30ce4328ce532b4c02f21 | 根据公司编号查询公司类型编号 | infocrmdb db = new infocrmdb();
String sql = "select cotypes from supplier where co_number ='"+co_number+"'";
Supplier supplier = null;
ResultSet rs = null;
String cotypes = "";
try{
rs = db.executeQuery(sql);
if(rs.next()){
cotypes = rs.getString("cotypes");
}
}catch(Exception e){
e.print... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.