Posts

python - Creating a heatmap by sampling and bucketing from a 3D array -

i have experimental data exists so: x = array([1, 1.12, 1.109, 2.1, 3, 4.104, 3.1, ...]) y = array([-9, -0.1, -9.2, -8.7, -5, -4, -8.75, ...]) z = array([10, 4, 1, 4, 5, 0, 1, ...]) if it's convenient, can assume data exists 3d array or pandas dataframe : df = pd.dataframe({'x': x, 'y': y, 'z': z}) the interpretation being, every position x[i], y[i] , value of variable z[i] . these not evenly sampled , there parts "densely sampled" (e.g. between 1 , 1.2 in x ) , others sparse (e.g. between 2 , 3 in x ). because of this, can't chuck these pcolormesh or contourf . what instead resample x , y evenly @ fixed interval , aggregate values of z . needs, z can summed or averaged meaningful values, not problem. naïve attempt this: x = np.arange(min(x), max(x), 0.1) y = np.arange(min(y), max(y), 0.1) x_g, y_g = np.meshgrid(x, y) nx, ny = x_g.shape z_g = np.full(x_g.shape, np.nan) ix in range(nx - 1): jx in range(ny - 1): ...

javascript - laravel - How to list all Event of an calendar if I have permission -

i have web application use google calendar api. when access web app, give me permissions access calendar. example: mr b access web app can access calendar. how can access b's calendar if give me permissions access calendar ? edit: if i'm mr , access web app, can google calendar create event, invite atendees, ... . public function __construct(request $request) { $client = new google_client(); $client->setauthconfig('client_secret.json'); $client->addscope(google_service_calendar::calendar); $client->setaccesstype("offline"); $guzzleclient = new \guzzlehttp\client(array('curl' => array(curlopt_ssl_verifypeer => false))); $client->sethttpclient($guzzleclient); $this->client = $client; } public function oauth() { session_start(); $rurl = action('eventcontroller@oauth'); $this->client->setredirecturi($rurl); if (!isset($_get['code'])) { $auth_url...

C++ ipch visual studio tracked in git.Cannot push due to large size -

Image
i using visual studio c++ , have forked repo , during building,git tracked huge file of 101mb resides in src/.vs/v15/ipch now problem cannot push of changes origin github's size limit 100mb. i committed 4-5 changes after , cannot push single of them origin. following error in bash: remote: error :gh001: i tried doing : git --rm cached <file> this deleted files index still have push changes. how can deal issue? is there way go make n commits , undo tracking of .vs code when changed it? you can try bfg repo-cleaner in order clean local repo of big file, applies on bare repo. for current local (non-bare) repo, can follow " removing sensitive data repository " , remove 1 specific file past commits. git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch path-to-your-file-with-sensitive-data' \ --prune-empty --tag-name-filter cat -- --all but actually, should remove .vs folder itself: see "...

Angular - Subscribe to route.queryParams -

i've got in ngoninit ngoninit(): void { this.sub = this.route.queryparams.subscribe((params: any) => { this.data = {...params}; this.stationsservice.getstations(this.data).subscribe((res: any) => { this.stations = res.data.stations }) }); } and have delete function deletemass() { let array: = manipulateselections(this.selected, this.stations); this.stationsservice.deletestations(array).subscribe((res: any) => { this.data.random = math.random(); this.router.navigate([], {queryparams: this.data }); }) } what i'm doing. every time delete stations create random number change me route make first observable runs again. can suggest better way. seems bad practice.

entity framework - List Data from DB using POST method in C# Web API EF -

i working on project , 1 of requirements able list value stories without using method. i have controller code here: // post api/valuestories [responsetype(typeof(valuestory))] public async task<valuestory> postvaluestory([frombody] string value) { valuestory valuestory = await db.valuestories.findasync(); var valuestoryname = (from vs in db.valuestories vs.id == valuestory.id select vs).tolist(); list<valuestory> vs1 = new list<valuestory>(); foreach (var v in valuestoryname) { vs1.add(new valuestory() { id = v.id, valuestoryname = v.valuestoryname, organization = v.organization, industry = v.industry, location = v.location, annualrevenue = v.annualrevenue, createddate = v.createddate, modifieddate = v.modifieddate, mutualactionplan = v.mutualactionplan, ...

linux - Debian Stretch apt autoclean => E: Unable to stat initrd.img. - stat (2: No such file or directory) -

i have installed debian stretch, amd64 architecture. i installed on luks-encrypted lvm volume using debootstrap, unencrypted usb pendrive mounted /boot. it's procedure know well, have been using many years, jessie, wheezy, , (maybe, i'm not sure) before, , have never faced problems of kind. this time installation process seemed have finished successfully, can boot , login system, install packages, etc, when try clean obsolete packages /var/cache/apt/archives using aptitude autoclean or apt autoclean . i error message: e: unable stat initrd.img. - stat (2: no such file or directory) i looked in / directory, , symlinks (initrd.img included) seem created correctly (well, expected, otherwise not bootstrap system), pointing (relative path) /boot directory. i tried remove links, regenerate them manually, uninstalling , reinstalling kernel, no result... i tried update-initramfs -u -k all but strange message i: initramfs attempt resume /dev/dm-2 i:...

Ruby on rails - Showing featured posts? -

i creating blog application ruby on rails , show 30 'featured' articles on home page. i have considered using boolean attribute 'featured' on articles table, have issues this; if have 4000 articles, have search through of them find 30 featured. 3970 articles have empty column. i'm wondering if there better way - such creating db table stores id's of featured articles? thanks in advance. i think in case best decision use model scope featured articles. class article < applicationrecord scope :featured, -> { where(featured: true) } end and use scope rails view <% @articles.featured.each |article| %> <p><%= link_to article.subject, article_path(article) %></p> <% end> link scopes ruby on rails guide