Posts

c# - How to add checkboxes to each day in this calendar view? -

i trying add simple checkbox feature each day in calendar view. must inline style of current calendar , when bool selected must able save changes database. suggestions appreciated. my main issue @ moment checkboxes being selected not being saved db. controller.cs private f2fw _db = new f2fw(); [httpget] public actionresult calendarindex() { list<event> events = new list<event>(); project.models.calendar calendar = new project.models.calendar(); calendar.setdate(datetime.now.year, datetime.now.month, datetime.now.day); calendar.view(@"~\views\patient\calendar.cshtml"); calendar.viewdata.add("events", events); viewbag.calendar = calendar.render(); return view(calendar); } [httppost] public actionresult calendarindex(user user, calendararg calarg, int daycounter, string[] cbx_day, patient patient, sessionexercise sessionexercise) { sessionin...

osx - QLPreviewView can not show the quicklook preview in sandbox -

i use qlpreviewview show quicklook preview in app. without sandbox, works well, once change app sandbox, preview can not show up. i found error in console: quicklookuihelpe(20786) deny file-read-data xxx. i have used security-scoped bookmarks & com.apple.security.files.user-selected.read-write grant access user home dir, then: [allowedurl startaccessingsecurityscopedresource]; self.mypreiviewitem.myurl = fileurl; self.myqlpreviewview.previewitem = self.mypreiviewitem; [self.myqlpreviewview refreshpreviewitem]; [allowedurl stopaccessingsecurityscopedresource]; with these, can delete files of user home dir, qlpreviewview can not work. not know difference between these 2 scenes, qlpreviewview need more sandbox? if add com.apple.security.files.downloads.read-only entitlement, files in "downloads" can previewed, other files of user home dir can not previewed. finally have found solution! refreshpreviewitem async call, before mac finishes loading p...

agda - how to define an element of type record? -

i have define datatype of real number as.. record ℝ : set field l : stream pair r : stream pair inhabited : ∀ (x : pair) → ( (x mem l) or (x mem r)) disjoint : ∀ (x : pair) → ( (not (x mem l)) or (not (x mem r))) located : ∀ (x y : pair) → (x ≤pair y) → ((x mem l) or (y mem r)) now want define element of type r . tried as.. mkreal : stream pair -> stream pair -> r mkreal x y = record { l = x; r = y}. but not working please help. your record ℝ has 5 fields, l , r , inhabited , disjoint , , located . define instance of ℝ , have supply values 5 fields: mkreal x y = record { l = x; r = y; inhabited = ?; disjoint = ?; located = ? } you have pass values of inhabited , disjoint , , located arguments mkreal well. by way, there way automatically define constructor record: record ℝ : set constructor mkreal field l : stream pair r : stream pair inhabited : ∀ (x : pair) → ((x mem l) or (x ...

Android Google Play Services in Emulator -

Image
i "google play services" message when run app using emulator i have checked many posts , said have download google apis , google play services and did, , have code in gradle.build dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.google.android.gms:play-services:7.3.0' } how resolve issue? please download 1 , check again : because using com.google.android.gms: play-services :7.3.0 in dependencies.

c++ - Need to create a custom data 2D texture with reasonable precision -

the idea i need create 2d texture fed resonably precise float values (i mean @ least precise glsl mediump float ). want store in each pixel's distance camera. don't want gl zbuffer distance near plane, own lovely custom data :> the problem/what i've tried by using standard texture color attachment, don't enough precision. or maybe missed ? by using depth attachment texture gl_depth_component32 getting clamped near plane distance - rubbish. so seems stuck @ not using depth attachment tho seem hold more precision. there way have mediump float precision standard textures ? i find strange opengl doesn't have generic container arbitrary data. mean custom bit-depth. or maybe missed again! you can use floating point textures instead of rgba texture 8 bit per pixel. support of these depends on devices want support, older mobile devices have lack of support these formats. example gl_rgba16f ( not tested ): glteximage2d(gl_texture_2d, mipm...

clojure: stack overflow over range -

i trying solve problem 60 @ 4clojure.com sequence reductions my solution works last 2 cases fails first case in handling range. here solution (fn reds ([func lst](if (empty? lst) [] (reds func (first lst) (rest lst)))) ([func init lst](if (empty? lst) (println "hi") (concat [init] (reds func (func init (first lst)) (rest lst))))) ) i think because keep calling function on more terms of infinite list . how do better? update : solved using lazy-seq

c# - Calculate best collection to use in method -

i have search method in custom a* algorithm. uses collection keep track of search doing. set path know doing following collection: contains 860x (lookup) remove 91x add 270x the order or sorting not matter unless can find way order it. possible generate unique id each node based on x , y value. making dictionary lookup possible. is there way calculate based on method, best collection use in specific case? thanks in advance, smiley the general census says: if don't run performance issues, leave alone. if , can away it, leave alone. if do, can't (or love code tight), benchmark it, , you'll find. ( clarification : didn't use "premature optimization root of evil" reference, because think there place optimization. here's good article subject). from you're saying, doubt it'll make change, unless you're running on device next no resources, again, unless need it, above numbers, doubt you'll see difference. edit : pe...