query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f0d7048c010dbb358736552d80021110 | c9dbc0cebd43d60e6668e56ab392580c | takes one argument - a string of hex values
returns one value - char representation of the string | def hextoascii(val):
temp = bin(int(val, 16))[2:].zfill(8)
return chr(int(temp, 2)) | 1 |
26cef489f7fd3287657453a09a7f770f | e6fdd78e8f272422aa3d27f0f5bae8c6 | returns the direction of the scroll.<br>
SCROLL_HORIZONTAL or SCROLL_VERTICAL | namespace qx.ui.core.scroll
object GetOrientation(); | 1 |
a2a681189ce220bbbf795bb6ad9c6219 | dea10b7fe5c806be720f2817f7873ca7 | read mouse events and generate history tables | {
DWORD ret;
while (1)
{
if ((ret = WaitForSingleObject(m_event, INFINITE)) == WAIT_OBJECT_0)
{
int mx = 0, my = 0;
DIDEVICEOBJECTDATA od;
HRESULT hr;
double time;
if (!ActiveApp || Minimized || !mouseactive || !dinput_acquired)
{
Sleep (50);
continue;
}
time = Sys_DoubleT... | 1 |
c4a761cf8af98db8e40aee24d2f3bd3e | fc6551458abb97afc468316367d7cad5 | แสดงหน้าคะแนนทุกคน และคะแนนรวม | def totalscore():
print("\n\n\n")
gdata = open(r'd:\a\nameteam.txt', 'r')
f=open(r'd:\a\checkteam.txt','r')
nameteam=gdata.read().split("\n")
checkteam=f.read().split("\n")
for i in range(1,4,1):
if i==1 or i==3:
print('{0:-<69}'.format(""))
else:
print('{... | 0 |
8c1f955b15b2309d25ac631843d9aa56 | b74d91e6190e098682faa3a526b4eb93 | Recover file extension from file name. | try:
split_name = file_name.split(".")
if len(split_name) < 2:
return ""
return split_name.pop(-1)
except IndexError:
return "" | 1 |
d68073c74be7d9d60a61b6e698b14694 | 5b4d01f964e42fe1846a099bab6526d1 | Gets an overview of the email clients used to open your emails.
This is only recorded when open tracking is enabled for that email. | class CampaignEmailsOpenedApi
def marketing_campaigns_id_emails_opened_count_get(id, opts = {})
data, _status_code, _headers = marketing_campaigns_id_emails_opened_count_get_with_http_info(id, opts)
return data
end | 0 |
a3ad807169dcec383ac5dc5de60e50dd | 7f61448ad6da3ef0f9cb03f40c5be655 | {{{ lua completion | cases like (1) | 0 |
e98c4f213a194cceda078e0e240036dc | 27004179aa6096b6860b91e45f5f6c09 | 対象にダメージ等の情報をコピーし、爆発の状態にする | {
m_target = target;
m_damage = damage;
m_instigator = instigator;
Destroy(gameObject, maxLifetime);
} | 1 |
003b5c1029dce6c0f086f5637f3353ce | 844da51dc068c4cd56e0a2ba721f0260 | テクスチャが更新されたことを通知します。 | export default class Rope extends Mesh
_onTextureUpdate()
{
super._onTextureUpdate();
if (this._ready)
{
this.refresh();
}
} | 1 |
60955375e10584656ec512a2f7cdfa03 | 004e9f3360648102b72e98d33fa389cf | binaryComparison() need to be called, if both operand are either null or not null | public BooleanDataValue isNullOp(); | 0 |
5b00a95dc3989f12f9f415225e069fac | bec15ea423853e74368a53e409777672 | 获取该博客最终的、有层次的评论 | class ArticleController extends BlogController
protected function getReComments($obj)
{
$reComments = BlogComment::query()
->select('blog_comments.*', 'u.nickname', 'u.avatar', 'u.admin')
->join('users as u', 'blog_comments.user_id', 'u.id')
->where('pid', $obj['id'])
... | 1 |
54adbcd265d2e70635f34150d12e6709 | 1a2d9ac096f3e5b4ec5c41ca4c2c9978 | Compute the transfer function of a stimulus and response signal. | -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
if type(f) is not np.ndarray:
f = np.array([f])
f.shape = (-1, 1)
lf = f.shape[0]
depth_array = np.array([depth_array])
if type(tissue_array) is not np.ndarray:
tissue_array = np.array(t... | 1 |
2e08f91d8ae58777afc8d903759cdb14 | 9c5399140b423e3c2d12889ff06cd768 | Retrieves a list of the Forums moderated by a particular user. | namespace Spinit.Wpc.Forum.Data public class SqlDataProvider : ForumsDataProvider
public override ArrayList GetForumModerators(int ForumID) {
using( SqlConnection myConnection = GetSqlConnection() ) {
SqlCommand myCommand = new SqlCommand(databaseOwner + ".spForumGetForumModerators", myConnection);
myCo... | 0 |
f578d2bb03ec723800c7d0204dd0cb67 | 6b2a0a409e13f5d4dacf33baf7aa4016 | 设置品牌删除时间 | {
$item = \App\Company_Brand::where('intCBID', $id)->get();
$date = date('Y-m-d H:i:s');
$item->first()->deleted_at = '2017-08-15 05:08:50';
return redirect('/Company_Brand');
} | 1 |
69ba008fd2eafd0094eb30925c31487c | 10b244b9d323bc9433d6c4104d0d62dd | Create threads which will exercise some SpinSection code. | void
mapping_thread(int argc, char **argv)
{
memsection_ref_t mem;
uintptr_t base, rand_val, *w, *r;
int loop = MAX_LOOP;
L4_Word_t page_size, page_size_mask;
L4_MsgTag_t tag = L4_Niltag;
while (!libs_ready) ;
L4_LoadMR(0, 0);
L4_Call(map_main);
page_size_mask = L4_GetPageMask();
... | 0 |
993b1eab963cc0871ce3c21ff0a2a054 | 06ceb877f3c59eeea71117df3664fc56 | 获取指定寄存器的指定位的值 | function getVal(regAddr: number): number {
return (_mpu9250.getRegAddr(regAddr))
} | 0 |
3f50354461cb2456afa2f59915017bdb | 9e972951ebf0c68aa7c4a092a68c979a | Tests the active page with default settings. | class supervisorTests(mcuTest):
def test_06_activeDirectorySystemSettings(self):
self.mcuConsole.systemSettingsPage.activeDirectory().click() | 0 |
2e3ee03b37e35a7575d0511efe95ff6d | 1d719e8ccf866a0db7b4e87fd90f0c75 | Converts the logLevel into a Status | {
Level logLevel = Level.OFF;
if( iLogLevel == 6 ) logLevel = Level.FINEST;
else if( iLogLevel == 5 ) logLevel = Level.FINER;
else if( iLogLevel == 4 ) logLevel = Level.FINE;
else if( iLogLevel == 3 ) logLevel = Level.INFO;
else if( iLogLevel == 2 ) logLevel = Level.WARNING;
else if( iLogLevel == 1 ) log... | 0 |
e177cad1eb014a3fae0186a8ea5d6799 | 170bb76ebaca49442b0173fe401740e4 | Reads an image into an RGB array | def read_image(path):
return cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB) | 1 |
4f8ee72b88259ba2db9e195c3be7efa8 | 45de862dcc4bab5a3d7b7090943ff98f | Seçili anketi siler. | class ChoiceController extends Controller
public function destroy($id)
{
$choice = Choice::findOrFail($id);
$question = Question::findOrFail($choice->question_id);
$choice->delete();
$questionTypes = QuestionType::all();
return redirect()->to('/surveys/show/'.$question->surve... | 0 |
d939bb3b676795705ba6ca18a1f7635a | e2f96c93d2c4194d90b06cac8147781b | Questo metodo restituisce l'id del locker. | public class RmLockVo extends RmValueObject{
public String getId(){
return id;
} | 1 |
4ef83cca0d70468babdeb1057037dd66 | 8eded0e481804453d48479113fe7601f | Create an instance of {@link GetComplaintDetailsResponseMessage } | @XmlRegistry
public class ObjectFactory
public GetComplementResponse createGetComplementResponse() {
return new GetComplementResponse();
} | 0 |
5cf311dc5403dbb9eb741c0f46bc2b98 | 507f136c984f3dfbb76c18f02a2f5d95 | convert milliseconds to 00:00:00.000 | var seconds = Math.floor((milli / 1000) % 60);
var minutes = Math.floor((milli / (60 * 1000)) % 60);
if (seconds < 10) return minutes + ":0" + seconds;
return minutes + ":" + seconds;
} | 0 |
07185f3afa97c84c62d2cc8561b2e768 | 64119ab6faabd965cde59e8606c092b5 | Prepare chunks for upload of a file of given size.
It raises a ``ValueError`` when ``chunk_size``
or ``file_size`` is negative. | if cherrypy.request.headers.get('Content-Type', '').startswith('multipart/form-data'):
raise RestException('Multipart encoding is no longer supported. Send the chunk in '
'the request body, and other parameters in the query string.')
if 'chunk' in params:
... | 0 |
02ac82486fd83294d4ae16f241d18e22 | 3e71792c3bf70af6103735535784be15 | GET: Aplikasis | namespace SiTiPetro.Controllers
public class AplikasisController : Controller
public async Task<IActionResult> Index()
{
return View(await _aplikasiRepository.GetAll());
} | 1 |
f6319e74948147e7fa3a852a4d6013d2 | 21073c56e5ea3b979be60e96918ea049 | Puts mouse back to base position | void InputClass::ResetMousePosition()
{
SetCursorPos(m_screenWidth / 2, m_screenHeight / 2);
} | 1 |
6127881a676b7987d50d53423c41ba0b | 9bf4be1fb7d16b2ded0cdf7189f04b55 | 上传创建液货船中舱的复核照片 | public class CathKidstonTaskImpl extends BaseManagerImpl implements CathKidstonTask
@SingleTaskLock(timeout = TASK_LOCK_TIMEOUT, value = TASK_LOCK_VALUE)
public void uploadCkReveiceFile() {
log.debug("======================CathKidstonTask uploadCkReveiceFile begin!");
Map<String, String> config = configManag... | 0 |
821afa019a42676cdb6733575a594833 | e3bb7c6c999791f1bd447a697ef0b20a | Creates new rental of a given car for the client. | class RentalController:
def addRental(self,id, mId, cId, rentDate, dueDate):
client=self._ClientRepo.find(cId)
movie=self._MovieRepo.find(mId)
if movie==None or client==None:
raise RepositoryException('pls enter a valid movie and client id')
rental=Rental(id, movie, client,... | 0 |
c220b8553921169bb4c879da19185d67 | 02c2ac336cf6389cdff2b064adfbfa61 | 格式化变量名称
<br/>
将形如 person_name/PERSON_NAME 格式化为 personName | StringBuilder result = new StringBuilder();
if (name == null || "".equals(name)) {
return "";
}
for (int i = 0, n = name.length(); i < n; i++) {
String s = name.substring(i, i + 1);
if (s.equals(s.toUpperCase()) && !Character.isDigit(s.charAt(0))) {
... | 0 |
a619bee6a57eedb25f064523295d7d8f | 62ff520c3f5d2efcc85a90c6edaa8f1c | Borrow contents of this cell mutably (read-write). Only one
`TCell` at a time can be borrowed from the owner using this
call. The returned reference must go out of scope before
another can be borrowed. To mutably borrow from two or three
cells at the same time, see [`TCellOwner::rw2`] or
[`TCellOwner::rw3`]. | use std::cell::RefCell;
let x = RefCell::new(42);
let y = x.borrow_mut();
println!("{:?}", x);
println!("{:?}", y);
} | 1 |
368d334c09185079ce2431d793fe674d | 6fa29335b12f45dcb261ec03e5417b77 | スピナーを閉じたときにコールバックされます | public class GapView extends WebView
public void spinnerStop() {
if (this.spinnerDialog != null) {
this.spinnerDialog.dismiss();
this.spinnerDialog = null;
}
} | 0 |
1e457e838d0c66bde90e3cfaced68eaf | 9c60b79799776609b7c0e8cf413b0cb0 | Magic method to implement the equality operator(==) | class Point:
def __eq__(self, other):
return (self.x == other.x) and (self.y == other.y) | 1 |
a6c7d07e14debd18323cd4aabe2f9483 | 79e804b8aab77d2943807234085fbf01 | 스트링을 지정한 길이만큼 자른 뒤 지정한 문자열을 추가한다. (한글처리)
대상 문자열
자를 길이의 최대값
뒤에 추가할 문자열 | public class StringUtil
public static String addChartoString(String srcStr, String srcChar, int destLen, int location) {
int srcLen = srcStr.length();
if (srcLen >= destLen || destLen == 0) {
return srcStr;
}
for (int i = 0; i < destLen - srcLen; i++) {
if (locati... | 0 |
ec27089a4e2f7d2cb12f433397b576ff | e1ac681f4036ad3c839c13dc1b0cc6b0 | 我们在这里配置MA策略使用的均线窗口大小和账户对象信息 | cerebro = bt.Cerebro()
cerebro.addstrategy(SMAStrategy)
cerebro.broker.setcash(200000.0)
cerebro.broker.setcommission(commission=0.001)
periods = range(20, 120)
cerebro.optstrategy(SMAStrategy, sma_window=periods)
cerebro.addsizer(bt.sizers.FixedSize, stake=1)
data = ts_df.get_csv_daily_... | 1 |
8364243cc209c4497cefda67f343d59e | 3e1da5a7ebe3abeee8a41847a529b79e | This will spawn the turret at the spawn point | public class TurretConstructor : MonoBehaviour
void Start ()
{
} | 0 |
cb1e487cc284bc69ddbcb4bf746e818d | 4d8b6aad91fd7a9182c1d0ee57e53283 | on return will hold actual length of @bin_data.
Convert a buffer with hex data to binary data. | void* ahex2bin(const char *hex, size_t *bin_len)
{
if (hex == NULL) {
errno = EINVAL;
return NULL;
}
size_t len = strlen(hex);
unsigned char *b = (unsigned char*)malloc(len/2 + 1);
if (b != NULL) {
size_t ret = hex2bin(b, hex, len/2 + 1);
if (bin_len)
*bin... | 1 |
5c5609434d9b97a7d7ba2911df963db5 | 49ab8554f8345380a13255749aaf9485 | Iterate through underlying models to set non-dimensional flag | {
for(MFIter mfi(*dens);mfi.isValid();++mfi)
{
const Box& bx = mfi.validbox();
update_primitive_vars((*dens)[mfi].dataPtr(),(*velx)[mfi].dataPtr(),
(*vely)[mfi].dataPtr(),(*velz)[mfi].dataPtr(),(*pres)[mfi].dataPtr(),
(*consvars)[mfi].dataPtr(),bx.loVect(),bx.hiVect(),&nghost,geom.CellSize(),
geom.Pro... | 0 |
6f1b8f174d69294c9cefc5721700a118 | a8d4d68b00622b264b4ca789d192884e | Are two strings the same length? | function comp(str1, str2) {
if (str1.length == str2.length) {
return true;
} else {
return false;
}
} | 1 |
0490d4ec99fbe318593134deaac0d6f6 | 2e059ce226162f9dbe40ced0f8126121 | 현재 씬의 씬매니저 반환 함수 | public class GameController : MonoBehaviour
public EnvironmentManager GetEnvironmentManager() { return MainEnvironmentManager; } | 0 |
6c94116c51cc84ba5f5f2c8751934b9b | cd40d8354022dafcd661362ad6a353f8 | As soon as the component is ready, fetch all clubs from server | onReady() {
this.getAll();
} | 1 |
8c6d95c5d65b310e09701afe9fcce7d0 | 50ef263cbfb3e789941bde02b6dc003a | Restric the set of publications to those which are created by
specific authors. | class ContentNodeFilter(IdFilter):
def filter_by_authors(self, queryset, name, value):
authors = value.split(",")
return queryset.filter(author__in=authors).order_by("lft") | 1 |
3a13ba19a19140f685c39fa378679931 | f5179e2965e11e9cdb91f8232e984bdc | 取得两个日期的日期差,返回分钟数 | public class DateUtil
public static long MinuteNum(Date date1, Date date2) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
format.setLenient(false);
long minutes = (date2.getTime() - date1.getTime()) / (1000 * 60);
return minutes;
} | 1 |
57e0edba815547ea92e4107659b4b9a5 | c3b52df58f6333483346633e4e58cc42 | Prepares this Submission Queue Entry as a write. | public abstract class AbstractBatchProcess implements OLEBatchProcess
protected abstract void prepareForWrite() throws Exception; | 1 |
2343e4ff02feb3d15ca44dc87329172c | 90fb46374561e71d70ce1324170c45b5 | Bean(VO)类包路径 | public class PackageBean implements Serializable
public String getBeanPath() {
beanPath = this.getBeanPackage().replace(".", "/") + "/" + this.getEntityClassName() + Constants.SUFFIX_BEAN + Constants.JAVA_SUFFIX;
return beanPath;
} | 1 |
f5bcfe5399fb3d5491cb20f25fc1a1ca | ecf5a6eb9c43d16c5c267577a0e52344 | Tests edge case for concat when both lists are empty. | def test_concat_empty_lists() -> None:
xs: list[int] = []
xy: list[int] = []
assert concat(xs, xy) == [] | 1 |
5b6597528dfc09c5ded984b21c99919a | c810bc88d7d990c01d30c8a4055402a1 | Read the node style from the configuration file. | string read_string ( string config_node ) {
ptree pt_all;
read_xml ( config_path, pt_all );
string str = pt_all.get<string> ( config_node );
return str;
} | 1 |
aaffddbbc3680fae1b04cf6b16e9e532 | 60ffcd8eb93fc3c6a3203a772925de4e | quita espacios al inicio medio o final | def medio(palabra):
return palabra[1:-1] | 0 |
d032e4841e96c247a471fb4729cb7477 | 2c0db0aac5dcb5fe6614417cfb1de300 | Tells if the standard port for the given scheme is used | class Url
public function isPortDefault()
{
return $this->getPort() == $this->getDefaultPort();
} | 1 |
b8d338d7ece97b3522b52014ca7c5e34 | 6c4a62a877e4e4d8f08a492e5acd40bc | Setting values after selecting Key Field column | var fieldId = this.getAttribute( 'data-fid' );
autoExpandSettings( document.getElementById( 'field_options_field_key_' + fieldId ) );
} | 0 |
28fd1584c0517541159c509a392ab839 | 8754179caf539f217ac429ec5949e1c5 | Lazily applies updates to the indexes defined on this grain
The lazy update involves adding a workflow record to the corresponding IIndexWorkflowQueue for this grain. | def handle_update_percolate(sender, instance, **kwargs):
transaction.on_commit(lambda: index_percolate_queries.delay([instance.id])) | 0 |
bba2a48ca5d7e238b7e2ae3f1912f809 | 4017011a0f04555224d01012b4d33d05 | Хэндлер отработки для указания населенного пункта для отправления заказа | def handle_choice_delivery_method(call):
user = shop_models.User.objects.get(telegram_id=call.message.chat.id)
order = user.get_order_in_clearance_status()
order.delivery_data[str(constance.delivery_method)] = constance.DELIVERY_COMPANIES[json.loads(call.data)["command"]]
order.save()
data = {"tag":... | 0 |
29e1e59d92f52c4f11a25027ed50bfbd | 86cba25c9d9d1f06e719e202613bc9b7 | \brief map glhck shader constants to OpenGL shader constants | GLenum glhDataTypeForGlhckType(glhckDataType type){
switch (type) {
case GLHCK_DATA_COMPRESSED:
case GLHCK_DATA_UNSIGNED_BYTE:
return GL_UNSIGNED_BYTE;
case GLHCK_DATA_BYTE:return GL_BYTE;
case GLHCK_DATA_UNSIGNED_SHORT:return GL_UNSIGNED_SHORT;
case GLHCK_DATA_SHORT:return GL_... | 1 |
9fa0a3a09a967a6ce47dde686dd12afb | f551778cbdb11aab1b67eb91f2ede228 | Single required argument, No return | if ARGV.length != 1
puts "\nUsage: sum <fileName>\n\n"
exit(1)
end
end | 1 |
325fbe09d5ea0ef20705901de28e7d00 | 1ea19ee5b8ec7023aa135c3e5a942d49 | Helper function to assign or remove permissions as needed | class UserObjectPermissionsForm(BaseObjectPermissionsForm):
def save_obj_perms(self):
perms = set(self.cleaned_data[self.get_obj_perms_field_name()])
model_perms = {c[0] for c in self.get_obj_perms_field_choices()}
init_perms = set(self.get_obj_perms_field_initial())
to_remove = (model_p... | 1 |
7410467c07e9c48604b32032e183af05 | 7f61448ad6da3ef0f9cb03f40c5be655 | a compilation error. | cases like (1) | 0 |
802c7aea9d5d51e52f6fe6e4e82de3a7 | 19db700b45b5f9b84cadc385e2525907 | Sets the minimum amount of required arguments in order for this command to run. | public abstract class CustomCommand implements CommandExecutor
public int getMinArgs()
{
return minArgs;
} | 0 |
ed06ce9e8840bf3316b3e50d5bd005d6 | cec93609fe8224002b8f203c3fdbb8d6 | Obtains a URL with a SAS that can be passed to consumers for blob upload. No username/password required and can be (and should be) life-limited at creation.
NOTE: This action requires that the private/priamry storage key is accessible to this app. | namespace iLabs.ExpStorage
public class BlobsAPI
public string RequestBlobAccess(long blobId, string protocol, int duration)
{
string key = "any";
string pass = "1234";
StringBuilder blobURL = new StringBuilder();
blobURL.Append(ProcessAgentDB.ServiceAgent.cod... | 0 |
784576dcdf916e74cfdbe18ad0279da3 | 8d0ddf55186f2eac03d5d57fac4d7907 | Creates an instance of the settings window. | class SettingsUI():
def __init__(self, root, settings_handler, game):
self.root = root
self.settings_handler = settings_handler
self.game = game
self.options = ["10;10;10;50", "16;16;40;50", "16;30;99;50"]
self.widgets = []
self.setting = StringVar()
self.error = ... | 1 |
a74eb4cbd02b0f306f544b6653f88a7c | 87d08e5b156e12f8b7416a5217d72aa0 | RPCServer subclass that uses ZeroMQ REQ/REP to communicate with clients. | port = 5556):
self.url = "tcp://%s:%d" % (ip_address, port)
self.context = zmq.Context()
self.socket = self.context.socket(zmq.REQ)
self.socket.RCVTIMEO = int(1000);
self.socket.connect(self.url) | 0 |
3d2200b2febe553d7fd1feb463cdede1 | b35da905531ea371828e9bcb90ace2ea | Gets the singleton copy of the Cache object | namespace OpenDentBusiness
IFeeCache GetCopy(); | 0 |
22c065423047285e5e188b6709056a37 | d3bb8f4f551721b66c4b48b495db7f0e | <pre>
得到全部税率信息
</pre> | public List<SpoRation> getList(); | 0 |
1faff451f9be41be5df6c67694833ffc | 8e45b3be3adb3d01ba91eb15ab372d87 | Given I have checked out files they should be loaded into lists | namespace Client
public partial class MainWindow : Window
private void clearFiles_Checkout()
{
FileList_checkout.Items.Clear();
} | 0 |
72773b735f9c3a154c84ce3aa51567af | 4206ff1bc726afbda2378c764520f711 | 用户驾驶证是否存在 | {
$sql = "select top 1 id, hphm, state from MC_Car where user_id = :user_id and hphm = :hphm";
$bind = array(
'user_id' => $user_id,
'hphm' => $hphm
);
$car = self::fetchOne($sql, $bind, null, Db::FETCH_ASSOC);
return $get_data ? $car : (bool)$car;
... | 0 |
301acabd14fc72792919895ed2407240 | 679bfd69362a049fc02ea29972bef5e7 | executes all registered events | Object.keys(events).forEach(key => {
try {
events[key]();
} catch (error) {
console.debug(error);
return false;
}
});
} | 1 |
1e597912c384a173a712262719393f11 | 3bf49e510383d322f34eaa2b2fcebc5e | Evaluate a provided value to create a renderable React element. | function createElement(value) {
if (!document) return null;
assertType(value, 'string', true, 'Value must be a string');
if (value.match(/^([a-z0-9]+-)+[a-z0-9]+$/)) {
return new (getElementRegistry(value))();
}
else {
let div = document.createElement('div');
if (value.indexOf('<') !== 0 && value.... | 0 |
ca34edca00aa972d520f561dcf82630a | d97c9fb57442c66791571917922d9cdc | 問題\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
空白で区切った複数の数字からなる文字列(例えば "5 7 9 2 3")を引数として受け取り、
その合計を計算して結果の数字を文字列として返す関数 calc_sum を作ってください。
それを使って「合計したい数字を半角スペース区切りで入力してください > 」と表示して入力を受付け、
計算結果を表示するプログラムを作ってください。
今後の改善点\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\... | def worker1(inp, options = ''):
arr = [int(s) for s in str(inp).split() if s.isdigit()]
output = sum(arr)
print("worker1 => ", output)
return output | 1 |
414e69da678eb7b3d0e737e81a6fa151 | c94cff3d1bc960c19e4ef6851746b11c | Notification that the user has canceled the rating. | public class CircularRatingBar extends View
void onCancelRating(); | 1 |
29b212e0902a59ed8391f7b1d42f96c0 | cfed1cbe4b33ec43f873809372c6c5e8 | Return an informative version string. This usually is the actual release
version number or a git commit description. This string has no fixed format
and can change any time. It should never be parsed by code. | public function getVersionString(); | 1 |
5fd1906b64f4575b345dd8acfc1cb0c7 | 44b9f27e121b7efebee6b4d40ccf454f | Convert string containing non-digit chars to integral. | def convert_string_to_int(s):
value = ''.join([c for c in s if c.isdigit()])
return int(value) | 1 |
d15e32d80a31b611e2608f74b583ae4c | 11a02c9a1c7beb8ebd09bf07be6e9ae0 | Returns true if there is a data ready to be read. | public class SocketReader<T extends Serializable> implements Runnable
public boolean available() {
return !inputBuffer.isEmpty();
} | 1 |
c16087bec7b611f80011863cd969af5b | a519d7dedddf22327d6904c1ba5be340 | It returns the instance of the event producer for the StreamEPS. | public EventPublisher getEventPublisher(); | 1 |
92c4bf578652b264765307cf4c074749 | 08e4dbe96eb9d605a0ac8744df3edf6c | Returns all the d l record logs. | public List<LogRecordDto> getAllLogRecord(); | 1 |
bca32ad23be59d6d0b60be5734ab2ec2 | 5701ff545b4a4ec95b3739c46731a592 | Creates a new pipeline using a file path as a source. | public static function createFromFile($filename); | 1 |
448c7ca6fcbf8ff6c7fcce1554bba285 | 60520f61fea6e06071851360b9b622a9 | blank check cycles through the vector to check if anything occupies that point | boolean check1=false;
boolean check2=false;
boolean check3=false;
boolean check4=false;
boolean check5=false;
for (int m=0; m<r.get(i).getVec().size(); m++){
if(r.get(i).getVec().get(m).getPointval()== pv1){
check1=true;
}
else if(r.get(i).getVec().get(m).getPointval()== pv2){
check2=true;... | 0 |
b352534c609e6680f71f0846f1a837e5 | 23f976951d2bb2402bf908b20010cd6a | can not cache | class TemplateMatClassTileSource : public TileSource
CachePolicy getCachePolicyHint(const Profile* profile) const
{
return CachePolicy::NO_CACHE;
} | 1 |
30470afd8ac4767c3a75802f5c82e75b | 7670be67fdbe5956d7e16d268906d5c4 | Génère des erreurs si le nom du groupe est vide | var groupName = $('.groupName').val();
if(groupName == ''){
$('.errorGroupEmpty').css('display','block')
}else{
$('.errorGroupEmpty').css('display','none')
}
} | 1 |
ac5eddcb7e7f171c9b3f2757415c3104 | cbbe1e570f7aa9185b1fadb3f440ea1c | 匹配乘客乘坐的车次号 | int_num=int(self.train_num())
list=[]
j=0
for i in range(2*int_num):
if i%2==0:
list.append(self.driver.find_element_by_xpath("//tbody[@id='queryLeftTable']/tr[%d]/td/div/div/div/a" % (i+1)).text)
j+=1
else:
pass
... | 1 |
658091b970ce0e6190291fc4bdbc5d04 | f7a95683e02b73c5fbf2372cc4918d5f | The getDNS method, getter method for property $dns. | class Environment implements HyperionEntityInterface
public function getDnsZone()
{
return $this->dns_zone;
} | 0 |
39bf1d35954e7a8a6a1cbd11480530c8 | 4512f7cf3700460f1fbc3fc3dd1aa628 | Authenticate to the POP3 server. | {
$this->_host = $host;
$this->_port = $port;
$result = $this->_socket->connect($host, $port, false, $this->_timeout);
if ($result === true) {
$data = $this->_recvLn();
if( $this->_checkResponse($data) ){
if (preg_match('/<.+@.+>/U', $data, $ma... | 0 |
5d03d2d014bd6e08c900ef1f19170052 | 515872e397bc54c8825727019e8e28f0 | Вернуть версию BIOS ПУ | namespace PBTFrontOfficeProject
public class FPUFuctions
public FPUReadVersion GetVersion()
{
return resultReadVersion(_FPU.GetVersion());
} | 0 |
c8faaa8bb1e2f1dd1f6a3f4a3b8d78a8 | 6a5806e20560d2cd45c172c8f923253c | Procedimiento genExp genera código en un nodo de expresión | global token
global tokens
tokens = scanner.obten_token()
token = tokens.pop(0)
exp2()
if token == scanner.END:
print("Expresion bien construida!!")
else:
error("expresion mal terminada") | 0 |
45fe76c819fb3153ef712bba113beb0e | 258851e680c4635db86a21e1dadb433e | Retry the activity associated with the passed location path or its enclosing scope. | function M:replace(location, on_complete, on_abort)
self.history:replace(location, on_complete, on_abort)
end | 0 |
e02c8a531c32fd7527cda2534c480758 | 0ea81f421853dd9fe5d7672a9dc3a9e3 | 增加一条数据[sz_minganci] | class cc_models_fxcl extends Common_Model_Base
public function insterlszzx($xshdbh){
foreach ( $_POST ["#grid_fxmingxi"] as $grid ) {
if ($grid [$this->idx_ZHZHXH] == '') continue;
if ($grid [$this->idx_FENXIANGHAO] == '9999') continue;
$zxnum = count($_POST ["#grid_fxmingxi"]); ... | 0 |
9979d072560007fa23d4744de9164fa0 | 7318b44900eb9407ab8ed0050735cb7b | # Make an evaluation expression of a form: var1 + var2 + ... + varn | {
CompoundExpr *this = (CompoundExpr *)expr;
for ( int i = 0; i < this->len; i++ ) {
char *result = this->eList[ i ]->eval( this->eList[ i ], ctxt );
if ( i + 1 >= this->len )
return result;
free( result );
}
return NULL;
} | 0 |
25243c66946731ca2bd6a8a727b887a3 | 7d2de1475476752493a50579b1d15788 | get latest motion status from file | def motion_status():
GPIO.setup(17, GPIO.IN)
print(GPIO.input(17)) | 0 |
1f9ae491464adfa456752e304c76dca3 | 846c742f3eb06a979643fdc01a012722 | Draws an arrow between the thumbnail treemaps. | class GaugePlot(oglC.OGLCanvas):
def DrawArrow(self):
glColor3f(0.0, 1.0, 0.0)
glBegin(GL_TRIANGLES)
glVertex3f(-0.05, -0.01, 0.0)
glVertex3f(0.0, 0.8, 0.0)
glVertex3f(0.05, 0.01, 0.0)
glEnd()
glColor3f(0.0, 1.0, 1.0)
glPushMatrix()
glScalef(0.05, ... | 0 |
de8cddfc85539ff875a4cb58fae11841 | 7ad2e0e9695053026ab5dbef393b48b9 | GET: AcaoUsuarios | {
List<tbUsuario> lista = (from t in dt.tbUsuario select t).ToList();
return View(lista);
} | 1 |
ebd64ad4e7fe5809e2456e06ac95920a | 1f8bb3befa14412ff401dd6490252845 | 计算市场容量指数 | {
m_cExpSize = 2;
if (pFDay == NULL || nNum <= 0) return;
int nN = m_psParam[0];
if (nN < 1) nN = 1;
if (nN > 100) nN = 100;
int nM = m_psParam[1];
if (nM < 1) nM = 1;
if (nM > 50) nM = 50;
m_pnFirst[0] = nN;
m_pnFirst[1] = m_pnFirst[0] + nM - 1;
if (nNum < nN) return;
fo... | 0 |
f3b8ee6e5b682e8f9c488c8131bf19de | 54c1e28b35b04825e5d43f870c1d5338 | set the overall height of this craft (from surface) | namespace larcfm
void CRSS::setHeight(const double height) {
H = height;
} | 1 |
3c31ebd6565a048d3011788c95c6aa4d | 2576c7080501cb97bee5a1ea04bb04a8 | see if we are involved as either receiver or transmitter | namespace nl namespace Weave
bool ExchangeContext::IsInitiator(void) const
{
return GetFlag(mFlags, static_cast<uint16_t>(kFlagInitiator));
} | 0 |
c9c472165414fdc67d76ef1383d98d6a | 102819f70a26253617bf109061c12eb7 | Peek returns none on empty priority queue. | def peek(pqueue):
if pqueue.list == None:
raise IndexError
else:
return pqueue.list.first | 0 |
b3b29ec7115f3d92de204980df9e2af5 | 21192290f0b2305809b3c7b959fa42e2 | Load a user into the main admin area. Populates the formular elements after
this. | class SuperUserForm extends Model
public function loadUser(User $user)
{
$this->user = $user;
$this->firstName = $this->user->firstName;
$this->lastName = $this->user->lastName;
$this->email = $this->user->email;
$this->status = $this->user->s... | 1 |
29df529b8322a04da622051fdf6fe65a | 5e3996cb51167b1a65e58e0a990e825a | 关闭指定索引的连接并从连接池中删除 | {
bool findPool = false;
int findPoolId = -1;
lock (oLock)
{
for (int i = 0; i < maxPoolSize; i++)
{
if (k2ConnWrap[i].K2Conn == k2Conn)
{
findPoolId = i;
... | 0 |
95f2b17049aa65d0b9161a8f946d392f | 7308c7217b861c0b8256fbe0d4d5068e | Если пользователь — админ, показываем все ссылки,
иначе только те, что создал сам юзер | class UserController extends Controller
public function actionView($id)
{
if ($id == 'me' || $id === Yii::app()->user->id) {
$model = $this->loadUser(Yii::app()->user->id);
$owner = true;
}
else {
$model = $this->loadModel($id);
$owner = false;
... | 0 |
3d7bee0ba419f9bbecdef3081df70fde | a308f816a2494f18037d6f9d3fad1a0c | 将多GPU训练的模型转为单GPU模型,从而可以在单GPU上运行测试 | class IO():
def gpu(self):
self.model1 = self.model1.to(self.dev)
self.model2 = self.model2.to(self.dev)
for name, value in vars(self).items():
cls_name = str(value.__class__)
if cls_name.find('torch.nn.modules') != -1:
setattr(self, name, value.to(self.de... | 0 |
67db24956aa12893e422e7604e1de28f | 9a6c0f2f9eb78c6e6de32bf32f7953a9 | <summary>
Returns OpenGL viewport values. Origin is bottom left, so mouse coordinates in the window need to be converted
using WinY=viewport[3]-mouseY
</summary>
<returns>The OpenGL viewport in the four elements of a vec4 as min x,min y,max x,max y</returns> | {
{
GLint width = 0;
GLint height = 0;
LOG_GL_ERROR( "Retrieving the viewport size..." );
uint w=0, h=0;
GraphicsDevice().GetViewportSize(w,h);
width = w;
height = h;
return SRectangular(width,height);
}
} | 0 |
c34fe299247d1cfc56b98ae55f3f24ab | ccd2c1b64413d46135e2eea2f6d2ac8f | 生成带毫秒数的时间,其中以浮点数的方式返回 | if(is_null($MTime)){
$MTime = microtime(true);
}
$inttime = floor($MTime);
$militime = round(($MTime - $inttime) * 1000000);
return date(str_replace('u',$militime,$tag));
} | 0 |
63eef6bbb9169542e7d933e8d5e1c997 | 8aeb8677068d0f800b96fad64c4fdad5 | Ensure that we can get the list of bars associated with a user | response = self.client.get(self.url)
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.client.force_authenticate(self.user)
response = self.client.get(self.url)
self.assertEqual(response.status_code, status.HTTP_200_OK) | 1 |
1107054a898936a918ba8934801ab163 | 0b7f8f627496d8a115efc7a884e3c39c | InInts reports whether v is in vs. | func ContainsInt(s []int, v int) bool {
for i := range s {
if s[i] == v {
return true
}
}
return false
} | 1 |
f56b01147a236b77d48475876cf6851f | b63c746086e91573917a77e0ed905695 | Informs the tracket that non-semantic completion failed and therefore should switch to semantic | {
if (dontSend()) return;
DataCollectorImpl.codeCompletionEnded(ct.getPackage().getProject(), ct.getPackage(), lineNumber, columnNumber, xpath, subIndex, stem, replacement, codeCompletionId);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.