query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
26e8df7e4cf143c8163f54e96123814e | 92c3ebb539548bbbbea7c1672bccb27d | Compute the Sammon mapping metric for the input data | L = a.shape[0]
if d0 is None:
d0 = L**0.39 * np.sqrt(0.58 + 0.05*L * np.exp(-L/4.7) - 0.63 * np.exp(-L/37))
return 1/L * np.sum(1 / (1 + (np.sqrt(np.sum((a - b)**2, axis=1)) / d0)**2)) | 1 |
20d018951ee2e2b1f9eaf9ab3da8077c | ebdba866dd1d9abf94878c5b403bf911 | test of basic instrument operation and standard waveform case6 | void testFuncBasicInstrumentOperationAndStandardWaveformCase10()
{
ViChar channel[BUFFER_SIZE];
ViInt32 i;
for(i=0; i<2; i++)
{
if(i == 0)
{
strncpy(channel, CHAN1, BUFFER_SIZE*sizeof(ViChar));
}
else
{
strncpy(channel, CHAN2, BUFFER_SIZE*sizeof(ViChar));
}
CU_ASSERT ( VI_SUCCESS == tkafg3k_Conf... | 0 |
bfa6dc536b7cc15ea1f427d6594a022d | 3dbebdc905259c7ddb0490c6d8bf5301 | Broadcasts info about selling house. | player_id = self.game["socket_to_id"][sock]
player = self.game["board"].getPlayer(player_id)
total = 0
sold = []
for id in data["values"]["tiles"]:
space = self.game["board"].getSpace(id)
if space.getOwner() == player_id:
space.setOwner(Non... | 1 |
9629f0367ddeac5c4be6610d8ea13c66 | 17d78c7461e3d70c4a76545230e38359 | Provides a list of label conversions for each time unit, starting with its
most significant units on down. Any counts that evaluate to zero are omitted.
For example...
:: | return array(
'00'=>array('vif'=>'Energy mWh')
,'01'=>array('vif'=>'Energy 10<sup>-2</sup> Wh')
,'02'=>array('vif'=>'Energy 10<sup>-1</sup> Wh')
,'03'=>array('vif'=>'Energy Wh')
,'04'=>array('vif'=>'Energy 10<sup>1</sup> Wh')
... | 0 |
2463e8dda269a8a853933737d8da26bf | 3c4a4554bbafe670e132a31a6f0a7b42 | # Attempt an "Add" Trial move | { edge <- bestmove.greedy(net,indicator);
if (length(edge) == 2)
{ return(flipedge(net,edge)); }
else
{ cat("no improvement found\n");
return(net);
} | 0 |
c45d90ff69d4cd89a78b36296a6db4a6 | 9f1d5fff590bddd677fecca65d6f2af4 | Récupère les informations d'un coach | $sql = "SELECT * FROM championnat WHERE idchamp = ".$id;
global $connexion;
$infos = $connexion->query($sql)->fetchAll(PDO::FETCH_ASSOC);
return $infos[0];
} | 0 |
15cec43505b0085d9396a80a67a738c0 | 4fac1e4424ff5c8cf02a1d5da87301f6 | Pass or I'm Out dialog | return """
You are about to take the Top Path.
Are people even reading these things?
Do I even need to say anything anymore?
Does our words even matter?
Perhaps I'm just losing my mind at this point...
I mean who'd come down here right?
(Recommended after ... | 0 |
2401d701f0c853101c153e84abf60f11 | 00a53232918c38d863c698009e66e957 | アップロード完了 | class UpYunCloud
public function upload_completed($attachment) {
$type = $attachment ['type'];
$suffix = substr ( $type, 0, strpos ( $type, '/' ) );
$this->is_img = $suffix == 'image' ? true : false;
$this->file = str_replace( $this->upload_dir ['baseurl'], '', $attachment ['url']);
if (! $this->is_img && $th... | 1 |
a949947dce34eb1684c56087a6f53a54 | f108014bc75d554be00baebcbeb345d0 | 组卷
实际的出题过程,根据出题人的意图(领域和难度)从题库中挑选合适的题目 | class AutoApp(Automation):
# @pysnooper.snoop()
def _dispatch(self, count_of_each_group):
for num in range(count_of_each_group):
print(f'第{num + 1}题')
category = None
logger.debug(
f'[{self.username}]每日答题 第 {count_of_each_group - 1 - num} 题')
t... | 0 |
323bd7de9373cbf62ca65bd4ec4ebbbf | 70e68f6e86c973d590231947584eca8d | function to make the king enter the second fase | hide(kwkHormiga2)
hide(ayudaActual)
faseActual = 2
fase1Terminada = true
timerStash.timerAyuda2 = timer.performWithDelay( 15000, ayuda2, 0 )
end | 1 |
116a4a3fd28d523bb618dd2e2eb54497 | 1e089a00e3e987a9cd36f97ef36fa601 | Function Name:
rtk_intr_speedChangeStatus_clear
Clear interrupt status of port speed change.
None
None
RT_ERR_OK
RT_ERR_FAILED
None. | (
GT_VOID
)
{
GT_STATUS rc;
GT_U32 byteCount;
GT_U32 expectedByteCount;
GT_U32 egressByteCount;
GT_U32 extractBcFailsCount;
CPSS_PORT_INTERFACE_MODE_ENT sendPortIfMode... | 0 |
95196b6a566c6b6c8175b5ea1972e198 | cd352282d0394a6b1caba1629884c52d | Add console widget early so it picks up the engine's initialization output | class ConsoleAddon(object):
def init(self):
pass | 0 |
8847fb637da0315edf4eeb104257451c | b543151e6bdb6ee3b8e80f7c021de775 | Get the sensor statuses | class NeslabController(TCal):
def status_get(self):
return decode_status_array(self.query([0x09])) | 1 |
0bbde3e27729bb26ca3818a70489819b | 4251e2e52c210a5993f59a05646ef199 | Type guard for element with a shadowRoot. | this.shadowRoot = init.mode === 'open' ? this : null;
return this;
} | 0 |
5cc496d9de35ecc3cfba5241f2b5270f | 71a34a739ba8a8839ec2f50d657d25f2 | Animates the fake scrollbar and moveable on the menu | let start = element.scrollTop,
change = to - start,
increment = 20;
const animateScroll = (elapsedTime) => {
elapsedTime += increment;
var position = this.easeInOut(elapsedTime, start, change, duration);
element.scrollTop = position;
if (elapsedTim... | 1 |
15c3d3e4fe2670ef044f48f8d2b994b9 | 6959a8140bdb24e5c25028e41b0d085d | 配列から再帰的にXMLの文字列を作成します。 | class PipiXmlParser extends CApplicationComponent{
protected function arrayToXml($arr, $charset, $dom = null) {
foreach ($arr as $key => $val) {
if (is_numeric($key)) {
$itemx = $this->dom->createElement("item");
$id = $this->dom->createAttribute("id");
$id->appendChild($this->dom->createTextNode($key... | 1 |
9ee956a7384a8d679cc711f2e17b00b4 | b7882268501cc0153a3c835a027b67a0 | 支付成功后,异步计算各层级收益 | class Profit
public static function orderSuccessProfit($orderInfo){
$firInfo = UserModel::get(['id' => $orderInfo['user_id'],'status' => 1]);
self::updateSelfSale($firInfo,$orderInfo);
if(!empty($firInfo) && $firInfo['level'] == 0){
$secInfo = UserModel::get(['id' => $orderInfo['user... | 1 |
bfa3be225962063ef5b1c54265b8d77d | 3257ba51c8ce85b8c84d64da42d8178e | Output radius slide in a search form | radiusMapDistanceValue = Number(slideAmount);
initSearchingMap();
$('#lblDistance').text("Distance radius: " + slideAmount + " km");
} | 1 |
92128ae9c82da4039f12987238cf4c15 | 830ac3230bc9ef1b4ce4a6cc35b74caf | The root of the admin panel. | def admin_home():
return 'admin_home' | 1 |
56bd3a5fed1a19304a7b7c4b3ef083f8 | f2ff52a61c4a5bd94c3fbe98bed74e19 | This function returns metadata for native and smp schema. It first looks for cached
copy of metadata which is not more than week old and returns it. If it does not find a
recent cache copy it creates a new cache and returns the content. | def get_metadata_cache():
global _METADATA_CACHE
if _METADATA_CACHE is None:
_METADATA_CACHE = _create_metadata_cache(_DB_PATH)
return _METADATA_CACHE | 0 |
7e7de922da745ee1a9598c683edd117d | 025c0091315c8491813b1223ddb41edb | Valida inscri��o estadual do estado do Bahia | void setInscEstadual(String inscEstadual)throws Exception; | 0 |
d380913e86e107cbdad7f2c94824c8c7 | 71c407e69d48d7ad881a5a0267c6446f | На странице результатов выставить указанную дату | void MainWindow::on_calendarWidget_clicked(const QDate &date)
{
cmw ->stopTaskTimer();
ui ->tableForTasks->clearContents();
cmw ->calendarDate = date;
ui ->plainTextEdit->clear();
cmw ->setDay(1);
} | 1 |
988fd1033cd06d15b2260b1bf024e58f | 665ea67e80dc9f6ea17cdfb4604a4706 | Unsets the "epost" attribute | @XmlRootElement(namespace ="http://bp.comverse.com/data")
@XmlAccessorType (XmlAccessType.PROPERTY)
public class ContactObjectData extends BaseObjectData implements Serializable
public void unsetPostalCode () {
this._PostalCodeSet = false;
} | 0 |
84463ab471b151827f145a351a2a0b8e | 8aa6db67fbdd58d0b7b3402b355a0ace | Analyzes the site for SEO. | try:
r = requests.get(self.site['url'])
except requests.exceptions.ConnectionError:
self.status_code = None
self.latency = None
self.regex_found = None
return None
self.status_code = r.status_code
self.latency = r.elapsed.total_... | 0 |
c2d92b9fd37d015c96db5cf1df27ad89 | e6e466b4ae50f8914b1c807373fb8087 | 返回与指定嵌套模式匹配的所有已注册Rule实例的List, 如果没有匹配, 则为零长度List.
如果多个Rule实例匹配, 它们必须按照最初通过<code>add()</code>方法注册的顺序返回. | List<T> getRules(); | 0 |
0873ef3efc66df57ddf6bf4736b93493 | 25bc2e4a56a21d682eed25058c79b872 | <p>Body content to send with the request, typically used with “POST”<br>requests.</p>
<p>If body is a string it will be sent unmodified.</p>
<p>If Content-Type is set to a value listed below, then<br>the body will be encoded accordingly.</p>
<ul>
<li><code>content-type="application/json"</code><ul>
<li>body i... | BodyBuilder body(String body); | 1 |
14db44c4383df7a299b531d1cb1d49f6 | bc326aedec4902c5591d3bbd669ae37e | Increments the pointer used in the FIFO circular buffer. | class BFDataModel:
def increment_pointer(self):
self.pointer += 1 | 1 |
f29d3e7b1cac624418414f7bb4b0b4d6 | 4e3d670f970d14f84d2731616cf04709 | Get all machines in a given location. | namespace UiPathEJC.Service.Rest.Api
System.Threading.Tasks.Task<ApiResponse<ODataResponseListMachineDto>> MachinesGetMachinesAsyncWithHttpInfo (string expand = null, string filter = null, string select = null, string orderby = null, int? top = null, int? skip = null, bool? count = null); | 0 |
e9140b62279f9d5e38694e2567fcf739 | 483f24e0dedf1ef95128eac5a4953788 | Sets the last_version of this V1BuildRequest.
LastVersion (optional) is the LastVersion of the BuildConfig that was used to generate the build. If the BuildConfig in the generator doesn't match, a build will not be generated. | public class MachineInfo extends AbstractModel{
public void setVersion(String Version) {
this.Version = Version;
} | 0 |
19ee3336c1f61012c1d61754f19e3cdf | 7efbae0ac3a8bab296e23dd21d596d05 | Gets a rich menu via a rich menu ID. | namespace LineBotKit.Client
Task<LineClientResult<RichMenuIdResponse>> GetRichMenuByUserId(string userId); | 0 |
628c1ea6d043a9e86d0fc98d3e018b9e | 48d5156f21b3b9f739b2447e075841a9 | find integer value of percent stored in flex style | public class PercentCell extends RealCell{
public double getDoubleValue() {
String tempString = super.fullCellText().replaceAll("%", "");
return Double.parseDouble(tempString);
} | 0 |
9876773a8485dfdea5b6d7bc849ad57f | 95aa46e0acd5b78d1c5eb60357aae4fd | Template to edit and add bans | {
$row = $this->getModuleRow();
$this->view = new View('tab_bans', 'default');
$this->view->base_uri = $this->base_uri;
$api = $this->getApi(
$row->meta->hostname,
$row->meta->username,
$row->meta->password,
$row->meta->port
);
... | 1 |
73b748e432f93bb50ea6d37d15482b0f | f3b94641b940bf224789298e4405328c | returns the labels listed underneath this (nominal) attribute in a
FastVector | if not self.isNominal() and not self.isString():
return None
else:
return self.m_AttributeInfo.m_Values | 1 |
256e48f42e8d33715d420bb40b3ddb76 | 0165da3bb7c335b0169857339fa81c34 | 分词,同时返回词语的词性 | def parse_sentence(str):
return pseg.cut(str) | 1 |
f646f31e80664eb64e43adfd83f1e2cf | 60eb4c08b665cae4701c4d4ffe60e34e | 根据model查询记录数 | @Service("scoringConfigService")
public class ScoringConfigService<T> extends BaseService<T>
public int queryModelRuleCount(BaseModel model)
{
return mapper.queryModelRuleCount(model);
} | 1 |
29d11396894f61c305c691f8e0b9d732 | e66c9a19217ee7d58c9a58ef85e72e6d | Adds all the wall rectangles to the walls list | for i in range(9):
wall = Wall(i * 90, 500)
MainGame.wall_list.append(wall) | 1 |
f86275bb0056013b493e4814e96270e5 | bf7b48382fbc5c7c73749673c3562927 | Copies 'source_table' into a parquet table and makes sure that the row group
statistics in the resulting parquet file match those in 'expected_values'. 'tmp_dir'
needs to be supplied by the caller and will be used to store temporary files. The
caller is responsible for cleaning up 'tmp_dir'. | assert table in settings.STATIC_TABLES
assert source in connections() and destination in connections()
differ = doesTheTableDataDiffer(table, source, destination)
if not differ:
return
logging.info(u'Replicating table {0} from {1} -> {2}'.format(table, source, destination))
connectionStr... | 0 |
2d143ba3a070735163b326f13fb725aa | 76e1165cc0accd9928c8691d437a257b | Plots the output of gensim's LDA.diff() method.
It filters out th upper half of the symmetric matrix
Inspired by https://radimrehurek.com/gensim/auto_examples/howtos/run_compare_lda.html | def plot_pairwise_ld(m, colorbar=True, ax=None, imshow_kwargs=None):
import matplotlib.pyplot as plt
m_square = ensure_square(m)
m_square = np.tril(m_square)[::-1, :]
if ax is None:
x = m_square.shape[0] / plt.rcParams['figure.dpi']
x = max(x, plt.rcParams['figure.figsize'][0])
f... | 1 |
f99e8fcc7bbf867363bd4e4c7382c659 | ccada32ba58093deb596eda6f4d1f39f | Sets the current tab index. | namespace Iuker.UnityKit.Run.Module.View.ViewWidget
void SetTab(int tabIndex); | 1 |
bf0cd732709f205068eb912641c162fa | 258bd29a4574c1c4e378037ab9869952 | 显示搜索的订单 | function searchOrder(){
initpager()
} | 0 |
661e2432cc26ef7fc698e49944be961f | 872719e173fb53f292cce8eef0aba81c | Handles the Click event of the _generateKeyButton control. | {
try
{
_this.keyPair = EditorsUtils.generateKeyPair ();
} catch (Exception e) {
Environment.logError ("Unable to generate key pair",
e);
}
} | 0 |
298eda781848d65a5d7eb64555524cf2 | 86936e18b931c4d0b711fdbac94e16ae | 检查ctClass对refClassName引用的方法确实都存在 | int failedClasses = 0;
for (HookClass hookClass : HookClassDef.INST.values()) {
try {
Class<?> resolvedClass = findClass(hookClass.getStrClass(), classLoader);
hookClassMap.put(hookClass.getName(), resolvedClass);
} catch (Throwable t) {
if (Constants.getApkVersionCode() >= 73 && Constants.isApkDe... | 0 |
f927c5f4e1ca45323283098d626359ea | 69e25f9269ff7eefb9d244aec031967e | pengambilan data untuk melihat putaran sekarang | class PeramalanController extends Controller
public function index()
{
$barangTampil = [];
if(isset($_GET['barang']))
$barangTampil = Barang::find($_GET['barang']);
return view('peramalan.index',[
'barang' => $this->barang,
'bulan' => $this->bulan,
... | 0 |
2afce58eb348a6647f57430e83ab8075 | feb4933081166f0cfd2f747663c260f1 | With this method, Karel rotates 180 degrees | public class Assignment1Part1 extends KarelTheRobot
public void turnRight() throws Exception {
for(int i = 0; i < 3; i++) {
turnLeft();
}
} | 0 |
18f0865abfe8f6e32835096c2e621b69 | 14102aaadcd847c90731292416930993 | 判断类是否已被使用copydao注解,包括父类和接口上
用来判断的类型信息 | Class<?> runtimeClass) {
if (runtimeClass.isAnnotation()) {
for (String inter : classDescription.getImplInterfaces()) {
if ("java.lang.annotation.Annotation".equals(inter)) {
return true;
}
}
return false;
... | 0 |
ea2cb5c38ab40d3b6f3b294361a47af8 | a0151d89d1707c567646a2daf7115311 | ルート情報から現在のアクション名を返す | {
if (isset($this->_routingInfo['requested_action'])) {
return $this->_routingInfo['requested_action'];
}
if (($this->_rewritedPathInfo !== null) && isset($this->_rewritedPathInfo[2])) {
return $this->_rewritedPathInfo[2];
}
return $this->getActionName... | 1 |
0cec7a7da91a259c22809ac29079e322 | bb96352cd377bd2bcf31983c98b9dafe | removeLabelsReFunc removes all labels that match the regex. | needleMap := make(map[Label]bool)
for _, s := range needle {
needleMap[s] = true
}
var labels []Label
for _, label := range haystack {
if exclude := needleMap[label]; !exclude {
labels = append(labels, label)
}
}
return labels
} | 0 |
638b147fc2cc9b18a2042b23aed7591e | 7f176671485bb78caf662b9df80ead8d | The typical 3D Coulomb kernel | class IonSim:
def F_Coulomb(self, x, y, z):
n = x.size
r = np.zeros((self.d, n, n))
for i, w in enumerate([x, y, z]):
r[i, :, :] = w[:, None] - w
r2 = np.sum(r**2, axis=0)
np.fill_diagonal(r2, np.inf)
r3 = r2**(-3 / 2)
F = np.zeros((self.d, n))
... | 1 |
27c21c565d554965d56a139079c96205 | 570827a71d250ef8e190eb0065a6568a | Função que determia se o troco pode ser obtido com duas notas | var five = 0;
var ten = 0;
var len = bills.length;
for(var i = 0;i<len;i++){
if(bills[i] == 5){
five++;
}else if(bills[i] == 10){
if(five == 0){
return false
};
five--;
ten++;
}else if(bills[i] == 20){
... | 0 |
360110c4270d7e3cd519d72e5e44d61a | 783316a72031d66d2ea4cfd850d869a6 | A swizzle property, returns (z,z,z,0) | namespace StereoKit.Swizzles
public static class Vec3Swizzles
public static Vec4 ZZXZ(this Vec3 value) => new Vec4(value.z, value.z, value.x, value.z); | 0 |
1ba43e54be96b28791e5cf3e03911c3c | ce87f26652d5d0c708289ea03644e484 | Returns list of organizations-names as available on `data.gov.in` | class DataGovApi(object):
def organization_list(self, _format=''):
data = self.__get_api_page('organization', _format)
return data | 1 |
92cabc1a50a87bfc76e80fcc7535c259 | a8c3558e97f1482035294df0f2966591 | Output the tracking image for the given index to a file or screen | class SegmentationDataset(OCRDataset, ABC):
def show(self, indexes=None, data=None, **kwargs):
pass | 0 |
b06af6e1169e1aa2d4ba56c06296c865 | 2e9d02841acaabdaf84f9759065ee922 | Tests the validity of Link Ids. | public class EconomicAnalyzer
private void makeSanityCheck(List<ZVector> z_in_list) {
for(int i = 0; i < z_in_list.size(); i++) {
ZVector zvector = z_in_list.get(i);
for(int j = 0; j < zvector.getVectorValues().size(); j++) {
if(!(zvector.getVectorValues().get(j).getLinkID() instanceof SimpleLinkID)) {
... | 1 |
271d64e1bf1bc98bf0ca6c70a3585e36 | fe0bb01cca38a47ef29094bcbbd2a6f6 | Return the invoice notifications in a zip archive | export class Invoices
downloadZip (id: string): Promise<ReadStream> {
return this.wrapper.downloadZip(id);
} | 1 |
2bd82c30187758e5720bb895a6f36a50 | 26d0e8910340ee6901069fc85f38fd9c | Functia test verifica daca functia pentru numar prim este corecta | def numarprim(n):
ok = False
if n > 1:
for i in range(2, n//2+1):
if n % i == 0:
ok = True
return ok | 0 |
0f0713e2c0e464655ce5b208e23ebc14 | eba7a4cc9fd75310d41cc0418bdb9770 | build item-item matrix | n_items = len(self.movies_list);
self.items_llr = pd.DataFrame(np.zeros((n_items, n_items))).astype(float);
for i in range(n_items):
if i % 10 == 0:
print("Processed ", i, " items out of ", n_items);
for j in range(n_items):
if(j>=i):
... | 1 |
1d3a4ba2b635a9ab5110b889a785da6a | fa9ae1bd9ea90cb7ca48279f8d73cfba | 通过头插法创建链表,因为每次都会在链表的头部插入所以得名 | people_t* head=new people_t;
head->next= nullptr;
people_t* lastnode=head;
for(int i=1;i<=n;i++){
people_t* newNode=new people_t;
newNode->xh=i;
newNode->next= nullptr;
lastnode->next=newNode;
lastnode=newNode;
}
lastnode->next=head->next;
return last... | 0 |
158a4e7370df09d367fba02c6e1935f4 | 4bc180107c3987f0c181108bf8aac232 | 半透明モデルを追加する | currentOpacity = alpha;
canvasGroup.alpha = alpha;
if (hasAModelIcon) {
foreach (Renderer renderer in itemModelRenderers) {
Color color = renderer.material.color;
color.a = alpha;
renderer.material.SetColor("_BaseColor", color);
}
}
} | 1 |
467931b4b2682f33240528fe604c55be | 534ce439d5b678c98bfb9fcec89cf480 | Metoda vrací mapu všech pokojů. | public final class RoomHandler
public Map<Integer, Room> getRooms() {
return rooms;
} | 1 |
6f0797b0e162b19fa2f2b71f579e76dc | e35c8745eb003f39c40198b4b17fbdfa | # Function for finalising DAE: add gene names, regulation and non-degs | id_include = !grepl("_SCAF", tab_DEG[,2])
tab_chr_DEG = tab_DEG[id_include,]
fact = factor(as.character(tab_chr_DEG[,2]))
levels(fact)
tab_chr_DEG[,2] = fact
return(tab_chr_DEG)
} | 0 |
5ba53aa1a3269f6ae75876d2e18a51ce | 17efc6ffe1f480e38ea1faf634f98a5e | Scrolls to an icon.
\par Description:
Scrolls the view to make one icon visible.
\author Arno Klenke (arno_klenke@yahoo.de) | {
if (Item* item = mItems.FindValue(itemName, nullptr))
{
Vec3 itemPosScreen = item->GetScreenPosition();
Vec2 itemPosLocal = ToVector2(mScrollArea->GetClientWidget()->ToLocal(itemPosScreen));
mScrollArea->ScrollAreaToView(itemPosLocal, itemPosLocal + item->GetSize(), true);
}
} | 1 |
c6b708facf8a9938ec9b9ffa218397c3 | 983e3a3c2728e67662465c5e8f676e16 | create the secp256k1 curve | {
int32_t ret = 0, i, i32TimeOutCnt;
if (ecc_init_curve(crpt, ecc_curve) != 0)
{
ret = -2;
}
if (ret == 0)
{
CRPT->ECC_KSCTL = 0;
for (i = 0; i < 18; i++)
{
crpt->ECC_K[i] = 0UL;
}
Hex2Reg(private_k, crpt->ECC_K);
if (pCurve->G... | 0 |
b3864dc22e61247efd9f9564dc4ffa19 | f4a7b6951f9dc9b433e8444d61388eed | Resolve distance between two addresses | @Component
public class AskOpenRouteService
public Double getDistanceBetween2Addresses(String addressA, String addressB) {
Double result = null;
myOpenRouteService.setAddress(addressA);
String mycoordinateA = myOpenRouteService.getCoordinates();
myOpenRouteService.setAddress(addressB);
String mycoordinateB = ... | 1 |
9f1f942220bb7d07bbf3d69702928ce2 | d6e5fa620edfca315d7b5ae7859ceb58 | Tests that the bullet List contains the correct info after shooting two
bullets | public void GunGetBulletsTest() {
Gun test = new Gun(0, 0, null, 0, null, null);
assertNotNull(test.getBullets());
} | 0 |
8649d3560427298b163fcb12c49542b0 | 529848237e866ef9e91377094a9f035c | 增加标签(OpenStack原生)
该接口主要用于为某个镜像添加一个自定义标签。通过自定义标签,用户可以将镜像进行分类。 | {
Dictionary<string, string> urlParam = new Dictionary<string, string>();
string urlPath = HttpUtils.AddUrlPath("/v1/cloudimages/tags",urlParam);
SdkRequest request = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", createOrUpdateTagsRequest);
H... | 1 |
28176be73fcc82ccda4a51bab1dc1a19 | 3fa62e181c37b1aeb551cd84b63b25a1 | generates manhattan values for the board | {
int index = -1;
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 3; x++)
{
index++;
int val = (currentBoard[index] - 1);
if (val != -1)
{
... | 1 |
1957db1c4cb27b2a863e02d4222a957a | b293c16d7345f50ddc638f98d3a4ec06 | Indexer for Transformers whose tokenization scheme includes a prefix space
such as GPT2 and RoBERTa | tokenizer: Tokenizer = None,
token_indexers: Dict[str, TokenIndexer] = None,
lazy: bool = False) -> None:
super().__init__(lazy)
self._tokenizer = tokenizer or WordTokenizer()
self._token_indexers = token_indexers or {"tokens": SingleIdTokenInd... | 0 |
0bea0e4fce1a31bdcf45d5335ca275f3 | 4c402206c1e48a3231d7615906bffa96 | Click on Iphone Link. | public class zoho
public zoho clickIprComplaintsLink() {
iprComplaints.click();
return this;
} | 0 |
8ad12c19e91f01a43976466f9304075d | 5c615375238f6cfb1078f31d9cc121b3 | 对arr1中元素排序,符合arr2中的顺序,没出现在arr2的,就按照升序排 | public class RelativeSortArray
public int[] relativeSortArray(int[] arr1, int[] arr2) {
TreeMap<Integer,Integer> map = new TreeMap<>();
for (int i : arr1) {
map.put(i, map.getOrDefault(i, 0) + 1);
}
int j = 0;
for (int i : arr2) {
if (map.containsKey(i)) {
int count = map.get(i);
while(count-- !... | 1 |
f4da51d01cc030c5b8253b64b5ff3b76 | ad5e40a5fb7fa189026c405aac040789 | calculate screen coordinate of (the top left corner of) a certain tile | void MainWindow::focusTileAt( int tile_x, int tile_y, int screen_x, int screen_y ) {
int tx = 0;
int ty = 0;
screenToWorld( screen_x, screen_y, tx, ty );
m_x -= tx - tile_x;
m_y -= ty - tile_y;
if ( m_x < 0 ) m_x = 0;
if ( m_x >= m_width ) m_x = m_width - 1;
if ( m_y < 0 ) m_y = 0;
i... | 0 |
fd48747e1834062950a637e9b5bff205 | 58766e34fe79f5e5aad6c8cc5bb7c290 | To generate a new expected aliases list with typicalAliases excluding {@code aliases} | return [
${merge(' // ', 'aliases', """ \"MegaMinerAI-##-{}\",
""".format(game['name']), optional=True, help=False)}
];
} | 0 |
a58616e943b9afb46f9b0e93285b6c47 | e821a6a63dd5c49c82d857ead6493ddb | Prepends a new element to the list (adds a new "head") making it the first
element of the list. This function returns false if the memory allocation for
the new element fails. | {
element_t *e = test_malloc(sizeof(element_t));
if (e == NULL) {
report(1, "failed on malloc");
return false;
}
char *str = test_strdup(s);
if (str == NULL) {
report(1, "failed on test_strdup");
return false;
}
e->value = str;
list_add_tail(&e->list, head... | 0 |
8c1d574aa907f2c4517649519caa4a38 | 9c20e5416e1e676ea3965a966a7b7fc9 | Fills a buffer fully from the next available bytes. | public void readFully( byte [] buf, int off, int len ) throws EOFException
{
if( len > getAvailable() )
{
throw new EOFException(
"Cannot fill with " + len + " bytes as only " +
getAvailableByteCount() + " bytes are available." );
}
... | 1 |
0f806d4ee48dfcad872a13756549420d | 902dd1cf753511e5c0c63819dd258ec8 | 修改rt的clickhouse存储相关信息: 表结构变更add/drop column,TTL修改 | if processing_type in [QUERYSET, SNAPSHOT]:
return
expire_days = translate_expires_day(expire)
if expire_days <= 0:
return
ttl_by = TTL_BY_SQL.format(expire_days)
sql = ENGINE_FULL_SQL.format(db_name, replicated_table)
engine_full = get_table_schema(client, sql)
if ttl_by not... | 1 |
c2c7036bea98ab73a2c5f9b1c246af22 | b95beac4b7ae24ee74ee37edc7f3e245 | number of allocated control blocks | {
char contigiousBlock = 0;
int totalBlocks = 0;
for (next = head; next != NULL; next = next->next)
{
if (!next->alloc)
{
if (!contigiousBlock)
{
totalBlocks += 1;
contigiousBlock = 1;
}
}
if (next->alloc && contigiousBlock)
{
contigiousBlock = 0;
}
}
return totalBlocks;
} | 0 |
bb031534b7ff97260043d86b3cf58759 | 007a204a1d23f000a1f01ecf41472ee3 | not include variable that starts underscore | class CURLArgumentParser(Tap):
def _get_class_variables(self) -> OrderedDict:
all_variables = super()._get_class_variables()
return OrderedDict((k, v) for k, v in all_variables.items() if not k.startswith('_')) | 1 |
50c7b94fb753706474965ad6c85215e1 | 53ea49c3c16849cdd7dc949d3c79153a | 如果数组里只剩下一个柱子了,面积就是这个柱子的高度 | if (heights.length == 0 || heights.length == 1) {
return heights.length == 0 ? 0 : heights[0];
}
int[] heightsWithSentinel = new int[heights.length + 2];
System.arraycopy(heights, 0, heightsWithSentinel, 1, heights.length);
Deque<Integer> stack = new ArrayDeque<>();
... | 1 |
5d693bd965a7a0dec74ba873a4764937 | a1c164a1164d34d5e29faa54583be4ad | 为p创建右孩子,存储元素e,并返回右孩子位置,如果已有右孩子,抛出异常 | node = self._validate(p)
if node._left is not None: raise ValueError('Left child exists.')
self._size += 1
node._left = self._Node(e, node)
return self._make_position(node._left) | 0 |
2ce83908baf91587713af7a93aa14672 | c30c097ddba28c47d3c7819e62352585 | 先找出OrderItems中的已销售数量 | $where = [
'a.order_id' => $order_id,
'a.status' => 2,
'asi.sn' => $sn,
'a.type' => 1
];
$afterSalesItemsModel = new BillAftersalesItems();
$re = $afterSalesItemsModel
->alias('asi')
->join(config('database.prefix') ... | 0 |
a9fa28dafb4b40fec488749e1d2e672b | f921ff1bbf69e793d230edb8ae8d787a | Gets the value of the transactionPass property.
possible object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Customer", propOrder = {
"refferal",
"serviceAddOnPlanCode",
"addonPlanCode",
"alternateEmailId",
"alternateNumber",
"authorizedSignatoryName",
"automaticnotification",
"bankAccountNo",
"bankAccountType",
"bankBranch",
"b... | 0 |
ca7f556060d84b908d98d1e032a0c47b | 2cc633057d4a60d52d2af751d2e35aee | Test get_temperature method. | assert self.thermostat.min_temp == 41
self.thermostat._temperature_unit = "C"
assert self.thermostat.min_temp == 5 | 0 |
1b103972a6c410c59933d7c3d0812a67 | 69aadf516d757e399a1e5652dc971c28 | 確認用.構造体に格納したグラフをターミナル上に表示 | if (G.vexnum != 0) {
switch (G.kind) {
case DG:
DisplayDG(G);
break;
case DN:
DisplayDN(G);
break;
case UDG:
DisplayUDG(G);
break;
case UDN:
DisplayUDN(G);
break;
}
} else {
printf("- - - - - - - - - - - - - - ∅ - - - - - - - - - - - - - -\n");
}
} | 1 |
3ec72bb7cf1221da7497f3f6f1f7b9f4 | 626290f143e3f62630f344adfc7447d1 | string中没有换行符,且string长度小于等于70,且字符串的最后一个字符不等于‘:’
满足以上条件,该字符串为标题 | public class BeanUtil
public static boolean isTitleRow(Row row){
return row==null||(row.getCell(0)==null||row.getCell(1)==null)||isEmpty(row.getCell(0).toString())||isEmpty(row.getCell(1).toString());
} | 0 |
98beb9b45585cf138ddf5fddfc5f76c7 | 85117e5fa8819ec9e94f9f2c44d1126b | 删除前台APP用户 | {
string sqlStr="delete from tb_App_User where [ID]=@ID";
SqlParameter[] _param={
new SqlParameter("@ID",SqlDbType.Int),
};
_param[0].Value=ID;
return SqlHelper.ExecuteNonQuery(WebConfig.weixinRW,CommandType.Text,sqlStr,_param);
} | 1 |
dc652d87a345ffbb308a60e286f49435 | 149442d61a22f1f889b1685ffc57a3c4 | 取群公告 | class ApiController extends Api
function getGroupMessage(){
self::isLogin();
$return = $this->group_db->getGroupMessage($this->groupid);
$this->jsonOutput($return);
} | 1 |
9c1909e6ae473d39d64a40ae3d512995 | bd9d8fb9774a26051ad8878387bcdaf8 | 和另一个向量的夹角弧度值 | {
double p = ScalarProduct(vector1, vector2) / (GetVectorLength(vector1) * GetVectorLength(vector2));
if (p > 1) p = 1;
if (p < -1) p = -1;
return Math.Acos(p) * 180 / Math.PI;
} | 0 |
3092fb396346dcc6e7ebcf9bc430f99e | dd64d554c92fec3a903e537d8b51e16a | Step from a day to the next day | Passage au jour suivant du graphe | public final class GanttComposite extends Canvas implements MouseListener, MouseMoveListener, MouseTrackListener, KeyListener, IZoomHandler
public void nextDay() {
_viewPortHandler.nextDay();
} | 1 |
0cbc947016f5ad6e3ed8e7c69307f20a | ff431faf152e7f6b5bc76bf06c8e976f | Enter a parse tree produced by Ç_syntParser#pointer. | public class cpp_grammarBaseListener implements cpp_grammarListener
@Override public void exitPointerassign(cpp_grammarParser.PointerassignContext ctx) { } | 0 |
60c2cd02318d574a92cdf3fb70d80ba7 | 44d0ccf4430d6c66fdeb36cdeb39b74c | Method to call an api from oAuth server and get whether user is admin or not. - SS | export class UserService
getAdminStatus() {
return this.httpClient.get(this.url + 'users/isAdmin/' + this.currentUsername).subscribe(status =>
this.userIsAdmin.next(JSON.stringify(status)));
} | 1 |
e617e41676a34588a98a6042a017bd83 | f0db705216cbbddbee439abd944604e2 | Construct polygon from the intersection part of two contours | Polygons qA(1), qB(1), intxn;
qA[0].push_back(IntPoint(quadA.at(0).x,quadA.at(0).y));
qA[0].push_back(IntPoint(quadA.at(1).x,quadA.at(1).y));
qA[0].push_back(IntPoint(quadA.at(2).x,quadA.at(2).y));
qA[0].push_back(IntPoint(quadA.at(3).x,quadA.at(3).y));
qB[0].push_back(IntPoint(quadB.at(0).x,quadB.at(0).y));
qB[... | 1 |
fe9a8ad1b384d1d03eecea33105847f8 | 94700e8d04e929f4abfe0a93359a96c1 | Creates or updates a mapping between a <see cref="IWorldName.FullName"/> and a local path.
The change is immediately persisted.
<para>
<see cref="CanSetMapping"/> must be true otherwise an <see cref="InvalidOperationException"/> will be thrown.
</para> | {
if( w == null ) throw new ArgumentNullException( nameof( w ) );
var d = GetLocalState( m, w );
if( d == null ) m.Info( $"Creating new local state for {w.FullName}." );
return new LocalWorldState( this, w, d );
} | 0 |
abdd5447660ebc94555319ca24483167 | 56199e743a146029dd345ca8d530373d | 从rpc请求数据中解析出过滤条件 | {
int start_pos = 0;
int end_pos = buffer.find('=', start_pos);
JSAttribute attr;
obj.Clear();
while (end_pos != string::npos)
{
attr.name = buffer.substr(start_pos, (end_pos - start_pos));
filter.Process(attr.name);
start_pos = end_pos + 1;
end_pos = buffer.find(... | 1 |
4d1d5569dbb3832325a41b31c7409674 | 9caac585263f1328234aca7e79dfe7b3 | Feeds the living object. | public class EntityVillager extends EntityAgeable
public void onLivingUpdate()
{
super.onLivingUpdate();
} | 0 |
4d5841a8fa1a6ea706feabbc2172e88d | a3aa5ad856e6b4204d3ec7478cbacd39 | Normalize I/O parameters | void IO() {
#ifndef ONLINE_JUDGE
freopen("/home/zeddie/Documents/input.txt", "r", stdin);
freopen("/home/zeddie/Documents/output.txt", "w", stdout);
freopen("/home/zeddie/Documents/error.txt", "w", stderr);
#endif
} | 0 |
eac16eb9f2865f2366f43776335a819b | ff0a1134a81122408b4c7f30fd979378 | Atualizamos a geração: passamos os valores da matriz de gen atual para a nova, e zeramos a matriz da próxima gen | int r;
int c;
int jIndex=0;
int kIndex=0;
int nghbrs=0;
for(r = 0; r < rSize; r++){
for(c = 0; c < cSize; c++){
nghbrs = 0;
if(r-1 < 0){
jIndex = r;
}
else{
jIndex = r-1;
}
for(; jIndex < rSize && jIndex<=r+1; jIndex++){
if(c-1 < 0){
kIndex = c;
}
else{
kIndex = ... | 1 |
8e550f721248bfdb2f65a0cf851c9115 | 8052f0507652d3501f62be180439fad6 | Synchronise private members from the superclass using reflection | namespace Ox.Engine.Component
public class ComponentToken : ProxyToken
protected override void SynchronizeFromNonProxyPropertiesHook()
{
base.SynchronizeFromNonProxyPropertiesHook();
if (Instance == null) return;
scriptClass = Instance.ScriptClass;
scriptMemen... | 0 |
aa31078650283e0446b0c5dc827a651b | fc8ba20a188fce99083d5c0c80a9019d | サイト内リンクのイベント関数 | function linkcheck($url,$linkpage_url,$admin_mode = true){
$bln = array();
$bln[error_message] = "";
$my_site_url = site_url;
$anchor = site_title;
$linktag = '<a href="'.$my_site_url.'" target="_blank">'.$anchor.'</a>';
$UnixSockString = "";
$ChkrelinkURL = str_repla... | 0 |
f3aba70a8ef5e89b8254b058fb766de6 | e20e49676352b167a12f2612ee172baf | 层序遍历打印换行的二叉树 | public class BinarySortTree
public static void layerOrder(TreeNode node) {
Queue<TreeNode> q=new LinkedList<TreeNode>();
q.add(node);
while(!q.isEmpty()) {
TreeNode p=q.peek();
if(p.left!=null) {
q.add(p.left);
}
if(p.right!=null) {
q.add(p.right);
}
System.out.print(q.poll().data+" ");
... | 0 |
8f5e636c218fd2a6250db2f9647b98a7 | 36cc5ae33604422d2062aafb950ab5fa | Devuelve la fecha de presentación del trabajo | public class AlumnoEnTrabajo implements Comparable<AlumnoEnTrabajo>{
public LocalDate verFechaHasta() {
return this.fechaHasta;
} | 0 |
40ae3255f5352a8c5a7bbd80479269a7 | 1aff0c7662e6a232a9e67c2fd603f088 | исследование зависимости восстановления от уровня шума | i = 0
ilev = -1
klev = -1
size = len(sounding['PRES'])
pt = missing
zt = missing
pb = missing
zb = missing
while i < size:
p = sounding['PRES'][i]
z = sounding['HGHT'][i]
if p != missing and z != missing:
klev = i
pt = p
zt ... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.