query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
17c15cb9964bd211a271535c3f4ad420 | e3402024db5af7d987d092ca7151e1c9 | 仿真模式生成 CFG | CreateAllCDGNodes();
for (auto cfgEdge : cfgMST->GetAllEdges()) {
if (cfgEdge->IsBackEdge()) {
continue;
}
BB *srcBB = cfgEdge->GetSrcBB();
BB *destBB = cfgEdge->GetDestBB();
CHECK_FATAL(srcBB != nullptr && destBB != nullptr, "get edge-connected nodes in cfg failed");
if (srcBB == cgFu... | 0 |
a3f67442a52181771165af3220c3e6b8 | 196d00afa66be379d2304db96974b01d | 设置货物类型。 | public class AbstractGoods extends FreeColObject implements Named
public final void setType(final GoodsType newType) {
this.type = newType;
} | 1 |
344d8dd647b73d600a1a6ccac890d5c8 | 1c7bc1da3ebd5b565d15a9673c8966c0 | Remove a stanza from being a known root stanza.
A root stanza is one that appears as a direct child of the stream's
root element.
Stanzas that are not registered will not be converted into
stanza objects, but may still be processed using handlers and
matchers. | boolean removeAsyncStanzaListener(StanzaListener stanzaListener); | 0 |
f00e33c6c76ae756cce2629abeb2ae48 | a7d5a15f6b3d3e783b122d788717339b | Lines 110-119 | if not self.longdesc_id then
self.longdesc_id = string.gsub(self.desc_id, "_desc", "_longdesc")
end
return managers.localization:text(self.longdesc_id)
end | 0 |
8a0154eb3b5570aa7d6d329d9fe6e4eb | 9273e1cb03f41186d8800227e0bc1ebd | print the number 10 | for i := 0; i < 10; i++ {
fmt.Printf("%d ", i)
}
} | 0 |
d92e4ca0797e16a73f0a19379f8322ed | 6612eab06539a3ed1f5e5aeca34280d0 | Free memory from a channel | void assg_freechannel(long *ch)
{
if ((0 < *ch) && (*ch <= 99))
{
channel_stat[*ch] = 0;
*ch = 0;
}
} | 0 |
6a29e7fb65501e1ca4febf7cc657482f | 4afed8a6ba9a3e7ba109ff16c480f11e | Returns true if all the RMI server classes have been loaded. | public final class RCLJava
private static native boolean nativeOk(); | 0 |
5b07c6e7ce71e4a3355b6e30ecd2cde7 | ffa536b72c5357e478649e3315b00197 | 查看风险活动 | void MainWindow::riskControl(){
setting_riskctrlfold *rc = new setting_riskctrlfold;
rc->show();
} | 0 |
99e24083d4b71d48e1fa567a5d696ecf | 2cdb755b3ec997f80a2179525a74b9cf | @brief Create an unit test. | void UnitTest::setUpTest() {
} | 0 |
c7ba36e78442dbef2adfc7b73e70e7a1 | b021cdde20ef62235219d3ba50bb997b | Print matrix showing amino acid co-occurence until wildcards | void prtaawcdata(aaw_c *aawc)
{
int i, j;
for(i=0;i<aawc->numl;++i) {
printf("L%u(%uw):", i, aawc->aaw[i]->al);
for(j=0;j<aawc->aaw[i]->al;++j) {
printf("l%ut", aawc->aaw[i]->aw[j]->lp1-1);
switch(aawc->aaw[i]->aw[j]->t) {
case AA: case CC: case GG: case... | 0 |
dd6c729dfc0631ee5787217368bdd026 | 8fccdd7af328fa4e2df2618e01431041 | Get all messages for specific agent | {
var query = await _messageManager.GetAllMessages(input.ReceiverId, GetSessionUserId());
return await GetAllPagedByQueryFilter<MessageLogDto, MessageLog, Guid>(query, input);
} | 1 |
356106e6416b80ebf898d93a0577dab3 | a8b134c146e811a58f37645ce91afc36 | 最大含有2个相同 | maj, cnt = nums[0], 0
for num in nums:
if cnt == 0:
maj = num
cnt+=1
elif num == maj:
cnt+=1
else:
cnt-=1
return maj | 0 |
67c57ada4b51697d7070464217c058c6 | b2bff3419a1c48010d3c527bf4c7d557 | A loss function based on Jaccard Similarity index. | def jacard_coef_loss(y_true, y_pred):
return 1 - jacard_coef(y_true, y_pred) | 1 |
e937bc302bf8c69232d96dadaed00140 | ffedee32703628f5cbbb260cfaec9a86 | Increments the amount of sheets | FieldSheet FieldSheet::operator++(int) {
FieldSheet temp = *this;
numberOfDrones++;
return temp;
} | 0 |
48fca862f533b164ee966ad60d3d2b12 | 5a416ecc65038cc74bc8b0a76df2b415 | Informa quanto de dinheiro o cliente gastou. | public class InfoProduto implements Serializable
public double getGasto(){
return this.gasto;
} | 1 |
ee08849ced2ae091258cdbe51b7e884b | 8950d4d5bf366a7ad3d569ce4e7b13f9 | 修改出版社名字 | error = ''
pk = request.GET.get('id')
obj_list = models.Publisher.objects.filter(pk=pk)
if not obj_list:
return HttpResponse('要编辑的数据不存在')
obj = obj_list[0]
if request.method == 'POST':
publisher_name = request.POST.get('publisher_name')
if models.Publisher.objects.filte... | 1 |
4226cf7ef3ba4056a7f4e5b5a7df115f | 31ef28f23a40aa7f57caf41a8c73a22c | just wait for a fixed amount of time | public class Inspector : MonoBehaviour
IEnumerator MyWaitFunction (float delay) {
float timer = Time.time + delay;
while (Time.time < timer) {
yield return null;
}
} | 1 |
6d36b3f48b0925f804fd64ca70584143 | c55e92f48159690768216c3b848e2561 | Returns true if player is not stationary | {
return idle = ( !frozen && !(IsMoving() || HasValidPath() || HasValidTarget()) );
} | 0 |
36aa500488adf984a4a788c3bf924d12 | bdf5d221f45f2019029de3f50ef667b8 | Validate dsl2ssl Z axis transform | class DSLCotransDataValidation(unittest.TestCase):
def test_dsl2ssl_z(self):
set_coords('basis_z', 'DSL')
result = ssl2dsl('basis_z','basis_z_dsl2ssl', probe='a', eclipse_correction_level=1, use_spinphase_correction=True, isdsltossl=True)
self.assertEqual(result, 1)
bz_ssl = get_data('ba... | 1 |
c6d30707de128ab2d16ca696a8b72190 | d8fb44ee2df464bf9b279a0cedac6982 | Constructs the general timeline model. | assert df.index.name == "time", (
"Index name ('{}') different "
"than 'time'! "
"Are you sure you assigned index "
"correctly?".format(df.index.name)
)
if len(exclude) > 0:
df = df.drop(exclude, axis="columns")
self.timeline = ... | 1 |
c4eab44d6d003d9b9b75167bb2315381 | 69277cce1e337ccff4d333a84f20bda5 | 实体前缀拼接entityType和entityId生成实体的key | {
return GetValueForEntity(entityType) + key.ToString() + "|" + propertyName;
} | 0 |
dbe98080881e0adcb3b9f590dfb7de5d | 4505dc2bf4ff19cca0bc9797948223a8 | Store policy distribution and paths in history. | if dist.path not in self.path:
self.path[dist.path] = dist
self.name.setdefault(dist.key, []).append(dist) | 1 |
057dbbf70e33459667def5941d2db048 | 07b4a382053224bf46eda9bbe4009fb2 | 将自己发送的文件转发到最近聊天 | class MsgAllPrior(TestCase):
def test_msg_weifenglian_1V1_0125(self):
scp = SingleChatPage()
scp.wait_for_page_load()
if scp.is_exist_msg_file():
pass
else:
scp = SingleChatPage()
scp.click_file()
select_file_type = ChatSelectFilePage()
... | 1 |
2c57ffe491520faea637f3469c620a25 | 455e46fddf2d31d592325278df919f13 | Use url as a key to check if the user already exist in db. If exist,
return true | class SaveDataBase(object):
def check(self, url):
self.cmd.execute("select count(*) from " + self.dbname + " where url = ?", (url,))
res = self.cmd.fetchone()[0] > 0
return res | 1 |
3209735fd1e0f015c278c7a92d690721 | e9d6fb22fbeb585c11c6810fc78d86b0 | 将合并单元格信息转为json | {
DataTable dt = null;
if (ds != null && ds.Tables.Count > 0)
dt = ds.Tables[0];
StringBuilder jsonString = new StringBuilder();
jsonString.AppendLine("{");
jsonString.AppendFormat("page: {0},\n", page);
jsonString.AppendFor... | 0 |
8e24d95aaefbf3dc9797e844987c113a | 9dd32b1045fd717727a075efd90a0057 | Validates $category parameter and returns BiberLtd\Core\Bundles\GalleryBundle\Entity\GalleryCategory if found in database. | if(strlen($category) > 0) {
return sprintf('%s', $category);
} else {
return null;
}
} | 0 |
bd407b1b693ef514994460f34348b499 | 54605e28968fffeb290b49b150fc5d57 | A quadratic bezier interpolation method. | {
var tm1 = t - 1f;
var tm2 = tm1 * tm1;
var t2 = t * t;
var m1 = 0.5f * (p2 - p0);
var m2 = 0.5f * (p3 - p1);
return (1f + 2f * t) * tm2 * p1 + t * tm2 * m1 + t2 * (3 - 2f * t) * p2 + t2 * tm1 * m2;
} | 0 |
5a639a933c64145bf1f1b6ea1e12c390 | 2048e66d342eb3e699ffd69acda90900 | Check if a date folder has been created | class Statistics(object):
def check(self):
dataPath = self.getDataPath(date = self.date)
return os.path.exists(dataPath) | 1 |
3b30954aece7a638f945ab023f51ea6f | 23b26dbfdbd98b41f6502f1346b5c47e | Loads sidebar assets. | class Widget extends Module
public static function load_assets() {
wponion_load_core_assets();
} | 0 |
0adf75d3bc049c6228318a156a37b9ae | 9b33dedf165322b1fc227923986f40ca | Показать блок кнопок с нажатым Caps Lock. | export class MatKeyboardComponent implements OnInit
onCapsClick(targetState = !this.capsLocked) {
this.capsLocked = targetState;
this.capsClick.next();
} | 0 |
2186fc3810129e3b8c0b95fde290ef94 | 78835cfb9510f13a616203131d4a2436 | 获取明年年份 | {
int Y = DateTime.Now.Year;
int M = DateTime.Now.Month;
string m = "";
int y = Y - 2000;
m=(M < 9 && M > 2 )? "02" : "01";
if (m == "01")
return y.ToString() + (y + 1).ToString() + m;
else
return... | 0 |
6e36d834154f3f6bdf86b9991e8954a5 | c3e045009c7ac5eaaccc30fecc7b638d | Returns replica instances for all available replicated shares. | export class Registry extends events.EventEmitter
getReplicas (): Replica[] {
return Object.values(this.nodes).reduce(
(acc: Replica[], node: Node) => acc.concat(node.getReplicas()),
[]
);
} | 1 |
cad02bf4a293d2ec5456fcfa8f3018cb | bf7e401346e1b13c32e689b35a230413 | Gets whether the specified message will be handled asynchronous. | public class MessageHandlerConfig
public boolean supportsAsynchronousProcessing(String messageType) {
for (MessageConfig messageConfig : messagesConfig) {
if (messageConfig.getMessageType().equals(messageType)) {
return messageConfig.isAsynchronous();
}
}
return false;
} | 1 |
f290d7b0c738e3ae424cd5aa9f793dea | 16b30de084f7c44df2daffe948d5bc21 | Preprocesses data through:
- Fills null values with median values across columns
- Cleans dataframe to drop very highly correlated variables
Input: a pandas dataframe
Outputs:
dataframe: a pandas dataframe
kept_col: set of columns to be kept in dataframe | def preprocess (data, df_num_model, dict_median, dict_most_frequent):
df_num = data.select_dtypes(include=np.number)
for col in df_num:
df_num[col] = df_num[col].fillna(value=dict_median.get(col))
minmax_sc = MinMaxScaler(feature_range=(0, 1))
minmax_sc = minmax_sc.fit(df_num_model)
std_df_n... | 0 |
479fb09eb7c7bb908a4145acb8d6832d | 9a79297bbc9ea173b9db14f72ef997c7 | Check to see if InputArtifactDetails property is set | namespace Amazon.ElasticTranscoder.Model
public partial class Artwork
internal bool IsSetInputKey()
{
return this._inputKey != null;
} | 0 |
bbd24be07de2870b0e2f8289e3f1a09b | e288e3a17ecddc369922e75415f7dbc1 | Converts an XML formatted String to an Array of Hashes.
=== Example:
xml = '<?xml version="1.0"?>
<user>
<name>Anders Törnqvist</name>
</user>'
=> [{ 'user': { 'name': 'Anders Törnqvist' } }] | class XML
def decode(str)
MultiXml.parse(str)
end | 1 |
bb6c0c9577c3de5f199a44f95a77b7f2 | aaa2fc1b9446b0b31969fad4926ddbbb | pop function removes the top element of the stack and returns it. If the stack is empty, it raises Stack
Exception | if self.is_empty():
raise IndexError("Pop Operetion is not Possible Because Stack is Empty ")
else:
item=self.items[-1]
del self.items[-1]
return item | 1 |
c22d21a568269082515218c5dce7ddc4 | 37747ec2138f21be33b78b8af964dc28 | 获取最大的龙纹等级 | public class Itilemetainfo extends com.earthview.world.core.AllocatedObject
public int getMaxLevel()
{
int returnValue = getMaxLevel_void(this.nativeObject.pointer);
return returnValue;
} | 0 |
f8b0c91d5cb3f5f4a0aef6e3389e8676 | c975fb07a4f721a4e72afa1c17454641 | 通过layerName移除要素 | export default class OlHelper3
removeFeatures(layer=this.featrueLayer){
if(layer&&layer.getSource&&layer.getSource()){
layer.getSource().clear()
}
} | 0 |
4b4f203088260a26f42bb451042af709 | 74dbe9c825a651d5fd7b500b232766ff | creating variables to represent a permutation | class Structure:
def __init__(self, pairs, permutation):
self.pairs = pairs
self.permutation = permutation | 1 |
ddef3883fd5974262a7aafcd209c5902 | d4497e8fde83221e2a7a7c160eb8783c | Отправляет письмо пользователю о том, что ссылка на результат загруженна | {
$resultId = $request->get('result_id');
$url = $request->get('current_url');
$email = $request->get('email');
if ($request->has('subscribe-agree')) {
$subscriptionService = app()->make('InetStudio\Subscription\Contracts\Services\Front\SubscriptionServiceContract');
... | 1 |
e32c387230bdb93c2f28993404826539 | 1a930483c7f46b1118c230bc15a676b9 | 校验输入的EOS数量 | function checkAmount()
{
showMsg('pur_miaoshu', 'focus');
checkPrice();
var amount = trim(jQuery('input[name=amount]').val());
if (amount == '' || !isInt(amount) || amount == '0') {
showMsg('pur_num', 'error');
} else {
showMsg('pur_num', 'right');
}
} | 1 |
1ff3875c09aa41e99707f0428a492f73 | b85a0cb0cf36b2160c4f2ef3cdf9f880 | Enables retries.
This is useful if the caller is implementing it's own waiting process. | namespace Amazon.QLDB.Driver
public abstract class BaseQldbDriverBuilder<TBuilder>
where TBuilder : BaseQldbDriverBuilder<TBuilder>
public TBuilder WithRetryLogging()
{
this.logRetries = true;
return this.BuilderInstance;
} | 0 |
f3c275d39e9678127cbc44b6562722c3 | c174e45ba370dde7563d4bdca45d7694 | Find one with the least amount of time remaining | int lowestTimer = TIMER_MAX;
int lowestIdx = -1;
for (int i = 0; i < tNum; i++){
if (timedSocks[i]->timer <= lowestTimer){
lowestTimer = timedSocks[i]->timer;
lowestIdx = i;
}
}
lowestTimedNode = timedSocks[lowestIdx];
} | 1 |
c0f467dd00ace986d0577c32dd6ca429 | 75c6d0002df6180ef508478911345873 | Returns the result of interpreting the object as an instance of '<em>Anonymous trace Options 1</em>'.
<!-- begin-user-doc -->
This implementation returns null;
returning a non-null result will terminate the switch.
<!-- end-user-doc --> | public class CSharp5BaseListener implements CSharp5Listener
@Override
public void exitAnonymous_object_creation_expression(
final CSharp5Parser.Anonymous_object_creation_expressionContext ctx) {
} | 0 |
a6571789c7ba4f0dda40ef1b55e921ca | ef649509bb706d70fa89a0c44242b2ef | https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeV10 | class FauxMySqlServer
helloPacketHandler(packet: Buffer) {
console.log('receive hello')
if (packet.length == 0) return this.sendError(new ErrorMessage("Zero length hello packet"));
var ptr = 0;
var clientFlags = packet.slice(ptr, ptr + 4);
ptr += 4;
var maxPacketSize = pa... | 1 |
7e9352e065ffeddb1c0566a4f462f2e6 | 64c3219405f0fdf3ecbae67786911d04 | Vowel | bool isVowel(char c) {
char arr[5] = {'a', 'e', 'i', 'o', 'u'};
for(int i = 0; i < 5; i++)
{
if(c == arr[i])
{
return true;
}
}
return false;
} | 1 |
f3da03f392e94e7445ff975a54793622 | 48ed9a7ca567e9601ad27070a5d7f8fe | Handle requests to retrieve the info for a single light. | class GetDevice(Controller):
def handle(self) -> Response:
device = Device.get(self.request.query('id'))
return GetDeviceResponse(
device.to_dict(),
LightColors.get().to_dict() if device.has_color else {}
) | 1 |
07a19dece28d49c57adfa9b838b6836f | 5697d84db39254847d19f1a92c204eaa | Fragment örneğini korur. Yani ekran değişimlerinde her seferinde onCreate olmaz | public class FragmentModul2101 extends Fragment implements BlockingStep
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
} | 1 |
c3aba4af8983f14c54d1fc56a4dd1d2f | 7beb10fd8dc3039d6ee82dd80126e7ac | 根据尺码表模板id查询自定义尺码表模版 | function queryCustomTemplatesByCustomNumber(customNumber, query) {
return request({
url: `/api/custom-templates/custom-number/${customNumber}`,
method: 'get',
params: query
})
} | 0 |
6928e1f0f4861416163ca8079765204a | 6c954dba3eea1c5f83a293889e603afd | 关闭打卡提醒 | function closeRemind() {
var bottomDiv = document.getElementById('bottom_remind');
document.getElementById('remind_content').innerHTML = '';
bottomDiv.style.bottom = '-152px';
} | 1 |
e17ebb0b328ac6aba0b001f193389d69 | e7bf70961acfd43585a8eb3cc5fd7bda | Retrieves the messages associated with the current shopper's cart. | namespace Nop.Plugin.Cameleo.CameleoEvents.Services
IPagedList<CameleoCustomerEvent> GetCustomerEventsFromShoppingCart(ICollection <ShoppingCartItem> ShoppingCartItems, int shoppingCartId, int pageIndex = 0, int pageSize = int.MaxValue); | 1 |
af9be69e827caa0fa1525da0fa5957b0 | 14766fb50ae68bae9a332bb773cc4691 | Returns true if line i is completed, else returns false | static size_t iterationNo{ 1 };
os << "Line Manager Iteration: " << iterationNo << std::endl;
bool foundFirstStation = false;
bool isMentionedInNextPos = false;
int indexStartingPos{ -1 };
for (size_t i = 0; i < AssemblyLine.size() && !foundFirstStation; i++) {
for (size_t j = 0; j < AssemblyLine.size... | 0 |
d3d84b349c371a159ccdd8c6e067cfc7 | ccfe181c26b168b9eea4cc20b57a20ac | Sets the selected query via simulated UI interactions. | when (type) {
QueryTermType.IMAGE -> queryImage.performClick()
QueryTermType.AUDIO -> queryAudio.performClick()
QueryTermType.MODEL3D -> query3D.performClick()
QueryTermType.MOTION -> queryMotion.performClick()
QueryTermType.TEXT -> queryText.performCl... | 1 |
4b83e199ca8a0272df6405d8e56226ad | 959d1ff2d7be4e55809c901a88616d92 | Converts this Graph object to an igraph-compatible object.
Requires the python-igraph library. | class IGraph(Interface):
def to_nx(self, copy=False): | 0 |
fa75ca123c390d390e8f7d91c3784fb6 | 021a238846941719fd3125ecbc3230c2 | Returns a filtered version of the word list with words only containing
6-8 characters. | def easy_words(word_list):
pass | 0 |
f9435657b6046b53af654725cbc63475 | a6aaf1cef708efbce81dca872b848b41 | Скачать каталог. | request = requests.get(LINK, allow_redirects=True)
with open(os.path.join(PATH, "archive.zip"), 'wb') as file:
file.write(request.content)
with ZipFile('archive.zip', 'r') as zip_file:
zip_file.extractall(path=os.path.join(*dirs)) | 1 |
075e77a261454314d6ecb99aa1a5354e | 2312d0635dbba3dfbddd442d65a35c2f | gets the size of volume in bytes | {
if(IsVolume())
return (iVolume->Capacity() - iVolume->FreeBytes());
else
return 0LL;
} | 1 |
8d9d64ae610dcf3d5f8a26cbce4a461a | 08701cab6f897bb50cbe6140d3048832 | The first connected client will be the active one and notifications will be sent only
to him. After receive active connection index advertising is disabled for other clients. | internal class NearbyConnections(
context: Context,
private val dispatcher: CoroutineDispatcher,
private val connectionsClient: ConnectionsClient = Nearby.getConnectionsClient(context),
)
fun startAdvertising() = callbackFlow {
dispatchEvent = { trySend(it) }
coroutineScope.launch {
connectionsClien... | 0 |
8a50f7c37f5e71398af019bd2f15f6fd | 7db329bd679f5e17f3033c918e182116 | Flask 请求成功时返回的信息模板 | header = 'HTTP/1.1 210 OK\r\nContent-Type: text/html\r\n'
body = template('index.html')
username = current_user(request)
body = body.replace('{{username}}', username)
r = header + '\r\n' + body
return r.encode(encoding='utf-8') | 1 |
1a75d2e30c583231dab0d935d787c673 | 96082a2265d7cc5d7608ebaaa2968e8d | 配置继承自DomainTreeEntityViewBase<TKey, TEntityView , TIdentityUserKey>的实体视图 | {
foreach (var entityType in entities.Where(x => x.FindAnnotation("IsTreeEntity") != null))
{
migrationBuilder.CreateTreeEntityView(entityType.GetTableName(),
entityType.GetProperties().Select(pro => pro.GetColumnName()));
}
ret... | 0 |
8d2c5aa52f136d3722eb7ce533c16677 | 03d47c46e49d7f7938b1762ca3ce0432 | Query slot provider locations by geolocation | class ProviderController
def msw_search_spots
spots = MSW::Provider.search_spots(params[:query])
spots.each { |s| s[:name] = "#{s[:name]} - #{s[:country]}" }
render json: spots
end | 0 |
9a033ba62382a5564f452e347a817f71 | bef473031445e0d99ecea7d406b21230 | Swap src and dst ip | int ether_swap(void *buf)
{
struct ethergram *gram = (struct ethergram *)buf;
uchar temp[ETH_ADDR_LEN];
if (SYSERR == getmac(temp))
{
return SYSERR;
}
memcpy(gram->dst, gram->src, ETH_ADDR_LEN);
memcpy(gram->src, temp, ETH_ADDR_LEN);
return OK;
} | 0 |
80d73c2cd2be0c042d8a70e4688d2e72 | 775007f46d343460ba440426443409b1 | An observable list of users. | function users() {
return listOfUsers
} | 0 |
b3385bc4d59e3315ca87379bc10a5163 | 222acec961aa286c83c1262dced47e5b | 添加xmind节点 | window.editor.minder.exportData('xmind').then(function (content) {
const reader = new FileReader();
reader.addEventListener("loadend", function () {
let res = JSON.parse(reader.result);
let a = document.createElement("a");
a.href = res.data;
a.click()... | 0 |
74d071cf094a97c781eefa28d83b7d49 | d7d90d9df88f64d044c486b4d86ae33f | Are we in a web environment? | class ServiceProvider extends BaseServiceProvider
protected function runningInWeb()
{
return !($this->app->runningInConsole() || $this->app->runningUnitTests());
} | 1 |
a5dec8c5cc884a005c1d6e115f526890 | a2b9aeeca5338b20a6e0fb9463ec53dd | 去除指定字符(只去除第一个) | public class StringUtil
public static String remove(String str, char remove) {
if (isEmpty(str) || str.indexOf(remove) == -1)
return str;
char chars[] = str.toCharArray();
int pos = 0;
for (int i = 0; i < chars.length; i++)
if (chars[i] != remove)
... | 0 |
4ee9d3201a75db57518c752cc63dd7ea | d7f3a3eaef5f9dcd5fe918ca32f3e605 | Se ejecutará cuando cargue la página. Llama a función para crear
el tablero y crea el evento para comenzar la partida cuando se
pulse el botón Play y el de aumentar el nivel cuando se pulse
sobre Nivel | crearTablero(cantCol, cantFil);
crearMinas(cantMinas);
asignarNumero();
divPrincipal.innerHTML = "";
cantidadOcultos = cantCol * cantFil - cantMinas;
imprimirTablero();
timer.finTimer();
document.getElementById("timer").innerHTML = "0";
timer = new Timer(0);
document.getElement... | 0 |
805c46e2ce7e64826b4dfb16326cc912 | e6f780697e61c6f6ba0567a1e19e5540 | Called from the debug engine's Detach method to remove the active (bound) breakpoint instructions. | {
for (int a = 0; a < BreakpointCount; a++)
{
}
} | 0 |
20005aaeaa7f10774a0c4afd8667c6e6 | f0d800a3c365aca46ce975682b7007c5 | 生地仕入情報を画面に反映する | {
$uid = (int)($_SESSION[DBWork::sessionKey]);
$co_id = (int)($_SESSION[DBWork::accountKey]);
$close_year = (int)$this->param['close_year'];
$next_year = $close_year +1;
$from_yyyymmdd = $close_year.'0000';
$to_yyyymmdd = $close_year.'1231';
$this->startTransaction();
$sql = "SELECT A.io_item_cd item_c... | 0 |
969f7ea283c2fb5616df094693d67e81 | 820e8834b8d8150d38c0604ba71d8345 | Restrict user from entering '-' on IC | export class QtyFailedComponent implements OnInit
invalidChar(event) {
var invalidChars = [ "-", "+", "e", "."];
if (invalidChars.includes(event.key)) {
event.preventDefault();
}
} | 1 |
55187b4a12ecc8726771eeefce5f69c3 | c4a8f00289375671a923461934d5642d | This method is used to prevent StackOverflow Exception during data initialization. When object is in initialization
mode, the lookup mode will not trigger the OnPropertyChanged event. | namespace Syncfusion.UI.Xaml.Collections.ComponentModel
void BeginInit(); | 1 |
0d9e85b8f163e4d103dedfd37250a7f4 | 957a489b4285b14de1330ec6e5c93d56 | Sets the index to the default production index | {
for (int i = 0; i < _procProdMultSliders.Length; ++i)
{
_extProdMultSliders[i].value = ExtractorProduction.DefaultProdMult;
_procProdMultSliders[i].value = IndustrialProduction.DefaultProdMult;
_procProdModeMenus[i].selectedIndex = ThisLe... | 1 |
e9c4434d49f1a06fa6fc72994a810031 | 31c18a62c0751ba00dc9c05c596d0076 | MOV.W @Rm,Rn | INLINE void MOVWL(uint32_t m, uint32_t n)
{
sh2->ea = sh2->r[m];
sh2->r[n] = (uint32_t)(int32_t)(int16_t) RW( sh2->ea );
} | 1 |
78880df83bd135e435fcc6420552f816 | f4f2592a3c17299d55b8684487c3b9d3 | Verifies spacing around a <c>]</c> character in tuple types and expressions. | DocumentCommand command) {
String replace = null;
if (matchesOne(command.text, new String[] { "\t", "]", ")" })) {
try {
if (command.offset > 0) {
String pair = document.get(command.offset, 1);
if (matchesOne(pair, new String[] { "]", ")" })) {
command.shiftsCaret = true;
replace = "... | 0 |
8ae78bc59e2288dae50976d4398485f4 | 58b007f3e48dc3e6de2c74b8927a434e | Create a parent group for each selected joints. The purpose is to freeze joint attributes to zero. | super(Quadruped, self).create_joint()
hierarchy.batch_parent(
[self.l_arm.jnts[0], self.r_arm.jnts[0]],
self.spine.jnts[-1])
hierarchy.batch_parent(
[self.l_leg.jnts[0], self.r_leg.jnts[0]],
self.spine.jnts[0])
cmds.parent(self.tail.jnts[0]... | 0 |
baa6a9784b114c12d19858256c7c5046 | ad8bc785cc5246d6a571b2499cbdcdf2 | # Get the XML tag name of an XMLNode object | class IDXMLParser:
def gettag(self, node):
self.getoffset(node)
return self._xml[self.tagoffset:self.tagoffsetend] | 1 |
b8fa5dba89d356c7e167198d237d25ad | e1cb1ec3e5c60b199fd856de64538a4b | Calculate average and standard deviation for acceleration meassurements
source: HowToExtractPeaks.html | peaks = _detect_peaks(data, columname)
xm, ym = zip(*peaks)
return np.mean(ym), np.std(ym) | 1 |
b059bf7292fb9e5a8467991241d8c9bd | dfa8b37120a0999b1ce8d09a247edcf1 | Unwinding superblock updates for old filesystems.
See ffs_oldfscompat_read above for details.
XXX - Parts get retired eventually.
Unfortunately new bits get added. | void read_super()
{
lseek(fd, 1 * block_size, SEEK_SET);
read(fd, &isize, sizeof(isize));
read(fd, &fsize, sizeof(fsize));
read(fd, &nfree, sizeof(nfree));
read(fd, &ninode, sizeof(ninode));
read(fd, &avail_blocks, sizeof(avail_blocks));
read(fd, free_blocks, sizeof(free_blocks));
read(fd, free_inodes, sizeof(... | 0 |
61a1735a729fbd3a50137e9d04a2e8b1 | 143227e1422c46c85c5dab06a1453410 | print all the classrooms and their schdule | public class Timetable implements Serializable, Cloneable
public void printSchedule() {
for (Integer k : timeSlotInformation.keySet()) {
printSchedule(k);
}
} | 0 |
9bc0f1d44a2390234c2c06c32812d660 | 9d98a2b01b2df3fe84766f9d235c788d | Display a listing of the Exchange. | class ExchangeController extends Controller
public function index()
{
$exchanges = DB::table('exchanges')->get();
return response()->json($exchanges);
} | 1 |
f243929096d833c7b554224cba678527 | 18299ebdc3a76cc6efce3df53fae2a26 | 获取vip数据并存储到数据库中 | @Service
public class VipService
public int insertVipUser(String name,Integer money) {
VipsTable vipsTable;
UserTable1Example userTable1Example=new UserTable1Example();
userTable1Example.createCriteria().andUserNameEqualTo(name);
List<UserTable1> userTable1s = userTable1Mapper.selectByEx... | 1 |
7ed92e0c7b2e5a8fa0ebdcce3a798d83 | 7df197222248c34ad17d1f0f704a102a | Remove a failed node from the network. | if node_name:
node_id = (self._get_node(node_name=node_name) or {}).get('node_id')
assert node_id is not None, f'No such node_id: {node_id}'
self._api_request('removeFailedNode', node_id, **kwargs) | 1 |
2103f5e5e6c68b1b1cbc9e82894e8407 | b5115a45bb8662ddd3e3e89321b6601c | Setup the odometer. | class AStar:
def resetOdometer(self):
self._resetOdometer = True | 0 |
9bc38b315fb46738360cd2d8320c48e9 | 0f7ea4d2e7b0ae017422d827da83f600 | Вернет все шаблоны для текущей языковой версии и текущего домена. Метод с кеширование результатов. | class Pages extends ActiveRecord
public static function getAllTemplates()
{
self::loadTemplates();
return self::$templates;
} | 0 |
b54bb1aa99a4b0ca3556deed0f93bf26 | 30bc11600c6e22029b9533a1ecf5d9c0 | Perform depth test on depth buffer (write new z if successful). | void CD3DObj::DepthWriteEnable(bool flag)
{
if(flag)
m_pDeviceD3D->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
else
m_pDeviceD3D->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
} | 1 |
341331ed75c8ef16c1648645142d9c0b | ad97be4400fb3c85565ea7bf7e3c5a29 | Immediately after getting or setting a value, should a locked
object commit the active event's operation? (True for
non-atomics, false for atomics.) | class AccessCoordinatorImpl implements AccessCoordinator,
NonDurableTransactionParticipant private class AccessedObjectsDetailImpl implements AccessedObjectsDetail
boolean isCommitting() {
return committing.get();
} | 0 |
5bcf12c3c0ba3d1c48c298c9f5c0d4dd | 029930706eb00bf6b7020211c423ce25 | Applies values and default_values to a potentially nested workflow. | class CompositePlanValueResolver(ValueResolver):
def apply(self) -> AbstractPlan:
if self._values:
self._apply_parameters_values()
for name, step in filter(lambda x: isinstance(x[1], dict), self._values.items()):
child_workflow = next((w for w in self._plan.plans if w.nam... | 1 |
25acf1e21d7204fedcbc90ee15a7a703 | e37162913f568fd7fec53760aa985611 | Returns a uvr1611 packet from a list of bytes or an error. | packet_hex = [
"45", "00", "00", "73", "00", "00", "40", "00", "40", "11",
"b8", "61", "c0", "a8", "00", "01", "c0", "a8", "00", "c7",
"00", "35", "e9", "7c", "00", "5f", "27", "9f", "1e", "4b",
"81", "80"
]
packet_bytes = bytes(int(x, 16) for x in... | 0 |
4c006f6457e3aa0eb54e75e8a3a4028c | 649ee7ccf78edab7aa02453566d2836f | Parses the tracker output and updates own state | class beaconTracker (threading.Thread):
def processResponse(self):
for beacon in beacons:
json = self.lastResponse.json()
if json[beacon.getAddr()]['rssi'] != 0:
beacon.setScannerData(
self.name,
self.addr,
json[... | 1 |
b2b03d51e3bdeb628f1589084bd17370 | 18a7cc083649c35adcda7a58d7f6219b | Reads beer data from supplied csv files, initializes DB. | def main():
read_csv_file() | 0 |
417c8e5f5bc57a2e188549d7946deef0 | 5cf4f00c4af74fba1c86d4a216a2f6f6 | 如果是6.0或以上,并且没有全部权限授予,就请求权限 | public class PermissionHelper
public void request() {
if(!PermissionUtils.isOverMarshmallow()){
PermissionUtils.executeSucceedMethod(mObject,mRequestCode);
return;
}
List<String> deniedPermissions = PermissionUtils.getDeniedPermissions(mObject , mRequestPermission);
... | 1 |
102699ef8956aa5f79c1765483a1693c | 08e51502f4a151f8cb30e9acb2533fc5 | Generates the canvas of the appropriate size and attaches it to the
main jFrame for the emulator. | {
canvas = new samplePreview();
canvas.setPreferredSize(new Dimension(WIDTH,HEIGHT));
Container cp = getContentPane();
cp.setLayout(new FlowLayout());
cp.add(canvas);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setTitle("Poisson Test");
setVisible(true);
} | 1 |
0c7cb5f1c54f1c35093b48850d25d161 | f48616d9148b5d7faad71a8845172b59 | Validate and Store Shelf Life Related Data | if storage.locationID == None:
raise Exception("NullException")
if storage.lm_userID == None:
raise Exception("NullException")
if storage.locationName == None:
raise Exception("NullException")
if storage.timeCreated == None:
raise Exception("NullException")
if not isinstance(storage.locationID... | 0 |
65b96bdd99ad5256fefcf838165df177 | 2b0f95f70e8f82702098f942e457aa1b | Evaluate a query expression. | namespace Unisave.Arango.Expressions
public abstract class AqlExpression
public abstract JsonValue Evaluate(
QueryExecutor executor,
ExecutionFrame frame
); | 1 |
e70259da85acac6953f00e67ff65f0b5 | 86e7c7299914daa1165ed57b09be2619 | Unfold by using the pseudo inverse obtained by a least squares fit. | row_sum = np.asarray(A.sum(axis=1)).squeeze()
D = sparse.diags([row_sum], [0], format="csr")
A1 = 0.5*A + 0.5*D
DInv = sparse.diags([1/row_sum], [0], format="csr")
A2 = DInv @ A1 @ DInv
row_sum_2 = np.asarray(A2.sum(axis=1)).squeeze()
D2 = sparse.diags([row_sum_2]... | 0 |
c9c421d4cf6fa73e0278605aad1bac86 | 23c3b4c64a03ea7e633dae56a8e3fb5f | 신문의 헤드라인을 편집하기 위해, 주어지는 문자열의 알파벳 소문자를 모두 대문자로 바꾸는 프로그램을 개발 중이다. | public class Part3
public String toCaptial() {
txt[0] = Character.toUpperCase(txt[0]);
for (int i = 1; i < txt.length - 1; i++) {
if ((txt[i] == W_SPACE) || (txt[i] == N_LINE)) {
txt[i + 1] = Character.toUpperCase(txt[i + 1]);
}
}
return new String(txt);
} | 0 |
47f3ecbaa05dd41a6a735c99cb278631 | 7d76a299149519d407a4786841fffa8d | 부모 게시글 ID을 가져옵니다.. | class TMSC_Media extends \TMSC\Database\Migrateable
public function get_post_parent() {
return ( empty( $this->raw->WPParentID ) ) ? 0 : $this->raw->WPParentID;
} | 1 |
185155cae83c37fc074fc6f14f9ce5f8 | a0a262a58870b6a21db434c12c3ebe62 | Gets the timeline of the user with the specified <code>userId</code>. | List<Tweet> getUserTimeline(long userId); | 1 |
cf708d88a37ca2e17b112a8d97035473 | 323d902238e687fd3602693c9f5d09f3 | 计算三角形外心
返回:外接圆圆心 | namespace _circle{
circle outer_circle_of_triangle(point t0,point t1,point t2){
circle tmp;
double a=(t0-t1).len();
double b=(t0-t2).len();
double c=(t1-t2).len();
tmp.r=a*b*c/4/triangle(t0,t1,t2).area();
double a1=t1.x-t0.x;
double b1=t1.y-t0.y;
double c1=(a1*a1+b1*b1)/2;
double a2=t2.x-t0.x;
doubl... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.