query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
083295fbb690b7bf19d320e53e7bb595 | 5c5171c2fb1f85be868746b218e67ff8 | Удаленные сущности не отображаются | class App_Model_CustomSoft extends Orm\Model_Soft
public static function find_without_deleted($id = null, array $options = array())
{
parent::enable_filter();
$result = parent::find($id, $options);
parent::disable_filter();
return $result;
} | 1 |
32695526e36b01dceff999ab58c4fb52 | 6162c635b70dbe10f12fe94588541a99 | 删除Item(软删除) | @Controller
@RequestMapping("/item")
public class ItemController extends BaseController
@RequestMapping("/delete")
public String update(Integer id) {
Item obj = itemService.load(id);
obj.setIsDelete(1);
itemService.updateById(obj);
return "redirect:/item/findBySql.action?flag=0";
... | 1 |
99d1b1024c397942541d5aaa69efd496 | 68ec625779f2811ba4dff0255afcf4a4 | Send file. Send file using the embedded SSHClient. | namespace LibNetCat
public class Client
public void SendFile(string filename)
{
throw new NotImplementedException("Fixme");
} | 0 |
b39e0caf4c7813785680db8f038ed5b0 | 66c223ed019a6eaab51d1e59428780d1 | Checks if the given value is a valid form for a Indian Phone Number | class Validator:
def validate_phone_number(phone_number):
try:
if re.match(r"(^(?:254|\+254|0)?(7(\d){8}))", phone_number):
return True
except Exception as e:
lgr.error('validate_phone_number: %s', e)
return False | 0 |
6ded41ce2b681e05f55da56e9d5076c4 | 7c80b95341fd827172bc31bcc276f1e7 | To Prevent Serialize OwnerId Property | namespace Core2D.Data
public class Record : ObservableObject, ICopyable
public virtual bool ShouldSerializeOwner() => _owner != null; | 1 |
7279cb43ab89116a38af34df2d6738b4 | a1cb3021d8f304ae95a9280102452494 | Verifica se algum elemento do array passado esta nulo | public abstract class Assert
public static void noNullElements(Object[] array, String message) {
if (array != null) {
for (Object element : array) {
if (element == null) {
throw new IllegalArgumentException(message);
}
}
}
} | 1 |
2d09c1967c1c525d57e786ec2e499790 | 2b8b34d4933a1e6ad2675df4c3c446c4 | Get account details with minimum balance as specified | min_conf = str(min_conf)
try:
stdout = subprocess.check_output(["litecoin-cli", "listaccounts", min_conf])
accounts = json.loads(stdout.decode())
except:
sys.exit(1)
return accounts | 1 |
4847c604e4e77191bb4009102c7699fd | c0f2eaad4e87e468920ade4eb1eef686 | Retrieves (as CSV) all InvoiceLine payment attributions.
{ \"nickname\" : \"(CSV) Retrieve InvoiceLine payment attributions\",\"response\" : \"getInvoiceLinePayments.csv\"} | function eva__invoices.get_invoices() end | 0 |
9b6b1cae5300efbf54633fd50a7470c2 | 72ad9c22731dc52d0cd08d65ec097653 | Install custom fields to models.
Must be called after all models are initialized | if not ignore_validate and vmraid.flags.in_setup_wizard:
ignore_validate = True
for doctype, fields in custom_fields.items():
if isinstance(fields, dict):
fields = [fields]
for df in fields:
field = vmraid.db.get_value("Custom Field", {"dt": doctype, "fieldname": df["fieldname"]})
if not field:
try... | 1 |
38ac3e71353489ad958e4255be5a1f5b | f01e58244c854b8ca9fe65ef8892a482 | 删除一行数据。 | namespace CPC.Control
public partial class DataGridCanAddColumnRowControl : UserControl, INotifyPropertyChanged
private void mniDeleteRow_Click(object sender, RoutedEventArgs e)
{
DataGridModel dataGridModel = dataGrid.CurrentItem as DataGridModel;
if (DataRowList.IndexOf(dataGridMod... | 1 |
e7c93e5d9b6d5d5c93c5bd65df2ca72e | 1e004749fd7456fc01b4b8eb60ce6e55 | Returns {@code true} if, and only if, {@link #getTypes()} is an empty list.
{@code false} | interface TypeDescriptor
fun isEmpty() = myVariants().isEmpty() | 1 |
90a1a0a53e548567868c51cdec429f74 | 5067f6a4ce0f9b6d8197e5d61a31dbbf | read a byte array and store the content into file | {
try
{
FileStream fileStreamOut = new FileStream(p_strFileName, FileMode.Create,
FileAccess.Write);
BinaryWriter binaryWriter = new BinaryWriter(fileStreamOut);
binaryWriter.Write(p_arrByteData);
b... | 1 |
c92073424f2960aa62d26b81846b695d | b4a3c1f137460f83771b080cb22be0ed | Returns generator for indirect subroutine call operation | for instruction, *args in instructions:
if instruction == Operation.LOOKUP:
yield args[0] | 0 |
fd633a808b4e9174d086c255d6bf0ef4 | 806b454a990b2189c78be8fde9c74209 | Render result table from given data to selected template.
Parses man and women separate lists, if asked. | function renderResults(data, $template, split, title) {
var result = {};
if(split) {
var man = [];
var women = [];
for(var i = 0; i < data.length; i++){
if(data[i].sex == 'M')
man.push(data[i]);
else
women.push(data[i]);
}
result = {man: man, wom... | 1 |
edab65b7ec2e8f8ae687d707198c1c2e | ff404154ff5089cda33ddcec1b0171d7 | Return an impact factor, depending on the given positional index of an actor. | switch(index) {
case 0:
return 50;
case 1:
return 25;
case 2:
return 40;
case 3:
return 70;
case 4:
return 500;
}
return 0;
} | 1 |
4e898c54e1db8bc67f89169ab0011250 | 5f27032cce7ec117854b3fc981f57237 | Запрос количества резюме на сайте (асинхронно) | AsyncDataLoader.getDataLoader().execute("http://habrahabr.ru/info/stats/", false, new LoaderData() {
public void finish(String data) {
parseUserData(data);
if(l != null) l.onFinish(data == null ? "" : mUserName);
}
});
} | 0 |
0aae6bf7c56df9d6bd3d54e9055c6d49 | fb89bd744a472a60682300422705607a | Create a new BoolSetting and add it to the collection. | {
AddSetting( section, key, box.Checked ? TrueString : FalseString );
} | 0 |
56cfb02c60dd84d48fbb80b04e7dca77 | 3500459d3171ca431164283a7e23ceda | Getting songs from an empty database | namespace DatabaseConnection
public class DatabaseProvider
public List<Song> GetAllSongs()
{
return new List<Song>();
} | 1 |
1bebafc7576dd8d005d0579b6ca11dbd | 92a913b89656bbe4298715d0e3fe3d3d | 获取当前指定app_code在特定测试环境下使用的image | dslContext: DSLContext,
projectCode: String,
userDeptList: List<Int>
): List<String> {
logger.info("Input:userDeptList:$userDeptList")
val tImageFeature = TImageFeature.T_IMAGE_FEATURE.`as`("tImageFeature")
val tStoreDeptRel = TStoreDeptRel.T_STORE_DEPT_REL.`as`("tSto... | 1 |
619a01c150c89cff2408183da9415bfd | ac63b9572dfe94dcde10ec19e2b1ac41 | When a hook already exists, overwriting should replace the original file. | class HookController:
def overwrite(f):
setattr(f, HookController.FCT_FLAG, True)
return f | 0 |
9c0bdb91be772ad1b859bfcd9d7a1a6e | 45e2bbe4da856022f756cc97afb12614 | Test to make sure this rule does trigger with a document that
contains a block quote with a multiple line LRD with extra space on line 4. | def test_whitespaces_lrd_with_tabs_before_within_block_quotes_bare_over_two_lines_1xb():
source_markdown = """> [fred]:\t
> /url\t
[fred]"""
expected_tokens = [
"[block-quote(1,1)::> \n> ]",
"[link-ref-def(1,3):True::fred::\t\n:/url::\t:::]",
"[end-block-quote:::False]",
"[BLANK(... | 1 |
4ca93f7e2befd0e19e05f139a42c6ef9 | 804b1bbd9f9b8c21f46bc172c51efa3c | 在链表开头插入值为value的节点(插入到head节点之前) | def insertValueHead(linkedList, value):
newnode = {}
newnode["data"] = value
newnode["next"] = linkedList
linkedList = newnode
return newnode | 1 |
bb5db6c687b573ebd9b3d9434238c4b4 | f29dbcccbf5beed881aad056eae46661 | Adds a new section to Pie Chart based on angle (Degrees). | final Paint[] COLORS = { Color.DARK_GRAY, Color.RED,
Color.GRAY, Color.MAGENTA, Color.ORANGE, Color.CYAN,
Color.YELLOW, Color.GREEN, Color.PINK, Color.BLUE,
Color.LIGHT_GRAY };
PieDataset pDataset = pieplot.getDataset();
List keys = pDataset.getKeys();
for (in... | 0 |
e0b565f38d045c43d653b6fe79b14631 | 2cdd6bd6ff71c6fcbcfb8b1cab9a779d | Creates a new audio track by index. | {
$this->trackNumber = is_null($trackNumber = ArrayAccess::getInteger($input, 'position'))
? new TrackNumber
: new TrackNumber($trackNumber);
} | 0 |
cca7cbc257f07cf4b5f6c888a3785583 | 13e6134d60a81d1ad992efa153a1c436 | Получаем тесты с базы данных | {
$result = $this->query('
SELECT
*
FROM
`history`
ORDER BY
`id` DESC
LIMIT '. $this->limit
);
$tests = [];
$i = 0;
while ($row = $result->fetch_assoc()) {
$tests[$i]['i... | 1 |
c682391039bcade987ff899e08ab68a5 | a1ae43c7e9a0d48765476743373e0eaa | Japanese morphological analysis (POS tagging) using ipadic | import six
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
text = 'President Kennedy spoke at the White House.'
client = language.LanguageServiceClient()
if isinstance(text, six.binary_type):
text = text.decode('utf-8'... | 0 |
311b88ee8d7d388ff2eaff0834ece4e3 | 7c26fe89f9ec22bb6007eedd0ff0b080 | Delete all the tasks of a cohort | $sql = "SELECT * FROM `" . $this->avalanche->PREFIX() . $this->folder() . "_tasks` WHERE cal_id='$cal_id'";
$result = $this->avalanche->mysql_query($sql);
$query = "0";
while($myrow = mysql_fetch_array($result)){
$query .= " OR task_id='" . $myrow["id"] . "'";
}
$sql = "DELETE FROM `" . $this->ava... | 1 |
afe8373cb49da9cc2f9d9ee812ec41a0 | d5a5e1ea0a7f5a1700cc6dee00bb21f4 | Removes a packet handler. | namespace Game.Module
public class NetPlugin : IPlugin
public void RemovePacketDispatcher(int packetID, DispatchPacketHandler handler)
{
_PacketController.RemoveDispatcher (packetID, handler);
} | 1 |
5d59361eb328803c09ad1cc13c68be1b | 14333e95d7e48b2c1f89516dd4b8cc22 | GET: EquipoEmpleados | {
var bd_lesContext = _context.Elementoequipa.Include(e => e.FuncionarioIdFuncionarioNavigation).Include(e => e.ProjetoIdProjetoNavigation);
return View(await bd_lesContext.ToListAsync());
} | 1 |
35cc09b691b15b370ffb729e38b2d7ff | aa863385babdfb8f971a956eb63e39fd | 删除阅读理解下的小题 | let that = this;
that.setData({
loadModal:!0,
})
let userInfo = wx.getStorageSync(app.base.UserInfor);
let questionId = that.data.questionIds[that.data.activeIndex];
let obj = {
url: app.base.deleteWrongReviews,
data: {
userId:userInfo.id,
ids:questionId,
... | 1 |
bf5cd544b58a877c370cf77b090936c3 | 81b55b428823af46bb097432cc918054 | A reasonably fast convolution routine that supports re-entry with a
pre-FFT'd PSF. Returns the convolved image and the FFT'd PSF. | input_fft = fft.fft2(input)
PSF_fft = fft.fft2(PSF) + eps
result = fft.ifft2(input_fft / PSF_fft)
result = np.abs(fft.fftshift(result))
return result | 0 |
4b1bf4b45d05d4b005a13f19f497d402 | b085b2c6f6fbcab30dc275036f332585 | Converts an existing API profile to a Proxy profile. | class Proxy(proxy.Proxy):
def update_profile(self, profile, **attrs):
return self._update(_profile.Profile, profile, **attrs) | 0 |
0f99ab85451274cabd3bf13e65996ba8 | df9fe0a0e9b90359c49b4962d25ff72a | 删除景点前删除信息查验 | namespace FJW.BoLuo.Web.BLL public partial class GW_WScenic_Spot
public bool Delete(int SpotId)
{
return dal.Delete(SpotId);
} | 0 |
fc299c182a3e17b7407d7f69eb332bad | 9d326c15a2c945b1f62ea669a4c63222 | encodes session dict as a string | class BaseSessionStore(object):
def _encode(self, session_data):
session_data = self.serializer().dumps(session_data)
return base64.b64encode(bytes('%s:%s' % (self._hash, session_data))) | 1 |
4d32d6c08b970394961d33661a94c288 | 80f89b317af597847b70fa07c10c774a | change active / inactive status for vehicle | namespace VU.ViewModels
class CarStatusViewModel: Screen
public void ChangeCarStatus()
{
MySqlCommand com = IoC.Get<ShellViewModel>().connection.CreateCommand();
com.CommandText = "UPDATE Cars SET status=?status where id=" + SelectedCar.id;
com.Parameters.Add("?status", M... | 1 |
8f2ceef79337e422f9e97e54b969b0fe | 356f1759c48cbc313d93744187ec7a2f | Given user first name should return custom exception as invalid name format | class RegistrationTest extends TestCase
public function testInvalidFirstName()
{
foreach (["F", ""] as $fieldValue) {
$payload = $this->getPayload();
$payload["first_name"] = $fieldValue;
$response = $this->post(route("register", $payload));
$response->assertS... | 0 |
e38bfb7c04f28b48b740089f70815a30 | 66b930879b78894fa86241d3da413d8a | Sends friendship request result from current player to server | namespace FishingHole
public partial class FindFriends : System.Web.UI.Page
protected void SendFriendRequest(object sender, EventArgs e)
{
FriendActions.CreatePendingFriendRequest(Master.UsersInfo.ID, Convert.ToInt32(sendFriendRequestPersonId.Value));
GenerateSearchResults();
requestSentConfirmation.Visible... | 1 |
4ec164a3bbe14f8de3690b4d35b51c3f | 3ef50cd92b1a6037c7429892e0202746 | Returns a copy of the raw data stored in the class | class StreamingJSON:
def raw_data(self):
return copy.deepcopy(self._json) | 1 |
ddf7c888806921fa8237c1a35ecb572b | 72d910a2b394523713e1242886f89b3b | 校验更新的商品推荐存在 | class ProductRelated extends \Applications\Oss\Shop\Abstractions\AdminController
public static function ajaxCheckProductIsExist($request)
{
$pid = $request->get('pid', 'int');
$rp = RecommendProducts::query()->fields('id')->where('productId', '=', $pid)->all();
$data = array('isExist' => 'NO... | 1 |
dde2a66868f06a0033fbf6af203fec32 | 2f4a2d77b2a24f2dd4bb4b9f7cd72219 | Android调用: 传递 parentPath#filename | class MainActivity : AppCompatActivity()
fun androidInvokeJsByLoadUrl(view: View) {
web_view.loadUrl("javascript:callByAndroidLoadUrl()")
} | 0 |
453737407597cca53933f5ab81e95c1c | a6e0575af94cfcf1381fd5f1f292f788 | <pre>
【適用日付From】を取得する。
</pre> | @Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/09/12 17:12:05")
public class TProjInfoNames public static class _TProjInfoNames extends PropertyName<TProjInfo>
public PropertyName<Date> periFrom() {
return new PropertyName<Da... | 1 |
2674a244c02ec20f869b1395b13149fc | b7b2f63a8ff810dccc49f2f615db184c | used in ls | void ls (string path)
{
int max, i, len, tmp;
status trunc_flag;
mixed *dir;
set_this_object(previous_object());
dir = get_dir (path, GETDIR_NAMES|GETDIR_SIZES);
if (path != "/")
path += "/";
if (!dir) {
write("No such directory.\n");
return;
}
if (sizeof(dir) > 999)... | 1 |
533ee320bd5a10b793fa65b57a25cfa3 | 13336ab9023c14fade7bb5feb0498b98 | Retrieve AUS Tracking Log Retrieve a specific AUS Tracking Log for a Loan | class ApService extends \SoapClient
public function RetrieveMerchantLog(RetrieveMerchantLog $parameters)
{
return $this->__soapCall('RetrieveMerchantLog', array($parameters));
} | 0 |
10b14d806493461037a456f0f2e4338d | 69a445ee8a58c514f8e68357b081ab84 | Create terrain based on cosine bumps in random locations | {
for (int i = 0; i < blocks; i++ )
{
bool dupe = false;
int floorSize2 = 2*floorSize;
int rand_x = rand() % floorSize2 - floorSize;
int rand_z = rand() % floorSize2 - floorSize;
glm::vec3 pos = glm::vec3(rand_x, size * terrainLevel, rand_z);
if( i == 0){
_terrain.emplace_back(pos, size);
} else {... | 0 |
f25053e21639bdc01460c835d751200f | a969ceca99ad184355d12340304cf9a1 | Convierte una lista de DTO jugadores a jugadores | @Produces("application/json")
@Consumes("application/json")
public class UsuarioEventosResource
private List<EventoEntity> eventosListDTO2Entity(List<EventoDetailDTO> dtos) {
List<EventoEntity> list = new ArrayList<>();
for (EventoDetailDTO dto : dtos) {
list.add(dto.toEntity());
}... | 0 |
58a17924390b469fc3500797188b1375 | 9d5442c4d8b749ccf9041c64b8789e34 | Solves the rod-cutting problem via naively without using the benefit of dynamic
programming. The results is the same sub-problems are solved several times
leading to an exponential runtime
Runtime: O(2^n) | def rod_cut(n):
r = [-1 for _ in range(n+1)]; r[0]=0
s = [0 for _ in range(n+1)]
for i in range(1,n+1):
q = -1
for j in range(1, i+1):
if q < p[j-1]+r[i-j]:
q = p[j-1]+r[i-j]
s[i] = j
r[i] = q
return r,s | 0 |
6bdcd7b5719dba8874021488453cd822 | d37559ab55b691b636abc1fb38d59ccb | Récuperer une anomalie par identifiant | class ServiceMetierCtAnomalie
public function getCtAnomalieById($_id)
{
return $this->getRepository()->find($_id);
} | 1 |
c3954ee5f2bb5f726ff189e4d63c6ac4 | 3cecab6c95800a789b3294ee6a6e330d | Resets game specific properties on the given object | sessionScore = 0;
gameScore = 0;
gamesWon = 0;
playerObject = null;
isOutOfRound = false;
} | 1 |
75a79cb1c20f4b8b7171f940952a90e0 | 60d0ea58f1aae1e7818db3409ac0f970 | Ensures that the ucc binding source is kept in sync with the list contained in the extender. | let lineCount = 0;
let valueCount = 0;
while (lineCount < container.children.length && valueCount < values.length) {
let boundItem = container.children[lineCount];
let value = values[valueCount];
if (!boundItem.sourceBinding.equals(sourceBinding)) {
lineCount += 1;
... | 1 |
56191efa96d0d3597c0bc08e3b144164 | ab78f314118c0119a5e9e1cf3e2056e6 | r"""Create default settings taking just the metric of the given curve.
The optional keyword arguments can be used to set all the remaining
options. | return {
'fortran_compiler': 'gfortran',
'base_name': 'mol',
'spc_name': 'mol',
'memory': 4.0,
'r1dists_lr': [8., 6., 5., 4.5, 4.],
'r1dists_sr': [4., 3.8, 3.6, 3.4, 3.2, 3., 2.8, 2.6, 2.4, 2.2],
'r2dists_sr': [4., 3.8, 3.6, 3.4, 3.2, 3., 2.8, 2.6, 2.4, 2.2],
... | 0 |
a760458311ff73eed04a09a04a65b85b | 76e0a8422a390e3b3058c948bb9eb6ca | Returns conjugated copy of this quaternion (w, -x, -y, -z) | Quaternion Quaternion::Conjugated() const
{
return Quaternion(-x, -y, -z, w);
} | 0 |
a3d26c4701b576161503b5d9a0cf457b | f5af76f3102d291ff23129b91c81e930 | Sets the home page URL. | function setHomePage(url) {
this.setHomePage(url);
} | 1 |
57340bb3539322da72b488a06a80b624 | 95f9d8a24a03e5ed78f94c83b119f302 | Numero de pasos de la transicion a apagado. | public function getTransition(): ?int; | 0 |
09fbdb4bfd8724c60715007133756953 | 27920f6300349ba0ca417740205aa605 | Configures the application to use the specified implementation of <see cref="ITypeActivator"/>. | public partial class CliApplicationBuilder
public CliApplicationBuilder UseTypeActivator(IServiceProvider serviceProvider) =>
UseTypeActivator(serviceProvider.GetService); | 1 |
96b56328fbca0e68068a478bd3a5048f | cc4cd8e5ca1af169f2b596777911d01d | Create an instance of {@link UpStudentResponse } | @XmlRegistry
public class ObjectFactoryStudentPresence
public CreateStudentPresenceServicewsResponse createCreateStudentPresenceServicewsResponse() {
return new CreateStudentPresenceServicewsResponse();
} | 0 |
e0f340417da42f641e7369c320dd510a | 3f8c09a3be87e3b04e537437f76798b0 | Gets the value of the purchaseDate property.
possible object is
{@link String } | public class InitAuthRequestBRW
public String getPurchaseDate() {
return purchaseDate;
} | 1 |
b676037883d349474635e0c184ed3f01 | 9a6c75c2f1507492c0c457a4c07403c2 | Pop from the iterator stack. | class CLDS2_Seq_id_Hook : public CSkipObjectHook
void PopSet(void) {
if ( !m_Stack.empty() ) {
m_Stack.pop();
}
} | 1 |
7e65c27000287270a78cdf55c9cee8d5 | 0e7ed5c5afcd25c3221c4240a6e5e042 | Ottiene il punteggio totale di un utente | public double getTotal(String username); | 1 |
642ad1778cd90a7b31987a86e701c10e | fc2cbc103b89c34e721bbd225d42a86f | Main Pipeline for Preprocessing the Text | def preprocessing(dataset):
sentiment = dataset[['full_text']]
df = sentiment.copy()
df['cleansing'] = df['full_text'].str.replace('@[^\s]+','')
df['cleansing'] = df['cleansing'].str.replace('(#[A-Za-z0-9]+)','')
df['cleansing'] = df['cleansing'].str.replace('http\s+','')
df['cleansing'] = df['c... | 1 |
420074a758644e54b099acc11690b4d9 | 9113fae73ff759a77ded1a0fd921fcbc | Устанавливает позицию исходя из текущего элемента | namespace CheckSumTool.Settings
public class ColumnSetting : IComponentSetting
public void SetPosition(int x, int y)
{
} | 0 |
546c413d0f08af7f3fde44a8e3523266 | 19b76733210ef82b09f281aebb978ecc | Updates the editing object with this editor's values. | class ReadonlyEditor(BaseReadonlyEditor):
def update_editor(self):
control = self.control
new_value = self.str_value
if hasattr(self.factory, "password") and self.factory.password:
new_value = "*" * len(new_value)
if (self.item.resizable is True) or (self.item.height != -1.0)... | 1 |
99f178760fd57b370af45786217ec00a | 0a9da515493e0966eb4ad962d5bee058 | 监听队列smsQueue,有待消费的消息就处理 | @Component
@Slf4j
public class SmsConsumer
@RabbitListener(queuesToDeclare = @Queue("sms_quene"))
public void sendSms(SendSmsDto sendSmsDto){
smsApi.sendSms(sendSmsDto.getPhone(), sendSmsDto.getMessage());
} | 1 |
ddf6003cf1190a1d6da88b8710e09e5b | e2d36682db3705c8f7f74ee9891a36f3 | Retrieves all related entities of type 'StoreContactEntity' using a relation of type '1:n'. | class Order extends \BackendBundle\Entity\Order implements \Doctrine\ORM\Proxy\Proxy
public function getAllContacts()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getAllContacts', []);
return parent::getAllContacts();
} | 0 |
4566b53e79276b826fbf08532b382b1e | 466176b1829f8e6ab43ea6040fc6e6d9 | Returns the phone number, without the '+' in case of global number | function getDatabasePhoneNumber($phone_number, $country_code='KE') {
$phone_number = PhoneNumber::make($phone_number, $country_code)->formatE164();
return str_replace("+", "", $phone_number);
} | 1 |
96718229b3396fb3fb437534cd77d94b | 6ff84e925997b723204f95e88c0a261b | removes description, leading and ending spaces | {
$lines = \explode("\n", (string) $desc);
$leadingSpaces = array();
foreach (\array_filter($lines) as $line) {
$leadingSpaces[] = \strspn($line, ' ');
}
\array_shift($leadingSpaces);
$trimLen = $leadingSpaces
? \min($leadingSpaces)
... | 0 |
e31339ce42a070d1056dde4a5923591a | 45991ac913718172ae368da03a009e02 | 从数据库中获取复权因子 | sql = '''
SELECT A.ExDiviDate, A.RatioAdjustingFactor, M.SecuCode
FROM QT_AdjustingFactor A, SecuMain M
WHERE
A.InnerCode = M.InnerCode AND
M.secuMarket in (83, 90) AND
M.SECUCATEGORY = 1
ORDER BY M.SecuCode ASC, A.ExDiviDate ASC
'''
da... | 1 |
46d9f4aa89451a5942c65e3126fd1652 | 41dbcfe77a7f6c47ad00db18a0d283b6 | Method to add rows in Error LMS File | try {
PrintWriter pw = new PrintWriter(new FileWriter(outputFileName, true));
pw.print("<tr bgcolor=\"");
pw.print(REPORT_ROW_ERROR_COLOURS[reportRowErrColourIdx]);
reportRowErrColourIdx = (reportRowErrColourIdx + 1) % REPORT_ROW_ERROR_COLOURS.length;
... | 1 |
8692cff28df5478b2490f9a96663a2bd | 2eac57e065058b296614191228fb8b28 | 通过医生编号查找医生信息 | @Service
public class AdminServiceImpl implements AdminService
public DoctorChange findonedoctor(int id) {
return doctorChangeMapper.findonedoctor(id);
} | 1 |
94da26b712228066aeed43e336f59af2 | 9288c1b09c62bd03ebbb5640ed10c011 | Add new open node | class ISTravelSearch(GeneralSearch):
def open_node(self, new_node):
self.route[new_node.number] = new_node
if new_node.number not in self.open_list:
self.open_list.append(new_node.number) | 1 |
f49944e808081e7f904dc0ea9cb7a190 | d30a77ca37225310d0bd4be8110f574e | load the kernel modules needed to handle the sensor | class DS18B20(object):
def _load_kernel_modules(self):
system("modprobe w1-gpio")
system("modprobe w1-therm") | 1 |
379953202c3fb0baddbbe117c6adaebc | 523efadc9611f35ad339d1d41215ff07 | find adjacent non-zero values (works) | public class XGraph extends Graph static public class XVertex extends Vertex
public Iterable<Edge> getNonZeroItr() {
return () -> new NonZeroItrator(this.xAdj);
} | 1 |
80c6c0408a6aaf0635053fcae769a851 | 2c575603ac62f01364681708fbe6e9c4 | 회원탈퇴
회원정보를 삭제하는 것이 아니고
u_grade(등급) D로 설정하기(부분 Update) | @Repository
public class MemberDao
public void secession(String email) {
sqlSession.update(namespace + "secession", email);
} | 1 |
61f6a546cc681aa4c66332dfd6c3e7f2 | 887004104ac5faf82b9474143140d970 | Removes anthill and all its ants from the meadow field | public void move(objectProgramming.crazyAnimals.area.IMeadow meadow); | 0 |
2cea586b0190964ca0c374948f3f7274 | 6e62d70d2e4a5f731e025ffd04a9be5f | Loads the color from ini file. | {
InitColorCode( CodeCCX ) ;
CorrectExtension( file_name, ".tpc" ) ;
try {
boost::property_tree::ptree pt ;
boost::property_tree::ini_parser::read_ini( file_name, pt ) ;
for( const auto& i_key : pt.get_child( "Color" ) ) {
const auto& key = static_cast<string>( i_key.... | 1 |
14e688d94847bcf79bdb0ccb174c9f2f | baede736086e68662c7c8091fceeef73 | Generates a waiting list, where excess children are put. | while(roster.size() < class_capacity) {
if(!major_waitlist.is_empty()) {
Student s = major_waitlist.dequeue();
roster.add(s);
}
else if (!other_waitlist.is_empty()) {
Student s2 = other_waitlist.dequeue();
roster.add(s2);
}
else {
break;
}
}
} | 0 |
edaa6802211b650ce5bf94c9facaa0d6 | aec4db06722c8e491a08ff1fef2b9f66 | set up Aurora runner and accounts | dr = accounts.find_role( "Driver" )
driver = accounts.create_user( email="test_driver_1@test.com", password="pass" )
accounts.add_role_to_user( driver, dr )
from .models.driver import Driver
from .models.car import Car
car = Car( "Toyota", "Corolla", "Black" )
db.session.add( car )
driver = Driver( "test_plate"... | 0 |
5f0e003322fee96851728392c09e4672 | 54e3720572cec76034543bb6065f5fff | sets court numbers according to target courts identified by auto-reserve algorithm, so players can see
which courts the system will try to reserve | void AQuadBallCharacter::AlternateTargetCourtSide()
{
if (gameMode != QUAD_BALL_GAME_MODE) return;
myCourt = myCourt * -1;
} | 0 |
9d98f2f71f35e4fcd540e378e3f8177f | 76e0682eac882cbb146d15b552855e2d | We clear the error message state before the action.
That is because with continuations, the original (or cloned) action is being
executed, which will still have the old errors and potentially cause problems,
such as with the workflow interceptor | @TestInstance(Lifecycle.PER_CLASS)
public final class CallbackTest
@BeforeEach
void clearError ()
{
helper().clearError();
} | 1 |
09c1185b91924c99b762a4507c9d4292 | da9edba6b9450fea88ed2d95224320b5 | Handles the Click event of the bFreigeben control. | {
try
{
}
catch (Exception ex)
{
ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
}
} | 0 |
f2ee056d74faadb9f700f41cc94398ae | f610bdd3b14f79b85f8c735e21fd886b | Creates text node and append it to the element. | public class XPathDocument extends XPathNode implements Document
@Override
public Text createTextNode(final String data) {
return this.getNode().createTextNode(data);
} | 0 |
8a3e3bc862fe11e94915bda3fa89983c | 88d50c33f55608ccbf3833a98ec1f226 | 通过路径判断ftp服务器上文件是否存在 通过FtpClient的listNames方法列出路径文件夹下的所有文件 | login(ftpClient)
try {
val path = changeEncoding("""${Constant.BASEPATH}${File.separator}${ftpPath}""")
if (!ftpClient.changeWorkingDirectory(path)) {
logger.error("""${Constant.BASEPATH}${File.separator}$ftpPath$DIR_NOT_EXIST""")
... | 1 |
447b1576dcd17247a6235fe208cbb457 | af4218f37c5cd204819acd1e10efd056 | Increments the assert count. | namespace NUnit.Framework.Internal
public void IncrementAssertCount()
{
System.Threading.Interlocked.Increment(ref assertCount);
} | 1 |
8cf7c91f854e7c009aeff60dd11a5831 | 7f61448ad6da3ef0f9cb03f40c5be655 | meaning empty or only whitespace | cases like (1) | 0 |
d044e19b424c49207607a891e40f3239 | 55dbc12a37762641dcc56f0ea12d8db9 | <para>Normalizes a number from another range into a value between 0 and 1.</para>
<para>Identical to map(value, low, high, 0, 1);</para>
<para>Numbers outside the range are not clamped to 0 and 1, because out-of-range
values are often intentional and useful.</para> | namespace NullEngine.Core.Extensions
public static class FloatExtensions
public static float Normalize(this float self, float lowerBound, float upperBound, float minNum, float maxNum, bool clamp = false)
{
var num = self;
if (clamp)
{
num.Clamp(lowerBound... | 0 |
51db0f7929a47081d3f8c7d7399ffb55 | 22c1e555fe9b8712dbdeb922bdaf7cdc | 버프 실행 (방어하락, 공격증가) | function Arcter(){
Achcount++;
if(Achcount%5==0){
arrowEffectAnimation();
var ran1=(Math.random()*100)+1;
var ran=parseInt(ran1);
if(ran <= (critical/2) ){
hp -= attack;
document.getElementById("testHP").innerHTML = hp;
criticalCheck=1;
}else {
hp-=(attack/2);
document.getElement... | 0 |
2fdf204d558c4b2168205c8888126b1c | fde04f213a40f0e4b13d52d6dea5bcab | Initializes and opens EndScreenWindow. Closes GameWindow | class EndGameWindow(QWidget):
def __init__(self, result_text):
super().__init__()
self.result_text = result_text
self.initUI() | 0 |
315cd794860dc5d36109313202ef4367 | 86c765706396a55399c5a0c5e8d17deb | 获得今天在本年的第几天 | func getCurrentDayInYear() int {
return time.Now().Day()
} | 0 |
cf4ab9fb61a673ca07495dba1499a3d1 | 2a353368b1831fb094fee598c26c6fcb | Function to move the work from the remaining list to the finish list | {
for(int i = 0; i < Widget::workList_InAction.length(); i++)
{
if(msg.ID == Widget::workList_InAction.at(i).ID)
{
Widget::workList_Done.append(Widget::workList_InAction.takeAt(i));
fireEvent(command.task_event.workList_InAction_Removed, msg);
fireEvent(comman... | 1 |
4031e0862ad7802f2573b072e5186d7e | 2c8636b1e330b3d9866f25fab2f2f037 | 检查最右位的值 | if (*(first) >> 7 == 1) {
return 1;
}
else {
return 0;
}
} | 0 |
e1f7f98f459a6bbccfb43c39e4944925 | add76b3d00ac7a3c1545bfd138d1626f | Teste que checa se o método de ver se a lista está vazia
da classe MyLinkedList está funcionando. | public class LinkedListTest{
@Test
public void clearLinkedList(){
int Vtest1 =10;
int Vtest2 =11;
int Vtest3 =12;
LinkedList<Integer> l = new LinkedList<Integer>();
l.add(Vtest1);
l.add(Vtest2);
l.add(Vtest3);
l.clear();
assertTrue(l.size ==0);... | 0 |
b424b8e7f2361c3e03144f9f2d7707e9 | 7903ddf1c0d86ca0b287c70990e6006f | @brief stepifySeries
Adds additional points to a QLineSeries, effectively transforming it into a step plot to avoid the default point
interpolation of a QLineSeries.
We create a new pointsVector, preallocate the known final size and finally exchange the points. This is a lot faster
than individually inseting points int... | void QXYSeries::append(qreal x, qreal y)
{
append(QPointF(x, y));
} | 0 |
2c564d6665c929c44298de6ac842c23c | b712c26975fe23d1b4a5d464204f2127 | Returns the properly formatted mime type. Adds charset information if the mime type is a text type. | class FrontController implements Runnable
private function getContentType(Format $format): string
{
$charset = $format->getCharacterEncoding();
return $format->getContentType().($charset ? "; charset=".$charset : "");
} | 1 |
181401ec4ae347d05666593f8dd33699 | e22d09ecb427c85c794e72d6b8f8aecd | 切换全部的todo的状态 | export class TodoDataService
selctAll(flag) {
for (let i = 0 ; i < this.todos.length ; i++) {
this.todos[i].complete = flag;
}
} | 1 |
99ca35fb18b33b73982fdba2d9b23f25 | 6cf280e421ae4dcb96e766c502228980 | Test that resource usages are validated inside render bundles. | class ActionViewTestCase(TestCaseDeactivate):
def test_render_subbundle(self):
resp = self.client.get('/admin/blog/%s/edit/comments/' % self.post1.pk)
self.assertContains(resp, self.post1.title) | 0 |
42ca0c309e22b67763336ff1eb51a920 | 8d355ff5b052d3242d53b2b020e032c6 | 判断长度为n,元素分布服从0~n-1的数组中是否有重复元素。
利用数据分布特性,将下标与元素对应 | if (length <= 0 || numbers.length <= 0) {
return false;
}
for (int i = 0; i < length; i++) {
while (numbers[i] != i) {
int number = numbers[i];
if (numbers[number] == number) {
duplication[0] = number;
... | 1 |
a9284577d785e09402579c11d48f0078 | 52167ba8bdcb35a1faa680577e0800a9 | Helper method to construct an error list for the given exception message,
taking into account parser's configuration for returning full exception details. | {
return build(-1, 0, "MULTIPLE ERRORS", "Multiple errors while performing network operations.",
TextUtils.join("\n", errors));
} | 0 |
4579d658e9708ccf477d6cf152f6c13a | 88af632d1277f809b1ff89b44818ffc0 | cree les philosophes et les "lance" | n = arg;
pthread_t *threads;
if(!(threads = malloc(sizeof(pthread_t)*n)))return -1;
if(!(phils = malloc(sizeof(struct phil_struct)*n)))return -1;
if(!(sems = malloc(sizeof(mySem)*n)))return -1;
mySem_init(&semaphore,1);
for(int i=0;i<n;i++){
... | 1 |
953ec1c840063d4208003aeb61dd51ae | c4bac4ac906c13a5c36b40c4876d0b7c | Create the WCS pipeline based on EXP_TYPE. | class SpectrumOneD:
def create_weight_map_fits(self):
try:
if self.spectrum_header is not None:
weight_map_ImageHDU = fits.ImageHDU(
self.var, header=self.spectrum_header
)
else:
weight_map_ImageHDU = fits.ImageHDU(self.... | 0 |
01550c521fef4818ffd0b8db34b60f79 | 518bc3bf2502a01be49eb69994b7c31c | En/DecryptProperties | public class DESSecuritySupport implements SecuritySupport
public String decryptProperty( String sval )
{
final Matcher matcher = pattern.matcher( sval );
if ( matcher.find() )
{
sval = DES.decrypt( sval.substring( 5, sval.length() - 6 ) );
}
return sval;
} | 1 |
6cdc344c7cfcd6e29220d4a7ef5398cc | d5a83811d718e95c545c8ead25967851 | Método que mostra o endereço do imóvel vendável | return (
address.length !== 0
? address.map((adr, i) => (
<div className='row justify-content-between p-2
align-items-center m-0 mb-2 container-data' key={i}>
<div className='col-md-auto'>
<p className='m-0 p-0 text-black'>{adr.end_rua}, Nº {adr.end_num... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.