query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c91961f2f01601be4379667c0666e960 | 0a391501052e6c0563065692aa43ab97 | 激活出牌界面 | {
for (int i = 0; i < 5; i++)
{
IdAndPlayerDic[SelfPos].transform.Find("cardPoint").Find("Card" + i.ToString()).gameObject.SetActive(true);
IdAndPlayerDic[SelfPos].transform.Find("cardPoint").Find("Card" + i.ToString()).GetComponent<TweenScale>().PlayForward();
yi... | 1 |
45fda471281b36ecd5fe1e68d61c2239 | 44b31a19390904a9188730d446ed92dd | Converts the Reactive List into an observable change set | Func<TObject, TimeSpan?> expireAfter = null,
int limitSizeTo = -1,
... | 1 |
3ff6c16965a410ef613878ca9835ddf4 | 564d370602c2a1b0a446f491cc6ba1d9 | Size relative move. | class SMC100(object):
def move_relative_um(self, dist_um, **kwargs):
dist_mm = int(dist_um)/1000
self.move_relative_mm(dist_mm, **kwargs) | 1 |
d6bfc672e43281cf37df1ccebd3a1aa7 | 7e95d38ce5a2d4628b1fc19345de1671 | 获取所有在线好友 | public class ChatAPI
public List<Friend> getAllOnlineFriends() {
return api.getOnlineFriends();
} | 1 |
1329aa9b12e1b0c22553c3544713a0a8 | ff55ee048e2351b46e4a324ca41ff733 | Find the most expensive policy (as a total cost) | double value = 0;
double max = 0;
int maxNumber = 0;
for(int i = 0; i < N; ++i){
value = (double)this[i].points / this[i].budget;
if(value > max){
max = value;
maxNumber = i;
}
}
return this[maxNumber];
} | 0 |
8aa16146a144381dcd8920d3aeff4975 | 5f7a2a81be44ae6d06824d1ef17144b0 | Constructs SingleFieldSpecification | {
$this->addValidator(
new BasicValidator(
new SingleFieldSpecification($fieldName, new IsMatch($pattern)),
$fieldName,
$errorMessage
)
);
} | 1 |
0ea89289440f4374b5bf3e8c2ca56fe7 | ab02d2f5fb9a4a52981db1fcf6654d90 | Returns the maximal value of the chosen numerical attribute | public class IBk extends DistributionClassifier implements
OptionHandler, UpdateableClassifier, WeightedInstancesHandler
public double getAttributeMax(int index) {
return m_Max[index];
} | 1 |
1947b1bf28ba59c6b611c093bb2f5a17 | eb947322de2a08365b10562903529c75 | 生成测试的时候,xgboost所需的数据 | def xgb_test(data):
X_train,y_train,X_test,y_test=splitData(data)
xgb = XGBRegressor(max_depth=2,learning_rate=0.15, n_estimators=500)
xgb.fit(X_train,y_train)
print(xgb.score(X_train,y_train))
y_xgb=np.expm1(xgb.predict(X_test))
df=pd.DataFrame(data={'true_value':np.expm1(y_test),'predict':y_xg... | 1 |
2d4f2cf4f0a4783d1ce4b5a83fbd392b | 6abe1159e6fbbf2bc8ccecf551ff7622 | Get Currency Pairs | namespace EFCoreApi.Models.Service
public class BittrexService : IBittrexService
public Task<List<PairData>> GetPairsAsync()
{
return _apiDbContext.Pairs.ToListAsync();
} | 1 |
e0db19cfba299d524781666ec9bf7a0b | 4241870a674b8067918ba2130ceef211 | Output each column value as a line in its own file. | {
for (int columnIndex = 0; columnIndex < lineData.Columns.Length; ++columnIndex)
{
int columnNumber = columnIndex + 1;
if (!MapColumnNumberToFileWriter.ContainsKey(columnNumber))
{
MapColumnNumberToFileWriter.Add(
... | 1 |
2b9d0ab5173f2336e0d3d6ee45f88fc6 | a66a34d31ff75cab9512131c19d1b5e4 | <summary>
This defines the properties representing the imageable area on paper targeted
by a print operation.
</summary>
<ExternalAPI/> | export class PrintableArea
constructor(origin: Coordinate2d, size: Size) {
this.origin_ = origin;
this.size_ = size;
} | 1 |
86ea2e3a92c370d20d081127ba76a807 | e851ffd2ee6c39ebbc4dee67ef6dd241 | 定义一个方法来计算圆的面积 | {
var area = Math.Pow(radius, 2) * Math.PI;
Console.WriteLine(area);
} | 0 |
dcc26154af3477afb5cea967dfb9370a | 7f560c346bcac7c049dae306a9148119 | Save a Version | namespace Potato.Core.Shared.Database.Migrations public class MigrationController : CoreController
public void SaveVersion(int version) {
this.Bubble(
CommandBuilder.DatabaseQuery(
new MigrationModel() {
Name = this.Settings.Name,
... | 1 |
0e4498a2e840c6e361b65ea15d25d73c | ebefee5f7dd7a0f136a49e98bdf44f26 | Find a new incremental experiment ID | class ResultsLoggerClient:
def lease_next_experiment(self)-> Tuple:
r = requests.post(self.__servername + ResultLoggerConstants.ROUTE_LEASE_EXPERIMENT,
data={ResultLoggerConstants.FIELD_CLIENT: self.client_name})
assert r.status_code == requests.codes.ok, r
if r.text ==... | 1 |
67bb00f40357826d383ab89280b219c6 | f1353369626ba9eb220f240824a66a79 | perform some post-checking on an option. this disambiguates values
that are candidates for positional arguments, and warns about invalid
values. | def check_opts(obj):
if obj is None:
obj = {}
elif hasattr(obj, '__getitem__') \
and hasattr(obj, '__setitem__') \
and hasattr(obj, 'get'):
pass
else:
raise TypeError, '"opts" invalid'
return obj | 0 |
9ac02e8ad1312caef7547c93c0f28d48 | 60f161a7abb1c6bec07a91ce013fbcca | Accepts the questionnaire's constituent sectional value types and calculates total scores. | export class ExportService
getTotalScore(questGroups: QuestGroup[]): string {
const totalArray = [];
questGroups.forEach(group => {
group.questions.forEach(question => {
if (question.answer && question.answer.answer_options.length > 0 &&
question.options && question.options.length > 0) {... | 1 |
c01900e11c2b346ae44abca75e81e2f6 | 4238aff73f12aad285e4fa2e0fac7f04 | Uses Symfony MimeTypeGuesser to guess the mime type of a file. | class UploadFileValidator extends Validator
protected function getMimeType($file, $file_name)
{
if (!extension_loaded('fileinfo')) {
if (!$this->mimeTypesStrict) {
return self::getMimeTypeByExtension($file_name);
}
throw new InvalidConfigException('The fil... | 0 |
6e51f6ef96e5ad22ee22d6209b6a7f43 | 84a9c0d3bdc44c44c1e606f83cae6547 | 새 props로부터 state를 동기화시켜줘야할 때 사용한다.
예를들어 props로 넘겨받은 값을 state에다 저장해야할 때. | export default class Node extends Component
componentWillReceiveProps(nextProps) {
this.setState({...nextProps});
} | 1 |
e8f41ff33dccaaf642624ce0d34ec1fc | 367ee2865315b4829bd3dce37af2a877 | requests Prolog server a PC Easy play | from subprocess import Popen, PIPE
from threading import Lock
import shlex
self.lock = Lock()
self.proc = Popen(shlex.split(command), stdin = PIPE, stdout = PIPE)
reqCommands = ["known_command", "name", "version", "quit", "boardsize", "komi", "clear_board", "final_score", "play", "move_history"]... | 0 |
3b16948b0dbe7ced29d3bd587f330438 | 044355999a2b8c38f2e279e7e17a71f3 | Permet d'rattacher un objet détaché pour synchorniser son état avec la base
de données
l'objet détaché contenant éventuellement des modifications
effectuées en dehors d'une session | public <T extends BaseBean> T merge(T detachedInstance); | 1 |
4e7409e500dc33a1c986c6125e62a6dc | 75297b0fcade7dfef09aba9aa3495c65 | Cuando el tablero mueve una ficha, llama a esta función para notificarle
que la ha movido. | void notifyMoveMade(); | 1 |
51f1c013a48205ebdfb14046906eebaa | 8f810f6118b892b4c117f86523f4b543 | Add new tags for a parcelInvoiceLine. Adds a tag to an existing parcelInvoiceLine. | namespace Infoplus.Api
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteParcelInvoiceLineTagAsyncWithHttpInfo (int? parcelInvoiceLineId, string parcelInvoiceLineTag); | 0 |
3436c9ab8789e8aefa6e4724f69cf5f4 | 50cad0b245223dfd312bc680eaefa077 | обновление одной записи в UMSC | class USPStableAccess extends connectMysqliDatabase
function store_record($row, $col)
{
$x = $this->get_record($col, $row[$col]);
if ($x) {
$query = "UPDATE $this->table_name SET ";
foreach ($row as $key => $value) {
if ($key <> $col) {
if (is... | 1 |
58ead14ba9e854177b94de87e48a9b06 | 60f1e98efefeb89929c8566241062b72 | Moves the current value to the archive, and resets the current value. | export class State extends EventEmitter
archiveValue (context, skipValidation = false) {
if (!skipValidation && !this.isValid) {
throw new ValueArchiveError(`Cannot archive invalid value for current state: ${JSON.stringify(this.value)}`);
} else if (this.multivalueLimit && this.archive.length === this.mu... | 1 |
6f022e3391c7bd8070d778c9915d4f5d | b46d5a66093b59eb12361964d8bcfbce | *左スティック横軸入力を返す | float Gamepad::LeftStick_X(){
short sX = m_State.Gamepad.sThumbLX;
return (static_cast<float>(sX) / 32768.0f);
} | 1 |
3e1324a53ff277c8d9ace0e9b5502c8a | 3dc889407105bafded9ad00b07348825 | Returns a <i>bool</i> indicating whether the specified recipient caused a bounce during the last sending
of the specified mailing.
mailing, <i>false</i> otherwise. | public function findLastSendingForMailing($iMailingId); | 0 |
4383ed808ae676ef427a7e084dcf6982 | 822a1f36f993ab998c8ea4a467f220d9 | Shows the grid containing the processed bankitems | {
this.bankaGrid.Rows.Clear();
this.bankaGrid.Columns.Clear();
monedha_id = new DataGridViewTextBoxColumn();
monedha_id.Visible = false;
monedha = new DataGridViewTextBoxColumn();
monedha.ReadOnly = true;
monedha.HeaderText = "M... | 1 |
7c2ccff823ef83ef023c0d9284c515df | af30f1d94a37fab00fb98a547d616ddd | Stores the values into the translation yaml files. | {
foreach (Language::with('uiTranslates')->get() as $lang) {
$translatesFormatted = [];
foreach ($lang->uiTranslates as $translate) {
if (!$translate->value) {
continue;
}
Arr::set($translatesFormatted, $translate->k... | 0 |
0ba17a945bc96eb698da9aee81c6edf0 | 6cac320f785db9cd3b061adfa57e9282 | Find the fixed point of a DataFrame function. | def fixed_point(fn, df):
while True:
df0, df = df, fn(df)
if df.equals(df0):
return df | 1 |
ab8d3bbd3ed10e11d2c7cd38bb50043b | fa42d9439701cebc143949212c1e83ea | Message that will be sent if user delete a bus stop code from their favourites | Fav findFav = DataManager.findFav(getContentResolver(), Fav.KEY_TYPE_VALUE_BUS_STOP, this.busStop.getCode(),
this.busStop.getLineNumber());
if (findFav != null) {
DataManager.deleteFav(getContentResolver(), findFav.getId());
Utils.notifyTheUser(this, getString(R.string.favorite_removed));
} ... | 1 |
8b4b0304fbcf8acb8ba1a619f6392f4d | dd8c39cc5aa2d5c4a3fb96361d973a56 | Private method to directly retrieve all tasks from the collection | class TaskCollection(Resource):
def get(self):
return get_all_tasks() | 0 |
a6697ef1139ee144aeb8d77a847ff20f | 80f4626e1072869f73fc4f961d39793b | 電線色番号マスター削除 | namespace B2.BestFunction
public partial class ucManualIchiran : ucMaster
private bool meisaiDelete()
{
try
{
using (var context = new Entities.BfDbContext(b2Com))
{
context.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);... | 0 |
b6c1558bc861979ec76f8c02a0e151ab | 9bbc4955ec2a9153a5b6249e0a9cf2c1 | show removed employees | class EmployeeController extends Controller
public function destroy($id)
{
Employee::find($id)->delete();
$userData = Employee::where('role',2)->get();
return json_encode(array('data'=>$userData));
} | 0 |
b8cf185f9514f6a8a2c307aeb4fab653 | 59ba0a662b10674cc5a51d7a1f74f6a0 | x以下の素数を列挙(第3版) | q=[2]
yield 2
x=3
while x<=z :
for p in q :
if x%p==0 : break
if p>x**.5 :
yield x
if x<=z**.5 : q.append(x)
break
else : yield x
x+=1 | 1 |
fd4cc995fed34d81f68cfd542e5caf67 | 57a030579880f42143004d46cfca22ae | Работа метода заключается в обновление нашего текстового поля и проверки не была ли досигнута сумма очков для победы. | {
if(isWin)
{
StatisticsManager.Update(username, tm.ToString());
}
timer1.Stop();
string outtext = (isWin ? "Вы выйграли" : "Вы проиграли");
SummaryWindow sumWin = new SummaryWindow(this);
sumWin.SetOuterText(out... | 0 |
8c80cb8ae4c2f969c378cc04d35a4b07 | 7ffa647b60a380cbc372cf6cb2f3bbaa | 判断当前浏览器是否与该库兼容 | function isCompatible(other) {
if (other === false || !Array.prototype.push || !Object.hasOwnProperty || !document.createElement || !document.getElementsByTagName) {
return false;
}
return true;
} | 1 |
b48a20c19ce47935cb62bb1988fc83fa | 9d2d23579c65e0f773e50b9fb0c2c76d | in case when switched off while playing, won't wait and buzz | void Buzzer::PlayWait(int duration, int frequency, int volume) {
m_quiet = true;
std::lock_guard<std::mutex> lock(g_buzzer_mutex);
m_period = 1000000 / picopter::clamp(frequency, 10, 5000);
m_dutyCycle = (m_period * picopter::clamp(volume, 0, 100)) / 200;
m_count = (1000 * std::max(duration, 0)) / m... | 0 |
146c80d972d8c3199a68695242b091ed | 043d0ddb73173b324a4aa20b42b45798 | @brief the login successfully indication callback.
The callback will be notified if server login successfully
If @ref MtcCliDb::Mtc_CliDbGetUserReg is ZFALSE, this callback will not be called.
The callback is one of @ref MtcCli::Mtc_CliLogin results | TRADEAPI_API void WINAPI RegRspUserLogin(CTraderSpi* pUserSpi, CBRspUserLogin cb)
{
pUserSpi->cbRspUserLogin = cb;
} | 1 |
3ea18f96bb86d266768137af449671af | 52a25bbdb64e3e3d946aec211be711bf | Get the residue between the true latitude and longitude and the predictive values | res = np.zeros(len(m_list))
for ii, model in enumerate(m_list):
res[ii] = model.Y.min() - true_ymin
return res | 0 |
2ce4dec9d7bea25db7c1ac3ab37d1e36 | 778952ea07c910e13e48022a0f7102dc | Converts time in current timezone to time in wanted timezone | current_tz = pytz.timezone(current_tz)
target_tz = get_localzone()
target_dt = current_tz.localize(input_dt).astimezone(target_tz)
return target_tz.normalize(target_dt) | 1 |
22cf8107b6930497cba78e8fbbbf3d22 | 17f8d8ec50b8e822eebf7cf79dd81f71 | Devuelve el �ltimo evento que caus� que el popup men� se mostrara.
Util para saber la acci�n del mouse que lo caus�. | public class CCEventAdapter extends CCAABoundingRectangle implements CCMouseListener, CCMouseMotionListener, CCKeyListener, CCSetupListener, CCUpdateListener, CCDrawListener, CCDisposeListener
public CCMouseButton getLastMouseButton() {
return _mouseButton;
} | 0 |
e3be9ee2c51418dfa07bd8473086a8c6 | 315ef011ef97e61a3bd4435391385c7a | bytearrayのデータを見やすい16進数表現の文字列に変換する | namespace DataPump.SquareEnix.ExFiles
public class ExFileBase
protected string PrintBytes(byte[] bytes)
{
StringBuilder sb = new StringBuilder();
foreach (byte b in bytes)
{
sb.AppendFormat("{0:x2} ", b);
}
return sb.ToString();
... | 1 |
8600d4e1b10cc363bd14c22ae4be335b | 1c7827f096183094c0a6c5cc5fd3b97e | 创建一个零时文件夹,并且返回这个文件夹的路径 | namespace Elight.Infrastructure
public class FileUtil
public static string CreateTempZeroByteFile()
{
return Path.GetTempFileName();
} | 0 |
d42c01400bb4baa4dfad83efcd996fa0 | d895c634098c4b29495ec097e2b0cbb4 | 등록된 회의실관리의 상세정보를 조회한다. | public List<RoomVO> RDetail(RoomVO rVO) {
return dao.selectList(NS + ".detailR", rVO);
} | 1 |
a631b2b66151067ee76980c00eff7f08 | dd0c40801780ab25c2c91845f516bd8c | Pull a number of chunks around a specified skeleton vertex | void addSliced(const unsigned n, const Surface2D &S
, map<unsigned,SbVec2d> &vertices
, map<string,Surface2D> &surfaces
, const string &prefix
, unsigned ¤tindex
){
const unsigned &from = S.from;
const unsigned &to = S.to;
SbVec2d delta = (vertices[to] - vertices[from]) / n;
SbVec2d A = vertices[from];
f... | 0 |
57efd8398c755041524bb85afa86ef38 | e87182a91970a16d641775853fb729f3 | Get the total number of internal merkle nodes that were sent unnecessarily during synchronization. | public class SynchronizationCompletePayload extends AbstractLogPayload
public int getRedundantInternalNodes() {
return redundantInternalNodes;
} | 1 |
dd09e97dd77c9fa8cd5ce64e13c9ce82 | 4ce9204b17afaf920d3ac100a175d099 | 加载所有库存明细 | public class StockidmDao extends YeekuHibernateDaoSupport implements IStockidmDao
public List<WmsStockidm> findAll()
{
return (List<WmsStockidm>)getHibernateTemplate()
.find("from WmsStockidm");
} | 1 |
79438887395f576eeee83697cfabb02a | ed0e16336a97ed54da1635fea84ae3a2 | Deletes all rows from the qualification table. | abstract class QualificationQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(QualificationTableMap::DATABASE_NAME);
}
$affectedRows = 0;
try {
... | 1 |
8b9a6baae950e86fae6d6593cf00f6fb | a9852df1cea008cbeaf03c269e77f4e1 | 设置:小数位 | public class BigDecimalMapperBuilder extends SingleColumnMapperBuilder<BigDecimalMapper, BigDecimalMapperBuilder>
public BigDecimalMapperBuilder decimalDigits(Integer decimalDigits) {
this.decimalDigits = decimalDigits;
return this;
} | 1 |
05f07822bb71a3a2836b63aef1220890 | 3d8063bf31792ad274e6f1af5a239164 | create a divider for the top of the table of n length | namespace BetterConsoleTables
public class Table
private string GenerateDivider(int[] columnLengths, char innerDelimiter, char divider, char left, char right)
{
string output = String.Empty;
output = String.Concat(output, left, String.Empty.PadRight(columnLengths[0] + 2, divider));
... | 1 |
2114231ab44a47f95e5f99b981cd4462 | e683d2eb8ff1acbddc2541fee2c6059e | 为hash写入多个值 | class SsdbCluster
public function multi_hset($hash_name, $data = array())
{
return $this->get_ssdb()->multi_hset($hash_name, $data);
} | 1 |
2ca2af535b14b010ed34777e2c4f4f35 | 7f5a4218e8f54fbab15bba8db6e55399 | Show splash screen in fixed time. | namespace TimeTableManager.UI public partial class FMainForm : System.Windows.Forms.Form
private void FMainForm_Load (object sender, EventArgs e) {
splash = new FSplashScreen();
splash.Show(this);
} | 0 |
ba96338b18786f45481058123e7d8583 | eb80b72f7d9fbd97f3f92c9cbedc264d | Remove and return an item from the queue.
Return an item if one is immediately available otherwise raise Empty.
Equivalent to ``self.get(wait=False)``. | class Queue(QueueBase):
def wait(self):
obj = self._queue_base.brpop(self.__key, None)
return pickle.loads(obj[1]) | 0 |
57a9bed1f067e66f7478e53f2bb28cf6 | bd91a6c91e7b6571b56d088734fb1997 | 再生ボタンが"タップ"された場合の処理(イベントハンドラ) | val albumId = this.albumId.value
if (albumId != null) {
playMedia(albumId)
}
} | 0 |
4b8da67c425a56303b457a415f98e2c9 | 7fa368d86c4d2bf400a5a85d1e733e23 | Allow user to narrow down list of reviews with some keywords | List<Review> searchByKeywords(Map<String, Object> data); | 1 |
8a36f7d457f3b54d50301fdcc400d1f1 | f5eaa92c731a619a147e045f4826c506 | Collects information about continuous noun sequences like "Garry Bloom", "Tim Buk Tu" | {
if (isNaN(cur)) cur = 0;
let ret: IWord[] = [];
while (cur < text.length)
{
let name: string = null;
let f2 = text.substr(cur, 2);
if (f2 in FAMILY_NAME_2)
{
let n1 = text.charAt(cur + 2);
let n2 = text.charAt(cur + 3);
if (n1 in DOUBLE_NAME_1 && n2 in DOUBLE_NAME_2)
{
name =... | 1 |
ccbee12ebfe445099339c753074f0c5c | c679a3cabe121c2f0d5a9345b8a37832 | Adds the feature of forcing the items to be sorted by the first
column | namespace GirlFriendYell
public partial class MainWindow : Window
private void DataGrid_Sorting(object sender, DataGridSortingEventArgs e)
{
if (!e.Column.SortDirection.HasValue)
{
e.Column.SortDirection = System.ComponentModel.ListSortDirection.Ascending;
... | 0 |
0ef613fdcf97a394d5a8da0898c3d7da | 52f54c9c4216362996f45660b790f162 | dis <addr> [<count>]
Disassemble one or <count> instructions starting at <addr> | disassemble(UINT64 start, UINT64 stop) {
UINT64 pc = start;
xed_state_t dstate;
xed_syntax_enum_t syntax = XED_SYNTAX_INTEL;
xed_error_enum_t xed_error;
xed_decoded_inst_t xedd;
ostringstream os;
if (sizeof(ADDRINT) == 4)
xed_state_init(&dstate,
XED_MACHI... | 1 |
946801e43778d79ca724031b271dfefa | b9d4d9e46d010fe8fdd4c40da5f14a09 | Similar to
{@link se.vgregion.notifications.service.NotificationService#getSocialRequests(com.liferay.portal.model.User)}
but each {@link SocialRequest} is mapped to the requested {@link User} object. The {@link SocialRequest} class
only provides access to the userId but this method provides easy access to the whole {@... | @Service
@SuppressWarnings("unchecked")
public class NotificationService
public Map<SocialRequest, User> getSocialRequestsWithRespectiveUser(User user) {
return socialRelationService.getUserRequestsWithUser(user, true);
} | 1 |
61548ad43ba651e1c9e19dc349608bae | 4952e6fb51fad138de76da1bc2b6ef32 | 该接口用于删除轮播播单。 | @RestController
@RequestMapping("/Carouserl")
public class CarouserlController
@PostMapping("deleteCarouserl")
public AppResponse deleteCarouserl(String listString) {
try {
AppResponse appResponse = carouserlService.deleteCarouserl(listString);
return appResponse;
} catch (Ex... | 1 |
902b53f46073c485b12003883e8aa7b3 | 18f1efdb567f399d0992d83ed18a04f0 | Returns the total amount of sleep in minutes | class FitbitSleep
public function getSummaryTotalMinutesAsleep($readable = true) {
return $readable ? FitbitHelpers::GetReadableTimeFromMinutes($this->summaryTotalMinutesAsleep) : $this->summaryTotalMinutesAsleep;
} | 1 |
dedde4f767357fcd5bed17ae756ded8d | d780cc5830a1c4a2908073784780a60c | function used calculate the distance between two vessels
outputs a value in statute miles | class Life360Dev extends Homey.Device
FGCD(dlong1,dlat1,dlong2,dlat2) {
let c = dlong1 - dlong2;
let d = dlat1 - dlat2;
c = c * 66.997;
d = d * 111.3;
return(Math.sqrt((d * d) + (c * c))*1000);
} | 0 |
b0ad684d32b81cb36fdf2634e51d2176 | 3424b53f364a6a5c41dc2f46677777ed | fonction qui lit le fichier binaire pour afficher les métadonnées modifier | {
FILE *fichier;
fichier = fopen ("in.dat","r");
fscanf(fichier,"%d \n", TypeModel);
fscanf(fichier,"%d \n",typen);
fscanf(fichier,"%d \n",nbdata);
fscanf(fichier,"%d \n",nvsdata);
fscanf(fichier,"%lf %lf %lf %lf %lf\n",&xinit[0],&xinit[1],&xinit[2],&xinit[3],&xinit[4]);
fclose(fichier);
} | 0 |
b83a2b162b5c380d7abf16073f93e83d | d5b0b95530451a01d9e40857f8e2e437 | Returns internal debug counters calculated based on the current state of the cache. | namespace BuildXL.Cache.ContentStore.Stores
CounterSet GetCounters(); | 1 |
ce01eec3cee7d8c86a5b271b69e7c7e9 | 06d8b0068c0351780711c5e336984205 | Tarefas Não-inicializadas - gráfico de colunas indicando número por semanas | ylabels = []
customDates = []
customColours = []
colourTranslator = ["k", "g", "b", "y", "r", "c", "w"]
for initem in indatalist:
ylabel = initem[1]
colourNum = initem[2]
startdate = initem[3]
enddate = initem[4]
ylabels.append(ylabel)
customDates.append([createDate(startdate),createDate(enddate)])
c... | 0 |
6e6b67ce60d12b2e80877661f4b375b7 | 432170ce4175230d8c8b93fb054926bd | Construct a new instance of the logger. | class Log
public function __construct($sapi, $date, $level = 'all')
{
$this->processed = false;
$this->path = storage_path('logs');
$this->sapi = $sapi;
$this->date = $date;
$this->level = $level;
} | 1 |
ba6058e9df3cbe9576651adc6528e68a | a2ee8b86116275090bff972049c668da | @brief Funkce vytiskne slovo a jeho počet výskytů. | void print_word_statistics(htab_pair_t *data) {
printf("%s\t%d\n", data->key, data->value);
} | 1 |
b5f22635266f48787253cfec7925e95f | 4cb853238bacea48300c00ac568f145b | It should be possible to unregister all listeners of all speakers | {
#pragma warning disable CA2000
var msg = new EventListenerFactoryMessage()
{
MessageType = EventListenerFactoryMessageType.UnregisterAllEventListeners,
};
#pragma warning restore CA2000
AddMessageToQueue(msg);
msg.WaitForProcessed(20... | 1 |
36a55c10b5dc6c4b7c31d438e704e559 | f418717a0004a4bea383159be2b1282b | 获取支付网关编号 每个渠道的网关必须唯一 | class PayOrder extends ApiInterface
public function getChannelNo()
{
return $this->channelNo;
} | 1 |
a310cfc25ad6b47164dfc4d861a91dc1 | 9d076524d00bf88ef2d5d2336ed7b2cf | Display the raftless dialog. | {
using (BeamFramReinMakerForm displayForm = new BeamFramReinMakerForm(this))
{
if (DialogResult.OK != displayForm.ShowDialog())
{
return false;
}
}
return base.DisplayForm();
} | 0 |
dc4baa80d452cccaed474df4a1aa877a | 344045482a795b0eed1b2f6febe916d1 | Gets a webhook avatar. | namespace Octokit.GraphQL.Model
string AvatarUrl(Arg<int>? size = null); | 0 |
35fb77693e90cc0fc45bd63cc846cbe3 | 7f8a9b535becc6830c364671a818edaf | Este método tem como função retorna o espaço usado de um diretório
em Bytes. | public final class ControleDiretorio
public Long getEspacoUsado()
{
return getEspacoTotal() - getEspacoLivre();
} | 1 |
2fb70fe7f94700748a18491efa6a94ce | 13fa9de2d3d21b143664d3aab80ab608 | 删除指定名称的文件 | public class FileHelper
public static void deleteFile(String path, String name) {
if (!fileExist(path, name)) {
return;
}
File file = new File(path + name);
file.delete();
} | 1 |
d564bc60e9fa4c7bb07b70a8915d79f3 | ba155f19a37ff9e4d28c3079b1033926 | Gets the back history. | namespace CDTag.FileBrowser.ViewModel
List<FileView> GetBackHistory(); | 1 |
3acdeef68a6b513cd7f952c96f247367 | bdf050ec407c20b679f5c1f5ce361a7d | 判断替补球员是否已修改 | namespace FootballMatch.Umasou.Business
public partial class MatchPlayerManage : Form
private void addSelectedPlayer_NewEdition()
{
int selectedRowCount = dataGridView_notAssignedPlayer.SelectedRows.Count;
if (selectedRowCount > 0)
{
int playerID = -1;
... | 0 |
9099717ce71e99b0be95a1cbac3adcf1 | eb86762697af0b299c921fbd25aaf83d | - Keras 2 different parameter order | def parameter_space_1():
hp_values = collections.OrderedDict()
hp_values['n_bits'] = np.random.choice([8, 12, 16])
hp_values['n_layers'] = np.random.choice([3, 4])
hp_values['alpha_XY'] = np.random.choice(np.array(np.linspace(0, 2, 201), dtype=theano.config.floatX))
hp_values['m_XY'] = np.random.cho... | 0 |
607e69d06716e849d5b9641a8bcbfb62 | b94a81ed88189b5832dd082c2426f092 | 载入接诊清单 | class AllergicHistory extends Component
componentWillMount() {
this.props.dispatch({
type: 'odwsAllergicHistory/loadAllergicHistory',
payload: {
patientId: this.props.odws.currentReg.patient.id,
},
});
} | 0 |
6ff027307300a07fd52c7334ff2e667a | 30b870d178fa2dd372e21d625f4712f2 | Obtiene todos los resultados para la instancia de la página | class PageAumentationGoogle extends PageAumentation{
resultList(){
return document.getElementsByClassName('yuRUbf')
} | 1 |
24db07c2b5dcd229e4e133bc9c343ef7 | b653fbfcd75fbc1474d94420386d2b96 | 获取当前用户所在企业的下属企业列表(如果没有使用的地方就删除掉) | @Service("enterpriseApi")
public class EnterpriseApiImpl implements EnterpriseApi
@Override
public List<Map<String, Object>> findOnlyChildEnterpriseList(Map<String, Object> params) {
Map<String, Object> enterpriseMap = getEnterpriseMap(params);
String tenantId = MapUtil.getString(enterpriseMap, EnterpriseApiConsta... | 1 |
339cc993c42d09bb26034b9373a793aa | e82c140962e199e68e3f49e5e0687e8c | Forces an unindex of this data from the solr server. | if ($this->status()) {
$this->reindex();
if (!$this->isReadOnly()) {
$this->getServer()->deleteAllIndexItems($this);
}
}
} | 1 |
3f0f7be05864c9567e2149f212aea896 | 78de55f8237086f560105a3a5a15c539 | VERIFICA SE, DEPENDENDO DA QUANTIA DE PONTOS, GANHOU OU PERDEU | if (jogo) {
if (pontos == 12) {
alert("Você ganhou");
jogo = false;
pontos = 0;
pontosM = 0;
vpainelTpM.value = 0;
vpainelTp.value = 0;
} else if (pontosM == 12) {
alert("Você perdeu");
jogo = false;
pontos = 0;
pontosM = 0;
vpainelTpM.value =... | 1 |
c9b08820cd14f5be0c1e8affdb709a46 | 80ee8574a840b5366cec068af0becd36 | 反对主贴 | if(!is_admin()) $this->ajaxReturn('你不是管理员');
if(IS_POST){
$map = array('id'=> I('post.postid'));
if( M('ForumPost')->where($map)->getField('status') == 'stick'){
$result = M('ForumPost')->where( $map )->setField('status','normal');
$forum_post = M(... | 0 |
d7b960c71db80bfecc08a8715cc63500 | 6ceae2ebc5e59fff72530b8ce81af97e | function to open file from the phone | public class MainActivity extends AppCompatActivity @Override
protected void onCreate(Bundle savedInstanceState)
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
... | 1 |
05547f954e11994c93323a7b2b05d240 | 7a2f38a5286af67a67c105ca18200134 | Triggered on any filter input change. Uses timeout function to rate limit
api call fire | export class DataTableComponent implements OnInit, AfterViewInit
onFiltersChange(event) {
if (this.filterChangeTimeout) {
clearTimeout(this.filterChangeTimeout);
}
this.filterChangeTimeout = setTimeout(() => {
this.filterChangeTimeout = null;
this.appendFilterToQueryParams();
this.lo... | 1 |
d199486c861b40174d85d7e70b371088 | f740a435b87efa28b0b84fc04e149b1e | Metric type. Valid values are `ASGTotalCPUUtilization`, `ASGTotalNetworkIn`, `ASGTotalNetworkOut`, or `ALBTargetGroupRequestCount`. | class MetricMetricDescriptorArgs:
def value_type(self) -> pulumi.Input[str]:
return pulumi.get(self, "value_type") | 0 |
d8b7d3c4129f74daeda5eafec6ad8c83 | 443a3df20be0f05486ef1dee263e1477 | Gets the Rrpi Full Ref 12m | class PLC
public function getFabqQ12()
{
return $this->fabq_q12;
} | 0 |
48ea6ccabaf78de83aab07b499f2a185 | 7ef338e6aba1dfc70dc9354a3d49c59c | Set the timeout on CONNECT packet | class Options
public function set_connect_timeout($time)
{
return $this->merge([
CURLOPT_CONNECTTIMEOUT_MS => $time,
]);
} | 1 |
223abd9a0a5c0c9aff14403959e0fd56 | 5c91955faeee845fae21c0d77b0c3951 | Send handshake and bitfield requests to the peers above me | def peer_handshake(sender, peer, **kwargs):
if peer.has_ethereum_capabilities() and not peer.status_sent:
logger.debug("%r handshake, sending status", peer)
peer.send_Status(chain_manager.head.hash, chain_manager.head.chain_difficulty(), blocks.genesis().hash) | 0 |
8b4e1497293553a6aa47a588de3c8d10 | d6db8db9f5a2c1acf85d6e279e708000 | Print an array, assumes array dimension is known | void print_array(const demo_primitive_t *_array, size_t _len)
{
size_t n;
for(n=0; n<_len; n++) {
printf("%*d ", (-1 * ELEMENT_MAX_STRLEN), _array[n]);
if( ((n+1) % ELEMENTS_PER_ROW == 0)) {
printf("\n");
}
}
printf("\n");
} | 1 |
bf8e673a84f74de16d9e6670fb149177 | a8df31e63973ea6ff90ba0d36709662f | Logs the retrieval of upc audit information. | @RestController()
@RequestMapping(ApiConstants.BASE_APPLICATION_URL)
@AuthorizedResource(ResourceConstants.INVENTORY_LOOKUP_STORE)
public class InventoryController implements MessageSourceAware
private void logGetVendorOnHandQuantity(String ip, long productId) {
InventoryController.logger.info(String.format(Inventory... | 0 |
bcff360a2dbde485786aa6f4b9cabd17 | df04cc238977f502f962fbda4ab6da5b | jieba精确分词 | namespace ReceiverMeow
class Utils
public static List<string> Jieba(string s)
{
var r = segmenter.CutInParallel(s).ToList();
return r;
} | 0 |
97c5ec744af9b8c7f7317686f6568eb9 | 52435f207ab678735062b11914d7990d | Get the transaction class associated with this database backend. | if (
'TransactionMeta' not in
self.declarative_base._decl_class_registry
):
return self.transaction_meta_factory()
return self.declarative_base._decl_class_registry['TransactionMeta'] | 1 |
dd21fc5c7e6c19f467163540bc470811 | ececf9053cd16371a3e24a4379f4b6e9 | Adds a plot widget to a layout that will show the acceleration's x values | self.figure = Figure()
self.throttle_axes = self.figure.add_subplot(411)
self.throttle_axes.grid(True)
self.brake_axes = self.figure.add_subplot(412, sharex=self.throttle_axes)
self.brake_axes.grid(True)
self.steer_axes = self.figure.add_subplot(413, sharex=self.throttle_... | 0 |
a453b0886812c3d8507081471b153803 | 579145657a6736f87ef2f782398e344a | FUNCTION
DESCRIPTION
Get first available bookshelf id
PARAMETERS
void
RETURNS
S32 | S32 ebr_fmgr_is_book_shelf_path(PS8 path)
{
U8 nfo_path[MAX_DWNL_EBK_PATH_LEN * ENCODING_LENGTH] = {0};
U8 fmgr_path[MAX_DWNL_EBK_PATH_LEN * ENCODING_LENGTH] = {0};
U32 driveCount = 0;
S8 driveLatter[FMGR_TOTAL_STORAGE];
U8 driveNum;
memset(driveLatter, 0, FMGR_TOTAL_STORAGE);
mmi_fmgr_g... | 0 |
86377a49defa1d0dc476d8954127e936 | a13e176a5b7196e41979de37446bc651 | Function to standardize scores | def standardize(df):
std = df.std(axis=0)
df = df.loc[:, std[std!=0].index]
return (df-df.mean(axis=0)) / df.std(axis=0) | 1 |
1818747ab4080269a0e7d915503c558b | 779384cf805e9c901bd106dd4375c4b9 | Формирует битмап по таблице фактов. | {
var colorMap = ImageToColorMap(bitmap);
var gridMatrix = new int[_modelWidth + 1, _modelLenght + 1];
for (var indexX = 0; indexX < _modelWidth; ++indexX)
{
for (var indexY = 0; indexY < _modelLenght; ++indexY)
gridMatrix[index... | 0 |
42a43a7e3ca51f767c280f097b38fc85 | 06e9cce019d13096d636f4843870f5c1 | Check we can learn to output a zero vector | class TestRankOrder(unittest.TestCase):
def test_00_zeros(self):
x = np.zeros((5, 5))
output = rank_order(x)[0]
self.assertTrue(np.all(output == 0))
self.assertTrue(output.dtype.type == np.uint32)
self.assertEqual(x.ndim, 2)
self.assertEqual(x.shape[0], 5)
self.as... | 1 |
776294d30fb3f4eec709224a3494490d | 894ef0e74dedd3cfb6268eb206dc588a | inserts a new crawled url into the database | class Database
public function insert_crawl_history($rss_data)
{
$sql = 'INSERT INTO crawl_history(rss_updated) VALUES (:created)';
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':created', $rss_data['updated'], PDO::PARAM_STR);
$stmt->execute();
} | 0 |
86f92825fcc5d264c417e8a70b51e842 | b0cc0bcaa2166413a1452e15dfd273b7 | just update the source again when a new file is added | class FileWindow extends JInternalFrame implements ActionListener
public void updateText(Dim.SourceInfo sourceInfo) {
this.sourceInfo = sourceInfo;
String newText = sourceInfo.source();
if (!textArea.getText().equals(newText)) {
textArea.setText(newText);
int pos = 0;
... | 1 |
bc1d6d581995bd67422d20b095e02c07 | e52a99d604ba3db8331f31a6df805528 | 将时间戳转化为短日期时间格式,输出如:yyyy-mm-dd | public class DateUtils
public static String getDateFromShortTimestamp(Date timestamp) {
return timestamp2String(DATE_SHORTTIME_PATTERN, timestamp);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.