query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d599f4b216895c1dcae404e20fa4f1e7 | ca68c5adb7c60a210fc7dcd8858253dc | Upgrades software, sets up service, and installs dependencies on base | require('environment', provided_by=env.environments)
upgrade_packages()
install_packages()
sudo("easy_install -i http://d.pypi.python.org/simple -U pip")
sudo("pip install -i http://d.pypi.python.org/simple -U virtualenv")
create_postgis_template()
create_db_user()
create_db()
create... | 1 |
b15babc44288064bfb68ce719c3cfa49 | 50b11a65ff9a14b730bf03797e2be12c | Generate uuid based content and timestamp | uuid = generate_random_uuid(24)
while True:
if uuid not in self.objects:
break
uuid = generate_random_uuid(24)
tmp = copy.deepcopy(nodeContent)
tmp[pbxtool_uuid] = uuid
self.objects[uuid] = tmp
return uuid | 0 |
72922bcce04efaf42e590134f52ccca1 | 06c4d4fcdb9068b62489a72fc23e91e7 | Enables automatic chunked transfer encoding. | impl ResponseHeaders
pub fn set_encoding(&mut self) {
self.accept_encoding = true;
} | 0 |
afcf4aefee9c122f60cf52622b492166 | 770e9efcbb49401595619b981dbd5cfc | 函数作用:对提交的编辑内容进行处理
参 数:$post: 要提交的内容
返 回 值:$post: 返回过滤后的内容 | class threadplugin_product_proposal
public function editpost_submit($fid, $tid) {
$param["funtions"] = dhtmlspecialchars(getgpc('funtions'));
$param["backgrounds"] = dhtmlspecialchars(getgpc('backgrounds'));
$param["contact"] = dhtmlspecialchars(getgpc('contact'));
$param["description... | 0 |
53e92d58c5fe1551efb7864eb277fd77 | aeeffa976350cf4b3d39a88ec8bd9d4a | Convert frequency in hertz to energy in electronvolt | def E2V(E):
return sqrt(E/5.227e-6) | 0 |
df90abeffc57dc359198394dcafb7b1b | 8c895facfbbc22a64767f6b704da9e3a | 입력받은 input의 index값을 String형의 replace로 치환한다 | if(index == (string.length-1)){
console.log('The last char')
}
var reply = string.substring(0, index) + replace + string.substring(index + 1);
console.log(reply);
return reply;
} | 1 |
8cdce51923d94c5c467baafcd49b5647 | d06f8538a064753106bedd20a6e243f8 | 自动完成功能绑定实现 | namespace YanZhiwei.DotNet.DevExpress12._1.Utilities
public static class LookUpEditHelper
public static void BindWithAutoCompletion(this LookUpEdit lue, object source, string value, string displayName, string prompttext)
{
lue.Properties.DataSource = source;
lue.Properties.DisplayMe... | 1 |
fffabd95d225f675f6b8482325246b1a | d081c9c9671a64070ed46df67951b26f | recalculates local statistics vector. | {
for(int k=stat_shape_.begin(); k<stat_shape_.end(); ++k)
{ stat_shape_[k].update(shape_[k]);
stat_scale_[k].update(scale_[k]);
}
} | 1 |
f1caf629195a83ae8da0e76f1d4e0c95 | a3b97e519eebb91694727eaf57fbb586 | Handle update of isosurfaces upon level changed | class ModelmapControll(module_template.Controll):
def _setup_gui(self):
def on_slider_changed(self, slider_level):
surface_level = (float(slider_level) / float(self._slider_length))**3
self._viewer.set_surface_level(surface_level) | 1 |
e046530f64bed0008e245c2b786a6f3b | b2f2292e8332528dda277f7e84a9322b | This function returns the 'root' of a file, which is the filename
without any path component and without an extension. E.g.:
`dir1/dir2/myfile.x90` would return `myfile`. | def base_no_ext(pth):
return path.splitext(path.basename(pth))[0] | 1 |
ffb55febe556f23a3f44746a2ea4afce | c4d2c26a2ed697507c3450d073b0f0f8 | Rejestruje klienta | class Server implements Event\EventEmitterInterface
protected function addClient(Socket $socket) {
$id = $socket->getId();
if(isset($this->clients[$id])) {
throw new \LogicException('Client already exists.');
}
$this->clients[$id] = $socket;
} | 1 |
467471fa328a46e8fa1fbf81d65cd375 | b75036487c27dd575318f012ba10942d | Avto haqidagi malumotlarni lug'at ko'rinishida qaytaruvchi funksiya | def avto_print(avto_info):
print(f"Kompaniya: {avto_info['kompaniya'].upper()}, Model: {avto_info['model'].upper()} "
f"Rangi: {avto_info['rang'].title()}, Ishlab chiqarilgan yil: {avto_info['ishlab_chiqarilgan_yili']} "
f"Bosib utgan masofa: {avto_info['masofa']}, Narhi: {avto_info['narh']}$") | 0 |
99829e0a398354051713b4e8207ede1d | 0c805bc6b29be0da871a73ee5171744e | 跳转到入驻商家 | @AccessLimit(needLogin = true, needPermission = true, permission = {2, 3})
public ModelAndView toMerchant(User user, ModelAndView modelAndView, HttpServletRequest request, HttpServletResponse response) {
if (user == null) {
modelAndView.setViewName("login");
return modelAndView;
... | 1 |
704b20ae42ec8458588c397bad67132f | 9eb0e1c5d399e50ee826e33b72d8cb0a | 이 클립을 활성화 시킨다. => 선택된 클립으로 만든다. | {
if (InitializeFile())
{
_isMove = true;
_isCopy = false;
_cutViewIndex = _activeViewIndex;
}
} | 0 |
a097f002e65f879da97cf520bb0acb99 | cd5c3ecb605df2a2c5415abd59c6a1e5 | Overview
========
Here we will clean up any pointer attributes in this class. | Attributes::~Attributes()
{
} | 0 |
28ad758c95667e569918cdbfe43aaf04 | 4cda92e68e1e8ec0376582850ee69209 | Verifies function properly updates for and agn norms. | expr = cp.pnorm(self.x, 1)
self.x.value = [-1, 0]
self.assertItemsAlmostEqual(expr.grad[self.x].toarray(), [-1, 0])
self.x.value = [0, 10]
self.assertItemsAlmostEqual(expr.grad[self.x].toarray(), [0, 1])
expr = cp.pnorm(self.x, 2)
self.x.value = [-3, 4]
se... | 1 |
f0c75a7660b82796a43707c6315ebac4 | 00884f495774527affeef877da7e0ed6 | Funkce urcuje je-li zadana cesta je souborem | {
if (!($stat = $this->getStat($path))) {
return false;
}
return 'file' === $this->getTypeFromString($stat[0]);
} | 1 |
901031bcb177a6b46c2097d3a3dec52c | ebf4be6719ed6c10886f2fb81140a5a7 | 使用户点击后能够跳转到登录页面 | public class WelcomeActivity extends Activity @Override
protected void onCreate(Bundle savedInstanceState)
public void run() {
Intent intent = new Intent(WelcomeActivity.this,LoginActivity.class);
startActivity(intent);
WelcomeActivity.this.finish();
} | 0 |
3fa80b84339535c16605045fa1b7b2b3 | b43f17ecc8a69757129ce41bc4b06f18 | 反转整个字符串
如果字符的Unicode码值大于65535,则根据字符代理规则,由两个char组成。
反转时需要将这两个char再次反转,才能符合Java字符规则,组成一个字符。 | public void ts5() {
String str = "abcdefgh";
System.out.println("原始:"+str);
StringBuffer strb = new StringBuffer(str);
String str1 = strb.reverse().toString();
System.out.println("反转:"+str1);
char[] cha = new char[str.length()];
str = "kjlshdyu";
cha = str.toCharArray();
for (int i = 0; i < cha.lengt... | 0 |
961ce7870df34f0717797078d35249b0 | 5d216f5c8a3f1d68e3da21679a3ae009 | verifica se dois pontos são vizinhos | int delt_x = abs(p1->x - p2->x);
int delt_y = abs(p1->y - p2->y);
return delt_x + delt_y == 1;
} | 1 |
e7f47b39287e8556592bea51d183abae | 93970a069d53fae9bc5a5438604b4c2c | @brief Replace @p n bits that begin at position @p p in @p x with the
rightmost @p n bits of @p y. | int nbyte = (x >> (n << 3)) & 0xFF;
int mbyte = (x >> (m << 3)) & 0xFF;
int swapmask = ~0 ^ ((0xFF << (n << 3)) | (0xFF << (m << 3)));
return (x & swapmask) | (nbyte << (m << 3)) | (mbyte << (n << 3));
} | 0 |
f91566c7b3324baf3cf1bb43d3d7ee14 | be14c493a5002bf4b8af02ba6b5a4437 | Get all the typeCds. | public java.util.List<ClipType> findAll(); | 0 |
9653aef064245ad2aea9617c2bed2731 | 9fb60aa43a2a5fd5f95798288c3dd5e7 | Retourn true si la raquette effectue un mouvment vers le haut. | public boolean directionUp(); | 1 |
f59f97b0b9587c34184b5c032a226b64 | a1469cc7224260c6145a08fc1cedf464 | app取消收藏答案 | $openId = session('?openId') ? session('openId') : $this->error('请重新获取该页面');
$quesId = session('quesid');
$COLLECT = D('CollectRecord');
$cancelResult = $COLLECT->cancel($openId,$quesId);
if($cancelResult){
$this->ajaxReturn('success');
}
} | 1 |
beee9ab7e6fc0f96f73b531cbab6d54c | 3ae91e304da13d3529ebd6f85e00407d | If present, this contains the identifier of the "media stream identification" as defined in [RFC 3388] for the m-line this candidate is associated with. | class BraviaTVMediaPlayer(BraviaTVEntity, MediaPlayerEntity):
def media_content_id(self) -> str | None:
return self.coordinator.media_content_id | 0 |
2525b7edf436e9972b6a8f985beb1b2f | e04a255a7e987e60f6a646d373cc2215 | サービスクラスのテストクラスを作成する | {
$config = new Config([
'inputFile' => $this->wsdl,
'outputDir' => null,
'namespaceName' => $this->namespace,
'soapClientClass' => $this->soapclientClass,
'soapClientOptions' => $this->soapclientOptions,
... | 1 |
03456d675fc7760a3dd79827d50988e4 | 282ff255cbc7674254199c7cf935914a | 在开始时间选取后更新结束时间可选日期 | namespace UseingEQ
public partial class EQKeepAccountsManag : Form, IPlug
void dateTimeDuan2_SelectChange(object sender, EventArgs e)
{
this.dateTimePicker3 = this.dateTimeDuan2.Start;
this.dateTimePicker4 = this.dateTimeDuan2.End;
button1_Click(null, null);
} | 0 |
b4a3c012ebf1bf0a4b65505afdef0569 | 547eea10a2dbc9d7b034de793bdf3d5c | Calculate refined compositie multiscale permutation entropy. | de_normalize=False, A=100,Mu=100,return_all=False,warns=True):
patterns_dict = {}
for scale in scales:
_,_,patterns_dicti,x_discrete,_ = dispersion_entropy(x.copy(),classes=classes,scale=scale,
emb_dim=emb_dim,delay=delay,mapping_type=mapping_type,de_normalize=... | 1 |
6c696c14068ead74145e80a5af592910 | c7d4ea4507121b87fa731ac6951af952 | Actualiza los datos de una bicicleta usada especifica. | {
$model=$this->loadModel($id);
if(isset($_POST['ModelBike']))
{
$model->attributes=array_map('strtoupper',$_POST['ModelBike']);
if($model->save())
$this->redirect(array('view','id'=>$model->id));
}
$this->render('update',array(
'model'=>$model,
));
} | 1 |
62376e0f765d5702fd1af0f20623b70b | 086ebdac40c0c42f23252c96deee250c | 방 ID로 채팅방 정보를 조회 | @RequiredArgsConstructor
@Controller
@RequestMapping("/api/chat")
public class ChatRoomController
@GetMapping("/room/{roomId}")
@ResponseBody
public ChatRoom roomInfo(@PathVariable String roomId) {
return chatRoomRepository.findRoomById(roomId);
} | 1 |
070ba9a23f429cdafac1e6a756daccb3 | 3dbbd7dec5189c45019821d371d53055 | 虚拟币付费订单(仅课程、班级订单) | class fy_lessonv2ModuleSite extends WeModuleSite
public function doWebViporder() {
$this->__web(__FUNCTION__);
} | 0 |
1657540701ba8c7dba48484979ad95ba | b71ebcd762231d54f51de47a19501e27 | Get the active configuration descriptor for the specified USB device. | usb_config_descriptor ( struct usb_device *usb, unsigned int index,
struct usb_configuration_descriptor **config ) {
struct usb_configuration_descriptor partial;
size_t len;
int rc;
if ( ( rc = usb_get_config_descriptor ( usb, index, &partial,
sizeof ( partial ) ) ) != 0 ) {
DBGC ( usb, "USB %s could not... | 1 |
baab7b03f16dbf771ae0f5505e9c4700 | aef06134e41ade706523f73576b4246c | Sets the overall_status of this Status. | void unsetOverallStatusCode(); | 0 |
9031505fd4a9f11298843efd6dacf74c | b6d1c5d4375f01371eba1a39e03a09ec | 按照windows的文件名排序规则,如11.jpg会大于2.jpg
https://docs.microsoft.com/zh-cn/windows/win32/api/shlwapi/nf-shlwapi-strcmplogicalw
Returns 1 if the string pointed to by psz1 has a greater value than that pointed to by psz2.
Returns -1 if the string pointed to by psz1 has a lesser value than that pointed to by psz2. | namespace Win7FTP
public class FilesNameComparerClass
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
private static extern int StrCmpLogicalW(string psz1, string psz2); | 1 |
d763c4a05357c753233707e17d59a72b | 0d98eec673c596dc4c094f5cb3cad112 | Randomly samples <n> observations from a given set of data w/o replacement | def SelectNWithoutReplacement(domain, N):
random.shuffle(domain)
return domain[:N] | 1 |
a1c06030a171e7459352bdff4eb6adf2 | 6cfe3294f80cbb9463cdc0b259ea141d | Function to prune concurrent events and generate pruned dfg.
Returns a | def prune_features(module_list, conv_threshold, prune_way, minimum_channels=8, divisor=8):
new_module_list = list()
out_filters = 512
out_idx = None
idx = len(module_list) - 1
while idx > 3:
if isinstance(module_list[idx], nn.ReLU):
conv2d, batchnorm2d, relu, out_filters, out_idx... | 0 |
0aac9ad3d554c1a88cba86283edfc453 | 522030a68d45848ab4ea26eba4e3d302 | [fnc] Provide sprintf() format string for specified attribute type in XML | const char* ROMEUtilities::GetFormat(const type_info &t)
{
if (t == typeid(char) ||
t == typeid(unsigned char)) {
return "%c";
} else if (t == typeid(short) ||
t == typeid(int)) {
return "%d";
} else if (t == typeid(unsigned short) ||
t == typeid(unsigned int)) {
... | 1 |
e16c3614fcf99309b7c27c63660f9edb | 6e9d32c3cf177e6cc93afa11a3f0f667 | Tests that a Key Vault can be backed up. | @MethodSource("com.azure.security.keyvault.administration.KeyVaultAdministrationClientTestBase#createHttpClients")
public void beginBackup(HttpClient httpClient) {
if (getTestMode() != TestMode.PLAYBACK) {
return;
}
client = getClientBuilder(httpClient, false).buildClient();
... | 1 |
0ca710cbdb540900a39ca0329cdc08ab | 72b688e760bd6ced899bdbda4597cdc6 | Get 渠道商户号。外部平台接入云企付平台下发。必填。 | public class QueryOpenBankExternalSubMerchantRegistrationRequest extends AbstractModel{
public String getChannelRegistrationNo() {
return this.ChannelRegistrationNo;
} | 1 |
3865eebbeb91c9f6e331e81bd67f7eae | 4c1477692cb622005ed985fbc2241dd2 | Clear the input field when the user presses Esc | const targetInput: HTMLInputElement = event.target as HTMLInputElement;
targetInput.value = '';
} | 0 |
8653cb9232a6f6ce6e183bd014e4ab72 | 78338391bc8f97246bc165d5de4a976d | EQUIP_SPIRIT_LOCK单体模式 | namespace GameServer.Net
public partial class ClientToGameServerAction
void Equip_streng(ClientToGameServerMessage e)
{
CS_equip_streng msg = e.Msg as CS_equip_streng;
} | 0 |
b715d7f3c22a11dddb8a1c0029d73bbf | 721a19d8e8249d43f8f6236681a84a63 | returns a group to which the page belongs
0 - closer than a page with an medium distance
1 - closer than 20% most further pages
2 - in the last 20% | w = self.width
h = self.height
bw = self.big.width * 0.5
bh = self.big.height * 0.5
if (w > bw) and (h > bw):
return 2
elif (h > bh and w <= bw) or (w>bh and h<=bw) or (h>bw and w<=bh) or (w>bw and h < bh):
return 1.5
else:
retu... | 0 |
ae109d2fb316ef977861da6fc6454fb5 | 53b0100c70c3083c5de63935421d9f6f | Cambia el estado del modal de login, es decir si se debe mostrar o no. | export class LocationSendingComponent implements OnInit
changeLoginModalState(state:boolean){
this.loginModalVisible = state;
} | 1 |
62fe45a3c01bcee83379bbb49b8a972e | 2613e9529f88439f4bd3f4405c376e8b | adds total hours for this timesheet row. | public void addHours(int hour, int id) {
dao.addHours(hour, id);
} | 1 |
2bf5c00880c65a412bde865a3485ed4c | db31c2f3c20873775ce2bc586804b391 | 查詢特定會員某段時間的交易紀錄 | class EbaySeller extends EbatNs_Environment
public function getSellerTransactions($info){
require_once 'GetSellerTransactionsRequestType.php';
$req = new GetSellerTransactionsRequestType();
date_default_timezone_set('Europe/London');
$from_date = date("Y-m-d H:i:s",strtotime('-'.$info['from_time'... | 1 |
140da965f58454e2787ee3289c1d17ee | 56b3af0e04b1ee3619fa488ba5f53f7b | Getter of all filtered application users. | public final void getFilteredApplicationData(
final HttpServletRequest httpServletRequest,
final HttpServletResponse httpServletResponse,
final Model model,
@ModelAttribute(ALL_APPLICATION_FILTER_MODAL) final AllApplicationFilterDto allApplicationFilterDto,
final BindingResult result, final Locale local... | 0 |
ef9a0ac311f58cc3542050de28f8ead8 | 10dd490d350e49a2296a6bae54f25fc8 | Example from https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/10RootFinding/bisection/examples.html | int main(int nbargs, char* args[]) {
double f = 1.0;
void *par;
par = (void *) &f;
clock_t mClock;
double root;
printf("The actual root is %15.15f\n", sqrt(2.0));
if (bisection(myfct, par, 2, 0.0, 2.0, 1.0E-14, &root, mClock) == 1) {
printf("Root found by bissection at x = %15.15f\n \t found in %12.4f milli... | 1 |
8494575a6fe18bb4b698e3bf449de398 | 906db2510c255588c2786e44b246035a | opens the StaSh homepage. | class MainApplication(QMainWindow, Logger.ClassLogger):
def gotoHomepage(self):
url = QUrl('%s://%s:%s/index.php' % ( UCI.instance().getScheme(),
UCI.instance().getHttpAddress(),
UCI.instance().getHttpPort()
... | 1 |
86af17c0053493b6d086fe12622e6c98 | 3e82beb6c1d6860a0f75cb802d8ae67f | A single unit of the selected product is removed. | function ProductDetailController(commonService, dataService, $filter, $state, supplier, category, subCategory, units, ksAlertService, outlets)
function removeUnits(units, index) {
units.splice(index, 1);
} | 1 |
86f599315d0929ed94f381c772ab1d0d | 73d4f3a2e427e4d786b848705ed9f51a | 뒤집기 연산 | temp = [[0]*N for _ in range(N)]
for i in range(N):
for j in range(N):
temp[j][N-i-1] = arr[i][j]
return temp | 1 |
14831bb0c5edda15981d8aa53c3077d8 | 57b303032a82775929e213285aa0d83f | Decrease count of current LockForm operations | int lockCount = iLockCount.getValue();
if (lockCount > 0) {
lockCount--;
}
iLockCount.setValue(lockCount);
} | 1 |
58846afc4a8d4282ff105106b2caa656 | 7f374d5bdddd6bff0ebf3bb40ba54018 | Spawning Block: function
correct | c = random.randint(0,len(self.blocks)-1)
new_block = self.blocks[c : c + 1 ][0]
if new_block['type'] != 'O':
c = random.randint(0,len(self.rotations))
if c != len(self.rotations):
new_block = self.rotate(self.rotations[c],new_block)
topy = 0
for [x,y] in new_block['bits']:
... | 1 |
fa3626acb99659c90942b820adbf5a0e | 4f4d32531ce817fb1b8526e24d90e9e7 | 提交机票订单 | public class SingleBizPage extends FramePage
public void ticketOrderPlaced(String text1, String text2, String text3, String text4) throws Exception {
this.clickElement(addAir);
Thread.sleep(2000);
clickElement(chooseFir);
int size = this.getElements(btnOK).size();
this.clickElement(btnOK, size - 1);
Thread.... | 1 |
62873076c7b580a06ab59a3f399c2f9b | f8b15455deb374dc59fc76734f0ce635 | Invites a user to an invite-only channel. | class Master
public function channelInvite($sChannel, $sNickname)
{
return $this->sendRaw("INVITE {$sNickname} {$sChannel}");
} | 1 |
0344a6aaf0e74fd2e5d7e694805837b6 | 31276f2c7cc65c2acae2a7d6d6f9d830 | Get the requested extensibility service from the section. Return
null if the service is not offered by this section. | namespace Joerg.Battermann.TfsToolkit.Infrastructure.TeamExplorer
[PartNotDiscoverable]
public abstract class TeamExplorerBasePage : TeamExplorerBase, ITeamExplorerPage
public virtual object GetExtensibilityService(Type serviceType)
{
return null;
} | 1 |
38d8332a3a964b2e55ed82c70001c75f | f2babfac6d81a16da0574d429ca8cb03 | `Description:` Check if Correct user is listed or not in AOB user creation page
`:param`s name: Name of User
`:param`s bundle_name: Name of bunlde (in case bundle switch happened)
`return:` Status- True or False
`created by:` Saurabh Singh | self.account_list()
time.sleep(3)
self.user_name()
time.sleep(3)
self.continue_click()
time.sleep(3)
self.password_user()
time.sleep(3)
try:
check_box = self.driver.find_element_by_xpath('//*[@id="authportal-main-section"]/div[2]/div/di... | 0 |
43d3250592043da71e1511db801bcbaa | 2ece6857b85caa8e1ce5d83256e063a2 | Returns the value of the '<em><b>Playback Speed</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Playback Speed</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | float getPlayRate(); | 1 |
7841a26f80e6abff08414e2ec9620112 | 236bafb6d8789b3f74be65bce91c3805 | Create the Intelligent Objects and save the frames in the correct folder | individuals = only if only else listdir(cnn_folders_location)
for individual_folder_name in individuals:
individual_folder_path = folders_location + individual_folder_name + "/"
cnn_individual_folder_path = cnn_folders_location + individual_folder_name + "/"
if path.isdir(individual_fold... | 1 |
c746d1fafd57a2ebb7c83e6692a44a49 | 289eb7c577628cd46b636b89a7ecb0ac | Gets the xml schema to (de) xml serialize an action. | class ExerciseAction extends PlayAction
public function getSchemaUrl() {
return 'https://schema.org/ExerciseAction';
} | 0 |
78882f66dfb1905737152a806cf65e27 | 6dc2fffbc09e36655a1a2d8e7401a006 | Returns the meta object for the attribute '{@link com.zipc.garden.model.core.AbstractStyle#getFillColor <em>Fill
Color</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> | Fill getBackgroundFill(); | 0 |
e5c3111ed72868bc0870e504d0bcc16c | 1e5c25e3497f941f19e28a143915cd41 | 根据中级id获取中级和高级名称 | class ElementaryLevelController extends BaseController
public function get_middle_info()
{
$map['high_id'] = I('high_id',0,'int');
$middle = M('middle_level')->where($map)->field('id,middle_name')->select();
$option = '';
foreach($middle as $vo){
$option.='<option value='... | 0 |
ddc69bbdc957514308418ff793028560 | 55c3c5bf838c56809bd41489d5102841 | sends mail in UTF-8 | {
$fp = @popen($this->mailpath . " -oi -f ".$this->clean_email($this->headers['From'])." -t", 'w');
if ( ! is_resource($fp))
{
$this->set_message('email_no_socket');
return FALSE;
}
fputs($fp, $this->header_str);
fputs($fp, $this->finalbody);
pclose($fp) >> 8 & 0xFF;
return TRUE;
} | 0 |
88aa8797ef01b822cf9f7b5c8ce1179f | ffd476bd83ddc0e2c8d7b507b9f7caaa | Get the primary key of the parent object. | class base_m
public function getPkid() {
return $this->_pkid;
} | 1 |
3b739d92b6347d3e8bf7966a3008870d | 9fd7819f1760c9b2d545a16d9319ebb8 | Open an external file and redirect output to it | void redirect_in(char * command, char * file){
command = trim(command);
file = trim(file);
int fd, fd1;
fd = open(file ,O_RDONLY, 0644);
if (fd == -1){
printf("owl: %s: No such file or directory\n", file);
}
else {
fd1 = dup(STDIN_FILENO);
dup2(fd, STDIN_FILENO);
execute(command);
dup2... | 0 |
dfd218c34585ac656c2e9912794e6215 | f71949966b47b9804a62ee721ed5081f | Checks if the color layer dictionary contains this layer. | [System.Serializable]
public class GUIReticleColorConfig
public bool ContainsLayer(LayerMask layerMask)
{
return m_colorLayerDictionary.ContainsKey(layerMask);
} | 1 |
46d544dbf14162974d7d1b1255a9d480 | 7698059b8df8100ed7b2be6a3d1a38ea | Check nan gradient. | X, y = make_classification()
M = np.random.randn(np.random.randint(1, X.shape[1] + 1), X.shape[1])
mask = y[:, np.newaxis] == y[np.newaxis, :]
nca = NCA()
nca.n_iter_ = 0
def fun(M):
return nca._loss_grad_lbfgs(M, X, mask)[0]
def grad(M):
return nca._loss_grad_lbfgs(M, X, mask)[1... | 0 |
878c1505529ef363a110707b2ef28825 | 4745a26083ae94877c54c7a45f33b83b | Create component index for template type. Scene must be empty. | public class J3DIndexedFaceSetCompressor_Indexed implements SceneGraphCompressor
public void componentDecl(String componentName)
throws SAVException, VRMLException {
} | 0 |
24086b7f6e66e537e7fc5ad0eb9b6fcc | a4c21f00492340233d85721cf6a5dc6a | Check if it fails when domain name is empty | class TestFindDomain(TestCase):
def test_domain_name_empty(self):
with self.assertRaisesRegex(ValueError, DOMAIN_NAME_EMPTY_ERROR):
db.find_domain('') | 1 |
337670a50bf53d77cda248e34d2e6350 | 020b1fefcf13556f7d28a5207c9e42ae | Return table form class for a given interpolation_type | class Table_Form_Builder(object):
def _config_name_to_class(self, interpolation_type):
return self._table_forms[interpolation_type] | 1 |
fb75b5f3fb98d504d7480c9555780498 | ba16ba4d9427266cf210585ae4aa083b | Tests whether a file object contains an XCF (native GIMP format) image.
.. note:: XCF support is currently missing in official macOS binaries | def is_img(file: (Path, str)):
return True if _img_what(file) else False | 0 |
e8b60a71a00f29b73bdc15c1ea8f6eae | 7f3daec328366b2d59d92648e097cea2 | Indicates whether the cookie had a port attribute specified in the
<tt>Set-Cookie2</tt> response header.
<tt>true</tt> if port attribute is specified in response header. | public boolean isRequestedSessionIdFromCookie(); | 0 |
097a7c8be39967c8d89e6bf9f660d1dd | da61a826ae33261b9c3320ae3bcf6a91 | прием | namespace KR
class Shop
public void Accepting()
{
if (cart.Count != 0)
{
int delivery = 50;
float V = 1000; float V1 = 1500;
if (sum >= V && sum < V1)
{
sum = 0.95 * sum; Console.Writ... | 1 |
faf3bda103528f81e41c28ea90049746 | 79a6b8f34d414ea5540f3700d1c1ebfa | 조건에 맞는 게시물 한건을 조회한다. | BoardVo selectBoardOne(BoardSearchVo searchVo); | 1 |
765c00e9785d77a9b7d77259adc953b7 | 0713df60b246a11b79a5291666dd1a59 | 正規表現検索で行を括り出す | public final class ReplaceTest
private static Function<String, String> bracketing() {
return line -> StringUtils.join("[", line, "]");
} | 0 |
0de0c479f1e594d82bacc8cff5d036b4 | cdee11ab54e1c30f3aba45b2ec26e06e | 对于每件物品,可以选中也可以不选中(二叉树),直到选完最后一件物品为止(深度优先)
可以看出本题为对于一个给定的序列,遍历其所有的子序列,找到一个最优序列 | if (cw == w || i == n) {
if (cw > maxW) {
maxW = cw
}
return 0
}
var res = f2(i + 1, cw, items, n, w)
if (cw + items[i].weight <= w) {
res = Math.max(res, items[i].value + f2(i + 1, cw + items[i].weight, items, n, w)... | 1 |
14b838c57db5e1f9b62fa0f7fea6dfad | c65c9be52f181d4dfb22a30157671c6a | 使用基类方法 | namespace Extend
class Extend : Base //继承与Base
public override void method1()
{
base.method1();
} | 1 |
6d205879592fd3bd9f2c652d3d334500 | 2c903754760836485651381746aa3238 | 处理接收到的消息,然后发送给腾讯云智能API | async def call_tencent_api(event: MessageEvent, text: str) -> Optional[str]:
cred = credential.Credential(
plugin_config.tencent_ai_secret_id,
plugin_config.tencent_ai_secret_key,
)
httpProfile = HttpProfile()
httpProfile.endpoint = "nlp.tencentcloudapi.com"
clientProfile = ClientPro... | 1 |
b0845307d492da0294898ed12ce7ba97 | 7a057b9ca908939610585557e5accced | Get current position in bounding box format `(top left x, top left y,
width, height)`. | class Sizable(HasStrictTraits):
def pos(self):
return self.abstract_obj.pos() | 0 |
ba53065f2a94b9f5565314b7e2ea1456 | 1101ae303975b093340acbf3e158de8f | O(1) time and space - just compares the two values | namespace DT
int operator== (LinkedListNode<T> first, LinkedListNode<T> second)
{
if (first.getValue() != second.getValue())
{
return 0;
}
return 1;
} | 1 |
fcda873c0719149fe64861e5992343fc | ce246152a4befe22a303ceb1c2627907 | fix 2 stock to be in same length using padding. | def correlate_stock_len(stock1, stock2):
stock2_ = stock2.copy()
stock1_ = stock1.copy()
stock2_[TIME] = stock2_.index
stock1_[TIME] = stock1_.index
stock2_ = stock2_[stock2_[TIME].isin(stock1_[TIME])]
stock1_ = stock1_[stock1_[TIME].isin(stock2_[TIME])]
del stock2_[TIME]
del stock1_[TIM... | 0 |
3c0eb348f697f6c9edd372e4ad2e39af | cbfa0ab75f41b36f681650e6b635535b | Clear current appHost configuration | @SuppressWarnings(
"ComplexInterface",
"TooManyFunctions",
)
internal interface HostAppInfoRepository
@VisibleForTesting
fun clearInfo() | 1 |
3e80bcb06cd8ab4fec2cee1db848db14 | b30a787ae833d674a86c90591d6ac1b3 | Joins many MultiTrace objects into one. | class AppOutput(object):
def add_trace_df(self, tt, traces_df_list):
tdf = tt.get_df()
tdf = tdf.set_index(self._index_tracker.get_multiindex(tt))
traces_df_list.append(tdf) | 0 |
ca9ca0115bd88f84f003bf4c8bed9b65 | f007c0318e856d13cf4a655f89c25cd1 | красиво записывает список в строку [1, 2, 3] -> "1 2 3" | {
string s = "";
foreach (var item in list)
{
s += item.ToString() + " ";
}
s = s.Remove(s.Length-1,1);
return s;
} | 1 |
8a07936ad5c1f3c9c07d7c9286050e2b | 5c4bd46f85e07de8f7b83907d6c30ec4 | Print all Primes between 2 numbers | {
n=0;
i=startAt;
while(n < nPrimes)
{
if (isPrime(i))
{
console.log(n, ' → ', i);
n++;
}
i++;
}
} | 0 |
6445dcf13a28747e38565732436b5638 | a0994afa79f1a7ac6ed074b06ffc8ca7 | Sorts both of the lists using the natural ordering of the items. | namespace Alps.Core.Collections.Generic.Powerful{ [ Serializable ]
public class BigList< T > : ListBase< T > , ICloneable{
public void Sort() { Sort( Comparers.DefaultComparer< T >() ); } | 1 |
29ad8fdd057bfbaa7569b3605dae3faf | 77e5ef0e8bb4892d27c3a510365b0090 | 设置指定范围内文字水平位置 | public class PropertiesPanel extends VIAction
public void setHorizontalAlignment(TxtAlignItem position) throws Exception{
util().clickAndWait(prop.getHorizontalAlignment(position));
} | 1 |
f52a5c9f066d1253a8d528e8536ae6aa | 430b7171ac615a95df2a39e1a1e1c009 | 修正主厨 | public ObjectResultEx EditCookInfo(RequestCookInfo Param)
{
return ObjectResultEx.Instance(CookWebService.EditCookInfo(Param), 1, RetrunMessge.SUCCESS, HttpCode.Success);
} | 1 |
16f56996b00bd54dd4059001bbdac740 | 2e871e19d6abdc96719deb6568c47fb2 | test we can add a contact detail to an org | class TestAddMember:
def test_contact_member(self):
self.main.go_to_contact().go_to_add_member().add_member().save_member() | 1 |
286b2ddfde70f5d3e394f4a3b4b1a334 | 2e883d18dbcaa2917b2aa8992eaf13c3 | 匹配中文或英文 | @JvmStatic
fun isEnglishOrNumber(orginal: String): Boolean {
return if (TextUtils.isEmpty(orginal)) {
false
} else isMatch(REGEX_ENGLISH_OR_NUMBER, orginal)
} | 0 |
e9ece5f7463ef34b6f6e8762f7a747b0 | 515243cebc1602faf2000648d5dd34f0 | Check for instructions that end a block | int testinstrctlst(prog* p, turtle* t, var* v,
SDL_Simplewin *sw){
if(strcmp((p->wrds[p->testcnt]), "}")==0){
return 1;
}
else if(testinstruction(p, t, v, sw)==1){
p->testcnt++;
return testinstrctlst(p, t, v, sw);
}
else{
fprintf(stderr, "Error in instructionlist.\
(word %d)\n"... | 1 |
a513d9f569e6145811b5447ec956c01a | 4dcc4b978b8aee2458409ef07541997f | Support for transfer functions is not implemented! | static int call_nt_transact_ioctl(char *inbuf, char *outbuf, int length,
int bufsize,
char **ppsetup, char **ppparams, char **ppdata)
{
return(ERROR(ERRSRV,ERRnosupport));
} | 1 |
af9be67cf0d931d42b898f9c3c8befd7 | d1836b4ad0026b4338fe8c5b1a96cbce | This sample demonstrates how to Creates a task run for a container registry with the specified parameters. | return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).map(new Func1<ServiceResponse<BuildTaskInner>, BuildTaskInner>() {
@Override
public BuildTaskInner call(ServiceResponse<BuildTaskInner> response) {
return... | 1 |
de62f626b000f66a0edd6463aa94e7fb | e9198b925bdfbf2bab3d4480cf8e549f | Throws an exception if a project does not have a specific metadata reference. | namespace FunFair.BuildCheck.ProjectChecks.ReferencedPackages
[SuppressMessage(category: "ReSharper", checkId: "ClassNeverInstantiated.Global", Justification = "Created by DI")]
public sealed class MustHaveSourceLinkPackage : IProjectCheck
public void Check(string projectName, string projectFolder, XmlDocument ... | 0 |
108d67117f0c849c02535dd61e3d2762 | e2788cde537220767d088b591267d4c5 | @brief Returns the state of the microswitch. | uc_dipsw_state_t uc_dipsw_get_state(uc_dipsw_t p_switch)
{
uc_dipsw_state_t state = (uc_dipsw_state_t)gpio_port_get_pin_state(gpio_port_dd, (gpio_pin_t)p_switch);
return state;
} | 1 |
c8e10f0b07dd916df5a0f4df7fedbe5b | fd48f14911cdd22131fc35681d545cac | 上传Android应用 | dialog = new ProgressDialog(context);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setTitle("上传中...");
dialog.setIndeterminate(false);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
final String path... | 1 |
ad886aefae28afb4ec9c8846342c7712 | 2b5abe32b8acc919295ab044bdf51c7d | ____________________________________________________________
This method sort the stadiums by opened date
___________________________________________________________
Pre-Condition
vector of stadiums is given
Post-Condition
stadiums sorted by opened date | void ASCsortStart(vector<Timetable<int>> &vec)
{
int size = vec.size();
Timetable<int> temp(0, 0);
for (int i = 0; i < size; i++)
{
for (int j = 0; j < (size - i) - 1; j++)
{
if (vec[j].StartTime > vec[j + 1].StartTime)
{
temp = vec[j];
vec[j] = vec[j + 1];
vec[j + 1] = temp;
}
}
}
} | 0 |
4f8680f7de5c4173ab28e75b17e8c9aa | 9ea509dcbdb316236c704196fbdda774 | 网卡设备序列化类 | self.serial = serial
self.physical_port = physical_port
self.major = 0
self.minor = 0
self.bus = 0
self.dev_file_path = '' | 0 |
e676c896da4570349842a3100d33e841 | 48923c49b89dbe3f5041ccada85edea6 | Convert the JSON representation back to the correct type. The tag
will already be removed. | class ConvertUnit:
def from_json(convert_type, json_obj):
names = []
for name in json_obj["names"]:
names.append(name)
value = json_obj["value"]
new_unit = ConvertUnit(convert_type, names, value)
if "abbrs" in json_obj:
for abbr in json_obj["abbrs"]:
... | 1 |
dbba7635c0848b914c135b53e5f88f1e | 91788db4019da1591b157f36e6b8c146 | finds all supported images in a directory (recursively). | $files = array();
if (isset($this->func_scandir) && $this->func_scandir !== NULL && is_callable($this->func_scandir)) {
$files = call_user_func($this->func_scandir, $dir);
} else {
$r = glob($dir.'/*');
foreach($r as $file) {
$ext = strtolower($this->getExt($file));
if (in_... | 1 |
4f8c60975289ef9eeaef81b39ba1794c | 5600dc8e23ef42df051d0a4c8d0f596c | List (recursively) files and folders for user's directory | void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Serial.printf("Listing directory: %s\n", dirname);
File root = fs.open(dirname);
if(!root){
Serial.println("Failed to open directory");
return;
}
if(!root.isDirectory()){
Serial.println("Not a directory");
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.