query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
a47acf093b5052f01d4b4f5e7c9f4db2 | 195a6ab470020bfd37df17bdced67b60 | Searches next occurence of sSearch in a file. Called by Ctrl+I/F3 command
Positions the cursor at the occurence.
Marks the occurence. | {
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
if (_searchLatestEditPoint == null)
{
SetLatestFindStartPos();
FindNext();
}
else
{
TryToReplaceSelectedText(replacePattern);
FindNext();
}
SaveMatchedPosition();
} | 1 |
c2d4a275ef9d8c3a35e570ccdd2b8696 | 09fb17931e0752dadb13c76ad52a06f8 | Where to go after an action (add/mo/...) is done | class AuthController extends Controller
public function redirectAfter()
{
return (parse_url(url()->previous(), PHP_URL_PATH) === '/checkout') ?
'/checkout' : strtolower( auth()->user()->roles()->first()->name );
} | 1 |
92bb299815ab3ea48e56e15c1d8da6fc | bc4d81666e30e997fb87d38d5ba09cbe | função para dividir números inputados pelo usuário | function forDivide(){
let mod = 1;
let fnum = Math.floor(Math.random() * (1000 - 50 + 1) + 50);
let snum;
while(mod != 0){
snum = randomIntFromInterval(1, fnum)
mod = fnum % snum;
}
num1.innerText = fnum;
num2.innerText = snum;
} | 0 |
f33a9d9d79a5eb18f19709cb981e82c7 | 5fcfcc63ea3ba2c04bb051396ff57cfd | 文字素材的编辑页面 | def editor(request):
return render(request, 'other/editor.html') | 1 |
75f91fa173e03fc047456b1168f9fc1e | 4784ad9661faadbe692fd24ec4b50ae3 | 撤销机构 | orgCancel() {
this.$refs.treebox.orgCancel()
this.$refs.orgFormData.resetFields()
} | 1 |
017104130b3c1cb4c81ba044e1a28ebc | 1961df01070c78d120f0b74cf71437a7 | 创建一颗子弹 并将其加入到编组bullets中 | export default class NewClass extends cc.Component
createBullets(positionX) {
const bullet = cc.instantiate(this.yellowBullet);
bullet.setPosition(positionX, this.node.position.y);
this.node.parent.addChild(bullet);
} | 0 |
c2f52ba7ea8a791bef6e97dc71a72edd | eeae5440acfc28b1791be18ac057b7cc | Check that a given key has all foreign's columns into the primary key. | permission_for_get: PermissionForGet = permission.permission_for_get(model)
name_foreign_key = name_foreign_key.split(SPLIT_REL)[-1]
if name_foreign_key not in permission_for_get.columns:
return False
return True | 0 |
c70e85cc13e731c79a8c535875e0dd5b | be5c386fa246ebf9be7776334b3e0904 | 载入事件配置
将配置项申明为类属性 | public final class Config
private static final void loadEvents()
{
final ExProperties events = initProperties(EVENTS_FILE);
ALT_OLY_START_TIME = events.getProperty("AltOlyStartTime", 18);
ALT_OLY_MIN = events.getProperty("AltOlyMin", 0);
ALT_OLY_CPERIOD = events.getProperty("AltOlyCPeriod", 21600000);
ALT_OL... | 1 |
7bf4ff05e7b9c9339fa9e9dc2290aef7 | b85dea54df2a4ecb64830ccebd597c30 | Total waiting time in route | total_tt = 0.0
for lid in p.links:
total_tt += links[lid]['length'] / links[lid]['speed_limit']
total_tt -= p.start.offset / links[p.links[0]]['speed_limit']
end_link_length = links[p.links[-1]]['length']
total_tt -= (end_link_length - p.end.offset) \
/ links[p.links[-1]]['sp... | 0 |
3ef58831ca2c6e5b0f66638c327078bc | 0ab5e67ad43793a84e5aa9925ed37125 | 按照总分排序 | void sortbyall(user *stuhead){
user *p=stuhead->next;
user *q=p->next;
struct userinfo temp;
while(p->next){
while(q){
if(q->data.all > p->data.all){
temp=p->data;
p->data=q->data;
q->data=temp;
}
q=q->next;
}
p=p->next;
q=p->next;
}
} | 1 |
0e0d793d1a5845268e57160e0f6d9256 | a2489e11cdb61ddfa2cf54544eef9f92 | Converts a CLR typename to VB or C# type name. Type must passed in as plain name
not in full system format. | {
switch (typeName)
{
case "byte[]":
return "Binary";
case "bool":
return "Boolean";
case "byte":
return "Byte";
case "TimeSpan":
return "Time";
case "decimal":
... | 1 |
e6cf605b6e4dd39c82e3acb1e1755d47 | 87195b0a9c5fa1537c93bf4c9143ee2e | Calculates resize and superres params for next frame | val supportPreviewSizes = params.supportedPreviewSizes.map { RecorderSize(it.height, it.width) }
val screenProp = height / width.toFloat()
val optimalSize = getBestSize(supportPreviewSizes, 1000, screenProp)
this.svWidth = optimalSize.width
this.svHeight = optimalSize.height
... | 0 |
f40af996fab014c32d4fa7c9e9cfbac2 | 9e8d39e183309fe3fc194db864057453 | Exit a parse tree produced by {@link Verilog2001Parser#list_of_net_identifiers}. | public class VerilogParserBaseListener implements VerilogParserListener
@Override public void exitHierarchical_net_identifier(VerilogParser.Hierarchical_net_identifierContext ctx) { } | 0 |
63012f7d1a2b1414f347bc6d1862c6d4 | 73b625e6ba149688d563fd16716d655c | Returns the view count of this message boards thread. | class forum_topic extends reflex
public function countViews() {
return $this->data("views");
} | 1 |
cb3e1a16c5a45fbcc1318fa0af97707f | 19f93536df04df476e71f39f68506f66 | Get the NEMO output directory | def dat_dir():
return os.environ.get('FOMOSPEC_DIR') | 0 |
ddc7f45cc2177b4310e30af843885b56 | 874722fb08d4a90fcf9941a2c5dab00d | Push vote to webservice | @POST("/addvote")
Call<Void> createVote(@Body Vote vote); | 1 |
6331a0008aecaa5031e2a08b5d7b19c3 | 5419363bbceb39702e1ccf1f46039c68 | Esse metodo lista os erros, retornando-os em forma de string | {
$errors = Arr::has($this->data, $this->pathError . '.Codigo') ? [Arr::get($this->data, $this->pathError, [])] : Arr::get($this->data, $this->pathError, []);
$lines = [];
foreach ($errors as $err) {
$lines[] = sprintf('%s: %s', Arr::get($err, 'Codigo', ''), Arr::get($err, 'Mensa... | 1 |
8348a8c549f708f0f0fff7484a77e7f2 | af62f3f3261e3b58b7c59dd203d50643 | Generator to yield an item and the next item. | for i in xrange(0, len(items), 2):
yield (items[i], items[i+1])
raise StopIteration | 1 |
34c9884b47bce77eccf796e4a249cc3a | 287c4bfda28599a00cfe385a334392da | Cette méthode montre comment obtenir une liste des stocks d'article par dépot en utilisant l'ensemble des paramètres. | RequeteGestionStock rq = RequeteGestionStock.getInstance();
System.out.println("Requete: " + rq);
List<Produit> allProduits = rq.ensProduits();
System.out.printf("ensProduits() = [%d] %s\n", allProduits.size(), allProduits);
List<Produit> shirts = rq.ensProduits("T-SHIrT");
... | 0 |
4189397e10f38ab72aa8e47dca515689 | 37a94ce8da994da8857194e95565f383 | Finds all possible black pawn moves | if self._nextPlayer == self._BLACK:
bitP = self._bbB
bitO = self._bbW
else:
bitO = self._bbB
bitP = self._bbW
moves = 0
open = ~(bitP | bitO)
captured = 0
captured = self.shiftN(bitP) & bitO
for i in range(7):
... | 0 |
94ef9e06afc6576bbb078fe7873b8b2e | db413db16af8e522cb40901d70a1c662 | Check if a post is published. | class _PostBase(object):
def is_published(self):
return self.can_read(AnonymousUser()) | 1 |
0fbda6bba6d20f2bc0f6d673f44c802a | f0a172282c010efe993b9fe13417c58f | 默认选中第一行 | let { rowSelect } = this.props;
if (rowSelect) {
this.selectFirstRow();
}
} | 1 |
e36195cdb3c14533d68ff085838dcb07 | 00a073a22ef4b21e1d882f5837384b35 | 查询跟节点数据。 | const query = req.query;
let result = APIS.getBaseResponse();
if (!query._name || typeof query._name !== 'string' ||
!(query._name in COMMON._NAMES) ||
!query.node_id || typeof query.node_id !== 'string') {
result.message = '参数无效';
res.send(result);
return;
}
try {
... | 0 |
2ba435edf558416cb18af616c874e81f | 832265202e06d045ea6e434d23273b37 | 设置是否模拟 | fun setSimulateColorSpaceState(context: Context, state: Boolean, callBack: ExceptionCallBack? = null): Boolean {
val cr = context.contentResolver
try {
return if (state && !getSimulateColorSpaceState(context)) {
val enable = Settings.Secure.putInt(cr, "accessibility_display_d... | 1 |
6134cd7642ed4047ccccd32a1b1396c3 | 571375826117e67b2dd62217441a8dcd | Test filtering with specified IDs, with and without inverting. | args = [DataPath, "--output", self.outPath,
"--one", "visit=1", "filter=g",
"--two", "visit=2", "filter=g",
]
retVal = ExampleMultipleIdTask.parseAndRun(args=args)
self.assertEqual(len(retVal.resultList), 1) | 0 |
90a8752a46740ef9d58dadd29445f6cd | a674c8623bb3c6a403445e300bdb826f | Price using Closed-Form analytic | def price(k, us):
return S * (u ** (2 * us - k)) | 1 |
3aa0ace61e7fffcb8e74c4b0052086e2 | 4dd45da8d72b0a306c42197807763464 | Request a loan extension | params = {'token': self.token}
r = requests.put(f'{self.base_url}/users/{self.username}/loans/{loan_id}', params=params)
data = {'response': r.json(), 'status_code': r.status_code}
return data | 1 |
024c3511516f58cfb3ae467c24a472db | eb2a0f4c72f888b27aa3fa01516bb72e | 設定RF工作區域 | RF_RET_t Rf_SetWorkState( RF_STATE_t a_tState)
{
return RF_RET_OK;
} | 0 |
67e61d8b607facf5b5d67a606b4f5832 | d9b8b6b51633ea539fe58c256d4ec60e | # Calculate the dimensions of the graphs and related viewppoints | fix_dimension(layer.root,
row = list(id = c(0, 2, 3),
value = c(prefer_height(meta$main),
prefer_height(meta$xlabels),
prefer_height(meta$xlab))),
c... | 1 |
38e346539f400bbc56f923bd94657163 | 5bd9de003954cd7c921fcfa6956a7aa6 | Get the [website] column value. | class Application_Model_GuestbookEntry
public function getWebsite()
{
return $this->_website;
} | 1 |
b67f3348a125971e5d259d50e053962e | cc8080a19f9beff7789ccc9d8e421e80 | Returns object delta comprising both primary delta and (all) secondary deltas, merged together.
The returned object is (kind of) immutable. Changing it may do strange things, but most likely the changes will be lost. | ObjectDelta<ShadowType> getSyncDelta(); | 1 |
2d99f7c5c6f44cd936a82b8029440347 | bb870e62fa7d819f1dc144c27d7cb448 | Build a whisper network packet. | class EthJsonRpc:
def shh_post(self, topics, payload, priority, ttl, _from=None, to=None):
whisper_object = {
'from': _from,
'to': to,
'topics': topics,
'payload': payload,
'priority': priority,
'ttl': ttl
}
return self._cal... | 1 |
dc2bc8492a138b9c28aa931340f11749 | 084a0826aaee082ea0cc290b483efada | Creates a new hash calculator based on request and api key | class FyberGateway
class HashCalculator
def initialize(params, api_key)
@params = params
@api_key = api_key
end | 1 |
33e8e2fc120204aeffbf79268131ff86 | 688ffccee2f44836c39c21f91f1cfef3 | Connect the sync client to a Python script. | self.pynba = DataCollector(self._scriptname,
self._hostname,
self._schema,
self.config.get('tags', {}))
self.pynba.start()
LOCAL_STACK.pynba = self.pynba
self.resources = resource.get... | 0 |
17a459bfcb2df52ee61c3a652fc16260 | 13e7b12a0100c744e07e93bbc3c8d6b6 | 返回true,当运行时使用的是没有加载phpdbg SAPI的PHP。 | {
return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
} | 0 |
876db17e5e893d4e7450ed4d3c1a8668 | f495c6618439edc9ebd61c9c7079f27d | Dummy method for the inherited classes | class TimingReport
def doHeader; raise MESS; end | 1 |
1ba4a7f949c6c9a2ec3b6d8bb80cbc07 | 750c51d9aa2f523dbc8018958c065536 | Puan Tablosundaki Puanları Getirir. | namespace Website.Scores.Controllers
public class ScoreController : BaseApiController
public List<Score> Get()
{
return base.ScoreService.Get();
} | 1 |
788cd68835d776f24557d7100d85e94e | b74f89f23cdeaca6dc27bf0463089ab1 | Only remote IP and port address are used for equality | class Server(abc.ABC):
def __eq__(self, other) -> bool:
return self.ip == other.ip and self.port == other.port | 1 |
f58400cbc30d4f6825450417c7c927df | 536f1d0bd1dff766fdeefd82f81bc669 | Generate test and build modules for a single package. | pkg, err := build.ImportDir(".", 0)
if err != nil {
return err
}
return buildTestPackage(pkg, dir)
} | 1 |
b7c9ba64c5206d4ed4527379a1803102 | 86f0a738255a03c521313980dbd01e45 | Shortcut function to return redirect response.
The HTTP response status code 302 Found is a common way of
performing a redirection. | public function back($fallbackUrl = '', $status = Response::HTTP_FOUND, $headers = []); | 1 |
02f750aa463ff61f29fb261df517b9e9 | b6841e27f4857b95a7b611ce175d4e99 | + correction offsets, so the squence is centered around (0,0) | public class GblTrajectory
void defineOffsets() {
for (int iTraj = 0; iTraj < numTrajectories; ++iTraj) {
List<GblPoint> list = thePoints.get(iTraj);
int size = list.size();
list.get(0).setOffset(numOffsets++);
for (int i = 1; i < size - 1; ++i) {
... | 0 |
3111d7d5d63cefaceb11b6fda7ad38f3 | 95dec19715146b9f3899dfac41c5dd37 | 加密规则,有缓存优先用缓存 | class Cacheapi
public function urlrule_cache() {
D("Urlrule")->public_cache_urlrule();
} | 0 |
664f720477526a29e521a42828c0a86f | 87c0226d3826a4f48e5ff1f58dc978bf | 按照文件大小或者按照时间进行排序,返回排序后的文件列表 | file_list = []
for file in os.listdir(path):
if type == "lt":
if getsize(path + file) < size:
file_list.append(file)
elif type == "gt":
if getsize(path + file) > size:
file_list.append(file)
else:
raise Exception("type e... | 0 |
a9e9ba16aaad6c272df4f7ae00cc81ca | 5afa9c4cfb4f478eb111ccd72efcb8ce | Elimina articulo en Entradas y Salias actualiza las cantidades en Inventarios | $id = $validator->getVar('key_articulo');
$cantidad = $validator->getVar('cantidad');
$id_articulo = $validator->getVar('id_articulo');
$id_pedido = $validator->getVar('id_pedido');
$eliminar = $validator->getVar('eliminar');
$item = Doctrine::getTable('ArticulosPedido')->findOneById($id);
if(count($item)... | 0 |
df3b3bea0fab7968b5cbb4a5f357739b | d4f8cb9e58fd0de912635702d9beb945 | 获取文件的子文件个数,除掉了隐藏文件 | if (!file.isDirectory()) return -1;
File[] files = file.listFiles();
if (files == null) return -2;
return files.length;
} | 0 |
3400906b6ead1d71c11b573e8588ebea | 746fc8709dea608b3205eea0418eb2ca | 根据三方债权ID获取记录条数 | public abstract BigDecimal creditorYjqAmountCount(CreditorQuery creditorQuery)
throws Throwable; | 0 |
872481fe22185364f3dfae7e8dd01023 | d3c78f6eea730b5da7243bf679bb74e1 | Lookup a pointer to an ANSI C function. | PF
name_function(const char *fname)
{
struct funmap *fn;
for (fn = funs; fn != NULL; fn = fn->fn_next) {
if (strcmp(fn->fn_name, fname) == 0)
return (fn->fn_funct);
}
return (NULL);
} | 1 |
9f4e492a7ed7e2fb1abed1cabb1c4537 | c8c91d92ad702f9e7dbef02c556fe55b | Check balance of tree. | if not root or (not root.left and not root.right):
return False
total = self.get_sum(root)
left_check, _ = self.check(root.left, total)
right_check, _ = self.check(root.right, total)
return left_check or right_check | 0 |
e2dc81199a88187f59ec42a487185640 | b2107d32378c2c3a78bd6b169fe20dbe | Roughly test deconvolution performance. | def test_denoise_tv_chambolle_3d():
x, y, z = np.ogrid[0:40, 0:40, 0:40]
mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2
mask = 100 * mask.astype(np.float)
mask += 60
mask += 20 * np.random.rand(*mask.shape)
mask[mask < 0] = 0
mask[mask > 255] = 255
res = restoration.denoise_tv_cha... | 0 |
172dd45caa921deef23d734693c2ea39 | 4e57ab489c648eadf96d592e171943b1 | Sets the id of the kitchen | public class Drinks
public final void setId(String id) {
mId = id;
} | 0 |
b1a4ea289dac36dd848665a0fb78d40d | 9fa549b685e1b5ea19fd3e5f0d7164de | If this is set to <tt>true</tt> then the component will appear with a
thick outline. Otherwise, it appears with a normal outline. This
overrides compounded and restricted settings.
<tt>true</tt> if the component is to appear with a thick
outline. The default is <tt>false</tt>. | public class XYTextAnnotation extends AbstractXYAnnotation
implements Cloneable, PublicCloneable, Serializable
public boolean isOutlineVisible() {
return this.outlineVisible;
} | 1 |
7fa37d2809b3be616b31a517b05f81f7 | 0d234eca128f06e6cde08b2971a7b682 | подключение к случайной комнате | public class manage1 : MonoBehaviour
void OnJoinedLobby()
{
PhotonNetwork.JoinRandomRoom();
} | 1 |
6f7dfdde6b4fc89ffd495806a6424b35 | b314d7a8361cb72e1d313400cac36e1b | Returns all won offers. | class CalculationResultRow
public function getOffers()
{
return $this->offers;
} | 0 |
51a8a5e43fc9b0030271d0703fd59c9a | e4e9c875e445b368928695e75b2f0334 | Calculates beta distribution probability value for x using a and b parameter values. | namespace MathNet.Numerics.Distributions
public class Beta : IContinuousDistribution
public double Density(double x)
{
return PDF(_shapeA, _shapeB, x);
} | 1 |
854fd26acd8658d8dc4c9fe27e7d3c4a | f8acd7a343c22b6d214afec899f2269e | Inserta una venta a la lista de manera ordenada. | namespace DAL
int insertSale(string saleToInsert); | 0 |
b4c8fcd36bd92f147a8463a0135433ed | b88af1932d23c5d4a174106bae107339 | Returns the names of columns that have binary or *blob types. | class Dataset:
def bool_columns(self) -> Set[str]:
return self._columns_type.bool_cols | 0 |
020bd6336ac83a8485d502c9fcdcecac | 5d57c3540e07a331b69524678908f04e | Returns the table's name | class Table extends Varien
public function getName() {
return $this->_name;
} | 1 |
34d0343741e2cedaf374464e30c302dd | a1860c2b3e9e2a154c9eb8a8b4ea4a4b | Test that reads and writes from a single process are handled
correctly. | TEST_F(UnsynchronizedWriteClientMultiProcess, MultipleReadersAfterOverflow) {
const size_t dataLen = 16;
pid_t pid;
if ((pid = fork()) == 0) {
sp<ITestMsgQ> testService;
MessageQueueUnsync* queue = nullptr;
getQueue(&queue, &testService, true );
ASSERT_NE(testService, nullpt... | 0 |
b9525859f856ada542999beed8968804 | 1cfa8bd03e89391e7ac7227c5079e853 | 按天获取订单量 | @Service("orderService")
public class OrderServiceImpl implements IOrderService
public int getDayOrder(Map<String, Object> map) {
return (int) this.orderDaoImpl.getNumber(map,"getDayOrder");
} | 1 |
e7f9aeb71126a9d93ff89e7fca44d435 | a1968c5c060763b90442122e49350600 | check the input and output devices, find matching srs | class ASIOAudioIODeviceType : public AudioIODeviceType
AudioIODevice* createDevice (const String& outputDeviceName,
const String& inputDeviceName) override
{
jassert (inputDeviceName == outputDeviceName || outputDeviceName.isEmpty() || inputDeviceName.isEmpty());
ja... | 1 |
6eb5a4a831def51f8020e67f9c989d1c | 152f17b4325eb4c5bf28a6d5160bb4e3 | retrieves a single record (header, sequence) from FASTA file | with open("./input_data/" + input_file) as in_handle:
for title, seq in SimpleFastaParser(in_handle):
ref_seq = seq
ref_seq_id = title
break
return ref_seq, ref_seq_id | 1 |
80b600b169a72de38ffdef21274a4d27 | 450c7057db5e5624e96b3013b60f2b88 | Remove object_type foreign key to notifications.
Make sure the object_type in notifications is the same string field as in all
other polymorphic tables and remove the now obsolete object_types tabele. | class UpdateNotificationsTable extends Migration
public function down()
{
Schema::table('notifications', function($table)
{
$table->dropColumn('from_id');
$table->string('from');
$table->dropColumn('value');
});
} | 0 |
6057229242907cfdcffeef53a2e43da2 | b3b14172324700ebed2dbfcf0ee07234 | zipの解凍先フォルダを取得します。 | {
if (string.IsNullOrEmpty(zipDirectory))
{
zipDirectory = new FileInfo(sourceFilePath).DirectoryName;
}
if (string.IsNullOrEmpty(zipName))
{
zipName = new FileInfo(sourceFilePath).Name;
}
return ... | 0 |
021cdb80bb3eb55b9a71365a21c72776 | 0e52e97eaf4e1738efde29e63e3104bc | 商户订单详情,订单号为不存在 | public class OrderTestFrom4
@Test
@Order(13)
public void addShopOrderMessageTest1() throws Exception {
String token = this.login("13088admin", "123456");
byte[] ret = manageClient.put()
.uri("/order/shops/3/orders/66666666")
.header("authorization", token)
... | 1 |
6af1d834e9c2724c522bc90b905606f7 | 9a13a2d85d4aed6fc43507234f2b855b | Generate a list of broadcast axes for ngraph++ broadcast.
Informally, a broadcast "adds" axes to the input tensor,
replicating elements from the input tensor as needed to fill the new dimensions.
Function calculate which of the output axes are added in this way. | float32_size = 4
ub_size = cce.cce_conf.get_soc_spec(cce.cce_conf.UB_SIZE)/float32_size
shape_n = shape[len(shape)-2]
shape_k = shape[len(shape)-1]
n_axis_outer = 1
k_axis_outer = 1
n_axis_inner = shape_n
k_axis_inner = shape_k
min_m_axis = 1
min_k_axis = 2
if _get_restrictio... | 0 |
bdd71e095b9d7256ec495bd819b1ed3d | 5f949d9cf805162f5b222d556907a98d | Distance calculation using Pearson Correlation Score | first_list_size = len(first_list)
second_list_size = len(second_list)
if(first_list_size != second_list_size):
return 0
for item1,item2 in zip(first_list,second_list):
if((not isinstance(item1,(int,float))) or (not isinstance(item2,(int,float)))):
return 0
first_list_mean... | 1 |
db0c487fffd56f7c736bf42656bec14a | 70128f2cd3a9a7043fbeb743e5b26dee | Prints from first row to the number specified. Inclusive range. | {
Console.WriteLine("Enter a number: ");
int N = int.Parse(Console.ReadLine());
for (int i = 1; i <= N; i++)
{
Console.WriteLine(i);
}
} | 1 |
b5efa4579bc53b44ed45198cc5395925 | ccb1d57d940c3768a67bf3ea4c56ba12 | convert a cents value to decimal | function convertToCents($value) {
$value = preg_replace("/\,/i","",$value);
$value = preg_replace("/([^0-9\.])/i","",$value);
if (!is_numeric($value))
{
return 0.00;
}
$value = (float)$value;
return round($value,2)*100;
} | 0 |
9870dc86f4d90a89738d39f2e2e54a6a | 4d42a5c54a78c077a6ef0f3041eae3fd | Takes in a tweet and replaces html character codes with their ASCII equivalent. | def removeNonAscii(tweet):
encoded_string = tweet.encode("ascii", "ignore")
return encoded_string.decode() | 0 |
6da79d613894dbad324fff365dd2b2cc | 55945b4994dce46dfef9e9773875b039 | This API is used to rename an advanced DDoS policy. | class Client extends abstract_client_1.AbstractClient
async ModifyDDoSPolicyName(req, cb) {
return this.request("ModifyDDoSPolicyName", req, cb);
} | 1 |
96f441a7450b0f41bd56a314d14fdaa9 | a1b5572a0b99eab8d8ebc88023303cd9 | Returns the route sections for all the lines that service the given stop point ids | export class APIRequests
public webRoutesForStop(stopCode: string, ...params: any[]) {
return this.requestFunction<IRouteOfStop[] | null>(
API_URL,
`webRoutesForStop&p1=${stopCode}`,
...params
);
} | 1 |
c2b641c3a034494e3b13c6341c3c5847 | a8b6cc1a2bd820b0439aca555736dd6b | Cancels a failed deletion of a Certificate from the specified Account.
If you try to delete a Certificate that is being used by a Pool or Compute Node, the status of the Certificate changes to deleteFailed. If you decide that you want to continue using the Certificate, you can use this operation to set the status of th... | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String managedInstanceName, String certificateName, Context context); | 0 |
fab9a0a176a1a94836e9b1b7adfb3ca3 | b168bb9de405200334ae7bf9d5cf200d | are there no multiple-consecutive spaces? | bool ret;
if (line.find(' ') != std::string::npos){
if (line.find(' ', line.find(' ') + 1) != std::string::npos){
ret = true;
} else {
ret = false;
}
} else {
ret = false;
}
return ret;
} | 0 |
df33563912210db9a81267ba3035ba4e | b56b59e3568538d35bff391d326d4f8d | Complete synchronous transfer | {
isTransferCompleted = false;
DRIVER_MASTER_SPI.Transfer(tx_buff, rx_buff, transfer_length);
while(!isTransferCompleted)
{
}
return 0;
} | 1 |
28e382b514b3a2ae7faa56d109e93e30 | dab3b8bcd234a1fb0f14bb62d1e51487 | Computes the distance between this and another vector | impl Vec3D
pub fn distance_to(&self, other: Vec3D) -> f64 {
(*self - other).mag()
} | 1 |
bafe8cd28fd5d10949791c89dddee5ea | cc3a6588959e5f72e0166f271e21c110 | ALLOCATE-BYTE-VECTOR-16 | Object g2int_byte_vector_16_memory_usage()
{
x_note_fn_call(20,73);
return VALUES_1(G2int_bytes_in_allocated_byte_vector_16_vectors);
} | 0 |
19923fa45d9017fa8678034b60ee8c40 | ca3666a1a697226d01cb9452f1fed948 | 根据ip 获取真实地址 | import('ORG.Net.IpLocation');
$Ip = new IpLocation();
$location = $Ip->getlocation($ip);
$returnInfo = $location;
if(!$returnInfo){
$ipToAdd = M('ipToAddress');
$condition = $this->ipToArr($ip);
$ipToAddInfo = $ipToAdd->where($condition)->find();
$returnInfo = $ipToAddInfo['address'];
}
if(... | 1 |
e6f3824655fa8eec2a306951fff265b0 | ef121903c9c4fd26612d3898183d8c35 | 取消作业调度器休眠状态(强制唤醒) | export default class FactoryBase extends RoomAccessor<FactoryMemory>
public wakeup(): OK | ERR_NOT_FOUND{
if (!this.memory) return ERR_NOT_FOUND
delete this.memory.sleep
delete this.memory.sleepReason
} | 1 |
92117df7df817634f1a5612e244bae31 | 266fc6f0257d65aea42b799c0c606718 | 获取用章人所在部门或科室 | {
UserEntity userEntity = GetEntity(userId);
DepartmentEntity dept = new DepartmentEntity();
string roleName = GetObjectName(userEntity.UserId, 2);
DataTable dt = null;
string deptType = "厂级";
if (roleName.Contains("班组") || roleName.Contain... | 1 |
f32d1ccd3ae0406e8971a8b13b8ba970 | 1656e16411d3101046852263aa7f138e | loads all disconnected numbers | {
RefreshLines ();
TracingPart [] tracingParts = numbers [currnumindex].GetComponents<TracingPart> ();
foreach (TracingPart part in tracingParts) {
part.succeded = false;
}
if (hand != null)
hand.GetComponent<SpriteRenderer> ().enabled = true;
numberdone = false;
} | 0 |
d76b44d9b396eb15960d93bb1a39a38d | ea3925c7eb123503e1719ab6f817581a | Function to convert the linear version of the color to a sRGB color value. | namespace Dash
FColor FLinearColor::ToFColor(const bool bSRGB) const
{
float FloatR = FMath::Clamp(r, 0.0f, 1.0f);
float FloatG = FMath::Clamp(g, 0.0f, 1.0f);
float FloatB = FMath::Clamp(b, 0.0f, 1.0f);
float FloatA = FMath::Clamp(a, 0.0f, 1.0f);
if (bSRGB)
{
FloatR = FloatR <= 0.0031308f ? FloatR * 12.... | 1 |
b828706a984fe16f1451d7f7f60012e5 | e51fa3f5e81309f680988292b2eb2142 | Get the Keplerian mean motion.
<p>The Keplerian mean motion is computed directly from semi major axis
and central acceleration constant.</p> | fn calculate_mean_motion(a: f32) -> f32 {
(GRAVITATIONAL_CONSTANT * MASS_SUN / ((a * ASTRONOMICAL_UNIT).powi(3))).sqrt()
} | 1 |
a8b228a122c8e567285931fe6b97ffe4 | 926de75f9ee94f150573e23192d6184d | Calculate all depth of field numbers | def load_num_depths(filename):
with h5py.File(filename, "r") as h5f:
return h5f["ROIdata/Config/Depth"][0][0].astype(int) | 0 |
84c32fd9538775b894f7140534a961d7 | 1d67278f274a3eb09276e7dd6a69fb5c | Процедура обмена указателей | int swap(int *&a,int *&b)
{
int *c = NULL;
c = a;
a = b;
b = c;
return 0;
} | 1 |
283d45a7074d1cf9fdbe66e3f03372a8 | 9ca334b0d61ee316b4f46289e124a6ea | Busca níveis da tabela para verificação e validação | namespace Globosat.Library.Servicos
public class ManipularDados
public static DataTable BuscaNiveisTabelaSalarial(string coligada, string codigoTabela)
{
return AcessoDados.AcessoDados.GetNivelTabelaSalarial(codigoTabela, coligada);
} | 1 |
7c9eb46831d75fbc982ba93ab653170b | 353aff0cc2a72f6a3995277bd32c794c | fungsi yang digunakan untuk melihat daftar grup kuis : manajemen grup kuis | class KelasController extends Controller
public function index()
{
return view('administrator.kelas.index');
} | 0 |
bb841dfe65d55399f34e008ce0afeed4 | 8298a11c29ba2b3a22663671824c102f | Commit current buffer to memory.
Switch buffers. | {
int ret = swap_buffers(curr_pibr, new_pid);
if (ret && curr_pibr)
flush_buffer(PIBR_PTR(curr_pibr));
} | 1 |
468a2b714c945a659b861019756e2fbe | 821bac556119e1a2c3b4f2724b0b4844 | Converge on remeshed result as quickly as possible | namespace UnityMeshSimplifier
public sealed class MeshSimplifier
public void SimplifyMeshLossless()
{
int deletedTris = 0;
ResizableArray<bool> deleted0 = new ResizableArray<bool>(0);
ResizableArray<bool> deleted1 = new ResizableArray<bool>(0);
var triangles =... | 1 |
fa95fd808fabfd7f4ac64d0e1bdb1671 | dfe5aa329c49ae5f2544e8a002c9bb23 | 将模板表达式转换成 esToken 数组 | var tokens = [];
var words;
var scanner = new Scanner(templateStr);
while (!scanner.eos()) {
words = scanner.scanUnit('{{')
if (words != '') {
tokens.push(['text', words])
}
scanner.scan('{{')
words = scanner.scanUnit('}}')
if (words != '') {
... | 1 |
92794c706d2cd82e71e3ee022f0ed1cf | ccfecef8ec3e2c5dfd265e88b5b575fc | 将对象转换为sbyte类型,如果传入的对象不能转换为sbyte类型,返回0 | {
sbyte result = 0;
if (string.IsNullOrEmpty(value))
{
if (!sbyte.TryParse(defautvalue, out result))
{
return 0;
}
}
else
{
if (!sbyte.TryParse(value, o... | 1 |
905d34b43f49c7470f1b39e7c4cc63f6 | caa4f46e0e0a38bcd0a1567ecb99cba8 | You should add the value into index 0 (the front of the array) while maintaing the order of the rest of the array | int *newArray = new int[n];
n++;
int j = 0;
while (array[j] < value){
newArray[j] = array[j];
j++;
}
newArray[j] = value;
for (int i = j+1; i < n; i++){
newArray[i] = array[i-1];
}
} | 0 |
cff595b0e5d122b998bd0f2d2010036d | 3fcbfceb507776c345712462993358bd | Build an unreachable instruction
Unreachable instructions inform the optimizer that code below the
instruction are not reachable. This can be used to implement noreturn | void InterpreterGenerator::should_not_reach_here() {
_masm->hlt();
} | 1 |
533e5e28334ad5bbc79ee330bfcc268e | cb4b8f70fc920fb8b2a63c571fade1e9 | 组装图片路径 | var path = plugin.getLocalPath(),nowDate = kui.getCurrDate('curr_date');
path = path.replace(new RegExp('\{ORG_CODE\}','gm'), g_user.ORG_CODE);
path = path.replace(new RegExp('\{YYYY\}','gm'), nowDate.substr(0, 4));
path = path.replace(new RegExp('\{MM\}','gm'), nowDate.substr(4, 2));
path = path.replace(new ... | 1 |
4345add0fd1dc1048a23ca817440ef01 | c238bfbf38428dfd957d1ddd9ce6fa03 | Get the 'location' of the element. This is the mid point of the bounding
box for the element. For a point, this will be the coordinates of the
point itself of course. | Point2D.Double getLocation(); | 1 |
4defadbe82cb11547245ab844f08db82 | d92c6b7637356b1f61aa767f722bef4c | 获取今日发票记录 | function getcashierinvoice(num){
var model = {'daily_acc_num':num};
$("#dailyaccinvoicelist").datagrid({
url: 'getCashierDailyAccInvoiceCharge.action',
queryParams: model,
rownumbers:true,
columns:[[
{align:"center",field:"invoice_num","title":"发票号","width":20},
{align:"center",field:"... | 1 |
e15402eaf6a2d81999744dde9afbe2ee | 5d44b5101e6bcbbbea1fc62fd11aaca2 | Attaches leaflet map event handlers. | leafletMap.setLoaderContent = (content) => {
this.set('_loaderContent', content);
};
leafletMap.showLoader = () => {
leafletMap._handlers.forEach((handler) => {
handler._beforeLoaderState = handler.enabled();
if (handler._beforeLoaderState === true) {
ha... | 0 |
9a586cc0aaa7b1eaccd69c52ecd92512 | 6c8ddc07a1fb747f4f27d6e4c60bfea4 | 用于打开hello文件 | def helloWorldFile():
file = open("HelloWorld.sl","r")
fileIn = file.read()
text.delete('1.0','end')
text.insert(END,fileIn)
window.title('Slime Editor-HelloWorld.sl') | 1 |
e8486cfb658da8be99fb7706691b101e | 6c9d59048579b2c2149d2874edd0dbd8 | 현재 암호문에 연속된 중복 문자열이 포함되어있는지를 검사한다. | boolean flag = false;
String f, c = content;
char g;
char[] temps;
int length = c.length();
for (int i = 0; i < length - 1; i++) {
g = c.charAt(i);
if (Arrays.binarySearch(charFirst, g) > -1) {
tag : for (int j = i + 1; j < length; j++) {
f = c.substring(i, j);
g = c.charAt(j);
temp... | 0 |
cc1896f5005f1cede1823c2c28e9933c | 4d3c56a4332544257264c5e465e3ee08 | This method returns rows found by matching date modified fields. | return $this->load(
DB::select_array($this->fields())
->where('modified', 'IS NOT', null)
->order_by('modified', 'DESC'),
$limit
);
} | 1 |
ea4f42cbd1f2d4b9cb4310a99dde58fc | 0e5267d94f717d39544e2c7942d6d8af | Train a series of networks, then test the transferability of adversarial attacks. | flags = {
"train_start": 0,
"train_end": 5000,
"test_start": 0,
"test_end": 333,
"nb_epochs": 5,
"testing": True,
}
flags.update(
{
"batch_size": 128,
"adam_lrn": 0.001,
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.