query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ae8fbacc76384ceda5270e5a49987b14 | cdffd4c82d3d7724f8b0fa642a8ee35d | Проверяет является ли переменная строкой | class ArrayClass extends PHPArray implements \ArrayAccess
public static function isString($var){ return is_array($var); } | 0 |
fd71d08810bbcb82fe1970d4b12359d4 | f105fe4181795f16d7daf664131e9954 | Check if given number is a semi prime. A semi prime is product of two (may or may not be distinct)
prime numbers | let quotient = parseInt(num / 2);
let product = quotient * 2;
let modulo = num - product;
return modulo !== 0;
} | 0 |
e2d026c6e4481cb09066a8201071975b | 1f8f1601fca3cb0fce5fb29f0723e67a | 向后台发送导入xls 文件请求 | @RequestMapping(value = "/x_u/r_Excel", method = RequestMethod.POST)
@Transactional
public RequestType r_Excel(HttpServletRequest req) throws Exception {
long time = System.currentTimeMillis();
long ida = time;
if (req instanceof StandardMultipartHttpServletRequest) {
String s = FileUtil.doFileUploadOne((St... | 1 |
c476f4362bbdd05e7bfbb6a790f6e0e4 | 506cdf033e621fd072140257d81bbc2b | https://stackoverflow.com/a/51993539 | def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]:
for first in iterator:
rest_of_chunk = itertools.islice(iterator, 0, n - 1)
yield itertools.chain([first], rest_of_chunk) | 1 |
b52d4f14cf9e30be1c2c0d173a6915c5 | e3116004bc1ef89140a01a2b08b0e2a0 | 启动WebService(服务端)服务,提供外部调用 | {
WebClient web = new WebClient();
Stream stream = web.OpenRead(_baseUri + "?WSDL");
ServiceDescription description = ServiceDescription.Read(stream);
ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
importer.ProtocolName = "Soap... | 0 |
2882ca8ca98426af53fdbd945178b71d | 93f3d83b762ab7d45dbe0b0e92c85154 | 修改土壤肥力分级信息 | @ResponseBody
public DataResult update(tb_soilNutrients tbUser) {
DataResult dataResult = new DataResult();
if (tbSoilNutrientsDao.save(tbUser) != null) {
dataResult.setMsg("新增成功");
} else {
dataResult.setMsg("新增失败");
}
return dataResult;
} | 0 |
6c456d385f83325f815c99c9c4ee8623 | 6bda860b12a7b96d49eafb214e5db26b | Set the helicopter's dispose status. In case {@code b} is true, try to
remove the helicopter from the pool permanently, and if it is occupied,
mark it for removal. In case {@code b} is false, the method should
prevent the helicopter from being removed if it has not been already
removed. | boolean tryDispose(); | 0 |
aae0d0d20bf838c3933f945ee9f365ff | 79d911bcc272edaea19b12e766504420 | Adds an ingredient requested by the recipe fragment. | public class FavRecipesFragment extends Fragment @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
@Override
public void onClick(View view) {
addRecipe(view);
} | 0 |
93f6214918553ed93653714c8596f00a | 3ae2b82b1ad45c70a623037621bc1c33 | Convert a user entered amount into how it should be stored in the
database. For example, a user may enter '9.75'. This will be converted
into '97500'. This gives us a stock market level of accuracy.
0.01 = 100 | if amount == None:
return amount
amount = str(amount)
return amount.replace("$", "").replace(",", "").replace(".", "") | 0 |
55ef1e975ac540187e69b6fcb676b2a6 | 2bb51a0d90a414b62d79c97b786a15f1 | returns the age of the PR in days | public class ArrivalsDocument extends XMLDocument{
public int getAge() {
return (int) ((new Date().getTime() - mRequestTime)/1000);
} | 0 |
b95f580b5c1f3a752d5fd7c9ff6e7786 | 49ee8c083bd8ca51a1657c528cef164e | Return a list of pool hashes, filtered according to the given options.
This method does not actually hit the server, filtering is done in
memory. | class PoolStash(object):
def _filter_pools(self, incompatible, overlapping, uninstalled, subscribed,
text):
log.debug("Filtering %d total pools" % len(self.all_pools))
if not incompatible:
pools = self.all_pools.values()
else:
pools = self.compatible_pools.val... | 1 |
1ea5f62e36bbc9ed0d817b79f65d6d24 | 2fe5ad71c37f0e72b3ed69ef65698265 | 自身の単位を度へ変換する | public class Measure
public static float units(float i){
return unit * i;
} | 0 |
2129d039f59ae6f4569a3e8619ab25d7 | e7c3946204c855618df25cf87430cad0 | 更新VIPBOSS列表 | {
string content = string.Empty;
var respData = new RespData();
try
{
var dataStream = Request.InputStream;
var sr = new StreamReader(dataStream);
var dataStr = sr.ReadToEnd();
Loggers.Debug(new Debug... | 1 |
8e613c1a5987ee51cb5fc9145f8d74e0 | 5dff10efb9cf7b321913a341da4b5ec9 | Compute model gradients w.r.t. inputs. | def input_grad(model, x, layer_idx=-2):
fn = K.function([model.input], K.gradients(model.layers[layer_idx].output, [model.input]))
return fn([x])[0] | 1 |
0fe04cc725235daa113617271f2ea55a | 59f1746c009c156238c5b83225b2ff6a | List of allowed key lengths for the currently chosen algorithm. | public class RsaKeyValidator extends KeyValidatorBase
public List<String> getAvailableBitLengths() {
final List<String> result = new ArrayList<>();
for (int length : AlgorithmTools.DEFAULTBITLENGTHS_RSA) {
result.add(Integer.toString(length));
}
return result;
} | 1 |
d886eeb6e30fbbf2a387e43f36ae7628 | bf77b93a8e3a65f5b18c900074dc0fa3 | Handler for MoneyEvent. Add money to manager. | public class GameManager : MonoBehaviour
public void AddMoney (float amount){
_Money += amount;
UpdateUI();
} | 1 |
bd89fe2bb5d1fd482f28bf9d1731453b | d78346fcecadc9c27c993e28e3500ef7 | determine whether the character is a vowel, consonant or neither | Boolean isVowel = Boolean.FALSE;
if('E' == character || 'A' == character || 'O' == character || 'I' == character || 'U' == character) {
isVowel = Boolean.TRUE;
}
return isVowel;
} | 0 |
f5f950c35b07e17bab37029e6fbe9f19 | 27aa680b2a7256411bdd861722a4f535 | 生成されたテンプレートをディレクトリごと削除する | class ModuleCreatorService
private function deleteDirTempByName(string $dirTempName)
{
$dirTempPath = $this->dirTempPath($dirTempName);
File::deleteDirectory($dirTempPath);
} | 1 |
3b52caffbb13dbc3f352a2c24e18d343 | 6eac1ad66ce0cac8ca2a59bf116b71d0 | Returns the language (de_CH => de) | class BrowserLocale
protected function getLanguage($locale)
{
return substr($locale, 0, 2) ?: '';
} | 1 |
fee2d0912bf023d2af689aa3665cf38f | 392422515ea328b11dc400c3a70636d7 | 嘚啵币商城列表(包括自己卖出的列表) | {
$where['uid'] = session("id");
$where['type'] = 1;
$buy_data = Db::name("excoin_buy")->where($where)->select();
$buy_id = array_column($buy_data,'id');
$buy_id_str = implode(',',$buy_id);
$list = Db::name("excoin_match")
->where("buy_id in({$buy_id_str})... | 0 |
ccd4a867ffa9c17f488c37696212df29 | 6b12b642a6c6aedc074a2505b385c680 | An iterator for an array stack. | class StackInterface(object):
def __iter__(self):
return None | 0 |
f88683b539a73a9df82da66ba8f44248 | c33c9f2cfd99fb778dd34f490d4400bd | 添加计时回调项目 | public class Timer
public void Add(string timerName, OnTimer cb, float interval)
{
AddCount(timerName, cb, interval, -1);
} | 1 |
e3f7e121ef0526ce70f4bf05e1994383 | 0a5dd37fbe990324bbf8a5d26262de2a | Principal function in the program | def main():
welcome_banner();
prompt_user();
calculate_load();
print_wing_load(); | 1 |
b4a9b16ac3b3de4299ee0c0f25dc50a6 | 3e62444aea9cd0aad5796193fc4d6e7f | calculate accelerations and velocities for sample motors | float w[3] = {0};
dV[X] = (Ts/3)*(dataAvgd[2][AX] + 4*dataAvgd[1][AX] + dataAvgd[0][AX]);
dV[Y] = (Ts/3)*(dataAvgd[2][AY] + 4*dataAvgd[1][AY] + dataAvgd[0][AY]);
dV[Z] = (Ts/3)*(dataAvgd[2][AZ] + 4*dataAvgd[1][AZ] + dataAvgd[0][AZ]);
w[X] = dV[X]*(q1[0]*q1[0] + q1[1]*q1[1] - q1[2]*q1[2] - q1[3]*q1[3]) +
... | 1 |
3462a42b8de0b6e3cac25e2560c5a00c | 5cfedb6790eefdafa1b2019d1a4660a4 | Compares two given values with given comparison sign | def sign(x, compare_to=0):
if x > compare_to:
return 1
else:
return -1 | 0 |
ce452c90addd684a9aac5e9c91fb0edd | 548a8eac001ab448e32fd2156170f225 | A focus change event event handler. This is an example that only logs a message. | {
var panel = getTopOfStack().GetCurrentPanel();
if (panel is IScannerPanel)
{
((IScannerPanel)panel).OnFocusChanged(e.WindowActivityInfo);
}
} | 0 |
60912900fbc724e1f79b19f6555f1f68 | 33023096ffc9ae8d0a55d07d9d3c5c76 | If the selected element's index value has changed, commit the change in the UI | namespace Zero
class PropertyEditorEnum : public DirectProperty
void IndexChanged(uint selectedIndex)
{
uint enumIndex = mEnumIndexes[selectedIndex];
Any newValue((byte*)&enumIndex, mProperty->PropertyType);
CommitValue(newValue);
if(mProperty->HasAttribute(PropertyAttributes::cInvalidatesObject))
... | 1 |
a011ac10d8b87096afc62b2ffb48c6de | 798436e170efcd9aa1443fdf89a97554 | Проверка, что заданное слово - сокращение для метров | слово_размер = сам.слова_секции[0]
размер = int(слово_размер.Проверить())
сам.массив_размерность[len(сам.массив_размерность)] = размер
сам.СловаСекции_Обрезать()
слово_запятая = сам.слова_секции[0]
запятая = слово_запятая.Проверить()
if запятая == ",":
сам.СловаСекции_Обрезать()
Размерност... | 0 |
4e005ceca378ec54d45da4baebb685c3 | 9e098d4dcc4e03a573c5fc1d4a99cf89 | ensure we don't accidentally use the same command twice | {
var ov = Commands.FirstOrDefault(p => p.Name == cmd.Name);
if (!overwrite && ov != null) return false;
if (ov != null) Commands.Remove(ov);
Commands.Add(cmd);
return true;
} | 1 |
04b3d5f09dc5290c30d6189c718604dc | b868927572991a9c0d9c5db81741727c | 通过 name 获取表单值,传入 name 或 name 数组,返回一组值,不传入返回全部值 | create() render()
getFieldsValue(fieldNames) {
if (typeof fieldNames === 'string') return this.getFieldValue(fieldNames);
const valueObject = {};
const fieldNameList = Array.isArray(fieldNames) ? fieldNam... | 1 |
b1f44e064aa70701576cd109dd4c18b0 | d64e2125aa496ad9ec6b4e7290d84000 | Waits for a signal from another thread, aborting if the operation is cancelled | namespace OpenRCT2.Network
internal class TaskSignal
public Task Wait()
{
return Task.Run(() =>
{
_signal.WaitOne();
});
} | 0 |
db068c3b5e0770a0918b1b08b67bb5aa | 8487449c961e3ffabdef8a64c8e6fc24 | Retrieve all teamrooms accessible to the authenticated user | namespace RingCentral.EngageDigital.Api
public partial class TeamsApi : ITeamsApi
public GetAllTeamsResponse GetAllTeams (int? offset = default(int?), int? limit = default(int?))
{
RingCentral.EngageDigital.Client.ApiResponse<GetAllTeamsResponse> localVarResponse = GetAllTeamsWithHttpInfo(offse... | 1 |
7d2c84173ca1e14417538afb87b740b9 | 40e2db255327d288fccb8ca5874269b5 | Set up the $_SERVER superglobal to contain all elements required by the DAV class | {
$this->backupServer = $_SERVER;
$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0';
$_SERVER['REQUEST_URI'] = '/index.php';
$_SERVER['SCRIPT_NAME'] = '/index.php';
$app_id = "app_id";
$app_secret = "app_secret";
$my_url = "http://localhost/gsoc/joomla-platform/facebook... | 0 |
a0cc389347c8693cdfb0a74254c5f76e | d7ed89a2541f871ca8b66a33e76f810d | 获取系统时间戳(东八区) | class ApisUtilTime
public static function getBeijingTimestamp()
{
return self::getTimestamp( '+8' );
} | 1 |
d83f75f01c67dca46bac560c6c7faf57 | 51081e653704402d6a7b9646402d64a6 | 查询用户当前投标任务所含权限 | var _data=data;
var thisModuleId=_data.stepId;
$.ajax({
url: '/api/taskCard/getCurUserProjectAuth',
type: 'get',
data:{
projectId:_data.projectId,
userId:localStorage.getItem('userId'),
},
success: functi... | 1 |
83590c51fed80f2ca0292e749654c730 | f2f9361ea85ee1e49d401bb10bf8d347 | 从虚拟路径中创建缓存标记 | {
if (!enableCacheDependencies)
return null;
var fn = this.GetFileName(definition, virtualPath);
if (string.IsNullOrWhiteSpace(fn))
{
return null;
}
var dir = Path.GetDirectoryName(fn);
if (!strin... | 1 |
d31aa1b26cc95a5ed6811ebf9a30d64c | ce85f0fe1e5c17a344d0030ded8be8c4 | Generate products recursively given the number of bonds that should be
broken and formed, a set for storing the products, a sequence of atoms,
of bonds, and of valences. `bond_can_form` should contain a tuple of
tuples of bonds that contains all possibilities for forming bonds.
Nothing is returned, but formed products ... | def _generate_hydrogen_assignments(heavy_atoms, total_h):
if len(heavy_atoms) == 1:
if total_h < ATOM_TYPE_TO_MAX_BONDS_ANY_FORM[heavy_atoms[0]]:
yield [total_h]
return
if total_h == 0:
yield [0] * len(heavy_atoms)
return
for num_for_first in range(
min(ATOM_TYPE_TO_MAX_BONDS_ANY_FORM[... | 0 |
2ab5a2c336e249a5d3da3502e482d6d1 | 3e7c4cd6a7b43c490f649a06ed8fc581 | 测试Set的contains方法(hashCode+equals) | public class TestSet
private void testHashCode()
{
HashSet<Student1> stuSet1 = new HashSet<Student1>();
Student1 student1_1 = new Student1("aaa", "00001");
Student1 student1_2 = new Student1("bbb", "00002");
Student1 student1_3 = new Student1("ccc", "00003");
Student1 student1_4 = new Student1("aaa", "00001"... | 1 |
e0fc0c5bfaa935bf699151a1089aff7f | 7ae158381b26bdf967cd93691610c0e6 | 将房间列表转化成字符串 | StringBuilder sb = new StringBuilder();
boolean isFirst = true;
for (Room room : rooms) {
if (isFirst) {
isFirst = false;
} else {
sb.append("<br/>");
}
sb.append(room.getFullName());
}
return sb.toSt... | 1 |
d539857ab4005f6dc883e0dc68e88ab8 | 2df0037cd4146eb48ded2d67519f4313 | Remove order data by order identifier. | public void removeOrderByOrderNumber(final String orderNumber); | 1 |
e68543bd7c1917bdc8166d3941409561 | 6afb545e4ad0cea5c527670a32f70681 | Function for computing average F1 metric | def f1(precision,recall):
return (2.0*precision*recall)/(precision+recall) | 1 |
e031314cd6ffd98257e783ce477a92a8 | 2737268a82b3000571329c6e62ffd6dd | Makes the subprocess checkbox enabled. | namespace FrankHogan_WarrantySystem
public partial class MainWindow : Window
private void chbxMakeT3_Checked(object sender, RoutedEventArgs e)
{
this.cbxMakeT3.IsEnabled = true;
} | 1 |
9b30a5c8f22859376181d8e10eb12766 | c3adfa14e41dfb9e46b7ce0262636016 | Permite cargar en el combo de cursos aquellos cursos que se impartieron en el periodo seleccionado | {
ReporteBo objeto = new ReporteBo();
this.cmbCursos.SelectedItem = null;
this.cmbCursos.Items.Clear();
this.cmbProfesor.SelectedItem = null;
this.cmbProfesor.Items.Clear();
this.cmbCursos.SelectedItem = null;
this.cmbCursos.It... | 1 |
3eca737176ac8807a9a775638ccb457e | 6847240025d9e598bb89f29cce62a7ff | Convert GMT to local time | datetime WINAPI GetLocalTime() {
datetime gmtTime = time(NULL);
localtime(&gmtTime);
return(gmtTime - timezone);
#pragma EXPANDER_EXPORT
} | 1 |
c9427cc8b0d3864046010fa77f377dcb | 8e6a48fedc2887090fa0e77b24334bf0 | Check if a folder exists - used to remove contents as required | if _, err := os.Stat(folder); !os.IsNotExist(err) {
return true
}
return false
} | 1 |
662a5f94018d69044d2b2f7f705eea25 | c9adcdec3fea012a8b0f0beb1d23bdcb | only add if a customer with same id doesn't exist. | func CreateCustomer(customer *Customer) (err error) {
db := DB.Clone()
defer db.Close()
c := db.DB(config.DbName).C(config.CustomersCollection)
numRows, err := c.Find(bson.M{"name": customer.Name}).Count()
if err != nil {
return err
}
if numRows > 0 {
return errors.New("Customer already exists")
}
if err =... | 0 |
8bc9feea74e05cd2026f78c801578cf6 | 133ca2a12283de6ff288cd0e929ed1a5 | Get user_name value.
Notes:
The name of the user associated with the license
This attribute is named `userName` in VSD API. | public java.lang.String userName () ; | 1 |
3c9962471cb61099178f5a1735283704 | e65d8c2ab924f6f6339893147ee743f9 | Swaps the values of two Cells.
Difference with [`std::mem::swap`] is that this function doesn't require `&mut` reference. | quote! {
pub fn swap_mut(&mut self, v: #ident) -> #ident {
let r = self.get();
self.set(v);
r
}
}
} | 0 |
680e218f2344830fd8ba5552663d52a4 | ea7a2f66d5aa4bf4bfa5e16cb05e7d51 | Bu fonksyon şehir tablosundaki bulunan tüm şehirleri listeler | public class MysqlOdev
public static void SehirleriListele() throws SQLException{
System.out.println("Sehirler:");
ArrayList<Sehir> sehirler=veritabani.getSehirler();
for(Sehir sehir:sehirler)
System.out.println(sehir.getID()+")"+sehir.getSehir());
} | 1 |
833e1e9ef81c1e045164a136ad69fdb3 | 1a80df8745117e37b3fc4dbfbb44df5f | Method shows whether the figures are on the same diagonal | public bool IsDiagonal() {
return x != 0 && y != 0 && Magnitude == 2;
} | 0 |
55906da02dbc203c8e91a494ea235ee7 | f7c6728b8d4862da73d0ced948fed4fa | array为待排序的数组,n为数组大小, | Integer[] sort(Integer arr[], Integer n); | 1 |
d68d4377035c01ff4eb8d0988dbaf697 | b64ae5966e97429e33d48d9032cc0e7c | r"""Dequeues a tuple of one or more tensors from the given queue.
This operation has k outputs, where k is the number of components
in the tuples stored in the given queue, and output i is the ith
component of the dequeued tuple.
N.B. If the queue is empty, this operation will block until an element
has been dequeued (... | class QueueStore(object):
def dequeue(self, destination): | 1 |
07e72b34fcab30a9ee61672229eacc93 | cf3ff0426270aed5a3696b86deb0c6da | Активен ли статус "премиум". | {
if ( self::$freemius->can_use_premium_code() ) {
return true;
}
return false;
} | 1 |
9e12a9d3ec4a312b44ad8749dc27d62c | 8ffb98629745374efa52bf2faed1275c | @brief Push biases to the accel bias 6500 registers.
This function expects biases relative to the current sensor output, and
these biases will be added to the factory-supplied values. Bias inputs are LSB
in +-16G format. | {
unsigned char data[6] = { 0, 0, 0, 0, 0, 0 };
long accel_reg_bias[3] = { 0, 0, 0 };
if (mpu_read_6050_accel_bias (accel_reg_bias))
return -1;
accel_reg_bias[0] -= (accel_bias[0] & ~1);
accel_reg_bias[1] -= (accel_bias[1] & ~1);
accel_reg_bias[2] -= (accel_bias[2] & ~1);
data[0] = (accel_r... | 1 |
88e1de25f8e236a47009b32f17c8421e | 71b22a7f0c6c0339d9f20b13d073db88 | Méthode permettant de convertir un objet valeur en entité. | public E convert(Object value) throws ConvertException; | 1 |
f6896d11c2b4f48832d2deab683f7aa7 | 24b4024d317873020646c98deb26860c | Retrieve a list with received dtmfs | class dcmatterController extends Controller
public function index()
{
$datas = dcmatter::all();
return response()->json($datas);
} | 0 |
68b5ecbe56bd74b59ec496124822f0a6 | 0f1fafc0dfd97602036ff88de014a11c | Визначає точний час | def get_time_moment():
return choose_moment(get_available_moment()) | 0 |
ff1f0ce20aa3b68beb88321771ef8be8 | 8bc8210218d8e4bcaf28d9f3eecf3b6a | use this method to click on Create a Car button | public class EmployeesPage
public void clickCreatEmployeeBtn()
{
new WebDriverWait(driver, 60).until(ExpectedConditions.visibilityOf(btnCreateEmployee));
btnCreateEmployee.click();
} | 0 |
ec8356f2fe7c5462b2cab3c1fe616c22 | 4e9087eb51d8de2bfba0222cdc23630e | Get the ID of the suggested item based on total bytes and threshold. | class NumberStorageCollection(collection.StorageCollection):
def _get_suggested_id(self, info: typing.Dict) -> str:
return info[CONF_NAME] | 0 |
964cc49ee3ec8849b5ebb0b1cd9b51ba | 193b9a7bbe09b8b542e660f16000302e | Get milliseconds of specified date time. | fun millisForDatetime(datetime: String) = SimpleDateFormat(FORMAT_DATETIME).parse(datetime).time | 1 |
a2eb92e51279981e2b6a02c2065ab903 | 48d51fce25cbb7e7dab8e9f19d55ff5f | 将buffer中的网络字节顺序的值转换为主机字节顺序表示的16位有符号整数 | namespace Moons.Common20
public static class ByteUtils
public static int HostToNetworkOrder( int value )
{
return IPAddress.HostToNetworkOrder( value );
} | 0 |
f805402aad7310dee25f9c3f5707efb9 | f599a950ec0e580f02503deef6b3711a | #################### implementation of function to check changes on the working folder | $curRes = `sudo -u pi ../bin/wrapper gitPull`;
if ($curRes == "Already up-to-date.\n") {
$result['changed'] = false;
} else {
$result['changed'] = true;
}
$result['output'] = $curRes;
return $result;
} | 1 |
9925bd55adff7ed44f71ff89a7b9ef7f | d40b94291b6c6156cc945829c3f03d1b | Prompts the user for coordinates of the piece they'd like to move and
where they'd like to move it to. | {
cout << "Enter the coordinates of the tile you want to place your piece in and hit enter.\n\"x,y\" (without quotes) " << endl;
} | 0 |
17f39d31bbea00d3c1132d5303479feb | d8deef9d34ab0c09d7dd0b847505bd57 | Simulates a short press on the Recent Apps button. # noqa: E501
Simulates a short press on the Recent Apps button. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | ) -> Optional[Response]:
if options is None:
options = dict()
options.update(kwargs)
return await self._go(-1, options) | 0 |
a9dfe09963955662a61c16e447e34c17 | 9bc6b60789ac5727183ccac0e338ba62 | 将功放设置为环绕立体声 | {
if(md->vc->mode & DMODE_SURROUND) return;
if(flags & MD_ENABLE_SURROUND)
{
md->vc->vinf[voice].panflg |= VC_SURROUND;
} else
{
md->vc->vinf[voice].panflg &= VC_SURROUND;
}
} | 1 |
048a16963020421581576ad51a58b0c4 | 8fa1d040665d90ec9b2fad4d812161f3 | Reset the allow late submission checkbox | $("#BulkGradesCheckboxContainer input[type=checkbox]").each(function (i) {
if ($(this).prop("checked") == false) {
$(this).click();
}
});
} | 0 |
c76a1daad00505a2094b4477e8bd1db8 | dc79d889d6fd4e1c439a17c4b9d61875 | Modify the tempo and pitch of the track at the same time. | def set_tempo(pattern, bpm):
track = _set_tempo(pattern[0], bpm)
pattern[0] = track
return pattern | 0 |
c0cf1c2bcaa64dd6cebac79957bb2a40 | 23290100212d513408f753906095c0a2 | scriptファイルが存在するかチェック。なければ作る。失敗したらfalseを返す。 | public function SCRIPT_EXISTS($script); | 0 |
3435b17e860cee95bc5c354295e5c395 | b9be1497a2c1b52d757b049b737031ab | Initialise accessibility listeners for this control. | namespace OpenLiveWriter.Controls
public class LightweightControlContainerControl : FocusWatchingUserControl, ISupportInitialize, ILightweightControlContainerControl, IToolTipDisplay
public void InitFocusManager(bool wrap)
{
_focusAndAccessibilityController = new LCCCFocusAndAccessibilityControl... | 1 |
9fc16b158e96b490e838855d464aeee3 | a1a0162b5284a27731a8c7b314ebb0ff | adds an object to the list for saving/loading. An object cannot be put into the list twice. | class IMADObjects(Interface):
def addToList(field, obj, allow_duplicates=False, safe=True): | 1 |
c70bb74a2f59261ea2df1159d6d49005 | 03435756c7cab5a7cac189daf715762c | Get Today's Current Weather Data - by Zip Code (via asynchronous Internet API call)
https://openweathermap.org | function getWeather(currentSelectedCity) {
const url = `http://localhost:3010/forecast?latitude=${cities[currentSelectedCity]['latitude']}&longitude=${cities[currentSelectedCity]['longitude']}`;
return new Promise(resolve => {
fetch(url)
.then(response => {
if (!response.ok) {
... | 0 |
b81e23c34923fa3466ebc49cb3aad3ae | f9fe91670bb6bf8663895d7416ea3ad5 | LastModified为null时,忽略序列化该对象 | public class JacksonUtils
public static String obj2jsonIgnoreNull(Object obj) throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
return mapper.writeValueAsString(obj);
} | 1 |
1f34f1e56a5bd5a1916997fb956f232c | fa0303f23626226de311567fb115a409 | This function takes in the Teaching Point Number of the lesson and return the corresponding Resource IDs. | class GradeEntryQueryInspector:
def get_key_resource_id_terms(self):
return | 0 |
4f94137fbd9ec085976806de011ddc1c | 56baaf6abf078e7c9075ff5a80622ca9 | Adds a color to the table. | AddColorChoice(const CString& usage, COLORREF color)
{
UINT size = m_ColorTable.size();
ctl_color pair;
pair.usage = usage;
pair.color = color;
m_ColorTable.push_back(pair);
return (UINT)m_ColorTable.size() == size + 1;
} | 1 |
f1d4fb41c0c7e22cfcf620e151f517fd | 3dfde27cf4a956fe8633f272a775f15f | Cette fonction me permet la création d'ID pour chaque utilisateur contenue dans le fichier csv
PRE:-
POST:le fichier utilisateur.csv à été modifier en ajoutant un ID à chaque utilisateurs | def create_UsersIdTxt(list):
f = open('users_id.txt', 'w')
for i in range(len(list)):
f.write(str(list[i]) + '\n')
f.close() | 0 |
b4a5d16142ef60f2915022307510b2b8 | b57d6875fec0c471225de2352eef46be | @brief Read from Extended Address Register, which indicates the current segment. | {
uint32_t id;
g_tProg.FLMFuncTimeout = 500;
id = swd_flash_syscall_exec_ex(&flash_algo.sys_call_s,
flash_algo.read_extid,
addr,
0,
0,
0);... | 1 |
6fc3b937c380a26a625cdafaee92d8d1 | a9def66a9e421a5478c9f851bcf53a0f | Launch the storyboard called btnExitPointerEntered, animate color of the button BtnExit with the color resource ExitColor. | namespace GuessMyZik.Pages
public sealed partial class GamePage : Page
private void BtnExit_PointerEntered(object sender, PointerRoutedEventArgs e)
{
btnExitPointerEntered.Begin();
} | 1 |
9dc63dd3368739a1ad8584f34ee47346 | e76b8dc31dc1a72cb926bb513d553d36 | 批量恢复User | class UUser
public static function restore()
{
self::$long = 'yes';
$data = Array(
'type' => 'restore',
'long' => 'yes'
);
return self::authorizeRemote($data);
} | 0 |
5f2e9a392aa0f533ced49d5e16634877 | 5e4a9cab594949487b071501867e836a | Draws a line that connects the winning squares | namespace sdkSocketsCS
public partial class MainPage : basepage
private void ShowWinningLine(TextBlock w1, TextBlock w2, TextBlock w3)
{
w1.Foreground = _greenBrush;
w2.Foreground = _greenBrush;
w3.Foreground = _greenBrush;
} | 0 |
1fc2e7aad43c868b73a8a5b3f4a96706 | e37392de3ce5b07e18fc4f81890adb43 | Advances to the next document in the set and returns the doc it is
currently on, or <see cref="NO_MORE_DOCS" /> if there are no more docs in the
set.<br/>
<b>NOTE:</b> after the iterator has exhausted you should not call this
method, as it may result in unpredicted behavior. | public Document nextDocument(); | 1 |
51d9c465fd641a00fd9d8a3aedfb54d3 | 9f2ccb6ea58a15a5c06779ce6b73c396 | translate OpenCv coordinate to Web coordinates
It seems the origin of open cv is top left, while the origin of the browser is in the middle.
This function translate the coordinates relevant to the given element. | let realWidth = e.target.clientWidth;
let realHeight = e.target.clientHeight;
let realX = e.offsetX;
let realY = e.offsetY;
let canvasX = Math.round(realX * (2000/realWidth));
let canvasY = Math.round(realY * (2000/realHeight));
return [canvasX, canvasY];
} | 0 |
2626ebf35c5efba01464e4b798c6a72f | da24b503e8d902e8c8a12027ea1c4d11 | Retrieves all the visual descendants of a dependency object with the specified type. | namespace Dotc.Wpf
public static class DependencyObjectExtensions
public static IEnumerable<T> FindDescendants<T>(this DependencyObject obj) where T : DependencyObject
{
var queue = new Queue<DependencyObject>(obj.GetVisualChildren());
while (queue.Count > 0)
{
... | 1 |
76e125b428b1f6c90d1744e771e26616 | 831a51ffecc46f966498a973e7e0eed5 | Greedy_BLAST: greedy, no preemption | def runblastn(query, database, blastoutput, evalue=str(10), outfmt='custom qcov', task='blastn', num_threads=str(1), max_target_seqs=str(500), max_hsps=False, perc_identity=False, qcov_hsp_perc=False, culling_limit=False, word_size=False):
import subprocess
evalue=str(evalue) ... | 0 |
d29383d1da83daad23801c986cc0475b | a05cfb91380100b18575a602d4557501 | @brief Determines whether the arm has returned to its "Home" state. Checks the current joint angles, then compares them to the known "Home" joint angles. | Eigen::Vector3f differenceVector = (jointSystem.joints[jointSystem.joints.size() - 1].endingPosition - goal);
float errorTerm = differenceVector.norm();
if (debug) {
cout << "Error term of \n" << jointSystem.joints[jointSystem.joints.size() - 1].endingPosition << "\nis " << errorTerm << "\n";
}
if (errorTerm < E... | 0 |
94b4cec5c4f08685fa2daf860efc8055 | 5b23bcad4f274b462ce615ebe9c8c053 | 斜め上へ動ける駒 | let w = 4
let backarray = []
array.forEach(element => {
backarray.push(element.slice())
});
if(array[y - 1][x + 1] === (3 - player)){
array[y][x] = player
}
while(array[y - 1][x + 1] === (3 - player)){
x += 1
y -= 1
array[y][x] = player
if(arra... | 1 |
551aa31b0016e62c31de51b06dcaad13 | 9438fcd123d82bfe74943b9e41bc5bb1 | Permet de savoir si un patron d'expression régulière est valide. | final class Route
private static function isValidRegEx($string) {
set_error_handler(function() {}, E_WARNING);
$isRegularExpression = preg_match($string, "") !== FALSE;
restore_error_handler();
return $isRegularExpression;
} | 1 |
822e2a3c289c4e64606249d2bdf75f2d | 0a6f3e62a8674f3b1027e94a58f9640d | Returns a new object of class '<em>ECL Unicode</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EMObject createEMObject(); | 0 |
7c9856469729bb84068a32a19dfe3fa8 | 91d028cad9b6e13f69b364ab6e55144d | **Write a Python function that checks whether a passed in string is palindrome or not.** | is_palindrome = False
word = s.lower()
for i in range(len(word)):
if word[i] == word[-1 -i]:
is_palindrome = True
else:
is_palindrome = False
break
if is_palindrome:
return s + " is a palindrome"
return s + " is not a palindrome" | 1 |
f99e6879fab1fc22cd0e8e09cb8ad953 | 6d2b73613382d2a5a48d20d164109e93 | Страница рецепта. | class RecipeController extends Controller
public function show($id)
{
$recipe = Recipe::where('id', $id)
->with(['steps', 'doctor', 'ingredients.unit', 'ingredients.ingredient'])
->firstOrFail();
$recipeCategories = CategoryRecipe::where('recipe_id', $recipe->id)->with('categ... | 1 |
bbfab273be5be6c6ddca4d57823f6d0c | 709c9161a45b6152dbc58b1310bd8a5f | Generic routine to insert a record in a table and return the auto-assigned unique id. This uses a field list,
a list of corresponding values in the same order (value[1] is for field[1]), and the name of the
field that will contain the returning id. This field name must be in the field list. | def insertData(dbFileName,values,sqlInsert,sqlReturn,uniqueValue):
connection = sqlite3.connect(dbFileName)
cursor = connection.cursor()
cursor.execute(sqlInsert,values)
cursor.execute(sqlReturn,(uniqueValue,))
ID = cursor.fetchone()[0]
connection.commit()
connection.close()
return ID | 1 |
1bd1a843c74c7316513f9b70191b00fb | 1fea8afa2f2fc6be33387988299008eb | The base class for defining a collection of models | class Collection(SocialObject):
def __init__(self):
super(Collection,self).__init__()
self._objects = [] | 1 |
9a9c58c1c4c37689adf7518ea673c48e | d6b67aa597c3a5672efc5892a7aafa66 | Returns block summaries for the passed height range. | end = end || start
return _mapToBlockData(_lastBlocks.filter(block => block.data.height >= start && block.data.height <= end)).toArray()
} | 1 |
04cbd23d1ad1ec10b8b1c4dda2a94256 | f4c825dff8038aec95410bfb505f5807 | Check the block can be put in the specified location. | try:
for offset in block:
nx, ny = x + offset[0], y + offset[1]
if not (0 <= nx < self.width and 0 <= ny):
return False
if ny > self.height:
continue
if pool[ny][nx]:
return ... | 1 |
8e176e9923154069196aee02743b20b8 | 51c63669694914e575afc6009f00dc1b | Last refresh time of the DPMContainer. | class Pod
def last_refresh
@dt
end | 0 |
11987570d80d18f26c225f74aca03f56 | 3de2d5b9689f14abc72c1810986e6f29 | Método de busca do arquivo de configurações da API | {
string path = "config.txt";
if (!File.Exists(path))
return false;
FileStream fs = new FileStream(path, FileMode.Open);
StreamReader m_streamReader = new StreamReader(fs);
m_streamReader.BaseStream.Seek(0, SeekOrigin.Begin);
... | 1 |
138f781a7126e55ac9716c7187536d9e | 0b75d40a8e12af54d04812e79947baa7 | Get the mime type of an image | $imageType = strtolower ( substr ( image_type_to_extension ( $imginfo [2] ), 1 ) );
return $imageType;
} | 0 |
61a38d44e31545230ab2d9d90baabf4e | b503471f7b0a105cbb1cfecbaabcfff8 | Advance the virtual time by the appropriate amount:
- Operations that modify the program counter need 2Tcy, according to the PIC16C84 manual.
- All other operations only need one instruction cycle. | cycles = 0;
while (cycles <= amount) {
if (nmiLine) {
NMI();
cycles += 7;
continue;
}
if (!interruptFlag && irqLine) {
IRQ();
cycles += 7;
continue;
}
... | 0 |
8827b8b75875d8fa5650030a8eb60405 | 5a6769dc62c73f90dedb8c780d4148c5 | API for building the movie-movie similarity model using the dot product | user_id = keras.layers.Input(shape=(1,), name="user_id")
gender = keras.layers.Input(shape=(1,), name="gender")
age = keras.layers.Input(shape=(1,), name="age")
occupation = keras.layers.Input(shape=(1,), name="occupation")
movie_id = keras.layers.Input(shape=(1,), name="movie_id")
genre = keras... | 0 |
513af200c360f785347853a519433274 | 3dcafcdde1662856380859f752afc102 | Average number of participants | double Analytics::averagePeopleEntry()
{
std::vector<int> countPeople;
countPeople = storeUpdates();
int totalCount = 0;
for (int i = 0; i < countPeople.size(); i++)
{
totalCount += countPeople[i];
}
return ((double)totalCount / (double)countPeople.size());
} | 1 |
62b07981c2e431ba2f8a819327d29baa | 6df9d1aa09465c42d81e40ec26fd2d54 | 获取学校logo | class Pathmanagement_ams extends Pathmanagement
public static function uploadSchoolLogo() {
return self::getWebroot() . self::getAttachment() . self::$school_logo;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.