query_id
string
corpus_id
string
query
string
code
string
label
int64
c08478c4beb262a39c1a5706362c4e76
3bdee2ac0e7606a92041fd954a364a62
Searches for admins
def search_admins(username, email): search_query = User.objects.all() if username: search_query = search_query.filter(username__contains=username) if email: search_query = search_query.filter(email__contains=email) return search_query
0
cfe0800dee2f147fd33faabb840fedfd
9d529f3ec816f682b01e5720ed45b2b2
For each element in the input array, check it, and increment the count if it is prime.
{ int result = 0; for (int i = 0; i < firstArray.Length; i++) { if (IsPrime(firstArray[i])) result++; } return result; }
1
00da0b687cbe26e4b50e447df77436ea
856859936d5816fb4a79760cea0abf96
FUNCION PARA CREAR LA TABLA DE VALORES
let cadena=' <tr><td><h6 class="Vars" >y=</h6></td> '; for(let x=0;x<can;x++){ cadena=cadena+' <td><input type="number" min="0" class="func" id="v'+x+'"><h6 class="Vars" > x'+x+'</h6>+</td>'; } cadena=cadena.slice(0,cadena.length-6); cadena=cadena+'</td></tr>'; $('#funcionGenera...
1
294a1b5b61d7d4c2df5e1cf0ce5666a4
11f18cbbc483f6424600caf395b23084
Main tracker loop. Never exits.
public class Tracking public static void main(String[] args) { long lastLoopTime = System.nanoTime(); long lastFpsTime = 0; long fps = 0; boolean filterCalibration = true; boolean useCameraFeed = true; initializeMouseListener(); List<TrackingObject> objects = new ArrayList<TrackingObject>(); TrackingObj...
1
8893165c5469f9376985cae781e58ba9
4033eab387b3d60aa95c6612bb78f51a
Convert the FetchXML query object to a string
class SphinxQLQuery public function __toString() { return $this->toString(); }
0
b8a24c88daa7cabf0ce5d636483fb677
48ac4e611778551fdaf58271e62bc009
Calculate local mean time of rising or setting. By `local' is meant the exact time at the location, assuming that there were no time zone. That is, the time difference between the location and the Meridian depended entirely on the longitude. We can't do anything with this time directly we must convert it to UTC and the...
class Airmass: def LMST(self, date, longitude): gmst = self.GMST(date) lmst = E.degrees(gmst + longitude) return lmst.norm
1
a89b6450e96e909d4b71ecdfd8444363
69fea9ee7482f71b614bb741b213ba9b
maps response json to a verify Session response model
{ ResponseHeaders headers = new ResponseHeaders(parsedResults.perpage, parsedResults.format, parsedResults.pages, parsedResults.page, parsedResults.total); ArrayList<Session> resultSet = new ArrayList<Session>(); for (int i = 0; i < (parsedResults.sessions.length); i++) { ...
1
bf6aeb9eaf131b35587da9dd8dfc8ae4
9c668f87d49967de12928778bf660804
Get 待转移的源云存服务ID
public class DescribeMigrationJobsRequest extends AbstractModel{ public String getSrcInstanceId() { return this.SrcInstanceId; }
1
9a42b1b0c16ba8f077e901429b99b42a
9ac1a6c6ffec3dd7b496d87f898a4c03
method responsible for update DB from URL address
{ mysql_query('UPDATE `settings` SET `value` = 1 WHERE `title` = "status_updating"'); $url=addhttp($url); $host=parse_url($url); $scheme = $host['scheme']; $host = $host['host']; if (mysql_fetch_array(mysql_query('SELECT COUNT(1) FROM `url_list` WHERE `url`="'.mysql_real_escape_string($url).'" A...
1
e313ae35a4184d5be91388152448551e
cf091a8a0148df24f890f244548c98e9
Метод возвращающий все счета за текущий месяц
{ Balance bal = new Balance(); if (month == 13) { year++; month = 1; } ListDictionary ld = new ListDictionary { {"@storeid", storeId}, {"@WarehouseID", WarehouseID}, {"@month", month}, {"@year", year}, {"@days", DateTime.DaysInMonth(ye...
0
0545b5ff5e4accb03b05d119f1dea5d3
35cdd429037826974e9acc64ad4ba94d
Allow the default versions between tips to be overridden. After this number of diffs as been written, a new tip will be added. This method can either be called as an assignment (in which case you'll need to specify a receiver, such as self) or as a set_* alias.
class DSL def write_version &blk @write_blk = blk end
0
8961b01846476ad82e73db65a12feeae
a8a0acc313952922dacad82e6f353851
Function name: CountDigit Function Operation: the function receives a number and a digit and returns how many times the digit appears in the number.
def count_digit(num, digit): count = 0 while num > 0: d = num % 10 num //= 10 if d == digit: count += 1 return count
1
115a3ec6aa4b93f3fe8020cd940c96bd
8593f5751b614490e3961c35f6ae9291
Custom permission to only allow owners of an object to edit or delete it.
class IsOnwerOrReadOnly(permissions.BasePermission): def has_object_permission(self, request, view, obj): if request.method in permissions.SAFE_METHODS: return True return obj.owner == request.user
1
8663cb2dcb2b4a53a7f0b53e9a748718
2331b28a370091b79b4afbf7c77e650f
blink LEDs different durations
impl LEDColor pub fn blinky(&mut self, timer: &mut Timer<TIMER0, OneShot>) { self.red(); timer.delay_ms(1000_u32); self.blue(); timer.delay_ms(1000_u32); }
0
dbd5d71c429d2b5e67fc78e7a64f9e9c
7bdc7d1f71973c8dd808efb2d4d3dd58
Add section to contract template
class TherapeuticProposalViewset(viewsets.ModelViewSet): def add_section(self, request, case_id=None, id=None, pk=None): serializer = TherapeuticProposalSectionSerializer(data=request.data) if(serializer.is_valid()): serializer.save() headers = self.get_success_headers(serializer...
0
6b3efaf76c8d73af05e47e241272a7c8
c208ebf649092726a40e4cd0f98bdad7
Rotates the local geometric transform by the specified amount. This method prepends the rotation to the transform.
namespace ScriptCoreLib.ActionScript.flash.geom [Script(IsNative = true)] public class Matrix3D public void prependRotation(double degrees, Vector3D axis, Vector3D pivotPoint) { }
1
ccd9dc7518fb192bc4b0810273bc15bd
1ae0cbbc9f6a463d4f8bcebeb301f76e
ajaxinvoicelookupAction() - fetch invoices and return data in json format
{ $invoices = Invoice::all(); $multiplied = $invoices->map(function ($item, $key) { $item->date = (new Carbon($item->date))->toFormattedDateString(); $item->client = $item->client; $item->subtotal = json_decode($item->invoicedetails)->subtotal; $item->...
1
424a52c81376b0da838b43a296dc5130
28816a70710d00f75eb429fd1c055042
This returns an EmptyQuerySet.
class VerifiableEmptyQuerySet(VerifiableQuerySet): def filter(self, *args, **kwargs): return self
0
c9f477cad0137181b6c97f7e439f2f25
dcf46ecf32a7b21dbd6bec6d57374a4e
Fixture for browser selection and browser launching
def splinter_browser( context, type='chrome' ): if type != 'flask': context.browser = Browser( driver_name=type ) else: context.browser = Browser( driver_name=type, app=create_app( TestConfig ) ) yield context.browser context.browser.quit()
1
2e84791f0c05045be04cc3ae59113bd0
477faee30157101fb7481428e0cab040
Simple function to end a container (see above)
function container_close(): string { return get_ui()->container_close(); }
1
439d6cb03897e634f3ace2c834c82197
7a1cd9366cec7e88564a609c884baf43
是否和 Activity 共享 ViewModel,默认不共享 Fragment 要和宿主 Activity 的泛型是同一个 ViewModel
public abstract class MvvmFragment<V extends ViewDataBinding, VM extends MvvmBaseViewModel> extends Fragment implements Observer @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); }
0
1e9bca12b33f37342661ab939f3a3c1f
85457037e7d4383456996bf76d5cf811
Generate the octree from the grid data.
self.grid = [] lvl = 0 self._recursive_grid_level(lvl, self.origin) self.grid = np.array(self.grid)
0
22810820e942457bde28014dc4482e04
53f7dadd70f06b9dea296224f7caed85
Returns @a value if it is within the range of @a minimum (inclusive) to @a maximum (exclusive), otherwise a value wrapped with modular arithmetic to be within the range.
max -= min; value = (max + (value - min % max)) % max + min; return value; }
1
aa8fd435f2ed469b11b3e3150ca3dc83
4e0b90e7fef9399bc44d04ff2cc65a00
címzett tömb "név <email>" stringgé konvertálása.
public class Sender private String listToMailString(String[] receivers) { StringBuilder info = new StringBuilder(); if (null != receivers) { for(String r : receivers) { info.append("<").append(r).append(">"); } } return info.toString(); }
0
9714d1fe98d10e8741dc1b9fc032c53e
150663cddc0aed2182a1abe79805e2c7
<br />Creates a new wordpress database and adds a user to its previleges.
Class Wp_Migration public function wp_add_user($user_login, $user_pass){ require_once( 'wp-load.php' ); require_once( 'wp-includes/user.php' ); $userdata = array( 'user_login' => $user_login, 'user_url' => '', 'user_email' => '', 'user_pass' => $user_pass, 'role' => 'admin...
0
3aa197a42b893c84349f7eafcac2d256
0374dfcef56aa41879c2b5e633b32a2c
Called before every single test method
class UsersTestCase(TestCase): def setUp(self): print("setUp: Run once for every test method to setup clean data.")
1
ec2a3e82ec7fa6bf6c750ad101cba469
2786ecab9cb551d2236260e1375ba97b
Returns a pointer to the start of the code section for func
static inline Func_Tbl_t *Get_Func_Section_End(void) { return __section_end(".func"); }
0
6e1c6249a9269a69f77e12d6209da94f
4a0356d8d3ef82c6ca53b295f1d27206
utf16转utf8编码
{ if (utfString == "") { return ""; } string strOutUTF8 = ""; WCHAR * str1; int n = MultiByteToWideChar(CP_UTF8, 0, utfString.c_str(), -1, NULL, 0); str1 = new WCHAR[n]; MultiByteToWideChar(CP_UTF8, 0, utfString.c_str(), -1, str1, n); n = WideCharToMultiByte(CP_ACP, 0, str1, -1, NULL, 0, NULL, NULL); char *...
0
b6723b4ef2a7576e60461f7452ebda46
1b5fed0312b942791a7ce4158c34dabe
Find one "time based one-time password" by owner.
Optional<UaPasswordResetAuthKey> findOneByEmployeeId(Long employeeId);
0
74eabb00d463dfd0f381fcdd6449fdc2
3cf32f9f438da3f9df2b563f9f5ee404
Berekent op welke dag van de week een datum valt
int dow(int m, int d, int y) { int n = (y - 1900) + adj(m,y) + d + (int)floor(y / 4); int w = fmod(n,7); return w; }
1
ec487d6f29f3826de7aaa62ed1b4408c
bff24e238467cb32517a8c19fce84672
Dummy thread identifier is always None.
class Log4jParserTests(TestCase): def test_read_thread_without_thread(self): self.assertEqual(Log4jParser()._read_thread(['not a thread'], None), None)
1
681641b3b31bbbc61b17eb161cbde31a
5313ea3b32bceb7b4831b7b80fdc94ee
Retrieve the {@code language} property (displayed as '{@literal Language}') of the object.
@NotNull GenericAttributeValue<String> getLang();
1
dbf8b5181ae6936651d5ff3e83f5835c
1221b5ca3211d5efea8b559f6a51d042
در دکمه ی اول یک کشور با یک ایدی را به جدول کانتری اضافه میکنیم
class NationController extends BaseController public function AddEditcountry($id) { $data = $this->country->find($id); return view('add-country',compact('data')); }
0
aa747cae6f660a13b4585342a875044e
d954c13b446417fafbcab72af69822a5
Audio reader abstraction. Reads audio from a `csv` dataset.
self.path = os.path.realpath(path) self.dtype = dtype self.sample_size = sample_size self.offset = offset
0
edefb33df9f6ced99d91090101ec4751
add68d96ab6227ce5a77636b7b08281a
SR节点间的吞吐量曲线图(实时)
function realtimeLoad(chart){ var prm = { planId:_thisPlanId, startDate:_st, closeDate:_et, userRole:sessionStorage.ADRS_UserRole } $.ajax({ type:'post', url:sessionStorage.apiUrlPrefix + 'DRPlanExec/GetHistoryNSFHsByPlanId'...
1
f7ce8fe465c44b256cf018017570fa1f
ba27202c66cccbcf314391b17d0d7420
Retrieves the PlayerScore field
public abstract class AbstractPlayer implements Serializable public int getPlayerScore() { return playerScore; }
1
ac8bec5b2295500341bb3a2b5fa3cf1e
e49509678c3d9975e4cc61fd505858a3
allocate and initialize some LGN state variables
{ #ifdef CYBLE_LNS_SERVER cyBle_lnsFlag = 0u; cyBle_lnssReqHandle = CYBLE_GATT_INVALID_ATTR_HANDLE_VALUE; #endif #ifdef CYBLE_LNS_CLIENT if(cyBle_serverInfo[CYBLE_SRVI_LNS].range.startHandle == CYBLE_GATT_INVALID_ATTR_HANDLE_VALUE) { (void)memset(&cyBle_lnsc, 0, sizeof(cyBle_lnsc)); } c...
0
cfbc40dab2e49e8c81156493c091c7f2
42d849e96357d8218b4831931417a848
删除案件企业信息
export class CompanyInfoService delCompanyInfo(info: Info) { return this.baseHttp.post('companyInfoAction/delCompanyInfo', Util.toSearchString(info)).pipe( map(data => { return data; }) ); }
1
724bd3526ab32803e5dfaa1404cac880
34406bc486586d8c330a1a73af6a79a3
Remove trailing hashtags from the tweet. Hashtags in the middle of the tweet are retained.
{ $newString = ""; $words = explode(" ", $tweetString); $i=count($words)-1; while($i>0) { if(substr($words[$i], 0, 1) != "#") { $newString = $words[0]; for($j=0; $j<=$i; $j++) { $newString." ".$words[$i]; } return $newString; } $i--; } return NULL...
0
bf796d50354b3b73ca7d4097e96708b1
efb53d9dc7bbea23f7432e7f5c57a340
This method returns the number of bytes available in accelerated memory on this device. Some images are created or cached in accelerated memory on a first-come, first-served basis. On some operating systems, this memory is a finite resource. Calling this method and scheduling the creation and flushing of images caref...
@Platform public class Pointer implements AutoCloseable @Name("JavaCPP_availablePhysicalBytes") public static native long availablePhysicalBytes();
1
32d511c6ab873f0b73f118be5b5c3e75
609d67a5ee9d27ffbd4e83fc4313e0f0
Get the visualisation fiche cabinet.
class CabinetsController extends Controller public function show($id) { $cabinet = Cabinet::findOrFail($id); $config = array(); $config['center'] = "$cabinet->latitude, $cabinet->longitude"; Gmaps::initialize($config); $content = '<div id="content"> <div id="siteN...
1
0b82a760b21c15963e45ce0640c97e9a
7974ce3ce5383fee4b0042137199d514
Метод для добавления турнира в базу данных
DB = connect() c = DB.cursor() c.execute("INSERT INTO tournaments(tournament_name) VALUES (%s)", (name, )) DB.commit() DB.close()
1
8d639754590f3ec5b3173094923f94da
e5501dfa0f2d563ab660b8b7250a1c3f
重绘专家统计表格
$request = \Yii::$app->request; $post = \Yii::$app->request->post(); $field =["DATE_FORMAT(ea.create_time,'%Y-%m-%d') as days", "e.cust_no", new Expression('case when expert_source = 1 or expert_source = 5 then (select u.user_name from user u where u.user_id = e.user_id) when expert...
1
82555bc5d7f92dbf5f76b7da556a6486
2a61726bba83a463344419140938497a
Get the ID of the user with the given login or full name
class ServicesAuth(PluginRegistry): def get_user_id(self, user_name):
1
922860fe8aadbb39d9d563d49a2b3fd7
950c1637880f106d9c40395b93dd5725
Diese Methode gibt eine Sicht auf einen Abschnitt dieser Wertliste zurück. Sie Implementiert {@link #section(int, int)} ohne Wertebereichsprüfung.
public abstract class FEMArray extends FEMValue implements Array<FEMValue>, Iterable<FEMValue>, UseToString protected FEMArray customSection(final int offset, final int length) { return new SectionArray(this, offset, length); }
1
dd62eb3cd7e78e23fbbc2633b0f0d283
4502d267f8b8614ab3597730275efd81
функция для определения весов логистической регрессии градиентным спуском
new_weights=[] l=len(y) for i in range(l): if(y[i]!=y_pred[i]): new_weights.append(sample_weights[i] * math.exp(alpha)) else: new_weights.append(sample_weights[i] * math.exp(-alpha)) weSum=sum(new_weights) dummy=weSum for j in ran...
0
63f6a9ba41b2c812267a5ea6d4b28aaa
99c615575f4f063c9ab9a151bc3fc863
Initiates the asynchronous execution of the UpdateActionTarget operation.
namespace Amazon.SecurityHub IAsyncResult BeginDescribeActionTargets(DescribeActionTargetsRequest request, AsyncCallback callback, object state);
0
1117f9481630ca88a35db9a4e0f60d2e
e0e21ce46073603a5d38b874991183de
r"""State of HTTPS redirects for the SSL virtual server. For an SSL session, if the client browser receives a redirect message, the browser tries to connect to the new location. However, the secure SSL session breaks if the object has moved from a secure site (https://) to an unsecure site (http://). Typically, a warni...
class vserver(base_resource) : def redirecturl(self) : try : return self._redirecturl except Exception as e: raise e
0
b8e1b412b8377693d0dc39e0af95ebf2
eac701130d12dd39f2f1660b7082a515
根据站段ID和拆分日期查询全部人数
@SuppressWarnings("rawtypes") public List<BasicEmployeeVO> queryEmpBySiteIdAndTime(Map map) throws DaoException;
1
a8d50c32210b0821943775a0b70e9445
3abf031b6dd4c5715fe97275c1dae59c
Customizes the text of the close button which is helpful for translating this into different languages. The close button is displayed as an icon-only button by default so the text isn't visible on-screen, but is read by screen readers so this is an important accessibility feature.
public abstract class Dialog extends DialogBox public String getCloseText() { return DOM.getElementById(m_id + "_close").getAttribute("title"); }
1
3615cd7ecb0092781fc7c67cd1510b06
21d06af9c12deba6fbc66a8af3c088db
Is this component a template.
public abstract class TypeInfo public boolean isTemplate() { return Flags.isTemplate(fModifiers); }
1
fef23318eeb8dbddd75d9dbad2ec33d5
c7b4b943a471faa7699824bd30771475
Renderiza la vista de la grilla mostrar actualizaciones
class GridController extends Controller public function show(Grid $grid) { $grid->load('cells'); return view('show', compact('grid')); }
1
5bd4b7c52f1db7adb8591f64d8beafd9
5bf981fbd9d92f21e01a45365033c656
현재 로그인한 사용자가 최고관리자인지 확인한다.
namespace Nocoq.Common public class Authorizer public bool IsSuperAdministrator(IUser user) { if (AuthorizationService.IsSuperAdministrator(user)) return true; return false; }
1
4ff5d21163d7ea3582298d6713952da1
f46757dd0696b6e8f4a18ee7f22cb69c
Method to get transactions' details by transaction id (transaction_ids maximum size 10)
export default class OmniLayerApi getOmniTransactionDetailsByTransactionIDTxidWithHttpInfo(network, blockchain, transactionId, opts) { opts = opts || {}; let postBody = null; if (network === undefined || network === null) { throw new Error("Missing the required parameter 'network' when calling...
1
b743f7f5880c0708579cbb5aeec947af
6ee3454b17154e0a37e37e0f2865577e
extra step for getting the module in the right shape for the tests
class _Test(_ModuleTestCase): def setUp(self): self.data_shape = 100, 20 self.label = '`augmentor`' self.n_tests = 20 self.name = __name__
0
7bd23a41432657807ccb6615dd086a4d
75198230d8202699672f52d8b8412855
initialize fc_bk_queue structures.
void fc_init_bkup_queues(t_fc_bkup_queues *fc_bk_q, uint32 num_queues, bool is_data) { uint32 i; BCDLASSERT(fc_bk_q); fc_bk_q->num_msgs = 0; fc_bk_q->num_queues = num_queues; fc_bk_q->global_fc_state = BCDL_GSP_RESUME; BCDLMALLOC(fc_bk_q->fc_queue, t_fc_queue, num_queues); memset(fc_bk_q->fc_queue, 0, (nu...
1
bef5427d99c8cdd280c74d38c62cc210
ab0cae63e1f57a37b211524293a1cd38
Tests method to calculate the player's score
class Test(unittest.TestCase): def test_calculate(self): self.assertEqual(calcScore("hell ", "hello"), 80, "Should be 80") self.assertEqual(calcScore("moon", "mope"), 50, "Should be 50")
1
3cb955ff606c06fd77b6c3ac56d0d4c3
ff46549bc76f3b12a7d3d102a6cda5d0
Moves all of the children from one element to a different one
namespace GameJamStarterKit public static class GameObjectExtensions public static void MoveChildrenTo(this GameObject from, GameObject to) { var count = from.transform.childCount; var children = new Transform[count]; for (var i = 0; i < count; ++i) { ...
1
158f9ab5c6229a09fbfd7c979edc7cf6
b919204a2ab401c33ac5d0fbfe5eca64
Writes the given multi-string value into system registry database
TCHAR *szKeyPath, TCHAR *szValueName, TCHAR *szVal, DWORD dwSize) { int err; HKEY hKey; ULONG lSize; if ((err = RegOpenKeyEx(hRoot, szKeyPath, 0, KEY_ALL_ACCESS, ...
0
b443b52fe282dd3b5d731090c9a71b86
6dc40761061feff5b9729c30ff2b4e3e
Initializer for the controller with link to the repo
class ComicsController: def __init__(self): self.repo = ComicsSourcesRepository()
1
cbd092d4b01ebdbf1be9b3d818589c21
a10b1581f4aa8e64889f48425a9268cd
customer dashboard view
class DashboardController extends Controller public function index() { $currency_id = (auth()->user()->customer->currency_id) ? auth()->user()->customer->currency_id : config('constants.default_currency_id'); $data = Invoice::stat($currency_id , Auth::user()->cus...
1
ffc0b9ea244aae25c78a77b3b6c511fc
0a9da8a93fe1dc56d0de82d889f81a74
去掉日期时间中的日期数据
public abstract class HBaseWrapper extends Wrapper implements BatchTargetProvider, RealtimeTargetProvider private String replaceDateStr(String dataStr) { dataStr = dataStr.replaceAll("-", ""); dataStr = dataStr.replaceAll("/", ""); return dataStr; }
0
5745c609ccb75b253579a5d297ae1c69
076e8147884592c811bb7f843ce42210
新建AI好课课程的ID获取
{ $validator = Validator::make($request->all(), [ 'live_id' => 'required|json', ]); if ($validator->fails()) { return $this->response($validator->errors()->first(), 202); } $live = Live::find($request->input('live_id')); if(empty($live)){ ...
0
9dbd1ec5bbfd9cdbb3170183c09d4665
546c2753ad7860f17aabaec528b900d7
removing carriage return to make the string platform independent
for(let i = 0; i < arr.length; ++i) { arr[i] = arr[i].replace('\r',"") } return arr; }
1
390cfab000bdd1236c269d3a85752d49
c19f089bb1ffdea7ef7076cef319e734
Syncs legal entity divisions
def sync(ctx): e = ECSServiceRegistrator(ctx.obj['dns_name'], ctx.obj[ 'hosted_zone_id'], ctx.obj['hostname']) e.sync()
0
5f1f3e7d74878b492954895262edb4a9
da6bb6ebcec38c2690ffb82928756a30
Defining the activation function and it's derivative if flag derivative = 1
if (deriv == True): return x * (1 - x) return 1 / (1 + np.exp(-x))
1
6ff46f714683a2d87d431148891620f4
cbdc884fe062a2b0a864f7d837653933
生成biz层代码
function buildService(tables,module){ var table,field,pk,className,interfaceName,entityName,paramName,cu,cd,uu,ud; var fileJson = []; for(var tableName in tables){ var code=""; table = tables[tableName]; className = getLower(tableName); interfaceName = "I"+getLower(tableName); entityName = getLower(tableNa...
1
3d5a48fcb2bb21130db154fa09fdd522
44ee93769bacc81526af0e86522f655b
Get spazzCommentsCount
public function getCommentCount() { return $this->commentCount; }
0
5aca5a73685e53657db1650d583b3b58
d0c7847e24a7a956cee346e65c55ad46
Returns true if the summary panel is currently being shown
{ return this._summaryList != null && this._summaryList.Count > 0; }
0
892c3ea67685baf3e9f2d8e9a40926d1
08d39de6cf070714254de61d5ca8c88b
指定帯域におけるパワースペクトル密度 (Power Spectrum Density,PSD)を返す
class Denoiser: def __power_spectral_density(self): return (self.__magnitude_fft() ** 2) / self.audio.size
0
8fcb5d043c4e03d409438c82af101336
5420ba5d77d84585a5e33980005dab68
@brief Force an instruction cache index invalidate over a memory region Pointer to memory in question Length in bytes of the data pointed at by addr
void dci_dcache_inval(uint32 *addr, uint32 length) { #if defined(BUILD_BOOT_CHAIN) mmu_dcache_inval_region(addr,length); #else #endif }
1
aae237bcfd59c39316c2abc562993a91
cd7762f2f8910de010e56d6a460853b8
Always fail job immediately.
abstract class JobHandler public function throwForceFailure($message = "") { throw new TaskException($message, TaskException::FORCE_FAILED); }
1
ea749398dd7d0b8411dbc584d7ea861e
3658801fe7583e4381c9cde441ec8f35
Returns all registered metadatas and prevents further registration.
namespace Evaluant.Uss.PersistenceEngine.Contracts void RegisterMetaData(params IMetaData[] metadata);
0
0c9c9bd02c60c1a09a8fa88bff3b31f1
5b0271cf652a0d1341b83e1b3ead7ab0
Check login for web socket connections
class UserWebsocket(Websocket): def websocket_connect(self, message): if not self.check_auth(): return super().websocket_connect(message)
1
c8a2e715d9725fc5e6734873789d8588
c74099c50cb5d1d248ce661c475ae436
添加商品到购物车 并且停留当前页 显示出DIV
function addGoodsCart(goods_id , goods_name , goods_price ,obj) { var _obj = $(obj); _obj.parent().find('span').show(); _obj.hide(); if(!goods_id || !goods_price || !goods_name) { return false; } $.post ( 'index.php?s=/Home/Goods/addGoodsCart' , { goods_id : goods_id , goods_name : goods_name, go...
1
cb35bda8deceacbdecf44ecf92e26a8c
f0f7ce36366d2df3439e41c7105dbc8d
Create a new Injector instance.
func NewInjector(store store.Store, templates *templates.Templates) *Injector { return &Injector{ store: store, templates: templates, } }
1
dad78e36546d351f761ef5d240bf7299
b8d237a47495c6e0734d09f3df70e4cf
Stop streaming. Will trigger an error if streaming is not active.
interface Client : Closeable fun cancelStreaming()
1
532c20aad9974a7eae668ab2616e00b7
96c545ec579f51fcd95aff0383e9610a
Copy subject to other classroom
this.courseName = otherCourse.courseName; this.courseCredits = otherCourse.courseCredits; this.courseNo = otherCourse.courseNo; }
0
2d43ca88946edf3417759fbfbe687620
fd928b10481762e584fedcd8c43233f3
Loads video file(s) selected by file dialog
{ QStringList file_names = this->view->display_open_box_video(); if(!file_names.isEmpty()) { for (int i = 0; i < file_names.size(); i++) { this->view->add_sub_window(); this->model->load_video_file(file_names[i]); this->view->display_sub_window(this->view-...
1
d935020a72b978434367da9f35b1e894
f2699bceb2db4048e61af1140adeadfa
Computes the height of the whole tree.
def computeHeight(root): if len(root.getChildren()) == 0: return 0 else: return 1 + max(map(lambda c: computeHeight(c), root.getChildren()))
1
a09ee11c18ec3f469398f0f011662a02
48693cd1576d669d7331357abdae75d3
Convert a resource ID to its canonical form. This method is used to canonicalize the resource ID before it is stored in the connector instance. The default implementation simply returns the supplied resource ID as-is.
if not resource_name.startswith( "{0}:".format(self.resource_workspace)): return '{0}:{1}'.format(self.resource_workspace, resource_name) else: return resource_name
1
d109e75ed742c5a6d79a66f1a57c09b5
17e85008041f77a14397fe2aa65cce6a
Rotate this matrix around the [axis] by [a] radians. This performs a pre-transformation, in that it is equivalent to pre-multiplying this matrix by a rotation matrix
{ float m00, m01, m10, m11; float sm00,sm01,sm10,sm11; m00 = mat[ 0]; m01 = mat[ 1]; m10 = mat[ 4], m11 = mat[ 5]; sm00 = mycos[a], sm01 = mysin[a], sm10 =-sm01, sm11 = sm00; mat[ 0] = ( sm00 * m00 ) + ( sm01 * m10 ); mat[ 4] = ( sm10 * m00 ) + ( sm11 * m10 ); mat[ 1] = ( sm00 * m01 ) + ( sm01 * m11 ); m...
1
8b17d08e500132d0a30aa3c9804aa482
345b5841290dcf5ea43f3a9dc8b0efc6
取得新后台柜台产品库存信息
DataTable WmStock( string productnumber, string productname, string stockname, string brandname, string batchno, string wdr, string mode, string colorno, out int pagecount, int pages...
1
98205c6332600db539e5cd3338fa8644
3f4ad23a1b70a8e14cbfe2b796abd53d
Convert FHIR subject, predicate and entry index into a URI. The resulting element can be substituted for the name of the target BNODE
subject: RDF.Term, predicate: RDF.Term, object: RDF.Term, graph: RDF.Term): string { const entries: {[id: string]: string} = {}; const input = [ { uri: this.subjectUri, term: subject }, { uri: this.predicateUri, term: predicate }, { uri: this.objectUri, term: object ...
1
d5a0344cfdaac22ab971b258eac2401e
e180516c01aa2a83edddcc349e0200f0
在集合末尾添加
class Collection implements Aggregate public function append($obj) { array_push($this->objs, $obj); $this->last++; }
1
4fd264ec0e5c835a2ae7048a9a5c123d
d0eca6f643f44f2a800cb9989ce44a56
Checks if the input to one of the merge operations is correct. This means whether or not any of the inputs are null. If any argument is null, an IllegalArgumentException is thrown.
throws IllegalArgumentException { if ((a == null) || (b == null) || (c == null)) { throw new IllegalArgumentException("At least One of value is null."); } BigDecimal zero = new BigDecimal("0"); if ((a.compareTo(zero) != 1) || (b.compareTo(zero) != 1) || (c.compar...
1
9c91e6262bbcd70e7c0e688197716773
2d0c8b6aea9e92635b50bc801cf7a41a
Calculates the great circle distance between two points on a sphere given there latitudes and longitudes.
public static double? GetDistanceFromLatLonKM(double? Latitude1, double? Longitude1, double? Latitude2, double? Longitude2) { throw new NotSupportedException("Direct calls are not supported."); }
0
4a0644da8566a57a2fde7eeed9a72b52
f23316c855542e845dde2d700ef6d7ed
Changes shooting angle when detecting a change in aim direction.
{ if (aimInputVector.x + aimInputVector.y != 0) { aimDirection = new Vector2(aimInputVector.x, aimInputVector.y); rigidbody2DPosition = rigidbody2D.transform.position; aimDirection = rigidbody2DPosition + aimDirection; LookAt2D(rigidbody2D.transform, a...
1
a2b44a18832316041292eb89968462d6
bf63c5c7e75a5fba4cac4a0ae55f07af
POST /empresa_transportes POST /empresa_transportes.json
class UserEmpresaTransporteController extends Controller public function indexAction() { $helpers = $this->get("app.helpers"); $em = $this->getDoctrine()->getManager(); $empresas = $em->getRepository('JHWEBUsuarioBundle:UserEmpresa')->findBy( array( 'tipoEmpresa' ...
0
42f27213fc44a6bdce486c85d113fd44
6b20a1331a2ca93242596e3925b0e37a
# Answer returned in degrees
hours2degrees <- function(hour_angle){ return(hour_angle*15) }
1
90c6890d867be514897a74c598b540c8
0dd8cf95c8f62e9502de3367bcf9c2ef
Produce an RGB unit vector corresponding to a hue of a given angle. Code adapted from Tensorflow Lucid library.
C = (1 - abs(2 * l - 1)) * s m = l - C / 2 h_ = h / 60.0 X = C * (1 - abs(h_ % 2 - 1)) r, g, b = 0, 0, 0 if 0 <= h_ <= 1: r, g, b = C, X, 0 elif 1 < h_ <= 2: r, g, b = X, C, 0 elif 2 < h_ <= 3: r, g, b = 0, C, X elif 3 < h_ <= 4: r, g, b = 0, X, C ...
1
0aae1b203b4470c958036162c6a57d33
78c0e33a3625d7719f9f760c651ccdeb
根据短信发送状态获取短信列表
@ResponseBody public Object list(String condition) { EntityWrapper<SendSms> wrapper = new EntityWrapper<>(); if (!Tool.isNull(condition)){ wrapper.eq("phone",condition); } List<SendSms> smsList = sendSmsService.selectList(wrapper); for (SendSms s :smsList){ ...
0
9e51e55ae72595470eb60daf80503128
0a36b4c5faa63e3d9b7d3414438b3f04
Wait for the claw to get to it's target
task clawHold() { int lClawErr; int rClawErr; while( true ) { while( doClawHold ) { lClawErr = (lClawTarget - SensorValue[LeftClawPot])/3; rClawErr = (rClawTarget - SensorValue[RightClawPot])/3; motor[LeftClaw] = -clipValue( lClawErr ); motor[RightClaw] = -clipValue( rClawErr ); wait1Msec( ...
0
cf7097b968b877952f3527a75e1b5981
5976ccc4170b6bae6f74577669c62b21
Read the L2 cache configuration.
{ volatile unsigned int cache_cfg; cache_cfg = DRV_Reg(MCUSYS_CFGREG_BASE); cache_cfg &= ~(0x7 << L2C_SIZE_CFG_OFF); cache_cfg |= 0x1 << L2C_SIZE_CFG_OFF; DRV_WriteReg(MCUSYS_CFGREG_BASE, cache_cfg); }
0
6ec0fc79f8204b52ebdfa2560ec86445
833736203abe5ded4bc60cbcdd212919
用循环来实现前序遍历,构建一个栈。
class Tree(object): def front_stack(self, root): if root == None: return myStack = [] node = root while node or myStack: while node: print(node.elem) myStack.append(node) node = node.lchild node = myStack...
1
019049f4187fc76904a44fcf88ec009b
d53c9ecd7ea3a0db4d2e53f3250be29c
Returns the total amount of gold the player should have, including gold from before the current game. This value is likely different from the value tracked by `DataAndSettingsManager`, because it is not saved and written until a game ends.
public class ScoreDict<K> public int getTotalGold(){return (int)_goldDict.getSum();}
1
11bebfe8550edc3c04350e46a2ea8cd5
3c6b9277507de5de733b27a57611ffff
Method responsible for initializing database based on the current weather condition
def initialize_conditions(): global dbm if dbm: dbm.initialize_conditions()
0
adb4a80dfc1bba65255d5129e2b5d85c
996788b859c030480a67bddd583ff788
The test here is: there has benn no trend, and immediate decision maker should not report anything
class DataItemTest(unittest.TestCase): def test_trend_same(self): self.assertEquals(self.data_item.compute_trend(20), 0)
1
83cfd621179da7c9cc68f7a9ec0ccfa6
a85b484e142e086d7f212cafe65b122c
div : I J -> K L Integers K and L are the quotient and remainder of dividing I by J.
public int div(int i, int j);
0
acc6d0c8c09b52cc67c40e62d9c9be21
476fae449a915376f863108194f2b32c
@brief 管理しているジョブを再帰的に全てwait
if (id > MAX_JOBS || context->jobs[id] == NULL) { return -1; } int proc_count = process_count(id,context); int wait_pid = -1, wait_count = 0; int status = 0; do { wait_pid = waitpid(-context->jobs[id]->pgid, &status, WUNTRACED); wait_count++; if (WIFEXITED(status)...
1