query_id
string
corpus_id
string
query
string
code
string
label
int64
2c51876f2f752442ae28b17e758e6a66
439fe4f0f9eb88b8f3479ec22ce52b93
Resize console window
SMALL_RECT r; COORD c; CONSOLE_SCREEN_BUFFER_INFO csbi; HANDLE hConOut = GetStdHandle(STD_OUTPUT_HANDLE); r.Left = r.Top = 0; r.Right = width - 1; r.Bottom = height - 1; SetConsoleWindowInfo(hConOut, TRUE, &r); c.X = width; c.Y = height; SetConsoleScreenBufferSize(hConOut, c); }
1
789797b3dc4bc29f468433268c83bc59
e8a7ec3fa4079fff45362217f8ba73b6
Sets Subscription Id. __LEGACY FIELD__. The ID of the merchant subscription associated with the authorization. The ID is only present if the merchant signed up for a subscription during authorization.
public function getSubscriptionId();
0
85ae238dd9abfc91db02de439a7e6268
2fdfccc3c60db3280a11375e89678970
Удаляем указатель на текущий рабочий виджет, для освобождения памяти.
View_Executable_Sizes_Controller::~View_Executable_Sizes_Controller() { this->cur_wind = nullptr; delete this->cur_wind; }
1
092110d8b72d1568c3ea792f7f02730a
f6a9c799d6cf15d810c8464b32ee7f26
Getting all policies of Firewall Table
class CDNBEST(object): def getFirewall(self): method = 'GET' url = self.api_url + 'firewall' req = self.http_request(method, url) if req: return req['rows'] else: return req
1
54af174800775a11bc7de9d2a1a7864c
44f2397bf941b6f5b33b0de1cdc42af1
Send the given amount of XRP from the source wallet to the destination address, allowing for additional details to be specified for use with supplementary features of the XRP ledger.
namespace MCWrapper.RPC.Ledger.Clients public class MultiChainRpcWalletClient : MultiChainRpcClient, IMultiChainRpcWallet public Task<RpcResponse<string>> PublishFromAsync(string from_address, string stream_identifier, object keys, object data_hex_or_object, [Optional] string options) => PublishFromAsyn...
0
bce0a15c495de13de83e9aa8492aceb0
4e8261aef3031e868b029e3181c2c441
Update the configuration of sceneHolder.
public void updateConfiguration();
1
ebd3070008733020f09cac28ed09a838
a63c2bda56e2c3341738f9ecbf2a7d44
买卖盘量比
def test_bdp(securities, roundingData): try: pipeline = pybbg.Pybbg() data = pd.DataFrame(pipeline.bdp(securities, roundingData[0])) except Exception as e: print(e) return(data)
0
2e81c815ed554b70b8f3452568269d83
265edbd0f3c5f961f9e807dd1c2fe84d
获取当前的电表电能与功率值
void dlt645_07::parse_current_energy(int valueFlag,uint8_t *targetData,bool & errFlag,FRAME_CURRENT_ENERGY_MAX_DEMAND_DATA &currentEnergyMaxDemandData,int &PT_value,int &CT_value) { QByteArray qAmmeterByteArray; qAmmeterByteArray.clear(); int lowByte,highByte; int elePower; lowByte = ((targetData[...
1
368e1f61f35e3c1cd65eb5e2bd30306d
ef2766a9f6378617dc5c051336d970f7
异步移除list中的某个值
namespace Individua.CLIRedis public static class RedisHelper public static Task<bool> ListRemoveAsync<T>(string key, T value, SerializationStyle sstyle = SerializationStyle.Binary) { return Task.Factory.StartNew(() => { RedisValue val; if (sstyle == Se...
1
3f3347dcba869a94826784069a059c5d
8f77f21b9474851ce11b39075be8bbab
Accessor for the Interrupt disable flag.
pub fn intr_get() -> bool { let mut x: usize; unsafe { asm!("mrs {}, daif", out(reg) x); } x & DIS_INT == 0 }
1
e4aef5da89d07e514d71865635048c46
e92d588d9137a05eb3b168c95359993d
Checks if the delegation has uncommitted state transitions. Returns: true if the delegation has an uncommitted transition
class FinalStateMixin(object): def no_outgoing_transitions(self, diagnostics=None, context=None): raise NotImplementedError( 'operation no_outgoing_transitions(...) not yet implemented')
0
2f4a046a77eff8fbf55dc45459734a00
0993d8eb2eb4553a8bd7966909f521a1
Find the closest previously detected blob.
points = np.vstack((self.inputs, self.outputs)).T xy_pixels = self.axes.transData.transform(points) dist = np.sqrt((xy_pixels[:, 0] - event.x)**2 + (xy_pixels[:, 1] - event.y)**2) ind = dist.argmin() if dist[ind] >= 5: ind = None return ind
1
19c8009b0cb82031aea8fbdf318d0eb2
952fbaa98fc0bc13346dd205dd9ec759
Gets a value indicating whether this file is stored with the database or not.
public class ShapeFile public boolean hasDBaseFile() { return this.hasDBaseFile; }
1
6f1fd3860db7431ca27d0db322480eb0
1f1c20f988df0fb0decd43b8f7ce7257
Load danh mục đơn vị tính
{ try{ $chude = DB::table('chude')->get(); $json = json_encode($chude); return response(['error'=>false, 'message'=>compact('chude', 'json')], 200); }catch(QueryException $ex){ return response(['error'=>true, 'message'=>$ex->getMessage()], 200); ...
0
2d0c2403cab90ef15d63d7b0460861d0
b69d6945adddc70855c5a1e2991e5b99
Disposes the wrapped <see cref="RegistryKey"/>.
namespace Rapi2 public class RemoteDevice : IDisposable public sealed class DeviceRegistryKey : IDisposable public void Dispose() { sess.CeRegCloseKey(hKey); hKey = 0; GC.SuppressFinalize(this); }
1
667e42772481e4c982cf0833d6e7660e
1705cfc5873eec61b5cdf20a2acfa394
设置字段权限
function field_registered_permission_set ($fid, $perm) { debug_write_log(DEBUG_TRACE, '[field_registered_permission_set]'); debug_write_log(DEBUG_DUMP, '[field_registered_permission_set] $fid = ' . $fid); debug_write_log(DEBUG_DUMP, '[field_registered_permission_set] $perm = ' . $perm); dal_query('fi...
1
4fa8fef93ec00f75a0520a2d795dc5f3
6b56e362e1d53c34e1bbf0e00181cf2e
通过key生成keyName,对大写字母改为 "_小写字母"的形式
$newKey = ''; if (strpos($key, '_') !== false) { $keyArr = explode('_', $key); foreach ($keyArr as $i => $k) { $newKey .= $i == 0 ? $k : ucfirst($k); } } else { $newKey = $key; } return $newKey; }
0
cab21c62f63b41679ba829f04e1c502b
b2ff3ccd0f1aa97c6c9fdb45b747ffe2
Given a cache location, evict the cache line stored there
void DirectMappedCache::evict_cache_line(int line_num, int new_tag, int old_tag) { std::swap(RAM[old_tag].ram_entry[line_num].memory_block, cache[line_num].memory_block); std::swap(cache[line_num].memory_block, RAM[new_tag].ram_entry[line_num].memory_block); cache[line_num].tag = new_tag; }
1
66328428806a9e6dfdefd776d22e607d
06b91efa227ba4426ab22ee4cc6ce722
Enlever les id_ des tables SVP du critère selections conditionnelles, ailleurs que sur les tables de SVP
{ if ($this->no_deleting($tableName)){ if (!isset($cond['where']['deleted'])) { $cond['where']['deleted'] = 'no'; } elseif ($cond['where']['deleted'] == 'both') { unset ($cond['where']['deleted']); } } return $cond; }
0
768b0cee2b13ce06d5ba235be791dde7
7d7b8ba398fc082a491fea042e6d993c
Tests to ensure that admin users can access information about other users.
self.admin_user.save() response_admin_profile = self.__execute_get_request(id=self.admin_user.id, user=self.normal_user) response_own_profile = self.__execute_get_request(id=self.normal_user.id, user=self.normal_user) self.assertEqual(status.HTTP_403_FORBIDDEN, response_admin_profile.sta...
0
792ae6bbfbb52e137a4faf0e032bfd2e
44cf5c017f0674c66975d08e49865999
List all polls.
class PollsController extends Controller public function index() { return response()->json(Poll::get(), 200); }
1
edc36ba216482153f339323329ca4859
5230bb0bad9d8614690738b68afb86f1
Function to reverse addresses of a singly linked list
void ReverseList(struct node** head){ struct node* current=*head; struct node* temp=NULL; struct node* rev=NULL; assert(current!=NULL); while(current!=NULL){ temp=current->next; current->next=rev; rev=current; current=temp; } *head=rev; }
1
f9542c2a958a2f8268f58c1bbad5cc18
3c79fff1599fea3f9fb6a5ae38d991b8
Two city instances are not equal when they have different unique identifiers.
class TestDeriveKeyResponsePayload(testtools.TestCase): def test_not_equal_on_not_equal_unique_identifier(self): a = payloads.DeriveKeyResponsePayload( unique_identifier="fb4b5b9c-6188-4c63-8142-fe9c328129fc" ) b = payloads.DeriveKeyResponsePayload( unique_identifier="5c9...
1
2fceef780debd7b81d245fe545fa671d
7e6761ca091d42d89e70b805527968c2
Handles mouseover messages Also handles Clicks
function MouseOverActiveText() { var e = window.event.srcElement; if (e && e.className.toLowerCase() == "activelink") { e.className = "activelink2"; } }
0
493534095d6d3c5c17bb9ea48f91fe74
bfc85297dc03944a184d72c5992bb5c6
Console script for requirements-rating.
def main(): parser = argparse.ArgumentParser("""Word analogy score checker.""") parser.add_argument("models", nargs="+") parser.add_argument("--benchmarks", nargs="+", default=list(DATASETS.keys())) parser.add_argument("--data-dir", type=str, help="Path to data") parser.add_argument("--tokenizer", t...
0
a23cc5bf5ee91c75980f7383248e1a0e
793f589d603492e90d7f4478fa4b8f3d
Returns the users who are following the user with the specified id
public ResponseEntity<List<User>> getFollowersById(@PathVariable("id") long id) { List<User> followers = userService.getFollowers(id); if (!followers.isEmpty()) return new ResponseEntity<List<User>>(followers, HttpStatus.OK); return new ResponseEntity<>(HttpStatus.NO_CONTENT); ...
0
aaed5b831d85b691290a16e6fb955afd
67f335bf4dcf6c2b9614e1ba1e607f31
redis 集群设置,以集群模式连接
public void linkClusterRedisWithPool(){ JedisPoolConfig jpconfig = new JedisPoolConfig(); jpconfig.setMaxTotal(100); jpconfig.setMaxIdle(20); Set<HostAndPort> nodes = new HashSet<>(); nodes.add(new HostAndPort("192.168.62.156", 7001)); nodes.add(new HostAndPort("192.168.62.156", 7002)); nodes.add(new Hos...
1
2fa4789eda1f3032e4a5680315a90304
7cee5d3fc6d7073c53a6adbe90410e79
Updates buffered image to new pixel values
if (old_pixels != NULL) { GraphicsOutput->Blt(GraphicsOutput, old_pixels, EfiBltBufferToVideo, 0, 0, 0, 0, x_res, y_res, 0); free(old_pixels); } }
0
9ee3b6f43e002e9f477641cfeebc205d
09b6b4e6fa2299d85dca38201241a94f
Возвращает URL-адрес для загрузки видеозаписи рекламного объявления. https://dev.vk.com/method/ads.getVideoUploadURL
class Photos extends Action public function getMarketAlbumUploadServer(string $access_token, array $params = [], int $apiTokenType = VKApiTokenTypes::USER) { return $this->request->post('photos.getMarketAlbumUploadServer', $access_token, $params, $apiTokenType); }
0
d2506557e4b0c092e1565704702d5819
17f7589a19cc030ac097c3ff44a7e2d0
合并表格的单元格
function mergeCells(data,fieldName,colspan,target){ var sortMap = {}; for(var i = 0 ; i < data.length ; i++){ for(var prop in data[i]){ if(prop == fieldName){ var key = data[i][prop] if(sortMap.hasOwnProperty(key)){ sortMap[key] = sortMap[k...
1
4d09f56fab07f9d4e623074e92c2eebb
88d0fe632ee8484d643527cc10bb45db
ui32DMAFlags是要启用的DMA功能的位。 描 述:
FlagStatus DMA_GetFlagStatus(uint8_t DMA_Channel, DMA_Flags DMA_Flag) { assert_param(IS_DMA_CHANNEL(DMA_Channel)); assert_param(IS_DMA_FLAG(DMA_Flag)); switch(DMA_Flag) { case DMA_FLAG_DMA_ENA: return (FlagStatus)((MDR_DMA->STATUS & DMA_STATUS_MASTER_ENABLE) != 0); case DMA_F...
0
e09fb89e38cb942be523c67d3df9dbd6
75a40f6a94faedbb34cece8637f65154
Initiates the ListView element of main display list by bonding it to an observableList object.
private void InitListView() { _drones = new ObservableCollection<TestViewItem>(); lv_droneList.ItemsSource = _drones; }
1
524ff832ef43b16ccdce069c8b635a00
6e2488cdbc5f29b1c857cfab457d23c6
保存耗材信息
void saveMaterial(WorkRepair info, JSONArray material);
1
addcd0ce01b6881caf37759a3b01d34a
03ef49924a94e940b19aa0fd5fc32182
Given a source array of size X, and a target array of size Y, add or remove points from X until len(X)==len(Y), return X
Set<PairFloat> added = new HashSet<PairFloat>(); int count = 0; boolean moveUp = false; for (int i = 0; i < x.length; i++) { if (moveUp) { x[count] = x[i]; y[count] = y[i]; } PairFloat p = new PairFloat(x[i], y[i]); if (!added.contains(p)) { added.add(p); count++; }...
0
6bca35160d782e036c4a258e9ea67938
d9bc5274938ac036cce6a43a15a76303
Combined Web and IO test
int main() { axUTestCase( test_io_vary() ); ax_print("==== end of program ====" ); #if axCOMPILER_VC getchar(); #endif return 0; }
0
43183a0470ce43353562d4584e441c11
6226114570fd823c58ee04587f3c722a
Explodes a regular expression into an array of alternatives which were separated by '|'. Takes braces into account.
$text = trim($text); if(strlen($text) < 1) return false; return explode('|', $text); }
0
2b14b7695b6a55ca40eba1c83778a50a
349057c96db43c7ff814bcb504f6eafc
Compare to dates and check if they are in the same day or not
namespace FinanceData.Models public class RandomDataModel : AbstractDataModel private bool CompareDates(DateTime a, DateTime b) { if (a.Year == b.Year && a.Month == b.Month && a.Day == b.Day) return true; else return false; }
1
84c84646571e68f4a0b3f7e3cb1ad430
f18aaddb0a02bc2e8e636faf37ae3c56
Handle files registered with the self.static method. req.path is guaranteed to be in self._static, but not necessarily a valid file. Returns a Response containing the file content or Not Found.
class Ice: def static(self, root, path, media_type=None, charset='UTF-8'): root = os.path.abspath(os.path.join(root, '')) path = os.path.abspath(os.path.join(root, path.lstrip('/\\'))) self.response.state['filename'] = os.path.basename(path) if not path.startswith(root): retu...
1
8ae080d84e581c45b4c00bfbf6a8a4ad
b83edd38c580d011b7cea3390a7985f5
This function sets the name of the EDIF output file.
def setOutput(out): global FILENAME FILENAME = out
1
dfd8182b3d372c910720fdaa63283134
56e10ca254160cc406df8bd396379cdf
附件图片远程图片转本地
function GetRemoteImage($url,$filename="",$filepath="order") { include_once('httpdown.class.php'); $savePath="../attachment/{$filepath}/".date("Ym"); $savePath2="attachment/{$filepath}/".date("Ym").'/'; $savePath = substr( str_replace("\\","/", $savePath) , -1) == "/" ? $savePath : $savePath."/"; if(!is_dir($sa...
1
7e44cd1c63d2f0ec69647cbbd60e864d
66b1a21220efccb21233d58b9863bcc1
gets number of binary active problem variables
int SCIPprobdataGetNvars( SCIP_PROBDATA* probdata ) { assert(probdata != NULL); return probdata->nvars; }
0
459d101f1b60d9dae0832350eb6d5194
095a967f9a332399d197cfbdf91aed6f
Get the term frequency. This is the number of documents in the collection which are indexed by the term. This will raise a InvalidOperationError exception if the iterator this item came from doesn't support term frequencies.
namespace Monodoc.Lucene.Net.Index int Freq();
1
c99f6ad37a1dd2d82f25a81e2348670b
01fc973ef94e78063f54513687f3ab31
Returns a scm container client.
@InterfaceAudience.LimitedPrivate({"HDFS", "CBLOCK", "OZONE", "HBASE"}) public final class StorageContainerManager extends ServiceRuntimeInfoImpl implements SCMMXBean @VisibleForTesting public NodeManager getScmNodeManager() { return scmNodeManager; }
0
c353f33c1ae0e6f06a1afe3c1dfcbab5
17dd00b27129c3e0a342217f10de9668
@brief Calculate the rusage utilisation in seconds between a start and stop time measured by getrusage()
tvsub( struct rusage a, struct rusage b ) { double fa, fb; fa = a.ru_utime.tv_sec + a.ru_stime.tv_sec + ( a.ru_utime.tv_usec + a.ru_stime.tv_usec ) / 1e6; fb = b.ru_utime.tv_sec + b.ru_stime.tv_sec + ( b.ru_utime.tv_usec + b.ru_stime.tv_usec ) / 1e6; return fa - fb; }
1
5050c96fabe6b34767c1556af13f72b1
b8e659e95c937991fe67e54f4a54b016
Radix sort for base 2 for a list of integers in the range [0, k)
public class RadixSort public static Integer[] sortInteger(Integer[] input, Integer k) { Integer[] output = new Integer[input.length]; int[] count = new int[k + 1]; for (Integer j : input) { count[j]++; } for (int j = 1; j <= k; j++) { count[j] = count...
0
ec194ee10d1202a81f96db707914c19a
86acdf83d9bf5a4c880a74fb30b75177
GET: PanelPracownika
namespace DYV.Controllers [Authorize(Roles = "Admin")] public class AdminController : Controller public async Task<IActionResult> Index() { return View(await _practicesService.GetPracticesListViewModel()); }
0
acc91b1a15f0bbba78489d6a9f790f87
d919f675f3960a635c590d109737824b
Internally saves the connection type to be written with any exported data.
public class DiscoveryDTO implements Parcelable public void setConnectionMode(final ConnectionType connectionMode) { this.connectionMode = connectionMode.getCode(); }
1
00c8fb3f760bb22457b84d1346b33b84
aafe01c7257fd0dfee87cc8e0d7506f2
TestFloat64ToTimeSuccess - тест успешной конвертации f64 - время
then := Date(2009, 11, 17, 20, 34, 58, 651387237) return then.Equal(now()) }
0
b8cafc974e12f59bd5c52dc3edcdf044
222bd25241d85c5f7a6428859920f7b7
Returns the container of the visual tree for adding new nodes.
ViewGroup getContainer();
1
99d919aa2241d63d88168b50ba530a4b
fa4baccea3942ea811466b4c7d20df4c
Step 3: Initialize the RTLSDR device. If `Modes.rtlsdr.name` is specified, select the device that matches `manufact`. Otherwise select on `Modes.rtlsdr.index` where 0 is the first device found. If one have > 1 RTLSDR device with the same product name and serial-number, then the program `rtl_eeprom -d 1 -M "name"` is ha...
if self.handle: mode = str(mode).upper() self.handle.write('*RST;*CLS') self.handle.write('INIT:CONT OFF') self.handle.write('SYST:DISP:UPD ON') self.handle.write('INST LTE') self.handle.write('TRIG:MODE EXT') self.handle.wr...
0
fbdc6d43f5326c681915ecf267d6e0cd
7a9479baeef1c921192e451071d642fc
Gets all changes for a specific build, shows commits included in build
public class VCSCommitImp implements VCSCommit @Override public List<VCSChange<?>> getChanges(final VCSCommit commit) throws VCSRepositoryException { return this.getChanges(commit, true, (String[]) null); }
0
f812129f846eb66a751f9f0988b4f546
67399401ea1203cc52ad63562cae8f5d
Testing empty frequency_map is converted to empty probability distribution
def test_MLEProbDist():
0
a2105c82ca420ecde034ec02be5ae9e2
eee6ab58e4be66c05f75835a44887ee0
Establece los valores por defecto del formulario viaje combustible
namespace Vista public partial class fmResumen : Form private void mtEstablecerPredeterminado() { try { objControl = new clsControl(); vectorr = new string[6, 6]; vectorr = objControl.mtConsultarDatosBasicos(); for (...
1
1910ff16c651e2d06bcd1cf7e63fc870
9389d026dd368fd6d5e5ed0e49534efb
세부 상품화면
this.addOrDetail = true; this.selectedProductCategoryId = id; this.modal.open('lg'); console.log('test detial'); }
1
14b6b386f62a510649d3942ddecf9a48
e10166902424034d11409187f85615dd
产品下拉kv
class Sher_Admin_Action_Vop extends Sher_Admin_Action_Base implements DoggyX_Action_Initialize public function product_list(){ $this->set_target_css_state('product'); $pageNum = isset($this->stash['pageNum']) ? $this->stash['pageNum'] : null; $page = isset($this->stash['page']) ? (int)$this->sta...
0
c5d8418acc848e6322789640757567b2
8c4dc012122f3038ae3a229dc01e406b
概率密度计算
a = 1 / np.sqrt(2 * math.pi * sigma_**2) b = np.exp(-(x_-mu_) ** 2 / (2 * sigma_**2)) res0 = a * b res = np.prod(res0, axis=1).reshape(-1, 1) return res
1
377dc4db9a8b0e90776bbfba5ad647b1
7c6898fc440013b3475d5b7a3655adb3
CRenderer::SetFontAndColor (pCF) Select appropriate font and color in the _hdc based on the current character format. Also sets the background color and mode.
{ CHARFORMAT2 cf; ZeroMemory(&cf, sizeof(cf)); cf.cbSize = sizeof(cf); cf.dwMask = CFM_COLOR | CFM_FACE | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT; cf.crTextColor = MyGetSysColor(bReadOnly ? cTextReadOnly : cText); StringCchCopy(cf.szFaceName, _countof(cf.szFaceName), SEGOE); (void) ::SendMessage(hW...
0
7e2dd7c2b27984c3f5fc3f23bb7b0bed
09ef7d78c7a01d453b771d84a6bfe5c2
Test getApiClient.
mocker.patch.object( newsapi_helper, "NewsApiClient", autospec=True ) fkey = "TEST" _ = newsapi_helper.NewsApiHelper(fkey) newsapi_helper.NewsApiClient.assert_called_once_with(fkey)
1
5ac637e99f513c6894555a85d3d4c2f7
e5c918fe1c04ef1d4da2cb39f277f7ce
Get/Set the font type by its name.
open class CustomFontTextView : AppCompatTextView fun setFontType(fontName: String?, defaultFontType: FontType = FontType.BOLD) { if (!isInEditMode) { val fontType = TypefaceManager.getFontTypeByName(fontName) TypefaceManager.setTextTypeFace(this, fontType ?: defaultFontType) } ...
1
a931ce3d2a1f77664bff03fcb44c2aa0
c0430edcc5756aaa19e9db334f4e199c
Renvoie le signe associé au joueur pour le calcul du score de l'échiquier. Positif pour les blancs et négatif pour les noirs.
if self.current_player == 0: return 1 elif self.current_player == 1: return -1 else: return None
1
d7a098c6391ba930d2e23766558846ab
dc03783e85a89a03f5ee0da320b1b692
Checks if the current data is a valid call to the OpenWeatherMapAPI
{ int forecastCount = 1; for (int i = 0; i < pollData.size(); i++) { string state; char currentChar = pollData[i]; if (!isalpha(currentChar) && !isdigit(currentChar)) return false; else if (forecastCount == 1) { if (!isalpha(currentChar)) return false; } else if (forecastCount == 2) { i...
0
ab452e935c7767580f142149fd93ae7f
c0095371a9b389769413fb4549cdb334
异步加载js文件,若已被加载,则不再加载
function asyncLoadJs(doc, path) { return new Promise((resolve, reject) => { let script = doc.createElement('script'); script.setAttribute("type", "text/javascript"); script.src = path; doc.body.appendChild(script); script.onload = function () { resolve(); }; script.onerror = function...
0
6d33e767ce7ce5a620b17c964dfd3b94
da4695103e2fd85d1f6747edc23d6f82
Sets the result as failed with informative message
namespace Foundation.Utils.OperationUtils public class Result public void SetFailure(string message) { _success = false; AddMessage(message); }
1
0fed236d722bdb23364b98cef3ebc0dd
3c94edb33f465d78b497b74ccc90898e
Obtiene la lista de los n distritos electorles con más ciudadanos.
cadena = "query=" + query2 + "&Accion=DistritosOC"; $.ajax({ type: "POST", url: "/aplicacion/controlador/mapa.php", data: cadena, success: function (resp) { var total = 0; var Particular = 0; var Social = 0; $.each(JSON.parse(resp),...
0
4aff472bc8ea473ed393d6619292c8a0
6ec1c98f45da127ae0ae0be5f1d1eebb
获取单个proxy apply表示实际使用,如果支持查看的话,使用False以免use自动增加
def proxy_useful_valid(proxy): proxies = {"http": "http://{0}".format(proxy)} try: r = requests.get('http://httpbin.org/ip', proxies=proxies, timeout=10, verify=False) if r.status_code == '200': return True except Exception: return False
1
3f6e77d2898f6a5d940b4bdf38b9b1ab
341f46aee2958527004d85a984a1202a
备份redis数据库
class Tedis(object): def dump(self): self.redis.flushdb()
0
b762b58a16be23071b0f317e5eef7a75
e2e72778029c1361501c661b6c544d9a
10.Tổng số mốc nghiêng lưới quan trắc công trình
namespace Buca.Application.iBigTime2020.DataAccess.SqlServer.Report public class SqlServerSettlementReportDao : ISettlementReportDao public DataSet GetReportF0102BCQTP1_XmlBCTC(DateTime startDate, DateTime fromDate, DateTime toDate, string procedureName) { object[] parms = { ...
0
2cb9544c94d0fca7f44868a3d85c733d
4418674da600df3307d3f0565c4723d7
Create taskbar items.
class Module public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $menuSettings = $taskbar->getSettingsMenu(); $menuSettings->addMenuItem(new MenuItem($translator->translate(self::TRANSLATION_USERS), self::ROUTE_USERS)); }
1
c437a1a703196a9a2ef0eb19de3033b3
bccd6a3643c0a956ebf091ae0cc2f82e
データ値を指定されたリーダーから読み取ります。
public void ReadObject(IDataWriter<string> valueWriter) { switch (code) { case ValueTypeCodes.Null: return; case ValueTypeCodes.Boolean: throw new InvalidCastException("Can't convert Boolean to Object."); ...
1
8d5aaca09d145f76aae420c555447008
a6ee5ecb169baba1c07d6aff20f1bc9c
Function closes a file by uploading it and removing the local copy
class TCPClient: def close(self, filename): file_uploaded = False if filename in self.open_files.keys(): request = self.__get_directory(filename) if re.match(self.SERVER_RESPONSE, request): self.__unlock_file(filename) params = request.splitlines()...
1
e38e160c856cf72d5baa7c5206413863
6028d80388a4580492c9187d345c415c
3.1 -> 3 2.6 -> 3 2.5 -> 3 2.4 -> 2 3.5 -> 4 3.6 -> 4 etc
int_num = int(num) if (num - float(int_num)) >= 0.5: return int_num+1 else: return int_num
1
9c1d576b5edc79d32df2936ed86fed85
b4e179ec206ef4df4edc62a447243869
Create and initialize a speed control struct
{ PWMInit(WHEEL_A_TIM, WHEEL_A_CH, WHEEL_A_GPIO, WHEEL_A_PIN, PWM_TIM_CLK, PWM_FREQ); PWMInit(WHEEL_B_TIM, WHEEL_B_CH, WHEEL_B_GPIO, WHEEL_B_PIN, PWM_TIM_CLK, PWM_FREQ); PWMInit(WHEEL_C_TIM, WHEEL_C_CH, WHEEL_C_GPIO, WHEEL_C_PIN, PWM_TIM_CLK, PWM_FREQ); #ifdef FOUR_WHEEL PWMInit(WHEEL_D_TIM, WHEEL_D_CH,...
0
b02ae2be09dd7843d9b7e2239ea01211
2b7dd739f88852c481f3d08704b74e97
Clear the TMR2ON bit
void TMR2_StopTimer(void) { T2CONbits.TMR2ON = 0; }
1
8608b382314bbe3135e14dec237846ed
7773d996058cf95588cde6648d7def7f
给值为null的字符串赋值空字符串
public class CommonUtil public static String replaceNullWithEmptyStr(String src){ if (src == null) { return ""; } return src; }
1
b969367b78aaf51f29d6ba4e747fac5f
b047c6a3852a4c088b559af6e6ea92be
analyse the tree, calculate usage and destination information
{ $currentNamespace = $this->getNamespace(); $currentClass = $this->getClass(); self::$previouslyAnalyzed[] = $currentClass; $traverser = new NodeTraverser; $visitor = new UseDependencyVisitor; $staticCallVisitor = new StaticCallVisitor; ...
1
6bcedaf82768f208c9c44db00a451c8d
aab26d895de7d653ec50656d59f280cb
URL入力用ダイアログを取得する
final SiteNameAndUrl siteNameAndUrl){ final Context context = this; AlertDialog.Builder adBuilder = new AlertDialog.Builder(context); LayoutInflater factory = LayoutInflater.from(context); final View entryView = factory.inflate(R.layout.enter_site_name_and_url_dialog, null); ad...
1
dc76664b1aad87de466019e26886c17d
fa2a1cc83646ffe443bfce187089bef3
当前页记录集是否空
export default class Pager<T> extends HttpBase isEmpty(): boolean { return !this.data || !this.data.length; }
1
ee6b321a66f1d0a60d3b2616141fe077
75bb50a818148c9b6c0ee747acd7c0ab
多个数组求和
var s=0; for(var i=0;i< a.length;i++){ s= s+a[i]; } return s; }
0
0a0ca9f227871dfec13a079dd7de33d6
baebeee090e367cc0f34eef9e4a94177
Calculates the depreciation of an asset for one period using the straight-line method.
def depreciation(annual_percent, capex, residual_value=0): assert annual_percent >= 0 and annual_percent <= 1 annual_depreciation = [] prev = 1 while True: if prev < annual_percent: annual_depreciation.append(prev) break annual_depreciation.append(annual_percent) ...
0
ae9d5fa85caea2ce4003d7b9fdea3fd6
7062b279e643dd4a357d3a4433622a7a
Apply a point load to a node.
def nodal_load(load, n_elem): import numpy as np q = load L = 1 / n_elem dof_node = 2 tot_dofs = n_elem * dof_node + 2 r_elem = np.array([-q * L / 2, -q * L ** 2 / 12,\ -q * L / 2, q * L ** 2 / 12]) fixed_dofs = [0, -2] f = np.zeros([tot_dofs]) ...
0
f7fa9e487e0575e44d1b39ef4eb65962
96775ebf65557255288956e7cb5a908c
Metodi siirtää käyttäjän muistutuksen muokkaussivulle.
class Kuvakontrolleri extends Kontrolleripohja public function toteuta_tallenna_muokkaus(&$palauteolio) { $aktiivisuuslaji = Aktiivisuus::$KUVAN_; $this->kayttaja->paivita_aktiivisuus($aktiivisuuslaji); }
0
4311a3e3bf91c6bc56781b936f059098
a86972f8e2168dc9be2b43892987a877
Create or update the processes with ports, schema types and lineage mappings
String portGUID, String schemaTypeGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, ...
1
6cf33d8d629f1ba36096ec91827117ab
0b2ae8ac82357955ef5e6087943995ff
小球、挡板碰撞检测
let p = paddle, b = ball if (p.collide(b)) { if (Math.abs(b.y + b.h / 2 - p.y + p.h / 2) > Math.abs(b.y + b.h / 2 + b.speedY - p.y + p.h / 2)) { b.speedY *= -1 } else { b.speedY *= 1 } b.speedX = p.collideRange(b) } ...
1
5555c05074f8144e4c1d658c213bd7fa
d82005ce36ff878cb36b439276e93067
Convert a binary array into an array of weights of the given shape
class StoreSkinWeight(): def conv_weight_shape(self, shape, weights): return [[weights[i+j*shape] for i in range(shape)] for j in range(len(weights)/shape)]
1
54d955fe81179c2b02bc6f1644e589c6
ffbe226feccad4b9e1e0bbf3d4d03076
Returns a unique id for this follower
{ if (!IsValid) { return 0; } return uniqueId.GetHashCode(); }
0
eee90161ed08721897b5498c80ae550f
5881fdba5187b0de4fb3eda027e7a3e5
返回乡村名称
@Table(name = "weather_nation") public class WeatherNation public String getName() { return name; }
0
ccd2d6fe102724624f9c85cf900efa41
eaff5bce596d2495f71e0313af6ef36a
Selects the last enemy.
public class EnemySideController : MonoBehaviour GameObject SelectEnemy() { enemyCount++; if (enemyCount >= enemies.Length) { enemyCount = 0; } return enemies[enemyCount]; }
0
2bc93774d0acadb2fe2c6a6d471104eb
e4c7b35a7b5780bc1660978a21d2bba8
Get tool consumer key.
public function getConsumerKey ();
1
a0448cea5bc2e2d307970a5d05d811a8
8582858afe85248685b402c9b04ca808
Bind a signed 4-byte integer to an OCI statement
sword sql_bind_int(connection *c, OraCursor stmhp, ub4 pos, sb4 *val) { sword status; OCIBind *bhand; status = OCIBindByPos(stmhp, &bhand, c->errhp, pos, (dvoid *)val, (sb4)sizeof(*val), (ub2)SQLT_INT, (dvoid *)0, (ub2 *)0, (ub...
1
4e5209b6385ac0a0ba2591884daf9419
9ba173b30e6d51038971beae3722fee0
Build context from these simulation parameters. The build context only requires information on geometry.
class TestContext( BaseContext ): def createGeometry( self ): return Transform( children = [ Transform( translation = (0,0,0), children = [ Shape( DEF = 'Floor', geometry = Box( size=(10,10,.001)), appearance = Appearance( material=Mat...
1
b2a50ffd464079571d49f37bcbf6e99a
9bec6d063c9eb656e03b2e8f8250ddee
Store a 64-bit float value to a relative pointer
func StorePointer(addr *unsafe.Pointer, val unsafe.Pointer)
0
90877ae38c5300f66dfaeb666b84435d
23a4eca355fce372173543c3ec89de7a
Create a new sensor thread.
class Accelerometer(ShimmerSensor): # Set up the sensor def start(self): thread = Thread(target=accel_thread_ep, args=[self]) thread.start()
1
fc089b3f0f559cf539c3256992ec05df
a4414f57b695379be5ca384673837188
Reads a line of text from the keyboard. Re-prompts for data on invalid entry.
public class Client public String readline() throws IOException { return pwin.readLine(); }
0
9aebdd917904c8a2f7d579fb460556ef
9d09f8a5b2f13bbc2753b9b9ad9c471a
注册协议必须勾选
class UserSerilizer(serializers.ModelSerializer): # 显示指明字段 def validate_allow(self, value): if value != 'true': raise serializers.ValidationError('协议未选中') return value
1
af0d63b7e24d08ccf8628f06725642ff
98e8e845d3012f31b3c9f546466bb961
m_sceneRenderer->CreateWindowSizeDependentResources();
void DCSdirectX11Main::CreateWindowSizeDependentResources() { m_sceneRenderer->CreateWindowSizeDependentResources(); }
1
a2e60444a0c9a601c79e08d636e244ff
1a7ed2ba0ceb262d2e68e7a405ff871d
基于相似度矩阵和指定的酒店name,推荐TOP10酒店
axes = get_axes(axes_omissions) similar_hotels = [] base_hotel_chromosomes = get_hotel_chromosomes([base_h_id])[base_h_id] comp_hotel_chromosomes = get_hotel_chromosomes(comp_hotels) for c in comp_hotels: aggregate_similarity, similarity = get_similarity( base_hotel_chromosom...
1
e2b37d521a258d30bd54fc88e724d9bb
8f9675c5a870dada29e3d4b277acf23d
获取推荐的录播列表
VideoChatRecommend(params) { return minRequest.get('/Api/SearchByVideo/GetRecommendList', { ...params }, { baseURL: globalConfig.baseUrl + '/CenMacauCMS2/' }) }
1
0c47cb1cd1386939604c41b699b9d4ba
f0b37e3dec5f8fc64c57458342826b50
去冒险
cout << "--------------------------" << endl; cout << name << "向着平原爬去" <<endl; if((rand() % (3 - 1+1)) + 1 == 1) { RandEvent2(); } int v = RandEvent(); if(v == -1){ return -1; }else if(v == 1){ return 1; } FindFood(2); ...
1
3b09f2d7954c27c8ca8413b3253bdd65
51e9f5ec26810b6d2d085577eec3269e
This performs the arithmetic-geometric mean (AGM iterations. This routine is called by MPANGX. It is not intended to be called directly by the uesr.
register float *k, register float *a, register int p, register float *ex) { float bb[BIGSORD]; register int i, j; register float e, s, *b = bb; e = *r; *k = -r[1]/e; *a = *k; e *= (float)(1.0 - (*k) * (*k)); for ( i=1; i < p; i++){ s = 0; f...
0
35edae22d667012e493fd81eb9573324
b6ca11b94f9b3f51406ba4f0b1bcede0
Provides the actual variable which corresponds to this parameter on the stack
VarType getVar();
0