query_id
string
corpus_id
string
query
string
code
string
label
int64
4de855b1a7db6115e4e2da1b147acddf
573dec9975205e31c4eb41c44b3d5969
funkcija (metoda) za izračun površine kruga , vraća rezultat formule za površinu kruga
int Circle::getSquare() { return (PI*pow(this->radius_, 2)); }
1
5c13e227d320ef43ab1aa932d8e88c29
0c87e85a55bd811960a466cba2f2516c
Calculates the number of neighbors for each cell of a toroidal array. To do so, it rotates the array in each direction. Returns and array with this information.
NbH1 = [(x-1,y),(x,y-1),(x+1,y),(x,y+1), (x-1,y-1),(x-1,y+1),(x+1,y-1),(x+1,y+1)] NbH = NbH1 + [(x-2,y),(x,y-2),(x+2,y),(x,y+2), (x-2,y-1),(x-2,y+1),(x+2,y-1),(x+2,y+1), (x-1,y-2),(x-1,y+2),(x+1,y-2),(x+1,y+2), (x-2,y-2),(x-2,y+2),(x+2,y-2),(x+2,y+2)] return [self.toric(L) for L in NbH]
0
edcfd4c6b96829de9908f7d0f9bd1311
e086678f1a832fb569d6ec4030f7dfd7
Returns relevant questions sorted by vote count.
result = [] for contribution in course.contributions.all(): for questionnaire in contribution.questionnaires.all(): result.append((questionnaire, contribution)) result.sort(key=lambda t: not t[1].is_general) return result
0
2f8eed3b5cd21c181bd16ea54176c7d8
3d2ec49a1b03a1ce722cc0870c0b500e
Returnerar en collection med användare som svarat rätt på frågan.
return getAnsweredIndexes(quiz).filter { quiz.getResult(it) == 1 } .map { it } }
0
def802788ff1344671ea6e3f6aa267ba
eb68956f385ba2acf60ea9d29ceb0d35
Returns the meta object for the attribute '{@link org.eclipse.bpel.model.partnerlinktype.Role#getPortType <em>Port Type</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getPortInstance_PortType();
0
05b029bc9562f00a568c54e9bfe15901
6373eee8b6c0e31cddc04a1f20e9e33e
Gets red packet details adapter.
mCommonAdapter = new CommonAdapter<RedPacketDetailsBean.DataBean.RedPacketOrderRedisDtosBean>(context, R.layout.item_redpacket_history, mDataBeanList) { @Override protected void convert(ViewHolder holder, final RedPacketDetailsBean.DataBean.RedPacketOrderRedisDtosBean item, int position)...
1
c6a661a9594eb0d03ec18fb24968805c
541bc4e4aad85e30fb6d2d9a008ffb4e
Persist changes to host aggregate object
context = request.environ.get('context') host_obj = dbapi.hosts_update(context, id, request.json) return jsonutils.to_primitive(host_obj), 200, None
1
a1f181cd5f9c2c123a1f25acb2b39c0e
827ed2b9457d656694276c5de620566f
Фабричный метод создания connector-а к базе данных Microsoft SQL Server
namespace web public class Global : HttpApplication public static SqlConnection CreateMsSqlConnection() { return new SqlConnection(msSqlConnStr); }
1
e6e0157b5b05413dc1b8e3ea476ad225
e64159473e07bfc58bba37dbf32c62d4
Select values from dbo.PDFPage by primary key(s).
try: model_pk = inspect(model_name).primary_key[0] rows = db.session.query(model_name).filter(model_pk.in_(pk_ids)).all() db.session.commit() return rows except Exception as e: db.session.rollback() raise e
1
947aec6e3d9f1cc763f5c625f513c1e6
7fd199988237448ddc97e606bc3894d2
Sets the velocity base on destination.
public class ActionStatus public void SetVelocity(float x, float y, float z) { mExternVelocity.Init(); mMoveVelocity.Set(x, y, z); }
0
6be40424e6db39dbf58385d50c37528b
231292044a06442bc91e5d58cb8f65ad
Triggers a redraw
public function forceRedraw();
1
8375c53ea6f6d86feb83800f8ee10554
a4a00206513f8b57b458c3d4cd5bff7d
Test for some coefficients as max float, two solutions.
TEST_F(CurveTests, QuadraticRoot_OneMaxOneSolution) { CheckQuadraticRoots(QuadraticCurve(kMaxFloat, 0.0f, 0.0f), 1); }
0
21b1db5626a866c6e4bcbafb3ddc9747
cc068aa7d5b64c60a9ea46927f67372e
! \brief Loading ground truth classification .
const string &class_label_file, int class_label_count) { ifstream fp(class_label_file); if (!fp.is_open()) { THROW_TRTISEXCEPTION(MPF_INVALID_PROPERTY, "Could not read class label file: " + class_label_file); } vector <str...
1
10a16c60afba8ca09fb3eb9adfcd9b11
1155691f99566a79158dd47b8beb7092
this function overrides the form.submit() method for all forms. it checks a flag to see if a form is currently being submitted from this page, and if so, will prevent further submissions
function form_submit() { return R('FORM_HASH', 'P') == form_hash(); }
0
9d64203d1a2456401c9b8b3c20716e33
4232bbc06223ae130d2e6cc3bb6b10b0
Merges a data in the database by targetting certain fields only in an aynchronous way.
object entity, IEnumerable<Field> qualifiers, bool? overrideIgnore = false, int? commandTimeout = null, IDbTransaction transaction = null, ITrace trace = null, IStatementBuilder statementBuilder = null) where TEntity : class...
0
ee3891cd2f41bd47a79c538e3a9637de
a538d457b2735db1aafe8ae9ebf8f6af
逻辑表达式四元式生成
{ if(currentNode){ if(currentNode->currentLine != -1){ if(!strcmp(currentNode->name,"Exp")){ GrammaNode* tempNode = currentNode->lchild; switch(currentNode->rulenum){ case 1: translate_exp(tempNode); ...
1
aaf4f57c746df172f04fb72dc07b0adc
5d7db4ffea1263894f8a75daaa9e735c
Gets this level's terrain.
public abstract class Level implements Serializable public Terrain getTerrain() { return terrain; }
1
ae2e61fbb2410efd459686a8c562cc9f
02cb141045af8ace3c555494fcf40457
获取当月条件总额
public String findByMonth(String itemUids,String tranMonths){ String countTotal = ""; try { String queryString = "select v.countTotal from ProjectTermCount as v where v.id.itemUid='"+itemUids.trim()+"' and v.id.tranDate='"+tranMonths.trim()+"' and v.dataType='1'"; List list = getHibernateTemplate().find(quer...
1
18970657618f64033ee0939a28224abf
7e94b85b9acbfe6224272018ce23aedb
Specifies if the current entry relates to the file system of the device.
public class VFSView public boolean isFileSystem( VFSFile file ) { return true; }
1
9e79fd27ba00b98c01a043651eb874e7
a39c547ffe39a6553a3e01dc2e9c5f16
是否显示倍速切换 1. ios系统 2. 回放中
export class PreferencesView public get show_playback_fps(): boolean { return PythonInterop.getBoolean(this.interop, `${this.accessor}.show_playback_fps`) }
0
fad96aef222d5e0a3811ec7260647c80
22d1c7501561ea045baa2cf74c04f33e
Displays/opens the doc using the OS's default application.
def openDoc(doc_name): subprocess.run(['open',doc_name + '.docx'])
1
8c2ef2bf076d9282f868a4274d07d18c
2b63699bbd4644b27627bf04306a04e5
Sets the DBSecurityGroupName property
public class CreateDBSecurityGroupRequest extends AmazonWebServiceRequest public void setDBSecurityGroupDescription(String dBSecurityGroupDescription) { this.dBSecurityGroupDescription = dBSecurityGroupDescription; }
0
8385c77ba686903c1cd502e96a9824ac
451ea812d12922f513f4b9f5dac5e755
checkForBusts - get points using hand.getPoints function for both the dealer and player, and display message when someone busts. Returns true if there was a bust, and false otherwise.
function checkScore(hands, index) { const value = getScores(hands); if (value[index] > 21 && !handContainsAce(hands[index])) { return [false, 'bust', hands]; } if (value[index] > 21 && handContainsAce(hands[index])) { hands[index].cards.forEach((card) => { if (card.faceValue === 11) { c...
0
1b15b7ab86a82c98b7866e80dfd16b8c
d5a198cfa83d6264ba497c01bd7ea72d
Reads in the raw X and y trainging data, cleans it and writes the clean training data out to the data/interim directory
def prepare_train_test(): print("Reading data...") train_data = read('nlsy_training_set.csv') test_data = read('nlsy_test_set.csv') print("Cleaning...") train_data = format_id_and_label_columns(train_data) test_data = format_id_and_label_columns(test_data) train_data = drop_nonresponse_y(tra...
0
6facb41edb67507b539008337f7b9c0b
fa1532482bb8da50db268f2ae8c7c635
Validates that an array is not null or empty.
public final class Asserts public static char[] isNotEmpty(char[] arguments, String errorMessage) { if (ArrayUtil.isNullOrEmpty(arguments)) { throw new IllegalArgumentException(errorMessage); } return arguments; }
1
9ce667a4bd303db0ae7f510088580452
d782c622da70368c1e3b8a9f61936d9e
Recalculate the animations
local_each.call(self, function(el){ var model = self.conf.currentAnimation.transition; el.style[model.t] = model.tV; local_each.call(model.p, function(p, i){ el.style[p] = model.pV[i]; }, self); }, self); self.conf.applyAnimationsDOMRefresh = local_delay(function(...
1
928435d75f1228cd43ebed48d88621eb
32c68de4a57943bfe39d80874226abfc
根据传入的文件名进行 低碰撞的重命名 + 文件名长度限制
public final class FileUtil public static String getValidFileName(String fileName, int maxLength) { String validFileName = getValidFileName(fileName); if (validFileName.length() > maxLength) { return validFileName.substring(0, maxLength); } return validFileName; }
1
88d5db00e59a74da38715a1e901b2539
8a06dfeaed607ec8732014dd2c39f1b4
Constructs a new <code>null.bool</code> instance.
namespace kissmath bool2::bool2 () { }
0
32121a65ded459c8d4c6ef55bcf47f96
683ba6fade9e77ee7f9cfeee10a17223
给到表名和字段以及值,自动完成预处理和绑定,失败返回错误消息,成功返回插入的id
class DB{ public function insert(){ $sql='insert into '.$this->tableName.'('.$this->fieldName.') values ('.$this->update_values.')'; $state=mysql_query($sql); $insert_id = mysql_insert_id(); $result=array(); $result = array( 'state' => $state, 'id' => $insert_id, ); return $resul...
0
f65ef5b48fee36e0adfa5e4c373c2e36
f43fa292f69060f242f78f62957d8d3a
Set an option, checking the validity of interpolated values.
fn set_opt<T: private::OptOps>(&self, val: T::OptType) -> Result<()> where Self: SetOpt<T>, { T::set(self, val) }
0
f4e7be8540ed64d455387b050e964cc7
c6f31de09dae09852a4328577263b4a5
These are all bad because they're non-canonical field encodings.
class AllowTest(utils.FieldTestCase): def test_raw_bad_values(self): self.assertRawOK([hlh.Methods.get]) self.assertRaisesHeaderError([';']) self.assertRaisesHeaderError(['GET;']) self.assertRaisesHeaderError(['GET='])
1
2a1669a56d7caae6bd75a3365baa2a80
cbeb32854ff5d9e867511820755b439c
判断是否可以自动弹出界面
if (g.openPopupStack.size <= g.currentPopupStack.size) { g.nextWindowData.clear() return false } return beginPopupEx(g.currentWindow!!.getId(strId), flags or Wf.AlwaysAutoResize or Wf.NoTitleBar or Wf.NoSavedSettings) }
1
dee63e11edc72c7466da0d0275dd3731
c1e597e3ba45df520635577656c9c5fa
设置当前选中章节的星的个数
function chapterItem:setData() self.starPrefabs:setStar(0) self.starPrefabs.gameObject:SetActive(true) self.star = 0 self:setStar() self.gameObject.transform.localPosition = Vector3(chapterData.posx, chapterData.posy-45, 0) self.chaptername.text = chapterData.show_name if updateScroll then ...
1
e6e8c4e7d7401db3c96a6fc95a3f4ffa
74d83f76d097f3c49aa8d74ebe83ecad
Finds metafile for machine-learning model.
model_directory_name, pathless_model_file_name = os.path.split( model_file_name) model_metafile_name = '{0:s}/{1:s}_metadata.json'.format( model_directory_name, os.path.splitext(pathless_model_file_name)[0] ) if not os.path.isfile(model_metafile_name) and raise_error_if_missing: ...
1
9de34990619cad58cd06d8bf14615a38
17bada45e2a1e0a3ca068856f89aed1f
Funcion de refrescar todos los contadores cuando miran el evento
function refreshCount() { setCount('manager'); setCount('employee'); }
1
094f68db0c8c8e723c45796b517ca87a
cbbdd4f410cd4f219de17c72bd6b8462
Calcul de l'inverse modulaire
int invmod(int a, int p) { int q=p,x=0,y=1,r,t; while(r=a%q){t=y;y=x;x=t-(a/q)*x;a=q;q=r;} return (x+p)%p; }
1
5a8f524c8134081d2a14462e373fd775
ac155d58a161e6656355320e97292f1f
重置PageLoadParam到默认状态
{ this.Where = null; this.OrderBy = null; this.PageSize = 0; this.whereParam.Clear(); this.changedProperties.Clear(); }
1
4d7bd3cdffad7a0593329d4494b8e047
ad2ba71d2a0f3e4f9a283d7d5818ee80
Determines whether this instance has the specified category
namespace DgmlLib public class Category public static bool HasCategory(XElement diagObjXElement, string catId) { var firstCatVal = diagObjXElement.GetSingleAttributeValueOrDefault(CATEGORY_ATTR_NAME, null); return (firstCatVal != null && firstCatVal.Equals(catId)) || (GetCategorySubE...
1
c8e4594781cabe8831851a736e124488
a59be1a1301834025153fc315601efac
(non-Javadoc) 覆盖toString方法,显示方块中每个格子的行列信息
public final String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("row = " + this.row); sb.append(","); sb.append("col = " + this.col); sb.append("}"); return sb.toString(); }
1
819098b26092afaeb6f2656ce2bd2799
43262d2153be94e7385e700ad4c8e06f
@brief Accepts a measurement function and tests the performance.
void benchmark(void (*func)()) { cycle_t start_count; cycle_t final_count; cycle_t total_count = 0; int i; for(i = 0; i < NUMBENCHMARKS; ++i) { START_CYCLE_COUNT(start_count); func(); STOP_CYCLE_COUNT(final_count,start_count); total_count += final_count; } char test_name[TEST_NAME_LENGTH + 1]; strcp...
1
310b64408c21e7a951e1225797494d6b
838efb42991173aef83eff5235b4a145
当前只支持PBKDF2WithHmacSHA1
public class HMKeyGenerator public static String encryptPBKDF2(String password,String salt) { try { int iterations = 10000; char[] chars = password.toCharArray(); byte[] saltBytes = salt.getBytes(); PBEKeySpec spec = new PBEKeySpec(chars, saltBytes, iterations, 16 * 8); SecretK...
1
2c51a3740c29283a6553de9ac1fb8d00
c97601ede3bd250182b09481f4e8d22c
Uint8 returns a pointer to a variable holding the supplied uint8 constant
func Uints8(v []uint8) Value { return Value{bits: bits(TypeUints8), vBytes: *(*[]byte)(unsafe.Pointer(&v))} }
0
791db0a5df2f3234ff2d119fea97e7a5
4633f81143b19cca79c373fb551c64ee
scanFirstExecutionRecord scans a slice of batch change executions and returns the first.
if numFound == 0 { return nil, ErrScansNoResult } records = Records{} for i := 0; i < numFound; i++ { records = append(records, pointers[i].(*Record)) } return records, nil }
0
32a068a566ee8066b4142ab376321cad
db4bd9a72f831874ae5a852cbe5635eb
Change all values in array to 0.0
fltzeros(double *arr, size_t s) { fltval(arr, s, 0); return arr; }
1
6e69c958436b649f656801484bc162cb
a317c0599e865a89c496e495dccccb37
根据表达式查询分页实体集合
namespace Jurassic.So.GeoTopic.Database.EntityFramework public abstract class EntityFrameworkRepository<TEntity> : IRepository<TEntity>, IDisposable where TEntity : class public IEnumerable<TResult> FindListByPage<TResult, TKey>(Expression<Func<TEntity, bool>> whereExpr, Expression<Func<TEntity, TResult>> s...
1
607d6c374abc3f75910c96cdbb0b136f
f8b3582c65800575551f92ad1298ce1d
sets the height of the scroll container
export class VirtualScrollArea updateContainerHeight(containerHeight: number): void { this._updateAutoscrollBottom( (newState) => { newState.containerHeight = containerHeight; }); }
1
1a8c1cff55c7de374f6dc1ea9dec5fca
e54d80bce10eb96afa3bfc0f504e6064
EntityDefsToThrift coverts a set of client EntityDefinition to the corresponding RPC EntityDefinitions
func ClientToProto(resource *containerazure.AzureClient) *containerazurepb.ContainerazureClient { p := &containerazurepb.ContainerazureClient{} p.SetName(dcl.ValueOrEmptyString(resource.Name)) p.SetTenantId(dcl.ValueOrEmptyString(resource.TenantId)) p.SetApplicationId(dcl.ValueOrEmptyString(resource.ApplicationId))...
0
caa72e4ad1c173e515b0713b6ce3e471
a9039bd8b8cbd9d17aa30d387c2ea718
Publishes a key change to those subscribed to local key change events
class EventType(object): def publish(self, k, v): self._published[k] = v
0
d70d48c51e51021852be2a1d8301662d
1ab054184cb99361769c26c7b69db9ef
Try to get the single declaration of a local. A local can either be declared using localdeclaration or inline out.
public String inlineLocalVariable(RefactoringRequest request);
0
4bd73e48b380cdc7273efb2b6ebe93a5
e84a8e4fe89d62cff53fea90037e4758
Get the item from the Claim request with the matching itemSequence
class TcInjection( object ): def prepareSequence(self, seqItem, verifier, config = {} ): if self.tcInjector is None: raise HiflyException("TC injection not available") parameters = self.__processParameters(seqItem,True) LOG("Processed parameters: " + str(len(parameters))) par...
0
d1c236b5e3265671b7906f03ec4fea3d
86662d5544db2143a88bbd2bd030a452
NewCompleteGraph creates a complete graph with n nodes.
res := plantri.NewAdjMatrix(n) for i := 0; i < n; i++ { err := res.AddEdge(i, (i+1)%n) if err != nil { panicUnexpected("Cycle", err) } } return res }
0
922f35fdbfc95ee8d8dcf737a3d66210
a6942ac3c564e0f7568ae1692e220933
{HTTPD_SERVER_I}.shutdown_server
{ GTCX char *l_feature_name = "make_server_by_port"; RTEX; EIF_REFERENCE loc1 = (EIF_REFERENCE) 0; #define arg1 arg1x.it_i4 EIF_TYPED_VALUE up1x = {{0}, SK_POINTER}; #define up1 up1x.it_p EIF_TYPED_VALUE ur1x = {{0}, SK_REF}; #define ur1 ur1x.it_r EIF_TYPED_VALUE ui4_1x = {{0}, SK_INT32}; #define ui4_1 ui4_1x.it...
0
b9dc8123b3097a337b3838a11ccd40d1
a54877c1c97fe6289e47d3b7369c7040
Gets the popup menu used in the current interactive state. Returns null, if the current state uses no popup menu.
JFPopupMenu createPopupMenu();
0
0f83cb303c778ceadf5121ab4ab051f4
56918f9eeb0ffba540f5f1a29ddba7a8
Check if a given string is a CURIE.
class Node(BaseModel, StandardizeMixin): def parse_curie(self) -> MaybeCURIE: return _parse_uri_or_curie_or_str(self.id)
1
00aa57ecea044d729ac2830540ce6225
04a39f32dd48513e2d6b0a1bb4f951f1
Starts the Bracket Match(es)
for region in self.regions: region.run() for r1, r2 in pairwise(self.regions): self.rounds[Rounds.FINAL_4].append(Match(r1.rounds[Rounds.ELITE_8][0].winner, r2.rounds[Rounds.ELITE_8][0].winner, Rounds.FINAL_4, self.alpha.get_alpha(Rounds.FINAL_4))) self.r...
1
77b099f62d9f995dac1d095bb87442e6
1da8e8cc6c2a2c7b17a25f60983f61f4
"ts_expected" is a map from timestamps to lists of maps from values to counts of values. That is, ts_expected[ts] is a list of maps from values to counts of values; the map of values to counts that we see should be in that list.
func compareMaps(info string, a, b map[int]bool) { if len(a) != len(b) { panic(errors.Bug("%s - %d != %d", info, len(a), len(b))) } for k, v := range a { if _, ok := b[k]; !ok { panic(fmt.Sprintf("%s - k:%d (%t)\n", info, k, v)) } } }
0
6f88f0257aba9c4e0bc7e8d6f755d5ea
ec36bb6d2ebcaa53fe5d75267766d740
管理员获取某一课本下的所有单元(为网页端下拉框使用)
public class TestServlet extends BaseServlet public String WebGetAllUnitByBid(HttpServletRequest request, HttpServletResponse response) throws Exception { String bookid=request.getParameter("bookid"); System.out.println("获取到的课本id: "+bookid); UnitService us = (UnitService) BeanFactory.getBean("UnitService"); Lis...
1
4f5df57d5ba1e792f41042875e686eee
74e3684d26091a7d305c74e06956f71b
Set SharingInvitations value
{ List<ProfileSharingDataContract> lstProfileSharingData = ProfileSharingManager.GetProfileSharingData(View.TenantID, View.InvitationGroupID); if (!lstProfileSharingData.IsNullOrEmpty() && lstProfileSharingData.Count > 0) View.LstProfileSharingData = lstProfileSharingData...
0
8d074579e74fea3f1633cfb2fe1f527b
4176b3e1eeb38180afa99a2219723c82
Performs a comparison of the old and new projects and saves the HTML report.
namespace MigratingHTML public partial class Default : System.Web.UI.Page protected void btnSubmit_Click(object sender, EventArgs e) { string report = ProduceReport(); divReport.InnerHtml = report; }
0
3c6c3b01ff33fbd1ec8742664ab7d105
18ed4664b3025b992dfda20f19fe40e1
ZeroCallCounters zeroes call counters without touching registered responders.
void SimpleCache::zeroStatsCounters() { memset(&s, 0, sizeof(s)); misses.clear(); }
0
7a246b6844b4ab8a6301ae1ec8920848
a04a1a500ff7dd6366ca755ba1a3d468
Add background control.
{ if (!composer.composed) { composer.AddStaticElement(new GuiElementDialogBackground(composer.Api, bounds, withTitleBar, strokeWidth)); } return composer; }
1
3c0aa13ca6a09bcb4f25d8225adcd47e
85a6770214ff5efe3bba9e4b3a84e3d9
Verifica si inferior <= operador && operador <= superior en cuanto a las fechas, sin comparar respecto a los campos de hora de los 3 argumentos limite inferior del rango limite superior del rango fecha a validar dentro del rango
class PerfileslaboralesController extends ControllerBase function checkinrangeAction() { $result = 0; $this->view->disable(); if(isset($_POST["fecha_ini"])&&isset($_POST["fecha_fin"])&&isset($_POST["fecha_eval"])){ $fecha_ini=$_POST["fecha_ini"]; $fecha_fin=$_POST["fecha_...
1
dcecc060be09192cc79e7e280b326ed8
f3d01c0f33d6fed7510be5f4992a1087
对埋点数据进行统一操作并追加浏览器指纹和操作时间
collectInfo(_this); var paras = { mdname: 'http://192.168.40.100:8080/stat/gateway/stat/collect/jsonp', data: { v: '', aId: ishas(appId), cookie: ishas(cookie), r: ishas(refer), ...
0
1fa4554f653a9193d42431d4a7fd68b2
a648557f0e2548e05e6ad6d17c18ea19
获取vfwebqq必须加上referer,可能是获取的内容会根据referer不同而不同,也就是proxy代理版本不同
self.brower.get(pUrl, headers = self._headers) self.ptwebqq = self.brower.cookies['ptwebqq'] vUrl = "http://s.web2.qq.com/api/getvfwebqq?ptwebqq=%s&clientid=%s" %(self.ptwebqq, self.clientid) response = self.brower.get(vUrl, headers = self._headers) result = json.loads(response.t...
0
67e61e807e3eb899c6fe527566276a6d
04e89c68dbf9fb06ae5f51c8272df835
Check message is a stop command
public class SimpleChatApplication implements ChatApplication private boolean shouldStop(String string) { return string != null && string.trim().equals(STOP_MSG); }
1
8033890d3e5f313a2f1fa0559bdbe155
9e14420c39b4ceaca82ccb934430cb1b
设置UISprite Color为灰色
public class ChangeColorGray public void ChangeSpriteColor(UISprite sp, bool isNormal) { if(!isNormal) { sp.color = new Color(0f, 1f, 1f); } else { sp.color = new Color(1f, 1f, 1f); } }
0
d1983800351561212d428c1ea9a08c35
ca60cffb45e5b6db302e8b3c5680ca7f
문장에 '/' 가 포함되었는지 확인하는 함수
{ if( strsrch(arg, "/") == -1 ) return 0; return 1; }
1
2e12dd4ccffda58b1de34bb80143d06f
90f2de9c51068390ab0c399e1f72c3c5
Résolution du système version parallele
void elimin_gauss_jordan_parallel(int taille,double** mat_A,double* vect_b, int nb_thread){ int i,j,k,lignePivot; double tmp; omp_set_num_threads(nb_thread); for(k=0;k<taille;k++){ if(mat_A[k][k]==0){ lignePivot=k+1; while(mat_A[lignePivot][k]==0){ lignePivot++; } #pragma omp parallel for schedule...
1
2c49f3cb6f5d91363144f61475c89ac8
8cf32502c06415e2dbf18ad61d159e00
Gets the current role of a party
public abstract class PlayerController : MonoBehaviourPun public abstract string GetRole();
1
5581bff6c8d0a246694e7203ce30a4d2
f2b2c2d6265432f63d1c396b9215d2de
校验上传文件post大小
class UDload extends CtrlBase private function checkSize($size) { if ($size > self::FILE_UPLOAD_SIZE_LIMIT * 1048576) { $return['error'] = $this->message->send('#5f', array('MAX' => self::FILE_UPLOAD_SIZE_LIMIT)); $return['ok'] = false; } elseif(empty($size)) { ...
1
f8b4c7578b1dc79de93a2c106396acf5
8f4f9721cbb3acc499728c923ad5180e
Configure the Discovery LEDs on PC08 and PC09
__INLINE void ConfigureGPIO(void) { RCC->AHBENR |= RCC_AHBENR_GPIOCEN; GPIOC->MODER = (GPIOC->MODER & ~(GPIO_MODER_MODER8|GPIO_MODER_MODER9)) \ | (GPIO_MODER_MODER8_0|GPIO_MODER_MODER9_0); }
1
24a3925365bffd1e4b06d7b1925f7621
eac5439412b9aaaaa5b0d06d3d19134e
버퍼에 있는 데이터를 전송용 데이터로 분해 한다.
try { byte[] bufTotal = new byte[bufIn.length + remainLen]; if (remainLen == 0) { bufTotal = bufIn; } else { System.arraycopy(bufIn, 0, bufTotal, remainLen, bufIn.length); System.arraycopy(remainReceiveBuffer, 0, bufTotal, 0, re...
1
b6b6df075501f2b388313afaf1b471f6
0c169c39030e23189868713eba502a81
Return the metagraph as networkx.MultiDiGraph.
class MultiDiGraph def to_multigraph graph = NetworkX::MultiGraph.new(@graph) @nodes.each { |node, node_attr| graph.add_node(node, node_attr) } @adj.each do |node_1, node_1_edges| node_1_edges.each_key do |node_2, node_1_node_2| edge_attrs = {} node_1_node_2.each { |_key, a...
0
30c94769b33991b89067bd7a8275f57f
afa23c6fe3174bc201c55264313754c7
Faz modificacoes especificas, como remover tags HTML e transformar siglas em maiusculo.
if arg == "Concert" or value == "No title": pass elif arg == "Oratorio" or arg == "Cantata" or arg =="Festa teatrale": i = value.find('(') if i > 0: title = value[:i-1] tag = value[i:] value = f"<em>{title}</em> " + tag else: value...
0
5b4a75ea6449f57e6758cf1bc24057f4
dd62599799940e5927b7afaa8c86febe
214. 最短回文串
func LongestPalindrome(str string) string { if len(str) < 2 { return str } s := str[0:1] for i := 1; i < len(str); i++ { for r := 0; r < 2; r++ { for p, q := i-1, i+r; p >= 0 && q < len(str) && str[p] == str[q]; { if q-p+1 > len(s) { s = str[p : q+1] } p-- q++ } } } return s }
0
1fde1ce201ef89b7e03c8bf795a73697
32ac44246de834d69b9a8855fdd191fd
Obtiene las teclas presionadas de los dispositivos conectados
{ KeyboardState result = new KeyboardState(); if(state.GetPressedKeys() != null) { foreach (Keys k in state.GetPressedKeys()) { result.AddPressedKey(k); } } return result; }
1
b9375f049af9d7abd0e6f271dff121ab
465f55f167d1f5c28f527ffc9228f167
封装鼠标划上边框渐变显示效果
function borderShow(){ if (underline.style.transform === 'scaleX(1)') { underline.style.transform = 'scaleX(0)'; span.style.color = 'black'; }else{ underline.style.transform = 'scaleX(1)'; span.style.color = 'blue'; } }
0
4ee2e738215bd6c914ac0cc85b0ce11f
3357476b6ccfe3c0f1333bf3005a21ac
# Is a Natural number, but not a zero (1,2,3, etc.)
class Validation public function is_natural_no_zero($str) { return ($str != 0 && ctype_digit((string) $str)); }
1
b8813df0ba0f243ee1b3778bce13e35e
7b63315dbc9d97fed6573d0e79c9459b
Post a request for clipboard data to VBox/the guest and wait for it to be completed.
static DECLCALLBACK(int) VBoxGuestHGCMAsyncWaitCallbackInterruptible(VMMDevHGCMRequestHeader *pHdr, void *pvUser, uint32_t u32User) { PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvUser; Log(("VBoxGuestHGCMAsyncWaitCallbackInterruptible: requ...
0
375e3d501d173afd2883fda384882bce
9447dd14e21e7314c5e981e10b17cf5f
通常ステータスのキーとバリューレベルごとに分けて辞書型で返却するメソッド
class Item: def status(self): return self.__dict__
0
69af56c72862cdcdff04dcb93e62c66d
2cff0e753a0fce98553b1ec1077ffb68
@brief Initialize a new thread from its stack space The control structure (TCS) is put at the lower address of the stack. An initial context, to be "restored" by __return_from_coop(), is put at the other end of the stack, and thus reusable by the stack when not needed anymore. The initial context is a basic stack frame...
SYSCALL ER _tk_set_cpr( ID tskid, INT copno, CONST T_COPREGS *pk_copregs ) { ATR copatr = TA_COP0 << copno; TCB *tcb; ER ercd = E_OK; CHECK_INTSK(); CHECK_TSKID(tskid); CHECK_NONSELF(tskid); CHECK_PAR((copatr & available_cop) != 0); tcb = get_tcb(tskid); BEGIN_CRITICAL_SECTION; if ( tcb->state == TS_NONEXIST ...
0
14a7db2d23d001546c62b1e91bcf4434
5b4cfbe7193631b9777111b9ca4397cb
采用一个数组对匹配的括号进行标记,然后查找最长的连续匹配标记 O(n)
public class Exercise01 public int longestValidParentheses(String s) { int maxans = 0; int[] dp = new int[s.length()]; for (int i = 1; i < s.length(); i++) { if (s.charAt(i) == ')') { if (s.charAt(i - 1) == '(') { dp[i] = (i >= 2 ? dp[i - 2] : 0) +...
1
7a37ec7b60d7e4bb2e41862e5d44094d
23d3626d6d2dc24f1d90375dc4907e44
Predicts a class label for a collection of datapoints based on the shared covariance generative model.
class RFWR(): def predict(self, X): X = X.reshape(-1, 1) w = np.exp(-0.5 * cdist(X, self.mu.reshape(-1, 1))**2 / (2 * self.sigma)) X = np.concatenate( \ (np.ones((X.shape[0], 1)), X), \ axis=1 \ ) return np.sum(w * (X @ self.theta), axis=1) / np.sum(w, axis=...
0
822e539a0504154a68edd864a0f4adb3
d4894da55eba3d82b2a13d15b2a39fff
@brief Move the segment(s)' contributions to the scalar flux from the buffer to the global scalar flux array.
for (int tid=0; tid < _num_threads; tid++) { for (int r=0; r < _num_FSRs; r++) { for (int e=0; e < _num_groups; e++) { _scalar_flux(r,e) += _thread_flux(tid,r,e); } } } return; }
1
1abcdd172ad02b67e166e9b631e0e35d
6453c943f10962fe5ea05612fd5743dc
Creates a new queue taking as a parameter the number of workers to schedule
send := NewSender(maxWorkers) JobQueue := make(chan Job, maxQueue) send.Run(&JobQueue) return &JobQueue }
1
5a5c228acd90ca4e4d5a05a6d0b1950f
45fc39c7de688a9bcbed2eb58a0bf95d
Get all attribute hints. This method merges a model attributeHints with attribute hints of all used traits.
Map<String, Object> getHints();
1
543f710f442972580413de2e7240c1f3
e6ad60e5ae142f78dc6b36393a8f1e2b
通过id批量删除试题
@RestController public class KaoshiController @RequestMapping("testpaperdelete.do") public String testPaperDelete(Integer tqid,String tqids,String tqnums){ testquestionsRepository.deleteById(tqid); changeTqnum(tqids, tqnums); return "删除成功!"; }
0
d6a34f7da6909e669731fb04aea07806
182f1aa3b20b56ab89dcc6e25de882b0
设置车辆电子围栏
this.electricFenceService.GetElectronicFenceSettingByFenceId(data).subscribe( (res) => { if (res.State) { this.ElectricRenderInfo = res.Data; this.setOverlay(res.Data.RuleContent.Points); } }, (err) => { if(err.State == 10 || err.State == 11 || err.State...
0
8b96fba708805c02c3d34c63eb8c6bae
6ba6fe003415b06cd8fc4d90a753b60e
Diese Methode ist eine Abkürzung für {@link #interruptAll(Iterable) this.interruptAll(this.getActiveTasks())}.
@Singleton interface NotyTaskManager fun abortAllTasks()
0
355341d9245130702aa372daa8122f0c
4638d0b69dad964d55654a8c4acf2554
Si no ha terminado la accion actual, no hago nada
class WidgetSinAceleracion(QtGui.QWidget): def timerEvent(self, event): if not self.pausa: if self.capturar_errores: try: self._realizar_actualizacion_logica() except Exception as e: self.procesar_error(e) else: ...
0
5324daa81a735e5c2fdffab7d479218f
aa8e4afd3911c5315a44724d3191014e
多条件查询动态
namespace DayEasy.Contracts DResult<DynamicMessageResultDto> GetDynamics(DynamicSearchDto searchDto);
1
f1aeac2f60b286ef52f16fb7d43c6b8b
be5e17bcde820d2ed5f9c7f5865a0852
Быстрый ответ сообщением
class VkBotReplies: def return_msg(self, send_to, msg): self.vk.messages.send(peer_id=send_to, random_id=random.randint(0, 2 ** 64), message=f'{msg}')
1
3ab7b69d2d84823c0e989668c05631ff
31b84f6fa62dada2145b123702d7a0ec
Get Quotes pntable array
{ try { $quotes = Quote::all(); $statusCode = 200; $response = [ 'data' => $quotes ]; } catch (Exception $e) { $statusCode = 400; } finally { return Response::json($response, $statusCode); } }
1
20e6e4fb80e9f08d12a2d4040eeb2932
f487c9193e3990f071544d674f63214b
A reimplemented destructor that cancels the notification before destroying.
TeardownNotifier::~TeardownNotifier(void) { NotifyTeardownListeners(); }
0
c7d9266bba608e0fb1612f1a6321e259
0ac8b086e107a512b02fb0aa850ceb59
讓輸入欄位能夠按下Enter送出
function enterSend() { $("#sendText").bind('keyup', function (event) { if (event.keyCode === 13) { send(); } }); }
1
6883614c8fde289044230f8e0ba2f77f
a0c16f1defb6332b311aef2cebb2bbc3
Guarda a jogada na fila.
{ pguardar novo = malloc(sizeof(guardar)); pguardar aux; if (!novo) { printf("Erro a reservar memoria\n"); return jogadas; } novo->col = x.col; novo->lin = x.lin; novo->nrjogada = nrjogada; novo->prox = NULL; if (jogadas == NULL) jogadas = novo; else { aux = jogadas; while (aux->prox != NULL) aux...
1
f686bfdb3a100d38c6970b1b54de9543
fc06d7516b0938e8fdbdfd0b74974ccb
Called at end of execution to output data to stdout. Displays execution time and calls sys.exit to allow the script to break early
global observedValuesStore observedValuesStore.printCurrentState() observedValuesStore.printFullHistory() global receivedCount logger.info("Total successfully received and parsed measurements and commands: %d" % receivedCount) sys.exit(0)
0
08b6636adcfa036e7509a69c0454b535
76e64eaba7aac3ff6c7c973240e5c194
Adds a new meta key word extension string
class Blender extends Modules public static function addMeta (string $metaname, string $metacontent) { Blender::$metaTags[$metaname] = $metacontent; }
1
960a8ad4259847280ec692390b387433
f82613743dfb741a82669f31900d078f
通过表格名获得相应表格的指针
function xls_mgr:get_table(sheet) sheet = string.lower(sheet) return self.m_list[sheet] end
1
15d6ed9ef17589757a017cbf8a92087a
b1155df36b0a176fb2701fc3c60122eb
Test case for getCustomerInvoiceTemplateById Get a customerInvoiceTemplate by id.
namespace Infoplus.Api public partial class CustomerInvoiceTemplateApi : ICustomerInvoiceTemplateApi public async System.Threading.Tasks.Task<CustomerInvoiceTemplate> GetCustomerInvoiceTemplateByIdAsync (int? customerInvoiceTemplateId) { ApiResponse<CustomerInvoiceTemplate> localVarResponse = a...
1