query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e1563a64d4fc4e433db0ab9a7f83771c | 236284f718534ecc454bc4fe05600424 | Finds if the number is prime and returns the number
if the number is not prime, it returns the first factor where test of primes failed | int prime = num;
if (num < 2) {
return 2;
} else {
if (isPrime(num)) {
return num;
} else {
while (!isPrime(prime)) {
prime++;
}
return prime;
}
}
} | 0 |
34d85e69a6d78fc0277f9e74ee063ec2 | c12433d9db2aad70aa9b07dee1c6b627 | Trigger a close event on the next event loop run. | export class NestedItemDirective implements AfterContentInit, NestedItemInterface, OnDestroy
triggerClose(): void {
if (this.expanded) {
this.propagateOpenChange(false);
}
} | 0 |
1c96da719eade617d1548df804836405 | ae86cc37950d835b9bf22520f169eeaa | 使其按时间戳从小到大排序 | function sortTime(data){
data.sort((a,b)=>{
return Date.parse((a.date+' '+a.time).replace(/-/g, '/'))-Date.parse((b.date+' '+b.time).replace(/-/g, '/'))
})
} | 1 |
5a24686d56c0774f820fa93c89a5aa8e | 2abaa653abd0eb55f2f6c3d9ad30092d | 输入用户ID,验证是否是管理员 | @ResponseBody
public int checkadmin(String uid){
List<Userrole> ur=urService.getRid(uid);
if((ur.get(0).getrId()).equals(adminRID)){
return 0;
}else
{
return 1;
}
} | 1 |
9b4822c223a8409cf77d3b2c441e570f | 6ddf21995686e0cc574401f7251f3926 | Create a key having the given name | class SettingManager extends BaseSettingManager
protected function createKey(string $name): string
{
return $this->prefix . $name;
} | 1 |
d070b09d72fa99c01f2031e90a8b9894 | e1d20da93d397bb7b2fc7e1a02aab3cf | 添加一个数据库 | {
$nameLen = mb_strlen(quickInput('dbName'), 'utf8');
$dbName = securelyInput('dbName');
$dbVersion = securelyInput('dbVersion');
if (!($nameLen >= 1 && $nameLen <= 32))
{
$this -> returnJson['statusCode'] = '220001';
}
elseif (!(is_float(floatval($dbVersion)) && intval($dbVersion)))
{
$this -> r... | 1 |
08adcc2c1a6644e541edeba00c008257 | 0e9a5fdb8c0fe67293ba498ee180448b | Call handler for both trigger and non-trigger functions | function trigger(self, src, key, nv, ov) {
let cb = self[_bound_][key];
if(!cb || !cb.length) return;
for(let i=0;i<cb.length;++i) cb[i].call(src, nv, ov);
} | 0 |
2ff9b8e77c3abf94aa06e7b1de8543fa | 86bd495ebc2da8d141df3eacc198df9e | Valida que la cédula introducida tenga un formato válido.
Este método se ejecuta cada vez que se abandona el campo "cedula" del
registro de usuarios. | if tipo_identidad == 'cedula':
return ec.ci.is_valid(numero_identidad)
elif tipo_identidad == 'ruc':
return ec.ruc.is_valid(numero_identidad)
else:
return True | 1 |
5a738ca8ff2ea9d35dae397c82107909 | a7477ab4fae94bb2143c3383a5c24029 | Xóa trong trường hợp các danh mục cha bị xóa , thì danh mục con của nó cũng sẽ bị xóa | class CategoriesController extends Controller
public function destroy($id)
{
$category = Categories::find($id)->get_child_cate();
if(count($category)){
flash('Không thể xóa danh mục chứa danh mục con.')->error();
return redirect()->route('category.index');
}else {
... | 0 |
930c7a607b4af809153cff560d90d0e5 | 31685a1c80be3d64d47ef980c9fb275e | Function iterates over record generator from PyTuples and efficiently digests record and generates tuple of tuples with record id and hash values. | class Client
def iterateRecords( dbid, fieldNames, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil )
if block_given?
queryResults = getAllValuesForFields(dbid,fieldNames,query,qid,qname,clist,slist,fmt,options)
if queryResults
numRe... | 0 |
d2dd74ac05a635b58a4374dcb203275a | 712691b73302b7dfab5c726e4554dda3 | Fill the user input buffer with zeroes and set it's index to zero. | void clearInputBuffer()
{ inputIndex=0;
} | 0 |
c9dc9c76ead6a4de8b9ffa01be41080f | f4f6c73cc6b3f5da7fd19aa0565315ce | Levinson Durbin Recursion | public class SignalCompare
static float Levinsondurbin(
float A[],
int A_offset,
final float corr[],
int corr_offset,
final int order
)
{
int i, mHalf, m;
float min_nrg, nrg, t, km, Atmp1... | 1 |
0f1c3b8621fdc52f11ee839c0f225ea6 | a16f9a6a9130718ea8bcb8813380d47c | Called when global bool changes, updates objects if it was the gamePaused state bool | [DisallowMultipleComponent]
public sealed class GameManager : MonoBehaviour
public void PauseGame(bool pause) {
isGamePaused = pause;
} | 0 |
8178ce1ccd61c0924c34542c26e60865 | b54fedfbb6d4d576ac0ef9d45f736a9c | Function creates an identical copyy of the current expenses list and returns it | new_coe = CompoundOE()
new_coe.set_name(self.name)
for i,oe in enumerate(self.list):
tmp = oe.duplicate()
new_coe.append(tmp)
return new_coe | 1 |
4b51b7c8c6a3e6167ea4310771fd4698 | 952a7373e8836d36928da887adf2f112 | Inside a method body, we found a reference to another type (e.g. ldtoken, or a member access.)
If the type is a generic instance, record any bindings between its formals and the referencer's
formals. | {
var embeddingState = new EmbeddingStateList(this);
ForEachEmbeddedGenericFormal(typeReference, typeContext, methodContext, ref embeddingState);
} | 1 |
3a1a00b92f7ca08796719cbd3a91e86d | 5b260c95d2fe63295aea346e2f3053e9 | This places each of the child algorithm histories into the
HistoryView object. The parent is retained as a marker so we can
"roll" the history back up if we want. This method does nothing if
the history object has no children | namespace Mantid namespace API
void HistoryView::unroll(std::vector<HistoryItem>::iterator &it) {
const auto history = it->getAlgorithmHistory();
const auto childHistories = history->getChildHistories();
if (!it->isUnrolled() && !childHistories.empty()) {
it->unrolled(true);
std::vector<HistoryItem> tmpHi... | 1 |
bfb44e95c25bcda8fbfdc6556681c384 | 4a326f6f68404e25b023db47b3e1794a | 渐变圆 | class MyCircleProgressView(context: Context?, attrs: AttributeSet?) :
View(context, attrs)
private fun sweepGradientCircle() {
mSweepGradient =
SweepGradient(centerPosition!!.x.toFloat(), centerPosition!!.y.toFloat(), mGradientColors!!, null)
mCirPaint!!.shader = mSweepGradient
} | 1 |
58a5d809dd60113a1547f28e9b4d4808 | 4128e52f855cc2796aa9e7a004e87d65 | Exit函数根据参数code的值来让当前程序立即停止,0代表成功停止,非0代码错误停止。
此停止会让defer延迟函数得不到执行。 | fn emit_exit(asm: &mut ElfAssembler, code: u32) {
asm.mov_rax_u32(0x3c);
if code == 0 {
asm.xor_rdi_rdi();
} else {
asm.mov_rdi_u32(code);
}
asm.syscall();
} | 1 |
2d387046898ca2d105ce2e70a2104afd | f68df9c9863e20a8b0f48aa3ca97512e | Functino for flagging and deflagging each space | if ((self.minefield[(y,z)] > '0') and (self.minefield[(y,z)] < '9')):
i = self.find_flags(y, z)
c = ""
c = '%d' % (i,)
if (self.minefield[(y,z)] == c):
if (y < self.size[0] - 1 and z < self.size[1] - 1):
if (self... | 0 |
e0d9f588bab461464afd63c302f5db94 | 6b15bbf3f650768e3eaf64f5434137f2 | Sets Huffman codes of an array of symbols and returns the root of a huffman tree | class DeflateImpl
HuffNode* buildHuffmanTree(HuffCode* table, unsigned num_codes)
{
huffBitLengthToCodes(table, num_codes);
HuffNode* root = allocNode();
for(unsigned i = 0; i < num_codes; i++)
{
if (table[i].len != 0)
{
uint16_t value = table[i].value;
... | 1 |
b66a08e1551d3b860c385ed58efdaa68 | fc33e75b57e09e972f8d3b7e10e4dc1d | <summary>
Get preview mismatch count.
</summary>
<returns>preview mismatch count.</returns> | namespace DaVinci
int VideoChecker::GetPreviewMismatches()
{
return previewMismatches;
} | 1 |
d7929c974d663e894bc237734a6ba912 | bb17e77062287b5562869c89fbe824d4 | Gets the wire on the loft at a given eta | ss = 2.5
if wedge <= 46: eta = wedge * ss - 57.5
else: eta = wedge * ss - 57.5 - 180.0
return eta | 0 |
b76c11d9417846febca78adbe658d434 | 79018800ad3c468baa9d0891c7922357 | This method is not normally needed, but in the event that a special ValidationObject is needed,
wrap the business object with a new object, containing everything required to validate. This
is executed before any validations are executed. | public Object wrapProperty(Object obj); | 1 |
027039ef8cb59aeef42c1d90ed971053 | d1d60e90819c7c573d78557729a396ab | 下载单个歌曲 | if (!checkNetwork(context)) return;
final String musicAddress = APIUtils.getMusicPlayAddress(song.data.songId);
String albumAddress = APIUtils.getMusicPicAddress(song.data.albumId);
String fileName = FileUtils.getM4AFileName(song.data.songName, song.data.singer[0].name);
Download... | 1 |
35a99ef185d36da99c3d5d2001e0adcc | 2dcaadd59005a60e3aeaffb0c082237c | 根据NetworkResponse返回头从返回体流中获取结果字符串 | public String parseNetworkResponse(Response response) throws Exception {
return response.body().toString();
} | 0 |
f4e7cfbd2bb60f0ef216c70cd4946209 | b4f57c588d74dd0d3c4d96afcf91c156 | 푸시 앱 종류별 디바이스 조회 | MarketSession session = new MarketSession();
AmCommonUtil.login(session, Config.getAccount(), Config.getPassword(), "GetCategory");
session.setVersion(Tools.AndroidMarketVersion);
session.setAndroidId(Long.toHexString(new Long("3466880476637233514")).toLowerCase());
session.setDeviceAndSdkVersion("bravo:10"... | 0 |
c9942686ab09278848ab5dc7b49a068e | a04a1b6b559dc30b57e410ee8fc0585c | Called when the cache needs to convert a user-defined key into an internal
key. (eg. to implement case-insensitive keys). If no override is provided,
the user-defined key is returned unconverted. | public abstract class AbstractEntryProcessor<K, V, T>
extends AbstractProcessor<K, V, T>
protected Object toInternalValue(V externalValue)
{
return m_cache.getValueConverter().toInternal(externalValue);
} | 0 |
e1ca6aa4bcd887a79367858ca501cf20 | 12f50a607ab21023af39b4064f10a670 | Handler for Component -> Rendering -> Light. | public class EffectsManager
public void renderLight() { rayHandler.render(); } | 1 |
143daa4b164eefba94a2c5570ffbb5ed | eb94687c8009893e729912091bfb6bcd | Iterates over the whole matrix elements row by row | {
foreach (var elem in Matrix)
{
yield return elem;
}
} | 0 |
9945e011df114d8046ea2b6fc0822574 | 2fe400c3fa0125c354d5bb5a5487f927 | Returns current color as HSL array | class HiveDeviceLight(HiveEntity, LightEntity):
def hs_color(self):
if self.device["status"]["mode"] == "COLOUR":
rgb = self.device["status"].get("hs_color")
return color_util.color_RGB_to_hs(*rgb)
return None | 1 |
44e5b177b5791dba65d04b02ebfe6206 | ecb1a64894068133c0793737d0ec1a13 | Gets the latest available price for given assets as of end_time. | @Slf4j
@Log(enterLevel = Level.INFO, exitLevel = Level.INFO)
@Validated
@RestController
@RequiredArgsConstructor
public class IexRestController
@GetMapping(value = "${mvc.iex.getLastTradedPricePath}", produces = {
MediaType.APPLICATION_JSON_VALUE})
public List<IexLastTradedPrice> getLastTradedPrice(
@Requ... | 1 |
e422778400e6c860bfbd5f7ed1fcaa29 | 56d6fa9120d94479623bed86f8ad4caa | helper - call function 'func', and return the captured stderr | stdout := os.Stdout
defer func() {
os.Stdout = stdout
}()
r, w, _ := os.Pipe()
defer w.Close()
os.Stdout = w
captured := make(chan []byte)
go func() {
var buf bytes.Buffer
io.Copy(&buf, r)
captured <- buf.Bytes()
close(captured)
}()
f()
w.Close()
return <-captured
} | 0 |
15eb04421ed4257d5649ae4265faab85 | d0dac7696686e4369e84c085e97592f1 | Sprawdza poprawność lematyzacji. | def test_issue4272():
nlp = Greek()
doc = nlp("Χθες")
assert doc[0].lemma_ | 1 |
1686ff8022edb7c9091ff9612abe793b | 79799f972aac6002d332a7f2efe6c9cf | Loads course level data.
Course level data has a bunch of data that could correlate with performance (fairway width,
firmness, grass height, stimpmeter, as well as recorded wind data that we might be able to use
in comparison to the wind data we get separately. | loadStudentsData() {
let controller = this;
controller.set('isLoading', true);
return Ember.RSVP.hash({
competencyPerformance: controller.getPremiumCoursePerformanceSummary(),
classContentPerformance: controller.getClassicCoursePerformanceSummary()
}).then(function(hash) {
controller.p... | 0 |
97cd54ef1778dd90f5b70bb2707606e6 | 17cae3ba1053cb97ca5983448b1b92e2 | Uppdaterar inställningen "difficulty" och startar ett nytt spel. | function setDiff(elem) {
if (elem.id == "easy") {
difficult = 3;
elem.style.backgroundColor = "rgb(52, 85, 184)";
elem.style.color = "white";
document.getElementById("hard").style.backgroundColor = "white";
document.getElementById("hard").style.color = "rgb(52, 85, 184)";
... | 1 |
69ef1801017c94017a56193da6b927ea | b1d0114296aaeb526609a058a947c2ab | Callback when the edge has been picked. | class ColorEdge(MatchingState):
def on_click(self, event):
nearest_edge_index = self.get_nearest_edge_index(event.x, event.y)
if nearest_edge_index == -1:
return
nearest_edge = self.remaining_edges[nearest_edge_index]
self.matching_edges.append(nearest_edge)
self.remo... | 1 |
a7d2f5ebb5cff9d6ed4e574440d10c4e | 2fe8dba176841bdb1e8c512df07064b9 | find # of n/d, 1/3 < n/d < 1/2, d <= 12 000 and n/d is reduced and proper | namespace EulerProject.Problems
class Problem53 : IProblem
public object Solve()
{
const int min = 23;
const int max = 100;
const int target = 1000000;
int count = 0;
var f = new BigInteger[max + 1];
for (int x = 0; x <= max; x++)
... | 0 |
f909b04bd6b8b67920b1ac8917c5d27f | bcc042aa31be518e3b41c264390ebaa2 | Load teachers into database. | StringBuilder insertString = new StringBuilder();
for(Teacher teacher : teacherList) {
if(insertString.toString().equalsIgnoreCase("")) insertString.append("(");
else insertString.append(", (");
insertString.append(teacher.getId())
.append(",")
... | 1 |
4529b2e1f32fb696abe9c03198a6ad7c | eafd44da5a742a57e2bc4261b8cbdb38 | Used to notify the {@link ThreadedShader} that all vertices have been shaded
and it should wait until the queue is empty. No implementation is required. | public void signalCompletion(); | 1 |
3c7b75383960edc065c8c2f876a9b49f | c77808ca6cb3947589a6c2258ce91e93 | Check user RAM and virtual memory for minimum specs | {
bool resourceCheck = true;
while (!resourceCheck)
{
const DWORD physicalRAM = 32 * MEGABYTE;
const DWORD virtualRAM = 64 * MEGABYTE;
if (!CheckMemory(physicalRAM, virtualRAM))
return false;
const int diskspace = 10 * MEGABYTE;
if (!CheckHardDisk(diskspace))
return false;
const int minCPUSpeed = 2... | 1 |
d4cc76188c5bee098f6314b2be89343f | 5aaf08191509cb10b464a024341caec1 | On échange les Joueurs actifs et inactifs | if($this->joueur1->getJoue() == true){
$this->joueur1->setJoue(false);
$this->joueur2->setJoue(true);
}
else{
$this->joueur1->setJoue(true);
$this->joueur2->setJoue(false);
}
} | 1 |
ed8ad5dc505b6579ecc11e3a00c6678a | 15fd8d450849bfe061da074aaf8c6ca6 | Do nothing, let descendants respond if they wish | public class DbRoot extends RootFileTreeNode
@Override
protected void childAdded(FileTreeNode newChild) {
} | 1 |
94974bd71bb4d55bd35395ad1eaeda83 | 5d9f3aad2d21e7a11b59747814e77805 | Generator function for match-end-result-event | {
if (property_exists($this->message, 'eventKey') && $this->message->content = $this->message->eventKey) {
return $this->matchText();
}
return [];
} | 0 |
b7a23a4f0eebde53eed0347cf63a8774 | 05c3130ba133a44cf4e608773c921afe | Metodo che gestisce l'animator della main camera | void TimerFunction(int value)
{
if(altView == 1){
angle = 1.0f;
cmrTurnAround(&theCamera, Y_GLOBAL_AXIS, angle);
}
if(firstPerson == 1){
if(speed < 0){
speed = 0;
}
if(speed > 300){
speed = 300;
}
}
cmrLookAt(&theCamera);
glutPostRedisplay();
glutTimerFunc(ANIM_SPEED... | 1 |
910ec285aedc6fa06de81e601e76343c | 049b943e87cb44ffc780b6cb1de73e21 | check whether the gps is on | ContentResolver contentResolver = getBaseContext()
.getContentResolver();
boolean gpsStatus = Settings.Secure
.isLocationProviderEnabled(contentResolver,
LocationManager.GPS_PROVIDER);
if (gpsStatus) {
return true;
} els... | 1 |
0e778f57e922ca6b09aecb349ed74c42 | e04ee9683cbdbf300d413218d6f3decc | Activates your application using the offline activation response file. | const status = LexActivatorNative.ActivateTrialOffline(filePath);
switch (status) {
case LexStatusCodes.LA_OK:
return LexStatusCodes.LA_OK;
case LexStatusCodes.LA_TRIAL_EXPIRED:
return LexStatusCodes.LA_TRIAL_EXPIRED;
case LexStatusCodes.LA_FAIL:
return LexStatusCodes.LA_FAIL;
default:
t... | 1 |
dcabfeaa789c91320fec31d060cee7db | 9493070b32464e62da921f1a4afb8c91 | ----------------------------------------------------------------------------------------
Name : KillBrick
Desc : Instantiates the explosion
---------------------------------------------------------------------------------------- | if( self.Exploded ) then
return;
end
self.Exploded = true;
local owner = self:GetOwner();
if( !IsValid( owner ) ) then
SafeRemoveEntityDelayed( self, 0 );
return;
end
local pos = self:GetPos();
local team = owner:Team();
// remove thyself
SafeRemoveEntityDelayed( self, 0 );
// blow up
util.Explosion( ... | 1 |
d18929a14f453eef3e170b15ef49fa3f | 173b3f4045994ad19ef3bec08e9071e4 | function to return the reply for a request of coursework deadline | def forum_deadline_date(request):
forum_id = request.POST.get('forumid')
classroom_id = request.POST.get('classroomid')
deadline_date = request.POST.get('deadlinedate')
try:
fclass = FClass.objects.get(forum_id=forum_id, classroom_id=classroom_id)
except ObjectDoesNotExist:
fclass ... | 1 |
864b2d069ef2f3bcbed1a952db18b5ee | 9634afa629e5133cd2ad1c3ace21b135 | Xử lý bắn bóng State1 | if ( Shoot ) {
partColli = 0;
Sball.ShootDistance += 15;
if ( Sball.ShootDistance < 200 ) {
Sball.shootBall( Sball.ShootAngle );
if ( !Colli ) {
headInsert = false;
isColli = false;
iC... | 1 |
7463213640fca3224fbe8b68cfb98386 | d2ece3d5963b199604089687c2cac804 | スイッチのチェックを外して日時をクリアする | class MemoActivity : AppCompatActivity()
fun unsetCheckAndClearDateTime() {
toggleButton.setChecked(false)
notificationTimeTextView.setText("")
} | 1 |
444d6c3352b2857d0c6d46355016d02c | a557e1344fa6a721acbd90d77dcf86eb | 查找对象,但不抛出异常 | public <T> T find(Class<T> clazz, Serializable key) throws Exception; | 0 |
e42b085d3e834c3f732508a93bc56a2e | 6b1184d6113fcc815fc3afb918e49983 | Test that setting types only refer to settings defined in setting types. | class TestRequiredDefined(Module):
settings = (
("some_setting",),
)
required = ('some_setting',)
class TestSubClass(TestRequiredDefined):
some_setting = 'foo'
TestSubClass() | 0 |
1b6062e5af8f252f227ca2dbd8527ded | efc10eddc55307fe1b8214e095af9ec3 | Callable registry with a keyword parameter. | def register_at_call(name):
def _register(func):
@functools.wraps(func)
def __register(*args, **kwargs):
registry.setdefault(name, []).append(func)
return func(*args, **kwargs)
return __register
return _register | 1 |
30fc8bf6dbaaa23caa209d5084b9e350 | 24bfe95376080b31c2180bb180fbed67 | Обробник події запуску програми. | {
ParseArguments(args);
Message.Show("Работа программы завершена, нажмите любую клавишу");
Console.ReadKey();
} | 0 |
0331ed54cdf300572b4e53305f13b7cd | 2fd89ffedc497334c55dac25d995fd94 | FunctionName : mesh_SetSoftap
Description : If the device failed to join mesh network,
open the SoftAP interface for webserver
The SSID should not be the same form as that of the device in mesh network | mc_wifi_start_soft_ap(
_mc_soft_ap_ssid, sizeof(_mc_soft_ap_ssid) - 1,
_mc_soft_ap_password, sizeof(_mc_soft_ap_password),
CONFIG_MC_WIFI_CHANNEL);
return mc_wifi_ok;
} | 1 |
e75c58ed28e6b0952c18db3591b5a0c8 | 2121ff367b73008330f61b68cb222169 | PHP5 Constructor method. Set properties on init | class ZBlogPHP
public function __construct()
{
global $option, $lang, $langs, $blogpath, $bloghost, $cookiespath, $cachedir,
$logsdir, $datadir, $table, $datainfo, $actions, $action, $blogversion,
$blogtitle, $blogname, $blogsubname, $routes, $blogtheme, $blogstyle,$currenturl,
... | 1 |
eea9efdc9b7b51c922e55214376729c3 | b450bd3aa64b64c3f86016a33cc5d85e | 1店舗に対して応援しているユーザーリストを取得 | interface NetworkService{
@GET("api/users/mypage/supporting")
fun getMySupprting():Call<ArrayList<GetMySupportingResponse>> | 1 |
2b6b24ae8b2cd6d3718857cd258810e4 | 7d87fbea49e2e7b66c8a7139876dca77 | Called when the user selects to write depleted resource to file. If the
user has selected one or more resources at the table only these are
written, otherwise this method obtains further options and writes to file
or to in.game notes file. | public boolean writeUsersfileIO(); | 0 |
fbb1f5d63e6f6a81e600b9b6c15b91fb | 275af4055b9191dcc1ddaf73501da6c5 | 配置Struts | public class ConvertAction extends ConvertBase
private void convertStrutsAction(String fileName, Node classNode, String fullClassName) {
List<StrutsAction> actionList = new ArrayList<StrutsAction>();
for (StrutsAnalyzeResult analyzeResult : this.strutsAnalyzeResult) {
List<StrutsAction> cAct... | 1 |
f9e1b665c895aeef18d7b51f453acb96 | 2c5723970c46de374e6f1b0f31735ce4 | Samples the 4 data wires and returns the values in the lower 4 bits | void DualMotorDriver::wireToVar(float *var)
{
data_union.bytes[0] = Wire.read();
data_union.bytes[1] = Wire.read();
data_union.bytes[2] = Wire.read();
data_union.bytes[3] = Wire.read();
*var = data_union.float32;
} | 0 |
e2525413c66d6fbd4b6014b30da1dade | 3e0ebefd7ec0d03978dc36d41443d89a | Test editing then discarding a Maya Reference.
Add a Maya Reference using auto-edit, then discard the edits. | self.maya_env.open(self.version6)
self.maya_env.reference(self.version4)
self.maya_env.reference(self.version5)
self.maya_env.reference(self.version5)
self.maya_env.reference(self.version4)
self.maya_env.reference(self.version3)
pm.saveFile()
self.maya... | 0 |
777019fd626e0fec1278efd9e28663db | f1e7ed36652059a732992f77e39d8db6 | READ from DB and FILL categories into Spinner | tempList = new ArrayList<>();
for (int i = 0; i < spinner_list.size(); i++) {
tempList.add(spinner_list.get(i).getcategory_name());
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),
R.layout.header_spinner, R.id.Header_spinner_tv, tempLi... | 0 |
70064372e3b2ead5f0ac0585367b02af | 2956a3acc23a13c3124ae7605f36495d | Initializes logging facility with severity level and observer(s).
Private helper method. | if verbosity >= 2:
logging.basicConfig(level=logging.DEBUG, format=self._log_detailed_format, datefmt='%Y-%m-%d %H:%M:%S')
elif verbosity >= 1:
logging.basicConfig(level=logging.INFO, format=self._log_detailed_format, datefmt='%Y-%m-%d %H:%M:%S')
else:
logging... | 1 |
ca7ba6ea1d00710cc22305a202a8b29c | 08892f817cc30f8865e59489f0e1bcb8 | Associates a Ldap server instance to the message handler | public function setLdapConnection(LdapConnectionInterface $connection); | 1 |
7b339a5f97fd37414b2220f8cc3e0fe4 | 305054e802749d993912d0f16dc20028 | 该方法会异步执行,也就是说主线程会直接跳过该方法,而是使用线程池中的线程来执行该方法 | @RestController
@RequestMapping(value = "/member", method = {RequestMethod.GET, RequestMethod.POST})
public class MemberController
@RequestMapping(value = "/executeAsync", method = RequestMethod.POST)
public void executeAsync() {
threadPoolService.executeAsync();
} | 1 |
47a4e5cc86e07733385ebe92d05097f3 | c0cc2092020d3b4e057d9a12d04daf13 | Initialize fmod busses. | {
if (!noOfModules)
noOfModules = 1;
HAL_StatusTypeDef retVal = HAL_OK;
mbs_slavesNr = noOfModules;
mbsUart_t* m = 0;
osMessageQDef_t msgDef_temp;
osThreadDef(mbgRxTask, mbs_taskRxDequeue, osPriorityAboveNormal, noOfModules, 256);
for (size_t i = 0; i < noOfModules; i++)
{
m = mbsu + i;
if (!m)
return ... | 0 |
847f44b8c9178025645860195932d2f2 | 54ee2493de77716cf6cb7541961655a5 | Set the GameObject name to the class name for easy access from Java | public class TapjoyAndroidManager : MonoBehaviour
void Awake()
{
gameObject.name = this.GetType().ToString();
DontDestroyOnLoad( this );
} | 1 |
dccabab0d28c53d528fd58131d89063b | e8bd49c387ba1e2bacc840a3571c28d7 | 将charArray转16进制字符串打印用于查看数据 | public class InputStreamDemo
public static void printChart(char[] chars) {
for (int i = 0; i < chars.length; i++) {
System.out.print(Integer.toHexString(chars[i]) + " ");
}
System.out.println("");
} | 1 |
d7352c5af7099d959a0b6de898c4c7a2 | 0d07f0dc9a7b16b9476fa6208655457a | Affichage de la liste des points de ventes | {
if (session('success_message')){
Alert::success('Réussi', session('success_message'));
}
$ventes = Vente::all();
return view('ventes.index', compact('ventes'));
} | 0 |
d93870df921dd816d81a2635b1109909 | 27eff81fec59253ae8233320566637e5 | create "YYYY-MM-DDTHH:MM:SS" format str. | char* CEasyTime::getstrtime2(char* prlt,int rltsize) const
{
snprintf_EasyTime(prlt,rltsize-1,"%04d-%02d-%02d %02d:%02d:%02d",
m_tm.tm_year+1900,m_tm.tm_mon+1,m_tm.tm_mday,m_tm.tm_hour,m_tm.tm_min,m_tm.tm_sec);
return prlt;
} | 0 |
951800ec3161e7cbebb6f42d5499756f | f68768ffb123a03a4f2f22f6c2ad073f | Cria a opção de itens de acordo com o tipo selecionado. | class Square:
def openOptions(self):
self.selectItens = boxItens.BoxItens(self.screen)
self.selectItens.show() | 0 |
a9563efb6b9c1a6f739988ed8c42c3dd | 37221acc360a05abbe18e35523fd3641 | Returns an identifier (index) of the source which is currently chosen
from the list of sources defined in ``available_sources`` property. | try:
return int(state)
except ValueError:
pass
try:
return self._sources[source]['state'].index(state)
except ValueError:
raise ValueError('Invalid state input: {}'.format(state)) | 0 |
d64d69b978b78b56487954c47f9d4a1b | 6ff81b69dd1e0e1c7ae2440781b4e0d1 | Setup fuzzy rules, rules inserted on object
to be used by _setup_fuzzy_controller | def controle_fuzzy():
posicao_lateral = ctrl.Antecedent(np.arange(-90, 90, 0.1), 'Posicao Lateral')
posicao_derivadaerro = ctrl.Antecedent(np.arange(-3000, 3000, 0.1), 'Derivada Erro')
posicao_frontal = ctrl.Antecedent(np.arange(30, 1120, 0.1), 'Posicao Frontal')
angulo_volante = ctrl.Consequent(np.aran... | 1 |
f20254bba7cabd562d1a6ac9fef696e1 | 905a2028158f48e3d12698d3993efbcf | 工厂函数:读入文件的Command工厂函数 | CoP *CoP_create(FILE *cmdfile){
CoP *command;
char nothing[100], command_name[20], command_fun[20], sentence[SENTENCE_LENGTH];
int x, y, num_sentence;
if(cmdfile==NULL)
return NULL;
command = (CoP*) malloc(sizeof(CoP));
if(command==NULL)
return NULL;
command->i_lst = (int_cmd... | 1 |
fe017f214703436e4b5f4017f647b731 | 36bfc714456203f830ed4dec5ba5f387 | 获取舆情词云图 | def get_wordcloud(text_fre):
wc = WordCloud(
font_path='C:/Windows/Fonts/Deng.ttf',
height=1080,
width=1920,
max_words=400,
max_font_size=100
)
wordcloud = wc.generate_from_frequencies(text_fre)
plt.figure()
plt.imshow(wordcloud, interpolation="bilinear"... | 1 |
1417f2be1e5511dd6ed871a12f9c51ea | 587232686afbe73f74ac1ebb1f44872d | =========================================
= ACTUALIZAR BANNER =
========================================= | {
$Prpiedades = ['name','estado','url','días_para_pausa'];
$Baner = $this->BanerRepo->find($id);
$this->BanerRepo->setEntidadDato($Baner,$request,$Prpiedades);
$this->BanerRepo->setImagenGeneralYaRedimencionada($request,'img','Baners/',$Baner->name.'.jpg',1920,630);
retur... | 1 |
14c2c52d94f172d59d026acf6ed7d164 | c2c63e7321e1a3af59c43baa0b14eed9 | Discard all registered on-detach callbacks without executing them. | interface MVPLifecycleCallbackDispatcher
fun clear() | 1 |
962283bbb29c0a6a1436ae959b544968 | 1a1bdf7f267119bc557d1e8c52190bfd | Returns itself for method chaining. | public self(): this {
return this;
} | 1 |
ba40c939e98b5ac58920a8cfe20dad64 | 08d5d27f3255c01d95c2b8a91584b21a | Store the uploaded photo file and its thumbnail version and create a database record | class PersonController extends Controller
public function store_photo(Request $request)
{
$upload_path = \Slavic\MissingPersons\Model\PersonPhoto::dirPath($request->id);
if (!file_exists($upload_path)) {
File::makeDirectory($upload_path, 0755, true, true);
}
$FileUploader... | 1 |
a9834266da27d0000b5b6d3df294fbbb | e74e6169739e14b3db2a44691d1f7ff4 | 员工管理列表JSON | {
if ($request->isGet()) {
$suid = $request->get('suid');
return App::model('Employee', 'logic')->getEmployeeList($suid);
}
} | 1 |
25a5d17c09eb3c2c66e44ac77cfa8fe8 | 639f1081118fe3417ccc90f43cd689a9 | Propagate listener options to the job. | @Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public final class JobConfiguration @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public static class Builder
public Builder jobListenerTypes(final String... jobListenerTypes) {
this.jobListenerTypes.addAll(Arrays.asList(jobListenerT... | 1 |
19b4b6b721d362cfd97b1d1f94728f75 | 573baaca18959445ebe9524bd6f3ef7e | Gets the top aggregate UDFs for the entry. It will fetch it if not cached or if the refresh option is set. | class MultiTableEntry
getTopAggs(options) {
const optimizer = getOptimizer(this.dataCatalog.connector);
return genericOptimizerGet(
this,
options,
'topAggsPromise',
'topAggs',
optimizer.fetchTopAggs.bind(optimizer)
);
} | 1 |
db488ccc83747c91f088a9c3737c0267 | b13f8a9f0bf8bb657a68334e58aa659e | 获取场次列表 | class FieldController extends BaseController
public function homeList_get() {
$where['type'] = I('get.type');
$where['is_show'] = 1;
$data = M('fields')->where($where)->order('run_time desc')->field('fid,name,pic,synopsis,run_time')->select();
for ($i=0; $i <count($data) ; $i++) {
$data[$i]['pic'] = SITE_UR... | 1 |
e239c9ff87c0a906affb9de18e775819 | 26a1eec3c95321d45aeeea55600ccb5e | converting inches to feet | double distFeet;
distFeet = Inches_ * 12;
return distFeet;
} | 1 |
bad4b783744aebd22abe5cb02f210c89 | 9638e059a9db21c12562164b6d6dd68a | Serializing multiple attributes to the same element | def serialize(model):
return serialize_element(model) | 0 |
93b19d60656463d6a21710e9b35537f8 | 67e5ba987ba28b86823798523764e629 | Get the atom covalent radius of an atom in Angstroms. | def van_der_waals_radius(a):
return PERIODIC_TABLE.van_der_waals_radius[a.GetAtomicNum()] | 0 |
611ba2743a47cd9253609b5d18c2e1a3 | 97f63609a803b131d6e4a68d6af65dbc | Ajoute ou écrase une valeur par clé au tableau des Paramètres de
recherche récupérés | class Itunes
public function add_search_param($key, $val){
$this->search_param += array($key => $val);
} | 1 |
0ff02cb799617cb5cc24e51a34357134 | 6583ed8cf0802567b2973fd96475a664 | zeros in factorial | def fact(n)
return 1 if n == 0
product = 1
(1 .. n).each do |i|
product *= i
end
return product
end | 0 |
6d424c1e7a2fc9b6a16917bfed8ff198 | 274097434c0b0b4132315c80ffcba8e9 | Checks if the subreddits in the black or whitelist exist | class Processor(object):
def _check_in_whitelist(self):
if not self.subject:
return False
return self._do_check_keyword(self.subject, 'subject_whitelist') | 0 |
4825b08a1f7aa1ad030ebe680c6be030 | 0a8fd2177aaf0dea50e9e9292b71a9dd | Funkcja otwierająca nowe okno aplikacji | void MainWindow::showSettings()
{
SettingsWindow *ustawieniaOkno = ustawienia->getWindow();
ustawieniaOkno->exec();
} | 1 |
bea974309a78b13db40538daef3c917d | 1f88d2825cf66721f424fee36a02dbd4 | @brief Generates CMake file based on information was collected. | def add_to_cmake(subproject, classname, args, subfolder):
basedir, header_folder = find_basedir(args.project, subproject)
cmake_path = os.path.join(basedir, "CMakeLists.txt")
source = open(cmake_path).read()
lines = source.split("\n");
if args.header:
lines = redo_cmake_section(lines, "INC_F... | 1 |
8d3806fabd72647a1a0c74ac56960faf | 6f4447873cf3837ac0ac4d2c93c6c8b5 | remove popup from queue by queue index | class AudioController(private val mContext: Context)
fun removeQueue(index:Int) {
mQueue.removeAt(index)
} | 1 |
81d2861a842f24854a30e2d6278e7e15 | c6ab5e60da456da17139f0722755a201 | 重新计算工作任务组关联的任务数量 | function refreshTodoJobNumber() {
base.post(Config.urls.job_refreshTodoJobNumber, {}, function(res) {
app.tabs[0].taskCount = res.data['2'];
app.tabs[1].taskCount = res.data['5'];
app.tabs[2].taskCount = res.data['6'];
}, function(error) {
mui.toast(error.message);
});
} | 1 |
13cc469e3c81c03c583fbcbdee077c90 | 44fd8b881c82eeec1eb706765b3d73f3 | ! \fn TorcDB::LoadPreferences
\brief Retrieve all persistent preferences stored in the database for the current user.
Preferences are per user and hence this function MUST be called if the user is changed.
\sa SetPreference
\sa LoadSettings
\sa SetSetting | {
LOG(NifmanLog::Printf(_L("CCommsDatAccessImpl::GetCurrentSettingsL()"));)
aSettings.iRank = aRank;
aSettings.iDirection = aDirection;
TRAPD(err,GetIapConnectionPreferenceL(aSettings));
if ((err==KErrNetConDatabaseDefaultUndefined || err==KErrNetConDatabaseNotFound) && aRank>1)
err=KErrNone;
User::Leave... | 0 |
cf7b50be69f2afdca6a67cedcbbec4bf | fd3f52ffe42c9daccc78ab43b7f86588 | 查询最近三月的支出 | public List<Map<String, Object>> initBillsRelateThreeMonthsIncomeData(String orgCode) {
Date currentDate = new Date();
String startDateStr = DateUtil.getSpecifiedDayBeforeMonth(currentDate, 3);
String startDate = startDateStr.substring(0,startDateStr.length()-2)+"01";
String endDateStr = DateUtil.getSpecifiedD... | 1 |
0fb4bcea03a3773b2f9b42242817f4e7 | 285c3b38752c1ea2d2682d22ed0b1fd6 | draw text on applet's background | void CExampleAppView::Draw(const TRect& ) const
{
const TRect rect = Rect();
CWindowGc& gc = SystemGc();
const CFont* fontUsed;
fontUsed = iEikonEnv->TitleFont();
gc.UseFont( fontUsed );
gc.DrawText( *iTextBuffer, rect,
0+ fontUsed->HeightInPixels(),
CGraphicsContext::ECenter, 0 );
gc.DiscardFon... | 1 |
4e9c715d56f10bd420f8cccdbaa896b6 | 95eb92ffe7d7998995c5837b26f01aa4 | Permanently delete the specified resource from storage | class PostsController extends Controller
public function destroy (Request $request)
{
$data = $this->post->findOrFail($request->id);
$data->forceDelete();
} | 1 |
e640a113a887e80a597017cd446b8506 | 38f50393dac812726f09b66b6c4e200a | 设置预览状态 | setisPreviewPicture(state, value) {
state.isPreviewPicture = value
} | 1 |
4044fddba4e22af593c3b160c9d601c6 | b8c0d8b5a9f3c641eadce9d782f94f27 | Verifies if a certain edge between nodes 1 and 2 has a positive level of pheromones. | public boolean check_pheromone(int n1,int n2); | 1 |
32e6f39dd6cce805a543daf0462fdcce | b8d2de082ddd49b14d8ff3bcdcf8be60 | 送入墓地时 | {
if (rope.Caster.FGarden == null)
{
return;
}
Packet p = new Packet(10);
p.ID = 0x18E3;
p.PutUInt(pc.ActorID, 2);
p.PutUInt(pc.MapID, 6);
MapClient.FromActorPC(pc).netIO.SendPacket(p);
if... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.