query_id
string
corpus_id
string
query
string
code
string
label
int64
36ff0b3151e7851247428010bb3a3635
e41bf96bfe059463b9871d3c3ed0a7b0
确定选中区域是否可以更改
public class RangeImageSelectedView extends View public void setCanChange(boolean canChange) { this.mCanChange = canChange; }
1
3225d4350c2efd37f39d5935d58479d5
7f5fe819bacf4a03fdee35a4fefcf7c9
Returns a transform for converting local coordinates to world coordinates. Just a rotation then a translation - but constructing the matrix directly is faster.
centerVec = bdggeom.Vec2f(*grid.indexToWorld(*self.rotCenterIndices)) rotRad = 2 * math.pi / self.rotCount negTrans = bdggeom.makeTranslationMatrix(-centerVec.x, -centerVec.y) posTrans = bdggeom.makeTranslationMatrix(centerVec.x, centerVec.y) rotTrans = bdggeom.makeRotationMatrix...
1
cf23ec762eaf65e9e76c620d8c9311c7
64c0303e9ae47f3e57af72954c5c17a4
此函数通过使用poplib实现接收邮件
namespace kaoqin_mail public partial class Kaoqin : Form public void Recvmail() { Pop3Client pclient = new Pop3Client(); pclient.Connect("mail.lefu8.com", 110, false); pclient.Authenticate("weiming.shi@lefu8.com", "LeFu_0421"); int messageCount = pclient.GetMe...
0
5e8f3dc8214b87753c495632f79ddbd6
8198c51696ad871fdf70f78bccd0045b
returns the comma seperated values for the heap
String result = ""; for(int i = 0; i < size; i++){ result += heap[i].toString() + "\n"; } return result; }
0
d96ee1f4ce57fe4e4cfacc0848be3166
78c05c4917750d0531cb8a101544a54a
void glPolygonMode(GLenum face, GLenum mode)
int gl_CullFace(lua_State *L) { if(lua::is<GLenum>(L, 1)) { GLenum mode = lua::to<GLenum>(L, 1); glCullFace(mode); } else { luaL_error(L, "gl.CullFace: invalid arguments"); } return 0; }
0
fa1fbc15225e977f7e89613032542c25
073bb97ef086dd7b39a1e121e2cba0ec
converts the rectangle returned by predictor to bounnding box that is a four element tuple:(x_coord,y_coord,width,height)
bbox = [[0, 0], [0, 0]] bbox[0][0] = int(l[0]) bbox[0][1] = int(t[1]) bbox[1][0] = int(r[0]) bbox[1][1] = int(b[1]) return bbox
0
82dfe84a1db1881f7ade805607df5391
4e8489f3ee74a5cf6ee3af9322e676f8
Замена картинки на бинарное поле (для удобства)
{ Bitmap bmp = new Bitmap(SizeX, SizeY); for (int y = 0; y < SizeY; y++) { for (int x = 0; x < SizeX; x++) { bmp.SetPixel(x, y, Color.FromArgb(imgInt[y][x])); } } return bmp; ...
0
883a1717ea90cc18f60f25cb11e315c7
398ff12873305bf49746eac5bbbafcb7
Imagen y texto generado en sprites de capas
this.load.image('logo', 'assets/logo.png'); this.load.image('Law', 'assets/test/Law.jpg'); this.load.image('Floor', 'assets/game-elements/ground.png'); this.load.image('Circle-UI', 'assets/test/circle-ui.png'); this.load.image('Frog', 'assets/test/Rana1.png'); this.load.i...
0
8280c7a076e9bd7580e834e8bf3c2f01
4ee9575c9c8486a48dbe9ea50e73dcc3
如果本地不存在,则联网下载,保存至本地 如果本地存在,则直接显示
{ bool fileExsists = File.Exists(LocalMD5FilePath); if (fileExsists) { ReadeLocalMD5File(); } if (VersionTxt != null) { if(LocalResourceVersion <= 0) VersionTxt.text = string.Format("当前资源版...
0
e47360d2f5f513b5214e9eb27ae4f3c0
5d5eb82d9e2cfea8b54d22811a96e6ea
Add appropriate new criteria options to the form
abstract class award_criteria abstract public function get_options(&$mform);
1
6cddffcdb1e9ea2f205dae3240526a62
7ce2cf53e828c046ce962786c5fee023
<T>根据记录的编号查找可配置(<C>IS_CONFIG</C>)的数据内容</T>
public class ConfigServiceImpl extends BaseService implements ConfigService @Override public Config findConfigById(int id) { return getConfigDao().findConfigById(id); }
1
b0c423c3f5a9eef785957f24671be863
480db8acbd7c693ebbe9e0332722b4fe
Event handler for the easy difficulty button
{ try { optionsViewModel.OptionModel.Difficulty = 1; optionsViewModel.SaveToXml(); GamePlayWindow childWindow = new GamePlayWindow(); this.Close(); childWindow.ShowDialog(); } catch (E...
1
3b69f4bd2d7d2ed51c0b56c7980ea106
722e58f3f4ec684878e739050c002b26
Formats an introduction line and a list of bullet points at an offset
section = [f"## {title}", ""] if data: section.extend(add_lines(data)) section.extend("") return section
0
fef330d55952048e2abcbe9d23a3e455
c998bb3dc8571191e60c8efb4e72cab0
Computes the Signed Distance Function for input samples.
class RobotSelfCollisionNet(): def compute_signed_distance(self, q, with_grad=False): if with_grad: q_scale = scale_to_net(q, self.norm_dict, 'x') dist = self.model.forward(q_scale) dist_scale = scale_to_base(dist, self.norm_dict, 'y') else: with torch.no_...
1
9633979c0167e873b3ec3b8e9e64305c
5f6f07e9c8578156eab78b1539bf05b9
Multi-band, multi-scale Mel-spectrogram loss.
class SpecWaveLoss(): def __init__(self, fft_sizes=[64, 128, 256, 512, 1024, 2048], hop_lengths=None, win_lengths=None, mag_w=1.0, log_mag_w=1.0, l1_w=0, l2_w=0.0, linf_w=0.0, linf_k=1024, norm=None): super().__init__() self.fft_sizes = fft_sizes self.hop_lengths = hop_lengths self.win_l...
0
21832778f65c9dbb362d01cf35d6f24f
b94c33b8223d48ae51a11d55e7c1067a
Method to simplify deprecating a bulk of configuration related to a component. In short, it generates and returns a list of deprecated configuration from the complete list using a smaller list of supported keys. The output is formatted as a list of hashes, similar to the one from `GitLab::Deprecations.list` above. The ...
hash ||= {} config = {} hash.each do |key, value| config[key.to_s] = value end config end
0
770c503226ac9460cf038ad04799dd08
03441a691a691c1401aa0e549e679c25
Helps show alternate payer information.
if ( 0 === $payout->owner ) { $value = _x( '(none)', 'payout owner', 'affiliate-wp' ); } else { $user = get_user_by( 'id', $payout->owner ); if ( $user ) { $value = sprintf( '%1$s %2$s', affwp_admin_link( 'payouts', esc_html( $user->data->display_name ), array( 'owner' => $payout->owner ) ), ...
1
90ecbc90f1715a4a83fce770f8c32d3c
acc47eeb2f78d0a6f715f03eb438fccf
Time if value == time.Time zero value, return def otherwise return value
func Int64(value, def int64) int64 { if isZero(value) { return def } return value }
0
5af12470076e1900635536e6bf61d469
209a638187f38b95552403054afe93df
Checks if the navigation stack is empty
public class AppManager public boolean isEmpty() { return activityStack.isEmpty(); }
1
1971a9df5cf950cbef6b720166ae8774
25bf884270db18d18e0a6479a95e2511
构建所有部署任务的salt stack规则文件
class graphics_deploy(Deploy): def generate_deploy_file(self): result, config_list=self.read_config(["init", "arch", "host", "project"]) if not result: return False, config_list init_dict, arch_dict, host_info_dict, project_dict=config_list deploy_dict={ "proj...
0
4c53b657d600e1a959534f174fcddf7b
79fa05589b35f65f60eafbb57a952f58
retrieves the user's tickets upon page load
this.ticketFormService.listForms() .subscribe((data) => { this.ticketForms = data; console.log(this.ticketForms); }, (error) => { console.log(error); }) ...
0
9b9783b3cd0529526b8d05535829e31c
cf8d2b728a426a1fa2254e8020226556
#################################################-REGISTRAR-TURNO-##########################################
$desc = $_POST['desc']; $sql = new funciones_sql(); $query = "INSERT INTO rec.tbl_turno(desc_turno) VALUES('$desc');"; $sql->ejecutar_sql($query); }
1
e3ed6d00c2f736629f41a1d045a95e9a
27d37ca62f2154a9e269aec6a13e36d3
Gets the list of block names of the disabled blocks.
namespace Rim.Server.Security IEnumerable<string> GetBlocks();
0
adb2bd212fa2ecfcb8201d716d152fe0
6b6d4961c6310fec0e996e638ad4abb9
returns the macro averages in a tuple (precision, recall)
assert(type(m) is str and m != "") assert(type(u) is str and u != "") a = ActualCache[str((m, u))] p = NetAvg + (MovieCache[m] - NetAvg) + (UserCache[u] - NetAvg) if p > 5.0 : p = 5.0 if p < 1.0 : p = 1.0 assert(a >= 1.0 and a <= 5.0) assert(p >= 1.0 and p <= 5.0) return (a, p)
0
0245ed80f7e7000ab2d5b76aec5ecac1
ac875462db774513d008e2658496904a
每次闪光就修改下次闪光类型
{ for(int i=0;i<24;i++) { if(ModeState[i]!=temp_ModeState[i]) { lightup_list.Add(i); ModeState[i]=temp_ModeState[i]; } light_flag[i]=false; } for(int i=0;i<lightup_list.Count;i++) light_flag[lightup_list[i]]=true; lightup_list.Clear(); }
0
07b5fe8a5ccd6dbeb0634ca8ba74c32a
3c7ab6e91155ae101dc761b6e82db591
Считывает следующую строку, представленную в Unix- или DOS-формате. Устанавливает позицию потока на начало следующей строки или на конец файла.
last_pos = f.tell() line = f.readline() if not line: return last_pos, line line = cls._stripline(line) if line in ('', ' '): last_pos, line = cls._read_line_skip_empty(f) return last_pos, line
1
5d7d49f0e6b9afd2e521bbb18675e4ca
ffe5d1e4212d981f786de4e4d4a2e096
Save parameters from a model run for a set of specific training dates into the database.
class Random: def train_evaluate(self, auto_params): config = self._combine_params(self._split_config(auto_params), self.fixed_params) seed = config["seed"]["seed"] if not dict(seed=seed) in self.trained_model_table().seed_table(): self.trained_model_table().seed_table().insert1(dict...
0
eff03a3ea20f9dbf429e91a370bb3343
ddf7b3a1e8b5bdc5faf5084bd9d0a13a
Retrieve the <c>indexed_modified_on</c> property of the item
class Batchitems public function getModifiedon() { return $this->modifiedon; }
0
3ab47436741a8af33c751e3cdcaf89c9
4a2ab6ade3ba81aa8db181233c52a8df
create a new window with a title, x and y positions on screen, width and height
{ HWND window = CreateWindowEx(0, myclass, "title", WindowStyle , x, y, width, height, 0, 0, GetModuleHandle(0), 0); if (!window)return 0; return window; }
1
65fa3151812e2b3bfb412af0a64ba602
76f95783d0a3dda02e92fc0185944c87
configure SMS callbacks
LOCAL void setup_sms_watermarks( void ) { dsm_queue_init(&dsat_mt_msg_wm, DSAT_FROM_WMS_DONT_EXCEED_CNT, &dsat_mt_msg_q); dsat_mt_msg_wm.lo_watermark = DSAT_FROM_WMS_LOWATER_CNT; dsat_mt_msg_wm.hi_watermark = DSAT_FROM_WMS_HIWATER_CNT; dsat_mt_msg_wm.current_cnt = 0; #ifdef FEATURE_DSM_MEM_CHK dsat_mt...
1
6d6a239a934cbd081a0816dd16ca4457
847dc86406372f0f5d2118b01d36ca0d
constraining parameters to solutions that make physical sense with flat priors
class ExponentialSmoothing(TimeSeriesModel): def _enforce_bounds(self, p, sel, lb, ub): initial_p = p[sel] loc = initial_p <= lb upper = ub[loc].copy() upper[~np.isfinite(upper)] = 100.0 eps = 1e-4 initial_p[loc] = lb[loc] + eps * (upper - lb[loc]) loc = initial_p...
1
5d328d2617ff293cecf2c130e6284dc8
144866b3676e63c42eff267f98f9c206
Function used to mimic the behaviour of VideoCapture.get.
class VideoInterface(object): def grab(self): pass
0
950ebf8bcab3b2da86ab4543787e1185
a9703dc6359d326020abba7d00e702a1
Função para escrever o nome do GAME no menu inicial
def telainicial(): print("\nBEM VINDO\n") print("Escolha seu nome:\n") nome=input() Personagem.nome=nome os.system("cls")
0
49460e083081fe0633a0ef0f50ec74f9
791388b228de68ec1d373ecdfcdf024e
Tests that when a valid extension that contains a digit is appended to the chunk size, the chunk is correctly read.
def test_reader(tempfile): file = tempfile("file", size_kb=1024).open("rb") reader = models.ChunkedReader(file, max_size_kb=1025) assert reader.max_size == 1025 * 1024 all(reader)
0
9d2c745cd784a362bcd2e0e3b33ff0d5
e9d1a012e84aca205b071506155adabd
Translates the rendering context to the center of the player's face, parameters should be passed from {@link #render(PlayerEntityModel, AbstractClientPlayerEntity, float, float)}
public abstract class RendererLivingEntity< T extends EntityLivingBase > extends Render< T > protected void renderLivingAt ( T entityLivingBaseIn , double x , double y , double z ) { GlStateManager.translate ( ( float ) x , ( float ) y , ( float ) z ); }
0
8a084aa92109e0afccb19436983b6510
aa03c55050c09d2811549856bed7eb09
Helper function to create S3 object (see sqshelper.php)
class SpacesConnect function GetObject($file_name = "") { try { $result = $this->client->getObject([ 'Bucket' => $this->space, 'Key' => $file_name, ]); return $this->ObjReturn($result->toArray()); } catch (\Exception $e) { $this->HandleAWSExcepti...
0
e3a6822dddb1ad8a879f524f214f4ff5
7efbb2fa1470bbfefeeafbcebdee5493
PropertyChanging event handler of the target control
{ if (_property == null) { _property = e.Property; } object oldValue = e.OldValue; object newValue = e.NewValue; AdjustEventHandlers(sender, oldValue, newValue); }
0
30cad74649f84fe7b1e8c27758af07ab
157720564845751bf92b8902fd166cac
Train the Maximum Entropy Classifier on the train sentences.
def train(mm, data): assert type(mm) is MarkovModel l = 0 mm.e = [] mm.p = [] mm.indices = {} data = [(d.split(' ') + ['\n']) for d in data] prev = None for sent in data: for word in sent: if(mm.indices.get(word) == None): mm.indices[word] = l ...
0
5ea26caf599f03e8294a3ac16a052886
14c7ec14eb519b5354c4bd307f068bb4
Returns the spacing from the first line baseline to the view's top
public class YAxis extends AxisBase public float getSpaceTop() { return mSpacePercentTop; }
1
387859d12f245c7d6d0a6abdf60b0eb9
f13dc95807d78a4a1342a46683839147
Finishes the asynchronous execution of the PutAccessPointPolicy operation.
namespace Amazon.S3 public class AmazonS3Client : AmazonS3 public PutBucketPolicyResponse EndPutBucketPolicy(IAsyncResult asyncResult) { return endOperation<PutBucketPolicyResponse>(asyncResult); }
0
7e61a7ef45497b7ba6c6a8dfe9a6b704
2c6d0e2e0901f92eea915b30c162192d
saves a huff file to the filesystem at the given path
{ File outFile = new File("huffmanCode.txt"); if ( !outFile.exists() ) outFile.createNewFile(); FileWriter fw = new FileWriter( outFile.getAbsoluteFile() ); BufferedWriter bw = new BufferedWriter( fw ); encodeNode( huffTree, bw ); bw.close(); }
1
d1d10f99b5dcbf2af31acf2795ed8ec7
cc136934ea3589d748cf1ca097a396f2
将一组set对象转化为set的json串
if (set == null || set.size() == 0) return ""; StringBuffer sb = new StringBuffer(); int i = 0; Iterator<?> it = set.iterator(); while (it.hasNext()) { if (i++ > 0) sb.append(","); sb.append(it.next().toString()); } return sb.toString(); }
0
8243edc58f53ffb2ffe8225f2d2b90a9
f5069b5dcea1dda5c6063d5c570712fb
returns the node's alphabetically next node
public class Node private Characters nextCharacter() { switch(currentCharacter){ case A: return Characters.B; case B: return Characters.C; case C: return Characters.D; default: return Characters.A; ...
1
a9c328acb73d5b273ebb5b620c53d200
0972d866c38fed024d463b3177c11a7a
Sends the user back to the sign in page.
[Authorize] public abstract partial class IndexModel : PageModel public virtual IActionResult OnGet() => RedirectToPage("/Auth/SignIn");
1
d4d399401e92c3d3000394bff186fde7
126bf3b3de578b9c943a10fe47a84df4
Расчет псевдокритической температуры газа
Tc = 126.2 Pc = 33.5 a = 0.42748*Rgas**2*Tc**2.5/Pc b = 0.08664*Rgas*Tc/Pc res = P + a/(T**0.5*v*(v + b)) - Rgas *T/(v - b) return res
0
c617c046b76155fe1287615b60e39ff9
d12884b7d9d6e25a2fb769f90eaed701
Gets the addresses of all datapoints of devices controlled by this service.
SOAP_FMAC6 __tds__GetDPAddresses(struct soap* soap, struct _tds__GetDPAddresses *tds__GetDPAddresses, struct _tds__GetDPAddressesResponse *tds__GetDPAddressesResponse) { return 0; }
1
d2f4231f07866ba88d331b97d91ae98e
e7d64da233967e561d8390206754f006
query all messages for a specific campground for detail-tab.php page
class MessagesController def messages_by_trip @messages_by_trip = Message.where("trip_id = #{params[:trip_id]}") end
0
a03a19ff2f0ea25d6db56fb0c2b3e7cf
db628239b826c6416ff0c46cf1d1a1ed
Gets all Device Levels for a store
{ return Get("Store-" + key + "-" + StoreLevel); }
0
3297bd3cb3a8b0000249862c1f978dce
2557d3131968b72b77f16221f8d9af76
Alert Class - Create Alert from Dynamo Record
alert = self._customized_alert() record = alert.dynamo_record() new_alert = Alert.create_from_dynamo_record(record) assert_equal(alert.dynamo_record(), new_alert.dynamo_record())
1
0e91eec0db0d385ab3e3fdfc8dc38d8f
ebae6e27d38900fb6c4043e893cee472
Gets the list of LayawaySummaryEntryIfcs.
namespace $rootnamespace$ public class $fileinputname$SummaryComponent : SummaryComponentBase<$fileinputname$Summary, $fileinputname$SummaryTable> protected override IList<$fileinputname$Summary> ListItems(int firstItem, int maxItems) { List$fileinputname$sResponse listResponse = null; ...
0
4775a804e71a85d4afa096e109e9964a
85f41cba151b77d5bf78dde7df22fc22
Disparo aleatorio de un alien
void computeNextAlienShot() { int alienShotTick = (float) alienShotTickMax * (float) (rand() % 10); glutTimerFunc(alienShotTick, addRandomAlienBullet, 0); }
1
ae71e6eac7461924cb31aef952f6298c
bd5fff118f46da8500b65b60a3e85485
Adds new connection id to connection list by key
class AnalyticsStore(private val dataStore: DataStore) @Synchronized fun addConnection(str: String?) { if (!str.isNullOrEmpty()) { val connections = dataStore.getConnectionList() if (connections.size < MAX_REQUESTS) { dataStore.putConnection(str!!) } }...
1
3ff897022c03eff20e1353e843d8c298
993c0360822536e713799ae9529dbabc
Gets the user group model object.
class XenForo_DataWriter_UserGroup extends XenForo_DataWriter protected function _getUserGroupModel() { return $this->getModelFromCache('XenForo_Model_UserGroup'); }
1
9cf9ac07570dd3fbda425fc5dff17139
a87beaeb4078313b88a09e59234124cc
供应商沟通记录列表-导出
public String exportXls(PhSupplierinfoEntity phSupplierinfo,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid,ModelMap map) { CriteriaQuery cq = new CriteriaQuery(PhSupplierinfoEntity.class, dataGrid); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, phSupp...
0
da83460439a6f4e78ede427c4e052e74
7669efc2af78144598c4142f57ee7dcc
Problem: Find the pair of pentagonal numbers, Pj and Pk, for which their sum and difference are pentagonal and D = |Pk − Pj| is minimised; what is the value of D? This may be one of the most difficult out of the first 50 problems. The main issue is that the result is fairly large, and can take quite a long time even wi...
val triangles = TriangleNumberSequence(285) val pentagons = PentagonalNumberSequence(165) val hexagons = HexagonalNumberSequence(143) while(true) { val hexagon = hexagons.getNext() while(hexagon > triangles.getCurrent()) { triangles.getNext() } if(hexagon == t...
0
b5d6a1f5f4e32fbb81c3aa5c80da5997
16c9d65e1a02800d96e911ac943b48a3
Callback when query execution time exceeds the threshold. This callback is called only once per query if it exceeds the threshold time.
class SchedulingClientCallback: def on_timeout(self): ...
1
cc8b2ee2b1f70c4e398bc17a72460dc5
4dcd070f66f73ecc5ae32689474485a8
Retrieve a Summary of Affiliate Statistics Retrieves a summary of statistics for a list of affiliates.
{ $result = $this->client->call("GetSummaryStat", $params); if ($this->getError('GetSummaryStat', array())) { return false; } return $result; }
1
473134283d61962ea922a0b8a9d85db7
10e0f49039f211357669c9eedabb2e22
Test that delimiters included in the values of text transforms are correctly quoted.
self.assertEqual( ['(', 'This', 'is', 'Mr.', 'Hoppy', '\'s', 'tortoise', '.', ')'], self.t.tokenize('(This is Mr. Hoppy\'s tortoise.)') ) self.assertEqual( ['"', 'This', 'is', 'Mr.', 'Hoppy', '\'s', 'tortoise', '.', '"'], self.t.tokenize('"This is ...
1
9cadb1779c98013e8f3cd0cf0c2b546e
c9c4c8a2d728b83cadf33e3ab5ec70aa
Any translation in the set. Normally there will be exactly one, but in any case, we don't have any basis to prefer any particular item over any other, so just pick one.
class Base(dbus.service.Object): def set_def_lang(self): self.set_language(self.languages_sorted[0][0])
1
5670564363ff0f304d2e7d90b2eee831
63c9d742d1f9a81df492a4e612be477b
Returns the maintenance general status and all its maintenace type statuses. @TODO: Optimize this method.
namespace Siemens.Simatic.Web.PortalApi.Controller [RoutePrefix("api/EquipmentMaintenance")] [EnableCors(origins: "*", headers: "*", methods: "*")] public class EquipmentMaintenanceController : ApiController [HttpGet] [Route("getMaintenanceTypes")] public DataTable getMaintenanceTypes() ...
0
d6a00023d6aa3b01b253e0867f6d5db3
35b6aeb526bc75e0afa54839933ddd99
Displays the firewall status.
{ Type FWManagerType = Type.GetTypeFromProgID("HNetCfg.FwMgr"); dynamic FWManager = Activator.CreateInstance(FWManagerType); string state = (FWManager.LocalPolicy.CurrentProfile.FirewallEnabled == true ? "ON" : "OFF"); string text = "Firewall is " + state; ...
1
1fdde6833293a04fefba5fdd4bdae344
89ba9ecb8d71eb2353951ed12d797ffc
The indexed dataframe.
class VotingClass: def df(self): return self._df
0
4006b94e688aaf880bac3c485e4f3ba6
4358e1ed0033102e7c038dba97db7b6c
Returns the current time in a format that's compatible with directory name character rules.
public class TtsVoiceOcrActivity extends Activity implements DirectoryChooserFragment.OnFragmentInteractionListener public String getFormattedTime() { SimpleDateFormat formatter = new SimpleDateFormat("yyyy_MM_dd_HHmmss"); Date curDate = new Date(System.currentTimeMillis()); return formatter.for...
1
d49568c7010e203e577c2fde413455af
25bdf46d42448c35f80e5a2ca51fa92a
Use only the temperature desired - actual to generate hvac ON or OFF requests
{ if (!desiredTemperature.twinStateUpdated) { return; } static enum HVAC previous_hvac_state = OFF; int actual = (int)temperature; int desired = (int)*(float*)desiredTemperature.twinState; current_hvac_state = actual == desired ? OFF : actual > desired ? COOLING : HEATING; if (previous_hvac_state != current_hvac_...
1
d7b7d8f1da23ed791c02a865cb026299
9014601614a4d9025c6003f6f8aad4cb
F.S : Insert P sebagai elemen sesudah elemen beralamat Prec
void InsertAfter (List *L, addressList P, addressList Prec){ Next(P) = Next(Prec); Next(Prec) = P; }
1
b3b8dcd0adbff3f87d193cee9338ceb2
15a62338ab68487650a3c5766287d1e6
========================================== Mouse Parallax ==========================================
public class ParallaxController : MonoBehaviour void Parallax() { float deltaX = transform.position.x - previousCameraPosition.x; float deltaY = 0f; if (parallaxVertically) { deltaY = transform.position.y - previousCameraPosition.y; } for (int i = 0; i < b...
0
36b518456f2acd50ed5f8cf529a9a665
b3fb40308867480edc4c8fbfb9d077cc
Makes the rule apply to any traffic destination address.
namespace Microsoft.Azure.Management.Network.Fluent internal partial class NetworkSecurityRuleImpl NetworkSecurityRule.Update.IUpdate NetworkSecurityRule.Update.IWithDestinationAddressOrSecurityGroup.ToAnyAddress() { return this.ToAnyAddress(); }
1
025228703fde69dcf3e08e18790d8afd
8a912a8ecf400261dcf3c42b4d07d973
Gets all the quoted triples with a given subject and predicate from a specific graph of the dataset.
namespace VDS.RDF.Query.Datasets public abstract class BaseQuadDataset : ISparqlDataset public IEnumerable<Triple> GetTriplesWithSubject(INode subj) { return (from u in ActiveGraphUris from t in GetQuadsWithSubject(u, subj) select t); }
0
adced1e237d2f8e7b39a7212c3437081
d0ccfd076a50b5f406052ec2244a2aec
Usunięcie autorów bez przypisanej książki.
class Autorzy public function usun(int $id): bool { $sql = "SELECT COUNT(1) FROM ksiazki k where k.id_autora = " . $id; $result = $this->pobierzWszystko($sql); if($result[0]["COUNT(1)"] != '0') return false; return $this->db->usun('autorzy', $id); }
1
01d8b0d97c6935bb66d821df408abb27
8292a7e0ed54cb2372c4e4dcdb99f222
Get the 'LastFillDate' element value.
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "address", propOrder = { "businessUnitNbr", "countryCode", "languageCode", "addressTypeCode", "addressLineFour", "addressLineOne", "addressLineThree", "addressLineTwo", "baseDivisionCode", "businessFax", "businessPhone", ...
0
f196410585167d3f4ab6f3a305d700fe
2c91c8acaba34cfbe04b8c4b91375be0
returns all the spaces on the board that are occupied
def available_spots(board): spots = [] for x, row in enumerate(board): for y, spot in enumerate(row): if spot == ' ': spots.append([x,y]) return spots
0
f208c677537f4f6ae2768384620b1102
9c63e0010d52c7b675b21004606df893
Get the parameters of this line in gradient-intercept form.
weights: number[]; type: TypeLinearReg; } { return { weights: this.weights, type: this.type, }; }
0
8f95faf0bfac023acf9233c84383f131
9d70af6fd7290aa5475990add4a5d661
@brief Close a GPT Timer Channel for Input Capture. Implements input_capture_api_t::close. Clears Timer settings, disables interrupts, and clears internal driver data.
icup->etimerp->CHANNEL[icup->smod_number].CCCTRL.B.ARM = 0U; icup->etimerp->CHANNEL[icup->smod_number].STS.R = 0xFFFF; icup->etimerp->CHANNEL[icup->smod_number].CCCTRL.B.CPT1MODE = SPC5_ETIMER_CPT1MODE_DISABLED; icup->etimerp->CHANNEL[icup->smod_number].CCCTRL.B.CPT2MODE = SPC5_ETIMER_CPT2MODE_DISAB...
1
b99aa96b826ca3fe12d30bf00dfb03bd
8fbf01bc4e751aa5e7fe487e2cfbd035
檢查字符串是否需要顯示兩行
class SARibbonBar(QMenuBar): def checkTwoRowStyle(style) -> bool: return style & 0xFF00 > 0
0
fba18c044db3649486bcc1b6ce13bec3
67da3419be1e7eb36bb7b44068eb4c81
Returns a range of all the legal ds rels where docId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting...
public List<LegalTDRel> findByDocument(long docId) { return findByDocument( docId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
1
e9a06f75fa2ca62ea7e540a40b61077b
dd7ef73cec7bedcfdb8854744a1536d7
Returns the meta object for class ' {@link de.mdelab.sdm.interpreter.core.executionTrace.StoryPatternLinkExecution <em>Story Pattern Link Execution</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> '.
EReference getStoryPattern_LinkVariable();
0
821b2911032f487526e4ab55b1c37832
b587dbc268e397b392a07cb0b8111fd1
是否显示模版图片
{ string templatesName = ddlTemplates.SelectedItem.Value; if (templatesName != "0") { div_userupload.Style.Add("display", "none"); } else { div_userupload.Style.Add("display", ""); } B...
1
77725623cade2a14d44210d0c238ccdd
c9838f243b10651e95c43be43e1c3d4f
Controller for city events routes
class EventsController extends Controller public function indexOld(Request $request) { $filters = $request->only(['city_id']); $age_filter=[ ['age', '>=', 14] ]; if($request->has('age')) { $age_filter=[ ['age', '<=', $request->get('age')] ...
1
6b89fb5261be50864043f0d8c611f7f6
758161e1520be0fcd409155377bca38a
The function returns the x and y position of the SeekBar
milestones = self.test.milestones seek_bar_element = milestones.getElement([("name", "seek_bar_view", "==")]) self.test.log_assert(seek_bar_element, "Seek Bar not present") x_pos = int(seek_bar_element['x_pos']) y_pos = int(seek_bar_element['y_pos']) return x_pos, y_pos
1
c5035832e46c118550dd0d4854c4d8b2
ee25e3eb4967ba1ae038666600aa68e3
Method to get the no of components so that we can differentiate b/w a mixture and single component
int Simulation::getNumComponents(int current){ return getNumberOfEnterPoints(current); }
1
6606c1499d1c6231bca39a26ffc73ef2
747c69a7bb8bd82c43281e18785d2c7a
用户预约球赛
{ if (FALSE === $this->input->is_ajax_request()) { $this->output->json(array('code' => 10000, 'error' => '不正确请求')); } $phone = $this->input->post('phone'); if(FALSE === isset($phone)) { $this->output->json(array('code' => 10000, 'error' => '缺失参数[0]')); } $changg = $this->input->post('changg'); ...
1
0249ee422570d00f460190cf12d65a29
a4fa463be3e98109f7e1dc9d1b8fb289
make the app run on fullscreen
public class Project01_08 extends PApplet public void settings() { fullScreen(); }
1
7e3da285a23ae7133ad2c2c0e867760c
86c1fee9135a4f7529d1b67c12503506
Attempts to interpret this instance as List(UInt64).
class UInt64(object,IComparable,IFormattable,IConvertible,IComparable[UInt64],IEquatable[UInt64]): def TryParse(s,*__args): pass
0
ff9784db8cb1a338ae921f5115648e6c
f8e9dbd8fed6e01a030b0d55ae1c94b6
Computa el precio total del camion (cajones*precio) de un archivo
def leer_camion(nombre_archivo): return parse_csv(nombre_archivo, types=[str, int, float])
0
2d2c2ecc8aeef1f47160d7ba81e6ca8b
6f497a54c8c3fd12bf97dc0aa3c5fd04
POST: AdminMenu/Create
public ActionResult Create(CategoryViewModel item) { try { string userId = User.Identity.GetUserId(); if (userId == null) { return RedirectToAction("Login", "Account"); } var role ...
1
e34a320d8e706eef781b9e434e491086
d92fec9bd7a1a67e82bd78750c9897bb
funtion - make reports for sales by payment method
def reports(request, report_number): if report_number == '1': if request.method == 'POST': print(request.POST) employee = Employee.objects.get(id=request.POST['employee']) by_date, with_date = request.POST['by_date'], request.POST['with_date'] students = empl...
0
4dc449be42da68fa6d35297ebde9893a
17680c80054c6333ab2aa3f6eb5e1260
Returns a data for remote command execution (data using another application services).
namespace Christina.Framework.ConsoleApplicationFoundation.ConsoleApplication.ConsoleRequest [CanBeNull] TData RequestData();
0
f1a0510efc973860ed1452c5c08fd1bc
65cc529706d93462d6b5d9afc51558ef
функция, която сортира вектора в нарастващ ред
void sort(vector<double> &v) { for (int i=0;i<v.size();i++) for (int j=i;j<v.size();j++) if (v[i]>v[j]) { double tmp=v[i]; v[i]=v[j]; v[j]=tmp; } }
1
ca02af3f60a3d30dcec22584cde7567b
2249674eb19487694b5a65982b2b4f7f
得到mobj里的所有文本
def TextParse(text): raw = re.compile(r'"objURL":"(.*?)"') l = raw.findall(text) return l
0
e9f8cead55728dd866a4205c9596172c
69b08417ba09948f7fa4edaefb57c7f8
Returns whether or not the entity that satisfies this condition exists.
boolean exists(Specification<T> spec);
1
56609f83f8794cfc5f4c43446363a3fb
fb0b6e36bdb5a77a7badbb776d83c3e7
Javascript入力チェックエラー時のメッセージを返す
{ if (!isset($this->validatorRegex)) return; $regex = str_replace('"', '\"', $this->validatorRegex); $jsRegex = $this->reformateRegexForJS($regex); $values = array( "#regex" => 'new RegExp("' . $jsRegex . '", \'' . $this->validatorModifiers . '\')', "alertText" => LI_PREFIX . addslashes(JText::_($this...
1
59b1a028285173bee8e07f779b54d305
343524a05bfcf2912571e3c7f678883d
加载每日必应一图
JsonArrayRequest dailyJsonRequest = new JsonArrayRequest("http://www.haowuyun.com/api/daySay.json", new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray jsonArray) { String dailySentence = ""; try { dailySente...
0
3e3cd6559ca6d7a0553e4e196e426d88
2333df77ec75b9603f0e7f1b1193d039
Downloads the tiles to cover the path from [lat1, lng1] -> [lat2, lng2]. Will not download tiles or bands for a tile if a cached version is found in the download_dir.
tiles = list(tiles_from_csv(self.tiles_cover_path)) os.makedirs(self.sat_path, exist_ok=True) with requests.Session() as session: with futures.ThreadPoolExecutor(self.num_workers) as executor: def worker(tile): tick = time.monotonic() ...
1
1e11a08ed671daadb2abc83217414110
d342d2eecb1c186ab737b4c75561abb5
读取职业表
namespace SCEEC.MI.TZ3310 public class UPanList public JobList ReadJob(string jobPath) { FileStream fs = new FileStream(jobPath, FileMode.Open); BinaryFormatter bf1 = new BinaryFormatter(); JobList job = (JobList)bf1.Deserialize(fs); fs.Flush(); fs...
0
19af18fbf73c37336acc6cb2821c1030
bfde508371a0d56c4966492f3fb52b84
Get metadata Get SAML metadata from the server. SAML must be configured properly. ##### Permissions No permission required.
public class MetadataResponseGenerator : IMetadataResponseGenerator public async Task<IActionResult> GenerateMetadataResponseAsync() { var config = await _saml2ConfigurationService.GetConfigurationAsync().ConfigureAwait(false); var settings = _options.Value; var entityDescriptor = new Entity...
1
bc64289f502c2e5254dc29567dfaf83c
63b3de8a4458a90a07fddfba072ff603
Abstract method for resetting the dialogue state tracker, usually at the beginning of a new episode.
class DictEnvironment(Environment): def _reset_state(self): raise NotImplementedError
1
9d37f234d3cc148a841fc03d1c865221
6e21a097571710492f4388aacb387484
Parse progress from the log file.
def process_logs(conn, path, callback): current_file, offset = conn.mget('progress:file', 'process:postion') pipe = conn.pipeline() def update_progress(): pipe.mset({ 'progress:file': fname, 'progress:position': offset, }) pipe.execute() for fname in sorte...
1
5c20c1e692c2ad5a70274ea86de992d8
48d504f54b8146c2f9a7c3f94edc2de2
Перемещение всех точек на указаннное растояние
class Population(): def move(self): for i in range(len(self.dots_list)): self.dots_list[i].move()
0
3f492f1398525a75110d9e5b7fa04502
0130e0b4ae9860f09590a62a4f8d439d
功能:'.'不能出现在字典键值中,因此将ip,cname,邮箱等的'.'进行处理
static void to_cident(char *str) { for (; *str; ++str) { if(*str == '.' || *str == '/') *str = '_'; } }
1
01586b94ed0a849d40e2d189f7bb718b
9ed9aca736d0fb81581145ccb53fba1f
重载除法运算符
CBigNum CBigNum::operator/(const int & b) const { CBigNum ret; int i, down = 0; for (i = len - 1; i >= 0; i--) { ret.a[i] = (a[i] + down * (MAXN + 1)) / b; down = a[i] + down * (MAXN + 1) - ret.a[i] * b; } ret.len = len; while (ret.a[ret.len - 1] == 0 && ret.len > 1) ret.len--; return ret; }
1