query_id
string
corpus_id
string
query
string
code
string
label
int64
9f213415dda097305a71a9aaa7229b99
3066ffc19531ed1bf9ad70457264bb59
Executes all commands sent to the manager and exits
class SerialManager(threading.Thread): def execute_commands(self): self.__writer()
0
b7af03510c1ff3603693f745c45ea419
c1f87fe5485c6420bf6f4fe662d6d110
Installs Node and Python prerequisites
p1 = subprocess.check_call( ["yum", "groupinstall", "-y", "Development Tools"], shell=False) p2 = subprocess.check_call(["yum", "install", "-y", "cppunit-devel", "libtool", "zlib-devel", "gawk", "libsigc++20-devel", "openssl-devel", "ncurses-devel", "libcu...
0
0dfd8911b6cad998d5e06638a5916882
7bd4201e0a101b48b9d1bc0677c7dae4
Copies the selected content to the internal clipboard
class Selection extends GridView copySelection(info) { if (!this.isInRange(info)) { return false; } let values = this._copyContent(); let ta = $('<textarea>').val(values).appendTo(this.$dom.body).focus(); ta.get(0).setSelectionRange(0, values.length); document.execCommand('copy', true); ta.remove(); }
1
0bf492d789e0da861f36e8032df05c43
8ee582202a06bb07c9ff6b8676308a7d
Send a distance vector to neighbors
uint *tm = (uint*) dv->sendBuff; if (dv->poison) { for (auto& remote : remotes) { tm = (uint*) dv->sendBuff; for (auto& p : dv->rTable) { *tm++ = p.first; *tm++ = (p.second.next == remote.sin_addr.s_addr ? dv->ifinity : p.second.cost); ...
1
076947d247c4379e7de4e27a6b00804a
fe1d986e2f8e3d8124ed039547894345
Gets the tile type.
public class Tile extends JButton public String getType() { return type; }
1
64a0e81aec941796d3d1ce90761a790f
28bafa4a45ff7636313b6ecf40a08159
设置三角形翻转
open class NetworkSpeedView : View private fun setTriangleVertex(angle: Float) { if (angle in 0..60) { var trueAngle = angle + 90.0 var trueAngleR = Math.toRadians(trueAngle).toFloat() var i = 0 while (i < 6) { if (i % 2 == 0) { ...
0
b073dbb668183d51ee9f6ab9f30ba648
86e76f647bb02d0d4ee028ec50195c0d
Permite obtener un submódulo por su id
class ModuloController extends Controller public function show($id) { $m=Modulo::where("nombre_modulo","=",$id)->get(); return response()->json(["datos"=>$m,"mensaje"=>"modulos encontrados"]); }
0
525fc0dfcf932462afabece94401126c
b60260cadd7e6133c8cca8dcf03caf0d
Prints average residential market value for provided zip code
value_predict = Predictor() price = value_predict.predict(state="California", county="Orange County", city="Anaheim", neighborhood="Southwest Anaheim", square_footage=1000) print(price)
0
3ac09054fb4b6ac78f8a4026566e336f
2afcab1885cc6dccbf632124991a0f33
Cleanup this native info by unlocking the global handle
JNIEXPORT void JNICALL Java_org_sleuthkit_datamodel_SleuthkitJNI_closeFileNat(JNIEnv * env, jclass obj, jlong a_file_info) { TSK_JNI_FILEHANDLE *file_handle = castJniFileHandle(env, a_file_info); if (file_handle == 0) { return; } TSK_FS_FILE * file_info = file_handle->fs_file; tsk_fs_fil...
0
e75c8f964dd9a703c5f4a80e46d4f3bc
bc63fa00b5b94aae097ac68253184a74
Disables lazy loading mechanism and init object fully
class Appointment extends AbstractEntity protected function noLazy(&$property) { if (is_object($property) && $property instanceof LazyLoadingProxy) { $property = $property->_loadRealInstance(); } }
1
ae9bbae99e7dc5608a180009e8957fc4
b4c14084897d6c1439656bd7af0d9ba6
Function that move all zeroes to the end of the list.
count = 0 for i in range(n): if list[i] != 0: list[count] = list[i] count += 1 while count < n: list[count] = 0 count+= 1
1
0d9b470646365fa469b6ae1610442aca
c55e26ee9fd5f6db5a4fc39433c5efb4
! This reduces the effect of dead tubes by assigning them charge and timing values derived by taking the average of the neighbouring tubes
int finished = 1; reset_main_neighbors(); double factor, dist; int ncount; if (style == 1){ factor = 0.854; ncount = 12; } else if (style == 2){ factor = 1.207; ncount = 14; } for (int ti=0; ti<nop; ti++){ atoms[ti].cutoff = factor*lattice_cons...
0
31b7eca89568906b558c63697f54d6ce
467c8d3f12ab78f04f3bf84efa93c850
Trigger pause or resume play.
class BraviaTVMediaPlayer(BraviaTVEntity, MediaPlayerEntity): async def async_media_play_pause(self) -> None: await self.coordinator.async_media_pause()
1
8a8acdad3cf52e9b19b2b658e29a3cef
464cedc02e3324bdcc86d018cf9061fd
For each subsequent call to the mock, it will return the next result.
index = 0 while True: try: ret = mock_outputs[index] index += 1 except IndexError: ret = mock_outputs[-1] yield ret
1
3204eaec0b6814d567f61fb0effc7874
712ab6f5b503f976126401ca5399b611
Writes a rectangle.
public void rect(final double x, final double y, final double w, final double h) { if (LOG.isDebugEnabled()) { LOG.debug("[" + id_ + "] rect()"); } }
0
5b36652adbca231d42582e8d6ef7a579
adc200fcce766b5642520f9c62ad8c06
找start到finish换乘最少路线
def get_line(source, target): start_index = stations_index_li[source] end_index = stations_index_li[target] start_li = matrix_li[start_index] path_li = [0 for i in range(len(stations_index_li))] path_li[0] = 1 transfer_time = 3 transfer_node = StageNode() transfer_node.start = '换乘' transfer_node.end = '换乘' tr...
1
6785e152031025972a1bc9701357f75e
27efa5a1eebe9658fb7ec83b6913d1f1
узнаём бригадир ли пользователь
class Visitors_inc_counter extends Diafan private function is_Bot($user_agent) { if(empty($user_agent)) { return false; } foreach($this->bots as $bot) { if(stripos($user_agent, $bot) !== false) { return $bot; } } return false; }
0
674ecdbdc781ed91dc46a779f78f7081
f82c1e4635986d818105660f61e50199
Método que ejecuta llamado a los componentes de negocio, mediante endpoint suministrado por el service registry
try { return action.call(); } catch (BusinessException e) { throw e; } catch (Exception e) { throw new BusinessException(e); } }
0
23b8df06fbc2456b88f0f66470fb2b97
fef1af67787ea62219dbbe5f9a40cd0e
Generates the total rule infographic
def senten_cut(sentence): line = [] temp = [] count = 1 senten = '' sp_sen = sentence.split(' ') for word in sp_sen: if count == len(sp_sen): temp.append(word) line.append(' '.join(temp)) senten = '\n'.join(line) elif count % 6 != 0: temp.append(word) else: line....
1
819ad1f6d6174c87cfe9329747802cfe
7c8f445e3d278536924affc08e1f2ce6
Если тип текущего токена совпадает с переданным типом, то считывает очередной токен Иначе бросает исключение
namespace CalculatorBackend public class ExpressionCompiler private void CheckToken(TokenType type) { if (CurrentToken.Type == type) ReadToken(); else throw new FormatException($"Unexpected {CurrentToken.Type} at {CurrentToken.Position}"); }
1
4bcc52e56508a3f75adfb1fabd9e4a5c
f8b94ca9327ec8b553b5fb74d4f845b5
Comparar con otro punto
class Punto: def resta(self, punto): return self.suma(-punto)
0
ff294b48896013243c57cbb711f94610
7b2a43e9e33006c3b46ea8062dd62e31
save model and their optimizer
class NRU(nn.Module): def save(self, save_dir): file_name = os.path.join(save_dir, "model.p") torch.save(self.state_dict(), file_name) file_name = os.path.join(save_dir, "optim.p") torch.save(self.optimizer.state_dict(), file_name)
1
79a2b773844ccbc20aa9accc233ffbfb
5de09c8cab53835b88e50c3d34bfac04
Load values from an ``*.ini`` style config file. If the config file contains sections, their names are used as namespaces for the values within. The two special sections ``DEFAULT`` and ``bottle`` refer to the root namespace (no prefix).
var_dflt = r'\${(.*?):-(.*?)}' def _interpolate(content): rv = expandvars(content) while True: match = re.search(var_dflt, rv) if match is None: break bash_var = '${{{}}}'.format(match.group(1)) value = expandvars(bash_var) ...
1
c19192bde6867449d1982997229313eb
9da530978c889050b1d81694d6a60332
Returns the boolean indicating whether this <code>TextComponent</code> is editable or not.
public abstract class JavaFXAbstractTextInput<C extends TextInputControl> extends JavaFXComponent<C> implements ITextField @Override public boolean isEditable() { return resource.isEditable(); }
1
2db0c9766aaa301f7bfb859cc51871bf
6f77df13f3622fc2d31e0397562257e6
DBのExpを更新
function M:UpdateExp() self.ExpSlider.value = User.MapData.ExpRatio self.ExpValueLab.text = tostring(User.MapData.Exp).."/"..tostring(User.MapData.LimitExp) self.Particle:Simulate() end
0
7d0f396f9a7e29bba7820bad54a65c29
a11e3da22ced876cbcdc5b6f44e23d25
back propagation with bias and regularization
w_reg_gpu = copy(w) w_reg_gpu[-1,0] = 0 return (Xtilde.dot(Xtilde.transpose().dot(w) - y))/np.shape(Xtilde)[1] + (alpha/(2*np.shape(Xtilde)[1])) * w_reg_gpu.transpose().dot(w_reg_gpu)
0
6ab9a8a63728fb28f5c2a084e497da84
0c5dedec1ad51102ee83c7230eb026ab
Logea el inicio del proceso NPRACH. Logs beginning of NPRACH process.
{ $is_posted = 0; $is_posted = $this->isServicePosted(); if($is_posted)return 0; $this->ipd_process_log_generator(); $sap_procedure_data = array(); $sap_procedure_data = $this->sap_procedure_log; array_walk($sap_procedure_data, function(&$procedure , $key){ $procedure = array_merge(a...
0
8f42ae63a3364a70c99a142b3732cb39
12b0e41f2a91acdb1ce5932edf71856b
Generate input command line tokens for the csp (csp_galexev) utility.
result = copy.copy(self.FCTL_BASE_ARGS) result += ["--endpoints=file:%s" % self.prom_input_file_name] if extra_args is not None: result += extra_args return result
1
fe5e35b07099bb2360765d5984bf953d
68e406f4e8675d6ea1f08c7f884bdf14
This method increment the progression bar by adding 1 percent.
public class ViewHelper public void updateProgressBarValue(){ pb_activity.setProgress(pb_activity.getProgress() + 1); }
1
b15cf48d1e8f68cc442a8a91f520e774
900495496107ba5e22d50b3f44cc81b6
带Cache的图片显示策略
ImageLoaderContract diskCacheStrategy(int diskCacheStrategy);
1
83e0e54eb8d8c0aeb21733b710fe9f99
04817e77d8e77a54f8ee972545c21776
查询所有的家庭成员信息
public List<Map<String, Object>> getFamilyMember(String familyKey) throws Exception;
1
e7fa33045c90c52a67794b32459e68c3
75e11ec372a33017983b555150de7e0c
Extract from the docstring the keys and description, return it as a dict
def parse_main_docstring(): s = __doc__.split('\n') while not s[0].strip(): s = s[1:] desc = list(itertools.takewhile(lambda x: x.strip(), s)) rest = s[len(desc) + 1:] return ' '.join(desc), ' '.join(rest)
0
41b7fbdb247c360edf8f4c77c51f2c24
baa43fcaa8e3c71ffbb23ffa6aeb48b6
根据schoolid去得到相应的记录以json形式返回来创建一棵新的树 author: Ricker
{ string sql = "select name,content,star,imgsrc,id,areaid from tblschool where id=" + id; DataSet ds = DbHelperSQL.Query(sql); string json = string.Empty; if (ds != null) { if (ds.Tables.Count > 0) { ...
1
88dbcfe3f71199ee6dfca57c7413f64c
e8c3a88be3bea2cd075bd88b95d4e851
Returns true if the specified date is in the past, otherwise false.
class Helper_Date public static function isPast($date) { return new DateTime($date) < new DateTime(); }
1
a582bc7a78555500f17c08a948085402
9702500651fb8ab93cb32615213a2fb5
GET the Title of the Anime given the ID.
{ $db = new DB(); $animeInfo = $db->query(sprintf("SELECT * FROM anidb WHERE anidbID = %d", $anidbID)); return isset($animeInfo[0]) ? $animeInfo[0] : false; }
1
52ef0cd126de2d0d72bd37fe1fd0137f
189222a8e30900ce57cdc8f92e9489ac
6자리 인증번호 생성 메서드
Random rand = new Random(); String numStr = ""; for (int i = 0; i < 6; i++) { String ran = Integer.toString(rand.nextInt(10)); numStr += ran; } return numStr; }
1
82834c1b3db1f5e57d5c97416fbacee9
e1183d528c0bf9982f52c89fc89977a1
Getter for <code>kjruyigou.shop_manager.agent</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.6.0" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class ShopManagerRecord extends UpdatableRecordImpl<ShopManagerRecord> implements Record13<Long, String, String, String, Integer, String...
1
428299f2eb36d0099c496482575924aa
e34d2285ba6af29f422adb13bc28ab21
方差最小的投资组合优化
bounds = [(0, 1)] * len(daily_rets.columns) print(bounds) cons = ({'type': 'eq', 'fun': lambda x: x.sum() - 1}) result = spo.minimize(total_sharpe_func, splits, args=(daily_rets, rf_rate), method='SLSQP', options={'disp': True}, bounds=bounds, constraints=cons) return resul...
0
dd4cab12c8bf9de64bb74ff574ac02d6
1f1be6e617d43108bd246ec2e5bab4b5
when this event is triggered, the layout of header/background is not updated immediately. we use a one-shot timer to delay a synchronization among scroll viewers
scrollX = skin.getFlow().getHorizontalBar().isVisible() ? -skin.getFlow().getHorizontalBar().getValue() : 0.0F; requestLayout(); layout(); if (working) { requestLayout(); if (rootHeader2 == null) { createRootHeader(); } root...
0
22ddd459bd30db9963005f9cf464023b
8bb425e64d8b5e35078bf138ab0d2e14
获取支付预订单信息
class Order extends Auth public function getPayOrderInfo(){ $paramData = request()->post(); $data = $this->OrderService->getPayOrderInfo($paramData); if(false == $data){ return apiReturn(['code'=>1000000021, 'msg'=>'请求失败']); } return apiReturn(['code'=>200, 'data'=>$data]); }
1
ff8429706ce1aeb3837acbf026cb3e57
33e265317e0a1edef879ed108449a4ee
Determines whether the product has been initialized based on the status.
isInitialized() { return this.__initialized; }
1
1204df1c54be0ba97daafbe7103b977a
45122eaa165695eeb4e31dda292aee0b
Defines a default schedule definition for a CRON command.
class ScheduleTime(Dictable): def __init__(self, recurrence_pattern: ScheduleEnums.RecurrencePattern = None, execution: Execution = None, daily: Daily = None, weekly: Weekly = None, monthly: Monthly = None, yearly: Yearly = None): self.recurrence_pattern = recurrence_pattern ...
0
08220e88585745d39df8d2ef8b438756
18d6ebd1a24dcc2d921561727af319b4
Specyficzna metoda dla klasy, Zwraca nazwę i Id produktu instancji obiektu
namespace Globalstech.Domain.Model public class Product : IAggregateRoot public override string ToString() { return Name; }
0
b3e7a5c5e3fd54b0fec58f78dfc8ee8b
a9d4c3b390890a71e279fdf107cb83f9
품목 피드 보내기
public void pdsWrite(@ModelAttribute("page") int page) { log.info("Controller pdsWrite : "); }
0
a2f54cd60a61694544387856d2f8917d
c072252b0c79932b6b49e5710ac96ba2
Main menu, home of rover UI.
mprint("16:08:42 -- Hurry up, Engineer!") mprint("16:08:39 -- The Curiosity Rover sent to Mars " "has gotten lost and needs your help to navigate back to " "its launchpad") mprint("16:08:38 -- Unfortunately, its cameras are down so it can " "only dete...
0
a08b616b289f38d7d652294f06038f11
58293e77f2e5d5a65228910d7acd1ef9
Callback to cancel the recording and re-enable the UIs
header_btns.removeClass('ui-disabled'); stop_btn.addClass('ui-disabled'); record_btn.removeClass('ui-disabled'); play_btn.removeClass('hidden ui-disabled'); ongoing_recording_spinner.addClass('hidden'); record_btn.off().one('vclick', recordAudio); ...
1
c1a538d16445185a4b967d3136e5c267
a4854d32af55f52ecc0e8f1d6995892a
Writes a null-terminated string to the virtual monitor.
static void writeStr(svwCtx h, const char *s) { writeBuf(h, strlen(s), s); }
1
a86de819ad57ed6caf8dd452147cb98e
9b60c85a70834b7900746f9833b9d8b6
Genera números de referencia para los productos
class GeneradorCodigosUnicos public static function codigoProducto($id_producto,$tipo_producto,$codigo_subtipo_producto,$origen) { $codigoConCeros = GeneradorCodigosUnicos::rellenarCeros($id_producto,6); $codigo_unico_producto = $tipo_producto . $codigo_subtipo_producto . $origen .$codigoConCeros; ...
1
ece2298186fd42dcaa372f993c8abeda
70c7400c6b6f092b7bebc14c7cba5aaa
获取妖域幻界副本进入条件
local is_max_level = FubenData.Instance:GetCurMaxLevel() local is_max_score = FubenData.Instance:GetHadMaxBo() local score = DungeonData.Instance:GetScore(is_max_level, is_max_score) local circle = RoleData.Instance:GetAttr(OBJ_ATTR.ACTOR_CIRCLE) local role_level = RoleData.Instance:GetAttr(OBJ_ATT...
1
16751a2c955c731607bcef32a7a1e6f8
0ab9e41d8e21306926661e7570a060bf
# check whether or not two items are linked
function isConnected(a, b) { return linkedByIndex[a.index + "," + b.index] || linkedByIndex[b.index + "," + a.index] || a.index == b.index; }
1
6a1e28616039d35dd836e50540e394a1
49fe013709b3d6f0e1ce107d23c9cb7c
Throw if argument is NotImplemented, else return argument.
@SuppressWarnings("javadoc") // C'mon guys, it's just an old test :) public class TestEx8 static class Runtime static Object throwIfNotImplemented(Object u) throws NoSuchMethodException { if (NotImplemented.equals(u)) { throw new NoSuchMethodException(); } els...
1
5939a8ef0a9aa01c69ddc9e37ca02ca1
19c7a0f9b78a5a24cd7386f76fbf74cc
Test that `work_id` counter wraps around
assert isinstance(work, Work) def chunk(): work.ID = self.lab._do_insert('''"DB_USER_1"."WORKS"''', work) cursor = self.lab._do(''' SELECT COUNT(1) AS WORKS_COUNT FROM "DB_USER_1"."WORKS" WORK WHERE WORK.MASTER_ID = ...
0
1ce1999c42a5d9932ded5b9969e4c37c
2d5420761b552dfd07f63cfcb4de542e
通过项点名称获取项点view列表
{ DataTable dt = new DataTable(); if (!String.IsNullOrEmpty(strPointId)) { TMisContractPointitemVo objItems = new TMisContractPointitemVo(); objItems.CONTRACT_POINT_ID = strPointId; dt = new TMisContractPointitemLogic().GetItemsForPoint(objItems); ...
0
4e45546b7a95e70c5c75b337594aeee2
e54054095262239f1f5246e8a9fbc126
Function that shows what points are selected by a particular slice operation
if section=='xy': tmpImg = xImg[:,:,xSlice] elif section=='xz': tmpImg = xImg[:,xSlice,:] else: tmpImg = xImg[xSlice,:,:] show_plane(np.rot90(tmpImg))
1
4e57bc397ec0e7e5c9745f0dd2be90dc
6e58c3d02ae794b4bd2cef592606a826
Add a smart field to content
$output = ''; if ($this->item_id) { $contentFields = ContentFieldRecord::findAll(['content_id' => $this->item_id]); foreach ( $contentFields as $contentField ) { $output .= '<div class="form-inline"><div class="form-group">'; $output .= '<label for="AdditionalFieldId[' . $contentField->additional_fiel...
0
9bfa09b4a807cfea44e63bd6b857b26e
be2e4638b0b7ac7a5a24a1df5fc2d77b
将收到的消息的id更新到当前用户
public class ConnectionBean private void updateMessageId(){ Timestamp timestamp = new Timestamp(System.currentTimeMillis()); messageId = timestamp.getTime() + pid; }
0
88ecc2bc00d6cb5617a1af7ad6ba67d1
dfabe1a236f29f6f3adf9a78007d50af
Tests the dealer feed elements against a set of "master" values.
player_states = dealer.player_states curr_player = player_states[index] if not feeding_choice.verify_self(player_states, curr_player): dealer.kick_player(curr_player) elif not isinstance(feeding_choice, PlayerForgoAttack): feeding_choice.apply_choice(index, dealer...
0
88e3de54442e7d82ddd8a15c6e35433d
0f3d71c907a34bc24bed535024748b68
切换到左边
$('#layuiSideIndex').animate({ left: 0, }, 500 ); $('#hrakheight.layui-body').animate({ left: 180, }, 500 ); $('#changeSide').children('i').html('&#xe668;'); $('#changeSide').removeClass('change-side-left').addClass('change-side-right'); }
0
4768d7d4c7cb8eaa3799591d8e97bb07
ddc1672270f2c75138693a5a94ec5cf2
Returns true if at least one flag or positional argument is defined for this tool.
public boolean hasArgument();
1
9d8f122325166ab8aadd94e815328d34
780cbc4b59a4392aa7bbfa0f3898c3ee
Propagate the result to the field's shadow variable container.
void FieldVariable::operator=(const Array2D &result) { set_data(result); }
0
b639bb3fbfc12e2c56251bc251c977bb
a690de3cc52d3c0f593f00b89a408cab
The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider.
public String generatevpnclientpackage( String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters).block(); }
1
050dd294db502f620275e342b0d21012
cfba1d6c030909a44247700ea19bdf10
修改密码ajax
$this->isAjaxLogin(); $USER = session('WST_USER'); $m = D('Home/Users'); $rs = $m->editPass($USER['userId']); $this->ajaxReturn($rs); }
1
5bf55ce2164dd8dac147a682fc6f531d
14ae5b2cded81a1a4c1ef881b07a2ec4
Reset/regenerate asset cache.
function pum_reset_assets() { PUM_AssetCache::reset_cache(); delete_transient( 'popmake_theme_styles' ); }
1
5cab7ce960bca92eecd56f844659c4da
7423c4aa665d67e05d3d36c49ac164a1
Moves to the attribute with the specified Name.
namespace System.Xml [Obsolete("Use XmlReader created by XmlReader.Create() method using appropriate XmlReaderSettings instead.")] public class XmlValidatingReader : XmlReader, IHasXmlParserContext, IXmlLineInfo, IXmlNamespaceResolver public override bool MoveToAttribute(string localName, string namespaceName) { ...
1
d65f07c5bf34d0f27172b67d6670f213
bd6cd27f32635c539b67a075547d1966
Handles the Load event of the ProjCritParentAllocation control.
{ try { if (!this.flagLoadOnProcess) { this.EditEnabled(); } } catch (Exception ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCu...
0
b97d44a3dd9d11935d9c9c79ac66a1f2
0663c9f0896ba4cf48b40980e74ec59c
有可能从游戏态、角色选择态过来的,先关闭网络
class PlayerStateSelectServer : PlayerState public void Enter(object param) { NetMgr.instance.Close(); UIMgr.instance.Open<UILogin2>(); NetMgr.instance.AccountHandler.FetchServerList(); }
1
f34b2fc9f4a00758560be0c1ea4d3b56
8247a6a3b73adddb677902150ba147e0
Returns: Most likely word
def most_probable(d): data = Counter(d) return data.most_common(1)[0][0]
1
a00581e5cae6f57c3d5696313b8826f4
0d564786b2cfbc7fcec7fa47f2c56fa5
Ellison and Glaeser (1997) :cite:`ellison_1997` index of concentration. Implemented to be computed with data about people (segregation/diversity) rather than as industry concentration, following Mare et al (2012) :cite:`care_2012`.
def segregationIndex(A): neigh = countNeighboroughsArray(A) height = len(A) width = len(A[0]) segregation = copy(A) segregationList = [] for row in range(height): for col in range(width): if A[row][col] == 1 or A[row][col] == 2: totalneighboroughs = neigh[row]...
1
e7d95a8f809357023bf3977d47e49384
1dfa4cfad23b732d310675370258ab0e
This method is used for the insert/Update trading transaction letter details.
public void Update(int TxKey,decimal Amount,string EmailBuyer,string EmailSeller,DateTime InitDate,int? EventKey,string Currency,string ItemDescription,int? TxStatus,DateTime? ConfirmationDate,string TxnId,decimal? McGross,string PayerId,decimal? Tax,string PaymentStatus,string PayerStatus,string BusinessEmail,str...
1
9b6ef07b09e2ae4e9eddbb6981e5a227
4f4002d31f2c071f3e32f14b6a83698f
Extract the titles of the actions from the JSON action menu response
actions = [] for plan in plans: plan_body = plan.split("->")[1] plan_actions = plan_body.split(";") for action in plan_actions: if "(" in action: action = action.split("(")[0] action = action.replace(" ", "") if action not in actions: ...
0
f32ce44f4982ed2f8862e868be493735
948ced3c59051ac7b255b6641eb78b34
Gets the format of the metadata input file sent to the external application. One of "json" (default), "xml", or "properties" is expected. Only applicable when the <code>${INPUT}</code> token is part of the command.
@SuppressWarnings("javadoc") public class ExternalParser implements IDocumentParser, IXMLConfigurable public void setMetadataInputFormat(String metadataInputFormat) { h.setMetadataInputFormat(metadataInputFormat); }
0
f1452fd2d2d6159729bfd6f0f0eac7ff
b623601527caba037297e46b74494b7d
<p> Holds the current size of the repository in MB. </p>
public double getMaxRepoSize();
0
101b10d6d5bf46dddf3afc102ec45790
71c9c11912c5f090897d6ac7aba1fc9f
根据userid获取单个listTaskRecord对象
public class ControlTimeOfUserServImpl implements ControlTimeOfUserServ{ public Map<String, Object> getRecordById(String cuId){ logger.debug("getRecordById({})",cuId); List lt = null ; Map<String,Object> map = new HashMap<String,Object>(); lt = dao.getRecordById(StringUtil.getIntegerValue(cuId)); if(null !=...
0
f13e6ac7a4b0cb439e30c8d3cfe6b2f8
033a7184cb8f1a14bc879a18df8c6fe9
Logs pre worker event.
class Logger implements EventSubscriberInterface public function logPreProcessEvent() { $this->logger->info('Starting processing procedures...'); }
1
a360f3476244ff284ec189f7a00f050c
557f5c1cac358ead0770e2a120311a52
Scales 2D vector with scalar
{ return (TrVector2i) { .x = vec.x * scalar, .y = vec.y * scalar }; }
1
79db1e9f24e085143b1af21155c1816c
d87bc56d165b4be1656bb7800718105e
异步方式获取全部商品,并保存到List<>泛型集合
public class GoodsAction extends ActionSupport implements ModelDriven<Goods> public String listAllGoods_ajax() { List<Goods> goodses = goodsService.findAllGoods(); ActionContext.getContext().getValueStack().push(goodses); return "listAllGoods_ajax"; }
1
6d2fce5d44f8017be7bf14368b54ba1b
636a2065f78bc07ad779ccb40a0f3168
マウスホイールイベントの転送
namespace MHUrho.Input.MouseKeyboard public class GameController : Controller, IGameController protected override void MouseWheel(MouseWheelEventArgs e) { InvokeMouseWheelMoved(e); }
1
ca0af5f7c51d546c3db314dcd0f727b6
db8c42c719e8c16b3b01d990fd54b064
function returning the multiplication factor for calculating the y-coordinates
public class CharacterScaler : MonoBehaviour public static float returnMultiplyer() { return multiplyer; }
1
2c709d12bbaa6deb4c98704e24d59286
0b495b3b7a1a471fa95bc5b646f92216
Returns a Matrix that will scale in the X and Y
namespace Affin public class TMatrix public static TMatrix mScale2D(double X, double Y) { TMatrix buf = new TMatrix(3, 3); int i, j; for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) buf.arr[i, j] = 0; buf.arr[0, 0] = X; buf.arr[1, 1] = Y; buf.arr[2, 2] = 1; return buf; }
1
16468960e07b2de081793410714589e5
d10ff77983521c8c80677ed00d492ade
Construct the lowerer base class and initialize its members.
{ _LayerdObjectPtr = obj; _NumOfLayers = numOfLayers; if (_NumOfLayers < 0) { return; } _PartialClassMembers = new PartialClassMembers*[_NumOfLayers] {0}; }
0
5955907cf647357cb5298d2e2ac3096f
1f4468d0597ff106c800edcdb2197146
Set the case insensitive for field: ChgWho (CMF_REWARD_BALANCE_DETAIL.chg_who)
@XmlRootElement(namespace ="http://bp.comverse.com/data") @XmlAccessorType (XmlAccessType.PROPERTY) public class GlobalAccountBalancesObjectData extends BaseObjectData implements Serializable public boolean issetChgWho () { return this._ChgWhoSet; }
0
b8c24ac40109d9969bac8c3b41ebc731
279eda9ffe2dbe08675717db3d4824fb
ACFAccordionToTabs constructor.
export class FaqComponent implements OnInit constructor(config: NgbAccordionConfig, private titleService: Title) { config.closeOthers = true; config.type = 'info'; }
0
8c1a2f44181c86b519724ef4cb1ef81d
c39f98943f13c95324809fb5fe110b14
Creates or returns a preexisting {@link MethodInfoBuilder} for a method of the smart contract interface.
InvocationMethod builderInvocationMethod(Request request);
0
6755510dae5764f520441c7aa2e39be2
cff21caa836a484061fb6798fcfeed1f
Obtains daily prices of assets from yahoo finance form startDate to endDate. Log returns are calculated and stored to dReturns(DataFrame).
df = pd.io.data.get_data_yahoo(symbol, start, end) df.columns.values[-1] = 'AdjClose' df.columns = df.columns + '_' + symbol df['Return_%s' %symbol] = df['AdjClose_%s' %symbol].pct_change() return df
1
7994548097a9167f5b2b97473e86bc20
e735a28f2eaa8f3965a356595a2e91d8
rmi服务可用性检测
@Component public class RedisCheck extends BaseComponentCheck<ShardedJedisPool> public boolean isAvailable(Object obj) { ShardedJedis jedis = null; ShardedJedisPool ShardedJedisPool = (redis.clients.jedis.ShardedJedisPool) obj; try { jedis = ShardedJedisPool.getResource(); ...
0
6505d0ef75fff99464b843db6ec419dd
439b3916dd2bc870994fc517611c885b
Consulta si existeix un doctor, en un departament de un hospital.
c.setConn(DriverManager.getConnection(c.getDB_URL(),c.getUSER(),c.getPASS())); c.setStmt(c.getConn().createStatement()); String SQL = "SELECT codigoDepartamento from departamento"; c.setPst(c.getConn().prepareStatement(SQL)); ResultSet rs = c.getPst().executeQuery(); whil...
0
81ad70d9e0a03eb5bd83c5aa843cbbd0
d6f7ce164ab2a584e9fead4012243b69
获取本周热门抢购(有缓存)
try { return dao.getWeekHotProduct(); } catch (SQLException throwables) { throw new RuntimeException("前台获取本周热销商品失败"); } }
0
122a86d80b878f9bf3064a5d2d4bd40f
d0c5dee4b46c0f0561d1e8dfc2d400af
说明: 开启防火墙
void openFireWall();
1
817a74440eeb8fc2b3dffc1b1f105f81
db6c9ef4a1dd2b7492b7c60d0bb90eba
Shows a progress dialog with an indeterminate spinner in it.
if (mDialog == null){ mDialog = new ProgressDialog(this); } mDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); mDialog.setMessage(getResources().getString(R.string.in_the_effort)); mDialog.setCanceledOnTouchOutside(false); mDialog.show(); }
1
0e2ee69679e3fed5376650509c1c095a
77219f793d1494735d5955aed3cd5c39
This function returns the difference in number between our pieces and the enemies
ArrayList<Move> own_valid_moves = position.getValidMoves(); position.changePlayer(); ArrayList<Move> enemy_valid_moves = position.getValidMoves(); position.changePlayer(); return own_valid_moves.size() - enemy_valid_moves.size(); }
0
57f5d0f7ef7f925322776bbe5f077739
92802b3a8eff8184ed34c91bba2484a4
初始化飞行图标
var pt = points[0]; var picon = new Icon(); var pimage = "../../image/gis/"+ tripMode +".svg"; picon.image = "../../image/gis/"+ tripMode +".svg"; picon.height = 25; picon.width = 25; var pTitle = new Title("",0,0,"宋体","#fff","#fff","#fff",0); var marker = new Marker(pt, ...
1
feef3107dde2af61aa0109b4a909370e
fba4f2db74c331f5a686ca5cebd1eb20
Calculate total cost of received packages.
double tCost = 0; for(shared_ptr<Package> p: this->packages){ tCost += (*p).getCost(); } return tCost; }
1
5c1e78306297eabcbfc5e2d8220fcc4a
c9dc556dafd595eee23b62d0e72ac098
Metodo utilizzato per la restituzione del voto assegnato dall'utente
public class EsameVerbalizzato public void setVoto(String voto) { this.voto = voto; }
0
8514db2a0560a45b39e2df3e5acd3c91
ba04bdb537ce8eac06795a3e0e3746b3
自定义显示位置地Toast
public abstract class BaseNewActivity extends AutoLayoutActivity implements HttpListener<String> public void showCustomToast(String num) { Toast mToast = new Toast(this); View inflate = View.inflate(this, R.layout.toast_layout, null); TextView tv_num = (TextView) inflate.findViewById(R.id.tv_num...
1
7a3f3c69d2c9967b55b2b70fc7a05b29
956a8d38c5de0c732c198bc36dff0f80
# 去词函数
temp <- character(0) index <- 1 xLen <- length(x) while (index <= xLen) { if (length(stopwords[stopwords==x[index]]) <1) temp<- c(temp,x[index]) index <- index +1 } temp }
1
fa8683c566cafd48da1b4a1cc7a8eac1
f58c6b54a0f4d98c8ea02de4ecc0af58
registering a BroadcastReceiver to listen to incoming messages
public class CallFragment extends Fragment private void registerChatReceiver() { IntentFilter chatFilter = new IntentFilter("chat"); broadcastManager.registerReceiver(chatReceiver, chatFilter); }
1
1a5c47b9c8d7d85fdf3447fd333abf4c
e80ff46b6f477efde0b8d360732b9c91
Traitement pour supprimer une pizza de la ListBox
{ App.Current.Dispatcher.Invoke((Action)delegate { Process proc = (Process)sender; for (int i = 0; i < process_list.Count; i++) { if (process_list[i].Contains(Convert.ToString(proc.Id))) { ...
0
0b7fa2eaf8c3ee1c2bc209c2d1f20bcb
74396b59daeab9c8bceddc565a7617ec
显示层对象被销毁事件.
{ EventHandler handler = Disposed; if(handler != null) { handler(this, e); } }
1
4e0f7a4d85d9fdd81fd4faf808bf1989
2a11f38b818843c716b551bd24dcb049
判断用户是否收藏该路线
class RastroLogic extends CommonBaseLogic public function isCollect($userId, $rastroId) { $row = M("CollectRastro")->field("id")->where([ "userid" => $userId, "rastro_id" => $rastroId ])->find(); return !empty($row); }
1
db6dad8a49f3d5fe2a0cf44109ef421d
e5307febf52df05bdaa32c2b1d4e006c
Reset the connected AVR Chip (matrix driver)
void resetOnChip() { chip_state->index = 0; DIGITAL_WRITE_HIGH(CHIP_LETTER, CHIP_RESET_PIN); }
1