Posts

core data - Swift Fetch Request Returning Empty Item In Results -

i have project need fetch request gets recent 'updated' date of core data entity. when examine results returned query seeing rather strange behaviour. in addition 'correct' result containing date results include empty dictionary item. happens every time, regardless of underlying data looks like. stranger, if turn on sql logging in xcode , execute logged query against sqllite db produces correct result no entries. i'm not quite sure i'm doing wrong here, appreciated. the function builds , executes query: func queryforcontactdate(context:nsmanagedobjectcontext) -> anyobject? { var expressiondescriptions = [anyobject](); let expressiondescription = nsexpressiondescription() // name column expressiondescription.name = "maxupdated" // use expression specify aggregate action want take , // on column. in case max on update_at column expressiondescription.expression = nsexpression(format: "@max.updated_at") ...

amazon web services - Set Environment Variables in AWS EBS -

i wonder how can set environment variables in amazon's elastic beanstalk? i've worked gae before, in env vars can set in config.yaml file. didn't find similar way in ebs documentation. lot. in folder, create file env.yaml inside file env.yaml: option_settings: aws:elasticbeanstalk:application:environment: var1: xxxx var2: yyyy the variable names have less 20 characters in length , cannot contain underscores. (i read somewhere on stackexchange). for variable names more 20 characters , containing non-alphanumeric characters "_", way around string requirement use web interface. check environmental variables have been set going configuration -> software configuration

python - How do I add an include path when pip installing lxml on Centos7 using Salt? -

i'm trying install lxml python 3.4 on centos7. i have salt state looks this: lxml: pip.installed: - bin_env: /opt/rh/rh-python34/root/bin/pip3 - env_vars: include: /usr/include/libxml2 but doesn't work. or without env_vars, error: src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: no such file or directory so environment variable have add build see xmlversion.h ? exists: # salt 'myminion' file.readdir /usr/include/libxml2/libxml | grep version - xmlversion.h if have xml dev packages installed already, can please try symlink sudo ln -s libxml2/libxml libxml noted here: src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: no such file or directory

javascript - Sticky navigation bar - not working -

question i want navbar stick conditionally on scroll. there bugs can not quite diagnose, new jquery. preventing nav bar sticking conditionally on scroll? the jquery in jsfiddle below not run correctly, , after trying awhile make work, cannot seem make run. i've looked @ other examples of i'd rather not change jquery entirely until know reason code not work. not link html full of lorem ipsum test text body. found in jsfiddle link. what error in javascript isn't making navbar apply sticky class? javascript var navtop = $(".nav").offset().top; var stickynav = function(){ if ($(window).scrolltop() >= navtop){ $(".nav").addclass(".sticky") } else { $(".nav").removeclass(".sticky") } }; stickynav(); $(window).scroll(function(){ stickynav(); }; css * { margin: 0; box-sizing: border-box; } .mainheader { width: 100%; height: 20%; background-color: rgb(62, 65, 66); text-align: cen...

ios - Data is passed only once to child VC in container view -

i trying pass data container view contain 1 of several child view controllers depending on user state. passing data first time new vc instantiated, if close , reopen child vc, data doesn't passed through again. here action when button pressed: @ibaction func onmapbuttonpressed(sender: uibutton) { let latitude = double(selectedplace.latitude!) let longitude = double(selectedplace.longitude!) bringinsubview("mapviewscreen") (childviewcontrollers[0] as! placemapdetailvc).latitude = latitude! (childviewcontrollers[0] as! placemapdetailvc).longitude = longitude! (childviewcontrollers[0] as! placemapdetailvc).placename = selectedplace["name"] as! string } and helper methods: func bringinsubview(name:string) { newviewcontroller = self.storyboard?.instantiateviewcontrollerwithidentifier(name) newviewcontroller!.view.translatesautoresizingmaskintoconstraints = false self.addchildviewcontroller(self.newvi...

android - Passing data between activities problems -

in project, using volley library data, , based on data adding buttons, buttons displayed correctly problem opening activity not working: requestqueue requestqueue; textview txt; final int my_req_code = 12345; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_categories); final gridlayout layout = (gridlayout) findviewbyid(r.id.layout); requestqueue = volley.newrequestqueue(this.getapplicationcontext()); jsonobjectrequest jsonobjectrequest = new jsonobjectrequest(request.method.get, "url", null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { try { jsonobject jsonanswer = response.getjsonobject("answer"); final string[] name=new string[9]; txt = (textview) findviewbyid(r....

sql - Insert into with union -

i have problem. there 3 tables: t1, t2, t_target. t1 , t2 table have many different columns need id column both. t_target table has id column of course , another: project_no. there ids appears in t1 , t2 too, don't want create duplicates between them, if id appears in both table have inserted t_target once if in t_target it's allowed act twice. other of criteria every newly inserted id must value 21 in 'project_no' column. so, e.g.: t1: id 2548 2566 2569 2843 2888 ... t2: id 2557 2566 2569 2700 2913 2994 3018 5426 ... t_target: id project_no 2976 1 3331 7 4049 7 5426 8 5915 3 6253 10 ... and result want see: t_target: id project_no 2548 21 2557 21 2566 21 2569 21 2700 21 2843 21 2888 21 2913 21 2976 1 2994 21 2018 21 3331 7 4049 7 5426 8 5426 21 5915 3 6253 10 ... so, tried code (it important here "not null" criteria because both of t_target columns primary key): insert t_target ...