query_id
string
corpus_id
string
query
string
code
string
label
int64
f2fc8a8b3573b7881bcc22723f97a3a7
2f9aad28f797142fb4293b6daf106e7b
Función para validar el ataque del jugador
let efectividades: Efectividad[] = []; efectividades = cargarEfectividad(); let efectividad: number = 0; for (let i = 0; i < efectividades.length; i++) { if (efectividades[i].UniversoA === atacante && efectividades[i].UniversoD === defensor) { efectividad = efectividades[i].Efectividad; ...
0
ce252d623a8a436742bb539f68160aac
ab9cdcf2a0a951a392e4913751d17d12
Calculate number of rows to draw based on number of days in the month and day on which the month starts.
$dayscount, $firstday , $section_id ) { $IsMondayFirstDay = IsStartDayMonday($section_id); $Extra = $IsMondayFirstDay ? 1 : 0; $rowcount = ceil($dayscount / 7); if ($rowcount*7 - $firstday + $Extra < $dayscount) { $rowcount = $rowcount+1; } if (!$IsMondayFirstDay && $firstday==7 ) $rowcount -= 1; return $rowcoun...
1
721a989a457c9fb0ff697df59954d221
e19f4e906da53ab30a5ea7cac1070f6a
永久删除连锁店
public class MobileService extends Dao public String deleteStore(){ try { List donext=new ArrayList(); String id=String.valueOf(request.getParameter("id")); String sql1="delete from store where id="+id; String sql2="delete from storeDetail where storeid="+id; donext.add(sql...
1
fca69efaed29b5bce459e52164057645
5bba19b32ac7aa0cf9adbf504823365b
Returns the slot number of the first available action bar slot (assumes there is one available)
int getActiveSlot();
0
c076658202c18c91f7e1e064fb5275e9
000c102ace615a2418cf0039f5a64e5f
Invert the normals of the select object/component
{ for (int i = 0; i < this.points.Count; i++) { this.points[i].Normal = this.points[i].Normal * -1.0f; } }
1
a904cb534b03c4f9447ff3d864f1cbac
86262db0504958d4f9d39a8a1115a9e3
Returns a copy of a keras model.
def clone_model(model, custom_objects={}): config = { 'class_name': model.__class__.__name__, 'config': model.get_config(), } clone = model_from_config(config, custom_objects=custom_objects) clone.set_weights(model.get_weights()) clone.compile(RMSprop(lr=0.00025, epsilon=0.1, rho = 0...
1
68436d565790445c745824bcd54eaab2
040618c40f35fe2ab1304140a00eb11c
Check if the device stream is operating at an acceptable rate.
framerate = criterion r, f = get_sync_line_data(syncDataset, line_label) cam_rate = 1/np.median(np.diff(f)) logging.warning('cam rate: ' + str(cam_rate)) return cam_rate, (framerate-tolerance)<cam_rate<(framerate+tolerance)
1
e89bf157affcc363a4f5d0f792d6173e
f9ba7af280fab3b196058dc253960e2f
выбор цвета фигуры
function setFigureColor() { function getRandom() { return Math.round(Math.random() * (figureColorClasses.length - 1)); } figureColor = figureColorClasses[getRandom()]; return figureColor; }
1
733e83ea36adb6d61aecf7d5dc465aac
df8cb8b40dc23837ab671a04edde0f30
Mostra a schermo delle informazioni addizionali di debugging nel gioco.
public class SPW : Microsoft.Xna.Framework.Game private void ShowDebug() { int startRightX = SPW.world.ScreenWidth - 200; int y = 10; sw[ "frameNumber" ] = new StringItem( currentFrame.ToString(), startRightX, y += 20, 1.0f, Color.White ); sw[ "gameState" ] = new StringItem( "gameState: " + gameState,...
1
aaab273addd96345eb5428feda883a86
e920687d3cafa60fc1c2b5c343295f29
Get users arround range of a given user.
if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function'); $returner =& $this->getByUserId($userId, $rangeInfo); return $returner; }
0
37021cf1f7d7dba5fa21f95cd1eef3a6
7411075d1ff28a77f0f67746f65183e5
출금 계좌 변경시 숫자만 입력받게 하기
$(el).on('change', function () { var number = $(this).val(); var regExp = /[^\d]+/g; var newVal = number.replace(regExp, ''); $(this).val(newVal); }); }
1
c6b2f5b6379de518701cd1ca85db7070
9439ac8ad2abd934a460677dc50db0f6
We want to play the first move we find in a certain heirarchy of possible move types.
class AI extends Player int firstLegalStrat() { return findLegalMove(getBoard()); }
0
330af8468e650a204e57edd1a2aa8362
50c65a8346c311eb2b1332b528c6bfcb
1.4 函数的返回值可以是一个函数
int (*returnFuncPoint())(int, int) { return sub; }
1
9af24c9f1f43c36b08d9c39722b84725
126f13c5ab31f49ad1e6edc7c1b5ea18
Creates an assignments and adds it to the current block
void* add_assignment(int teacher_number,int course_number) { void* a = assignment_create(teacher_number, course_number); add_item(&assignment_list, a); return a; }
1
7fe2cad60256cb3f41e21d66f6d41950
7c666857d68c969e936c52b08cee08d0
Reenqueues all erroneous tasks
def requeue_jobs(modeladmin, request, queryset): queryset.update(status=Job.RETRY) for job in queryset: on_commit(job.execute)
1
fb1b656b78f0483beccbdf3894dbfc34
9fa0e3156dc3612bbb1aad54b0f0d6df
Vorlage für Kunde, der Kontaktangaben ergänzen soll
class ContactsController extends Controller public function create() { $id = Sentinel::getUser()->id; $user = User::find($id); $clubs = $user->clubs(); $club = $clubs->first(); $club_id = $club->id; $sports = Club::find($club_id)->sports; $user = Sentinel::getUser(); ...
1
8e56f6fdc18a0a16635655050db15f42
e2149456a3c5e6f793c5c791fede813c
函数的文档说明:
def greet_user(): #文档字符串的注释,描述函数是做什么的 print("Hello!")
1
9da8365b01db176b0f3c83ee6c025df5
3e471cebe2b94cff8ab65403db86b0d2
get student lesson attendance details from database (lesson attendance)
{ return Context.ExecuteStoreQuery<LearnerGroupAssociationDto>("USP_GetTeachingGroupsLessonAttendance @FromDate = {0},@ToDate = {1},@schoolId = {2}, @academicYearId = {3}, @learnerIdKey = {4}", fromDate, toDate, schoolId, academicYearId, learnerIdsToWorkOn).ToList(); }
1
90c40cd676cc68b1e752e22817280bad
0f5b3c3f03615b9925552330948df280
Test multiple threads racing to get a lock.
class ThreadTests(unittest.TestCase): # Create a bunch of threads, let each do some work, wait until all are # done. def test_foreign_thread(self): # Check that a "foreign" thread can use the threading module. def f(mutex): r = threading.RLock() r.acquire() r.rel...
0
a1a4edd7374c5ffb3bbb22e2c6885473
7f61448ad6da3ef0f9cb03f40c5be655
We don't need to check permission in this now
cases like (1)
0
e8fff0acbda1fd91ba2be0ae2e63b8b5
1684d556546f7744deb1c31cc07c5db3
Spravanie nahra loptu do daneho bodu s danou rychlostou
{ Vector3 temp = this->pos; if (!this->locked) { double f = 0.2 * deltaT; this->pos = this->pos*(2-f) - this->old_pos*(1-f) + this->force/this->mass * deltaT * deltaT; } this->old_pos = temp; }
0
e1f7ea2290cf381f6818343ffcc2e733
3720a48050538aa85e3968124b38b5b4
Given a worksheet, a column name, and a row index, gets the cell at the specified column
class ReadAndWriteExcel: def Get_Cell_By_ColIndex_RowIndex(self,sheetName,rowIndex,colIndex): return self.rb.sheet_by_name(sheetName).cell_value(int(rowIndex),int(colIndex))
0
290e32ae1b9228f55aae16097c7adc7f
fcdf573aed2fbd30318b9fc37cec25d4
This is a recursive method that ensures the user consciously chooses to save or not to save their work before exiting
def yes(): save() popup.destroy() quit() def no(): save() popup.destroy() popup= tk.Tk() question = tk.Label(popup, text = "Are you sure?", font = ("Verdana", 20)).grid(row=0, column=0, sticky ="nw", padx=10, pady=10, columnspan...
0
2ba28b33f47e058ecdef9bf131f58cfe
2cc9905715fb3409188a901e192e26d3
選択された処理ステータスを条件に物件問い合わせ情報を取得
class MInformations extends Db_Table public function getListSelect($where = array()) { $select = $this->select() ->from(array('minf' => $this->info('name'))) ->where('minf.delete_flg <> ? OR minf.delete_flg IS NULL', Db_Table::DELETE_FLG_ON) ->order('create_date DESC'); if (isset...
0
5f457ad44088212d6c4b90e729f5de51
f1b7c333170716e6410266e5fbbb1c0d
Sets the selected dog.
public class AddDog extends DialogFragment public void setIndex(int layoutPosition) { itemToModify = layoutPosition; }
0
087a8cf6833011709f868513a03ae660
b251451cc04ebe04b4a915eacb6eac97
Is phone vibrate for file transfer invitation.
public class RcsSettings public boolean isPhoneVibrateForPresenceInvitation() { return readBoolean(RcsSettingsData.PRESENCE_INVITATION_VIBRATE, RcsSettingsData.DEFAULT_PRESENCE_INVITATION_VIBRATE); }
0
4316682a2b3ee141ceebc46af0417353
7ad3b74f2c1e6b8e90fe0081b52fef74
Executes migration to create the table for Microsoft SQL Server based caching
{ var upgrader = new Upgrader(new CreateAllowedIpTableMigrationPlan()); upgrader.Execute(scopeProvider, migrationBuilder, keyValueService, logger); }
0
914d4126ed3d4e14ae22259cafc4ba6e
65c6ab6f05f68810e038a1daf7d8b4a7
有未完成的订单记录
function get_unfinished_orders($user_id,$token) { $result = check_token($token); if($result) { $type = Goods::get_unfinished_orders($user_id); if($type) { foreach ($type as $k => $v) { if($type[$k]['tr...
1
16eeb62b6ba5371d3a62d5051272b3ca
fccec30b4d63efb0763c196791978cdf
<pre> Inserts a slate. </pre> <code>.google.cloud.video.livestream.v1.Event.SlateTask slate = 14;</code>
namespace Google.Cloud.Video.Stitcher.V1 public abstract partial class VideoStitcherServiceClient public virtual gax::PagedAsyncEnumerable<ListSlatesResponse, Slate> ListSlatesAsync(gagr::LocationName parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) => Li...
0
b7af87a7107aaf8936cb559024a9dc88
c0e1d944dcf1ca33146e2a091c04ba28
构建场景按钮
{ GUILayout.Space(10); mScrollViewPosition = GUILayout.BeginScrollView(mScrollViewPosition); GUILayout.BeginHorizontal(); foreach (int f in mSceneEnums) { if (GUILayout.Button(m_enAssetDiskMapingFile_Maping[f])) { LoadScene(f, enAssetDi...
1
d313f725ec34007e08d8e8eab08c5e08
f1cf967dde86bb72f4c03d3b3381a49b
Update target velocities for the robot
void Motion::setVel(float v, float w){ float vl = v + ((PI * DISTANCE_BETWEEN_WHEELS * (1024.0/ 1.5) * w)/2.0); float vr = v - ((PI * DISTANCE_BETWEEN_WHEELS * (1024.0/ 1.5) * w)/2.0); target_left_v = v + w; target_right_v = v - w; }
1
7a3e481745486752a9634fa9aebcd6a1
385eb8fe9a86d0678295b7d1a01b3f96
立即停止播放相机效果
this.lock = false; clearTimeout(this.moveTimeout); this.mediaClient.emit("camera-stop", (client, ret) => { if (!ret.result && this.stateService.getActive()) { edger.notify.error(ret.msg); } }); }
1
03a22ad97243d2dfdf5d8eae498c29bf
761039f1586f8a00275811e3ece63197
true if the pacman eats everything on the board,
{ return dotsEaten >= TOTAL_DOTS && pelletsEaten >= TOTAL_PELLET; }
1
7b097ee725f0c933d0fc987efcdec9f3
667e5bfadb461fa3f31ffe427bb012e3
============================================================= Insert Product Attributes =============================================================
namespace WebAPIs.Controllers [Route("api/productattributes")] [ApiController] public class ProductAttributesController : ControllerBase [HttpPost("insertattribute")] [ProducesResponseType(typeof(bool), StatusCodes.Status206PartialContent)] [ProducesResponseType(typeof(IResult), StatusCodes....
1
36ec146d2888eeef4271eaf477d718e8
da85193121b36f0585aac7ce979e16fe
Returns array of only one chronometer from larger result array
class Inspec def combine_results(rule_results) return rule_results.first if rule_results.size == 1 rule_result = HappyMapperTools::Benchmark::RuleResultType.new rule_result.idref = rule_results.first.idref rule_result.severity = rule_results.first.severity rule_result.time = rule_results.r...
0
cb317f521f5089bbc2b03b54b69d574b
857027f2e0beaa8e20447357f0220797
Creates the path of Realms key file
public class KeyStoreManager public static String getKeystorePath() { return AndroidFactory.getApplicationContext().getFilesDir().getAbsolutePath() + "/" + KEYSTORE_NAME; }
1
598eebfe8d66e29008cd8050dc449888
cef8428fa379f3f4972d60f4c47b9ef5
Pay this invoice, effectively registering the payment into permanent storage (DB, file, etc) and update this invoice status.
class Invoice extends Model public function pay() { $connection = $this->getConnection(); $attributes = $this->attributes; $connection->executeProcedure('SP_PAY_FOR_INOVICE', [$attributes['INVOICE_ID']]); }
1
d394b5cb6cfe588811a16262c0cb5ba5
5eae9fee4de349c10c1ea7dbc49cdc09
检测数组是否进行了排序
function isSort(array) { for (let i = 1; i < array.length; i++) { if (array[i - 1] > array[i]) { return false; } } return true; }
1
23eb7375cd1f6a417bc93b2b97702d98
5abbd8108ea7b6fa7143d3eb5f1ad79a
Overwrite a stored file. This is essentially a two step process: (1) Delete the current stored file (2) Upload the updated file This will generate a NEW file handle
class WantuFileAdapter extends AbstractAdapter public function updateStream($path, $resource, Config $config) { $this->delete($path); return $this->writeStream($path, $resource, $config); }
1
9ef795e50c47366c1b1dd4d53402ef4d
f0a9a12ece3f27255c1673382ebf75c0
Lấy danh sách chứng từ chi tiết tiền gửi theo tháng
{ DataTable vR = null; SqlCommand cmd = new SqlCommand("SELECT * FROM KTKB_ChungTuChiTiet WHERE iNamLamViec = @iNamLamViec AND iThangCT=@iThang AND iTrangThai = 1 AND iID_MaTrangThaiDuyet=@iID_MaTrangThaiDuyet ORDER BY iSTT, dNgayTao"); cmd.Parameters.AddWithValue("@iNamLamVi...
1
524da53f78216aa718a5da096a15a175
449fe1513cd92d09feb787fd61a5539d
Validates the proper behavior if the ray starts inside the box
def test_the_hit__when_an_intersection_occurs_on_the_outside(): r = Ray(Point(0, 0, -5), Vector(0, 0, 1)) shape = Sphere() i = Intersection(4, shape) comps = i.prepare_computations(r) assert comps.inside is False
0
0e1841075f52a78e24149a4a3a4e8ca5
7bc767be6151df2e7c64113e7ba44847
Remove all pools in the system.
{ $pools = self::$pools; self::$pools = []; return $pools; }
1
a3342fe2b709d3a2c51c33c68c615cb3
0931b7e8af9733986a3c6e23733bdd19
Refresh posts of user and his friends
public class FeedFragment extends Fragment protected void refreshPosts() { ParseQuery<Post> query = ParseQuery.getQuery(Post.class); query.include(Post.KEY_USER); query.orderByDescending("createdAt"); query.setLimit(DISPLAY_LIMIT); query.findInBackground(new FindCallback<Post>() ...
0
383c4c0099dae66a2d667fc7136bfbcb
ea814432300c8ec923af00e664f5d387
根据所有主题/事件的热度值进行趋势预测并将预测的状态存入文件中
def start_search(bid, tbw_list): db = Database() eve = Event() con = Content() e_id = 'tp' + bid short_dir = create_time_file(tbw_list[0][0]) corpus_dir = DOC_DIR + '/' + short_dir + 'uid=' + str(bid) + '.txt' txt_file = open(corpus_dir, 'w+') bid_like = 0 bid_forward = 0 bid...
0
a6d283824303cf4bde975d341e706604
3e831bd5208e506cb2455c6489936f37
获取完整的通信录信息 同时返回递归的全部部门和成员,分开显示
public class ContactUtil public static ArrayList<SimpleContactPerson> getContactDisplayList(Context context, boolean onlyHasPhone){ long start = System.currentTimeMillis(); int sdkLevel = Integer.valueOf(android.os.Build.VERSION.SDK); ArrayList<SimpleContactPerson> displayList = new ArrayList<SimpleContactPerson>...
0
768f68f1f241e705455567a45c632b51
c3d1cea3f048c8d245b9e7aa4824741d
讀取本地端完結動漫資料。
function loadJapanese() { return xhttp('/details/index_jp.txt').then(function (text) { let arr = text.split(/\n/); arr.splice(300, 1); data.japanese = arr; }); }
0
52f80144b764c92a862b21023e73539c
f76e5d66a95bfd6e4087c51a2ee8e147
Sets the drive level for the left motor, from +1 (max) to -1 (min).
void driveL(int val){ val = (abs(val) > 127)? 127 * val/abs(val) : val; motor[LD1] = motor[LD2] = motor[LD3] = ((val) >= 0 ? 1 : -1)*TrueSpeed[min(fabs(val),127)]; }
1
d416cc45112b6adb0e06afe1c0b2c4fc
b44e9f71c87921b748442fab82575c8c
[LeetCode] 695. Max Area of Island_Medium tag: DFS/BFS
int m = grid.length; if(m == 0) return 0; int n = grid[0].length; if(n == 0) return 0; int max = 0; for(int i = 0; i < m; i++) { for(int j = 0; j < n; j++) { if(grid[i][j] == 1) { max = Math.max(max, maxAreaOfIslandDFS(grid, i, j)); } } } return max; }
1
1b7283f9782dbe3c7e2e0c6b0da1d661
74d063e8503fc57364eb130e065aacd0
送客先テナントIDを指定して、その送客元のテナント一覧を取得する 渡されたテナントIDのテナントは除く
{ log_message('DEBUG', __METHOD__.' start'); $info = '-->'.__METHOD__.'-->'; $info .= 'テナントID:'.$p_tenant_id; $sql = 'select * ' .' from trn_objects ' .' where tenant_id = ?' ." and delete_flg = '0'" .' for update ';...
0
34dbf68651625b3dccc1ecbb73476b55
e2c5e851c18378f5f9a564939a4dbbc5
Parses XML files and generates code.
args = self._create_parser() print(""" Generating interface source code with following parameters: Source xml : {0} Namespace : {1} Output directory: {2} Parser type : {3} overwrite : {4} """.format(args.source_xml, args.namespace, args.output_dir, args.parser_ty...
1
dd45baa5b419546e2d758d15236b263d
9e27691af0a071fa87ca5c8cfa262c0e
Checks whether the Stunt Die checkbox is checked
boolean cb1 = ((CheckBox) findViewById(R.id.qustion7_Wyzima)).isChecked(); boolean cb2 = ((CheckBox) findViewById(R.id.qustion7_Oxenfurt)).isChecked(); boolean cb3 = ((CheckBox) findViewById(R.id.qustion7_Kingsberg)).isChecked(); return cb1 && cb2 && !cb3; }
0
4fab64fdfb71074dee340ac7fd99b712
bcaea8e10e8dd2e40cdd49f3c12b7aab
Distance to destination in m.
if self.is_w_space or destination.is_w_space: return None else: return math.sqrt( (destination.position_x - self.position_x) ** 2 + (destination.position_y - self.position_y) ** 2 + (destination.position_z - self.position_z) ** 2 ...
1
3bdd9a2e213278d0a5dcec62a216e4fe
5b3a3f35a06922b64744d13207249fd7
Virtual to physical address translation. Given the virtual address for a character buffer, this function returns the physical (DMA) equivalent.
unsigned long rumpcomp_pci_virt_to_mach(void *virt) { uint64_t voff, pte; unsigned long paddr = 0; int pagesize, offset; (void)*(volatile int *)virt; pagesize = getpagesize(); assert((pagesize & (pagesize-1)) == 0); offset = (uintptr_t)virt & (pagesize-1); voff = sizeof(pte) * ((uint64_t)((uintptr_t)virt) / pag...
1
6e3fc332dc85bb11613ed6819373cc01
e2a5740d194c4b21ab0139b2f364dd21
Gets the tues start time2.
@JsonIgnoreProperties(ignoreUnknown = true) public class StoreWorkingHours public String getTueOpenTime() { return tueOpenTime; }
1
a57f7c8227d1f7c0a07998f528c451d1
9c827eacc86c54f3f5b1d2e25a385466
<Summary>Returns the issue identified by the given ref</Summary>
public class IssuesInner public Observable<IssueContractInner> getAsync(String resourceGroupName, String serviceName, String issueId) { return getWithServiceResponseAsync(resourceGroupName, serviceName, issueId).map(new Func1<ServiceResponseWithHeaders<IssueContractInner, IssueGetHeaders>, IssueContractInner>()...
1
8773837143107d2344a8365665174e29
ecf6e08ddab43ddcf1ce59091f53be5f
显示已经认证的公司列表
$this->module = constant('MEMU_MY'); $userinfo = $this->get_userinfo(); $data['userinfo'] = $userinfo; $user_id = $userinfo->user_id; $this->load->model('waitui/Certify_model','certify'); $certify_list = $this->certify->get_certifyByUser($user_id); if(count($certi...
1
4994eef6642843b9f5487dc8eb55f246
f27de74393b4bc02d4a22737518bb21b
no passing arguments and returning no value
def print_none(): print ("No args.")
1
99232c0dfc25da2b4fdb51f3606ff293
138f6b1a17983d28e4b80b4f518b92bf
根据类型和内容进行搜索
@CrossOrigin("*") @RestController public class IndexController @RequestMapping("selectByTypeAndName") @ResponseBody @CrossOrigin("*") public ArrayList<CacheEntity> selectByTypeAndName(@RequestParam("type") int type, @RequestParam("name") String name) throws SQLException, ClassNotFoundException { ret...
1
ea4dd1ae7b9974b0239bc19bf555dec7
859b413fce808ccb19507e9f8f309fc0
update sample array for display
{ var samplesStream = new Float32Array(rtSize); for (var i = 0; i < rtSize; i++) { var index = (i - rtSize / 2) * zoom - offSet; if (IsInSample(index)) { samplesStream[i] = GetValue(index, zoom); } } curentSamples = samplesStream; updateRenderPlane(); ...
1
64f6117a527fd03cb91626e3d0bb3ae5
4de42c9e42ca1dcde495b8d5fd2a22a6
Starts the relay functionality. Registered listeners will be informed with 100 Hz.
class USBRELAY32RpcServer(SimpleXMLRPCServer): def start(self): self.__is_running = True while self.__is_running: self.handle_request()
0
74526189dbf4bd8ca2704ef6c3e56b96
af57b29286bc9487b3ca02079271bdd7
Prints out the Induction Certificate for a completed induction:
{ $induction = CompletedInduction::where('user_id', Auth::id()) ->where('induction_id', $induction_id)->firstOrFail(); $details = [ "person" => Auth::user()["first_name"] . " " . Auth::user()["last_name"], "induction" => Induction::find($induction_i...
1
de375ab348176dd4f05b508a00bbaf88
4287b9d91110e4fad3d9c21a48db00e0
Read the magic string to get the version of the file format.
int res = KT_UNKNOWN_ERROR; char magic_from_file[MAGIC_SIZE + 2]; size_t count = 0xff; if (in == NULL) return UNKN_VER; res = SMART_FILE_read(in, (unsigned char*)magic_from_file, MAGIC_SIZE, &count); if (res != SMART_FILE_OK || count != MAGIC_SIZE) return UNKN_VER; magic_from_file[MAGIC_SIZE] = '\0'; if (strcmp...
1
72672abb0aa5b22ddb9e853b51ad5357
098d2fff9c150d5c20143dfc1b4bc676
Retrieve all [Article]s for the specified section, then push results to [ArticleStore].
class ArticlesRepositoryImpl( val articleDataSource: ArticleDataSource, val articleStore: ArticleStore, val articleCache: ArticleCache ) : ArticlesRepository override fun pollTopStories(section: Section): Single<List<ArticleEntity>?> { return articleDataSource.getArticles(section) }
0
fa2d0a1ef32b69b3ef00263c286969b5
a5209780de921863ec883323cc53d79c
CHANGED gets in seconds the amount of time remaining of the current player's turn
public class Player extends Person public int getTimeLeft() { return timeLeft; }
1
8b61298e4e2bab352ce17977cee26570
06d6c21852225beb5c59c702cce0dc81
Возвращает ModuleName, Action и массив параметров, необходимых для конструирования родительского модуля. ModuleName обязателен, остальное зависит от конкретного модуля: Action может быть null, Params может быть пустым массивом.
class ModuleEnableAction extends AbstractAction public function getParameters() { return [ 'modules' => $this->modules, 'enableDependencies' => $this->enableDependencies, ]; }
0
141ae2e6dee8122fb1161f92b4020206
f96cdd0872069759aed4a6215ec33a1c
Print dashes for a full line.
for (int dash = 1; dash <= 27; dash++) { System.out.print("-"); } System.out.println(); }
1
a3e6c6675c808a4691a74f8e92ce71bc
48d3c96dc7c3fbd0f7f69f94f26752e1
Extract controls from cache_control string into a case-insensitive dict.
class _MethodInfo(object): def cache_control(self): return self.__cache_control
0
acc1c89828fea46b646ffd06bb3d660c
5529f422fc597d6de5c5b9fabdd51816
Removes the notification and stops tracking the music session
public class MusicService extends Service public void stopMusic() { mp3Player.stop(); NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); notificationManager.cancel(NOTIFICATION_ID); }
1
ff788be6bd1c702a7edcddf67c7935f2
336495d73a7ab8ae32131865671f43a7
Initialize Brain-built-in Inertial Sensor.
{ RPR0521RS_STATE *state = (RPR0521RS_STATE*)this->state->state; state->sensor = RPR0521RS_ALS; (void)sns_memscpy(&state->my_suid, sizeof(state->my_suid), &((sns_sensor_uid)ALS_SUID), sizeof(sns_sensor_uid)); rpr0521rs_common_init(this); rpr0521rs_publish_attributes(this); return (SNS_RC_SUCCESS...
0
1e3518c5a9bc4c5f893900066881e9a9
80d0ed9f02262e2c722ca2b8f8f677ca
在回收站t_recycled表中增加删除的文件记录
class ChajianBase_upfile extends ChajianBase public function delTorecycle($filenum) { $time = (int)config('rock.recycle'); if($time<=0){ $this->delfile($filenum); }else{ $frs = FiledaModel::where('filenum', $filenum)->first(); if($frs){ $frs->isdel = 1; $frs->deldt = nowdt(); $frs->save(); ...
0
5815a4fda85b6e8d8817e9e4b75ba535
534db9463d87691ec60c7bf0af7e78de
Middleware for logging hits to the web server.
tethys_log = logging.getLogger('metrics_logger') username = "None" if hasattr(request, 'user'): if request.user: username = request.user else: username = 'Anonymous' request_method = request.META.get('REQUEST_METHOD') client...
1
2b2ab7d1c1f599f103ddf9fc32527b9e
f3378759dacd3b048724d92adf623ece
Retorna el listado de dimensiones territoriales precargadas de acuerdo al tipo
public class US04Controller public GeographicAreaList getGeographicAreaList() { return this.mGeographicAreaListOfTypeGiven; }
1
283896293a943bd8c0239d757dc113aa
edc30872a5072ed7facf5d478eb23d39
Given a MVector it returns a python list with the corresponding values.
class Vector(Matrix): def point(self): return [component[0] for component in self.value]
1
ae2cf5bc29bba438859fa9d943297a28
fb0b64438cce179fc54f7b59d51047e1
Catch up with output queue by producing ready results
static int output_catchup(int nmax) { int nout = 0; BINQ *bp; int i; while (out_bq != NULL && out_bq->nadded >= accumulate && out_bq->ndx == lastdone+1) { if ((nmax > 0) & (nout >= nmax)) break; bp = out_bq; out_bq = bp->next; bp->next = NULL; for (i = 0; i < nmods; i++) mod_output(bp->mca[i...
1
3d90fda8ad1735dba0dbf2995cfba77f
518cc21a15b9108f21cea311020981c1
Collapse an entire subtree into a clade object.
def collapse(table_file, taxonomy_file, output_dir): os.mkdir(output_dir) for i in range(1, 8): _ = taxa.methods.collapse( table=Artifact.load(table_file), taxonomy=Artifact.load(taxonomy_file), level=i) _.collapsed_table.view(pd.DataFrame).T.to_csv( ...
0
f17c7df3fdb219d6dd4172fda7ee68a6
6dd314ce5aa7a4982e08b89af5ed7238
initializes an instance of PermissionManager.
class Permissions public function __construct() { }
0
8242d64c3ccf67afb3f402a0ac839721
f0241b7e364a3daa9e291076d77585a7
Inline style of the content area (i.e the anchor tag). <P> set by the JSF file.
public class FCKeditorTag extends BodyTagSupport public void setEditorAreaCSS(String value) { editorAreaCSS = value; }
0
b6a1a00e354e94f3cb010147453dc177
134cafeb22464cc7feba71521657a86a
将ASCII转16进制
class NaluParser(object): def transAscii(self, letter): result = hex(ord(letter))[2:] if len(result) == 1: return ''.join(['0', result]) else: return result
1
eebc4740ab5ea953f3ae65ba96c63fad
192c4ecb4f33a5fd3e05cb93ee7237c1
绘制出城市每个区的历史房价折线图
def get_price_dist(data, city): data = data[['city','dist','aver_price']] fig = plt.figure(dpi=300) city_data = data[data['city'] == city] dists = city_data['dist'].unique() aver_prices = [] for dist in dists: s_price = city_data[city_dat...
0
105abb634915eb7abf9ba9be908cc964
10fc0626cec455c5e8fd00cf698ee961
Statusの追加(実行)
class ToruBot(): # ツイート抑止 def addOmikujiExec(self, request): ds = DataStore.DataStore() lst = request.get('status').splitlines() for status in lst: ds.addStatus(DataStore.Type.omikuji, status)
1
ad284b3b144822746944b940619bdfa8
8f3e74e61fe9e8a77d5eb69649aa343d
显示在首页,必需IsPublic的。根据页码,每页显示的条数返回请求页的未读链接
@CrossOrigin //支持跨域问题 @Controller public class WebController @RequestMapping("/") public String home(Model model,Integer pageIndex) { if(pageIndex==null||pageIndex<1) pageIndex=1; Authentication a = SecurityContextHolder.getContext().getAuthentication(); boolean onlyPub = true; if(a!=null && a.isAuthenticat...
1
247b274d244fb6fc933389ff3d6678a0
b88184f0a8c5e9f7ee5019c30fb22646
https://edabit.com/challenge/Nz7ZmEeMFZ6GznPex
function bouncingBall(h, bounce, window) { if (h <= 0) { return -1 } if (bounce <= 0 || bounce >= 1) { return -1 } if (window >= h) { return -1 } let sightings = 0; let currentHeight = h; while (currentHeight > window) { sightings++; curren...
1
7d9dafc3f84f7613876d5f976034c614
c2eba05667b885df1a5b8948609cea4a
根据桌所在的区域返回page对象
@SuppressWarnings("serial") public class GeRuDocumentView extends JPanel implements GObserver public JPanel getPageArea() { return pageArea; }
0
b91117086954b16ce19d0646e82f2d90
0bb38ab8b684235f845e776ce2673cf1
Método que obtiene los estados de los artículos de forma asíncrona
{ $this->checkAcl('read'); $table = new Products_Model_DbTable_ProductState(); $select = $table->select(); $select->from( $table, array( 'product_state_id', 'product_state_state', 'product_state_datetime', '...
0
399f0e83873b56f231ad3844e461baa7
d408f60fc9f41897ee54344155cf57f9
Despliega el Reporte de liquidacion de salario..
{ $fecha1=Input::get('date1'); $fecha2=Input::get('date2'); $document = Input::get('document'); $document = $document ==null ? 'Todo':$document; $fechaActual=date("Y-m-d"); if($fecha1==null){ $fecha1=$fechaActual.' 00:00:00'; }else { $nuevaFecha1 = explo...
0
e7972d0c5502ba243762a94016f450ee
abba346501ea4a5a9b28d5285836f70a
Test operations involving freezing and relaxing freezes down to the timestamp level.
{ R::nuke(); R::store( R::dispense( 'book' ) ); R::freeze( FALSE ); asrt( R::getRedBean()->tableExists( 'book' ), TRUE ); asrt( R::getRedBean()->tableExists( 'book2' ), FALSE ); R::freeze( TRUE ); asrt( R::getRedBean()->tableExists( 'book' ), TRUE ); asrt( R::getRedBean()->tableExists( 'book2' ), FALSE...
0
315bd29ec97a07182eb30b3a99db0238
e96ba569a4a5f45a0faa75c46ef9b5c4
5. 死代码 (也叫僵尸代码,这里是未使用的变量).
class Highlights public function deadCodeFunction1() { $variable = true; }
1
62efe49ed0a8453edf021742c1a4d1c7
03846cf1464c4d200fbb39a6114db304
Tests that the expected extensions exist.
def test_ext(): app = Flask("testapp") InspireS3(app) assert "inspirehep-s3" in app.extensions
1
0474c34647b81ae599b7bbd3f656335f
74050273115b4e1fa249918ad96d9cea
Elimina todas las vistas o paneles añadidos
namespace ProyectoFinal public partial class MainWindow : Window private void UnloadAll() { TabCartelera.Visibility = Visibility.Hidden; TabAlquileres.Visibility = Visibility.Hidden; TabTuCartelera.Visibility = Visibility.Hidden; TabTuAlquiler.Visibility = Vis...
0
3974c372ae9ce41b7a25ae1e8ce7893d
0af43d2373fa56ef984c0d2b1d526bcc
Checks the output of ttmsolve using an example from Jaynes-Cumming model, which can also be found in the qutip-notebooks repository.
r = 0.43 mu = np.array([0.24, -0.2]) V = np.diag(np.array(np.exp([-2 * r, 2 * r]))) res = density_matrix(mu, V) expected = np.array( [[0.89054874, 0.15018085 + 0.05295904j, -0.23955467 + 0.01263025j, -0.0734589 - 0.02452154j, 0.07862323 - 0.00868528j], [0.15018085 - 0.05295904j, 0.0...
0
b373a7142e399649b3046e33b99e9713
879f14dda507b05aacf098866150ba75
Returns the value of the '<em><b>Derived Contribution</b></em>' reference. It is bidirectional and its opposite is '{@link Contribution#getSourceContribution <em>Source Contribution</em>}'. <!-- begin-user-doc --> <p> If the meaning of the '<em>Derived Contribution</em>' reference list isn't clear, there really should ...
double getPrincipal_disbursed_derived();
0
9c1c877aea69b4397a066583eb41b81c
7d315148ae475a5980f6c9f09ea7086b
! Output the contents of the goal table via debug logging.
{ DEBUG_LOG("goalsEngine_DebugLogGoalQueue"); FOR_ALL_QUEUED_GOALS(gs, i) { pending_goal_entry_t *entry = &gs->pending_goals.pending_goals[i]; DEBUG_LOG(" goal_id %u rule_id %u lock 0x%x lock_mask 0x%08lx%08lx", entry->id, entry->rule_id, entry->lock, PRINT_ULL(entry->lock...
1
19f9f577a67f1cba6c0d1c77ca9c24d5
d34aafa1616313931109accb5e8d7cca
get a list of photos from server with latest order.
class Server extends Back public function getPhotos() { $this->layout = null; $photos = PhotoModel::orderBy('created_at', 'DESC')->paginate(12); echo View::make('back/server/photoPaginate') ->with('photos', $photos); }
1
e91959f0ca246d94a1988b31006789c6
54e1b9b371f6892315d563817e9fed62
Get max_response value. Notes: Defines maximum results returned by the REST call (allowed max=5000). This attribute is named `maxResponse` in VSD API.
try : return self._httpclenresponsesrate except Exception as e: raise e
0
c9c2fb86f5daf42773b81fdea285f7a1
409017866bdd53ea0fda4366c9cf83fb
Read a scan script from the specified text file. Each entry in the file defines one scan to be emitted. Entries are separated by semicolons ';'. An entry contains one to four component indexes, optionally followed by a colon ':' and four progressive-JPEG parameters. The component indexes denote which component(s) are t...
public class TXTParser extends DefaultHandler public void readFile(String filepath) throws IOException { scanList.clear(); TXTScan scan; String line = ""; int scanNum = 0; boolean centroided = false; int msLevel = -1; String polarity = ""; Double retentionTime = 0.0; Double ba...
0
7bf6ab0c576863afb34e6f7d349f9f93
4b3f1a978fa59862e7c0dbde9df13d52
根据属性值返回属性名称
function getAttributeName($options, $value) { foreach ($options as $option) { if ($option['value'] == $value) { return $option['name']; } } return ''; }
1
3c8967059f931b55fc10b9c8e408e1b3
401c6e4a5d1baffdbfb03536115728e4
判断底部是否可以刷新
final Adapter adapter = refreshView.getAdapter(); if (null == adapter || adapter.isEmpty()) { return true; } else { if (refreshView.getFirstVisiblePosition() <= 1) { final View firstVisibleChild = refreshView.getChildAt(0); if (firstVisible...
0
e5b8667084676c09778acdfb974ab5b3
31372a101f3ae3227ef9e0ffddd71e9f
获取同辈对象列表
public function getSibling($self = false) { return $self ? $this->where('pid', $this->pid) ->orderBy('sort', 'ASC') ->get() : $this->where('pid', $this->pid) ->where('id', '<>', $this->id) ->orderBy('sort', 'ASC') ...
1
2626e71fa48e605a897dbc63ab769f9b
c89063e3be18a471cb12e29cf13a817a
歩行者種別取得
public class JvdUmagotoRaceJoho extends JvdUmagotoRaceJohoKey public String getBlinkerShiyoKubun() { return blinkerShiyoKubun; }
0
98e065519985472ef27ad70f5bd03b23
6cbb43a373e446c216b1b1966ff6df0e
tim co ban theo ma hoc vien
namespace PMS.Data.Bases public abstract partial class TietNoKyTruocProviderBaseCore : EntityProviderBase<PMS.Entities.TietNoKyTruoc, PMS.Entities.TietNoKyTruocKey> public TList<TietNoKyTruoc> GetByMaGiangVien(System.Int32? _maGiangVien) { int count = -1; return GetByMaGiangVien(_maGiangVien, 0,int.MaxValue, o...
0