Posts

openlayers 3 - geolocation.bindTo() is not defined -

i following guide. executes when visit site when try run localhost gives me geolocation.bindto() error undefined. read being geolocation object not yet created or method executes asynchronously far read here. here link: https://openlayersbook.github.io/ch10-openlayers-goes-mobile/example-02.html this tracking location of user using openlayers 3 openstreetmaps. bindto depracted ol.dom.input. use "propertychange" , other listeners.

ruby on rails - Rails4: Template is missing error with using PDFKit -

i'd generate pdf file, trying use pdfkit failing. the following error displayed when input http://localhost:3000/users/1.pdf browser. template missing missing template /users.show {:locale=>[:en], :formats=>[:pdf], :variants=>>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. searched in: * "c:/xxx/xxx/app/views" please advise me on how avoid error. \config\initializers\pdfkit.rb pdfkit.configure |config| config.wkhtmltopdf = `which wkhtmltopdf`.to_s.strip config.default_options = { encoding: "utf-8", page_size: "a4" } end \app\controllers\users_controller.rb def show @user = user.find(params[:id]) respond_to |format| format.html format.pdf html = render_to_string template: "users.show" pdf = pdfkit.new(html, encoding: "utf-8") send_data pdf.to_pdf, ...

ios - Swift: How to use static cell in dynamic UITableView -

static dynamic dynamic dynamic .. .. dynamic i've dynamic table list dynamic content. @ top of list, need static cell. and trying add label in static cell try features. my static cell's identifier is: firstcell dynamic cell's identifier is: cell override func numberofsectionsintableview(tableview: uitableview) -> int { // #warning potentially incomplete method implementation. // return number of sections. return 1 } override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { // #warning incomplete method implementation. // return number of rows in section. return 5 } override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("cell", forindexpath: indexpath) as! uitableviewcell // configure cell... cell.textlabel?.text = "test" return cell } t...

ruby - Rails not including timestamps even though I specifically ask for them -

i having problem ror. need fields created_at , updated_at in in tables further use. rails doesn't seem add them though ask rails to. these models: picture.rb class picture < activerecord::base belongs_to :category has_many :comments, dependent: :destroy mount_uploader :photo, photouploader validates_presence_of :photo end category.rb class category < activerecord::base has_many :pictures, dependent: :destroy validates :name, presence: true, uniqueness: { case_sensitive: false } end comment.rb class comment < activerecord::base belongs_to :user belongs_to :picture validates :text, presence: true end these migrations: class createcategories < activerecord::migration def change create_table :categories |t| t.string :name t.timestamps end end end class createpictures < activerecord::migration def change create_table :pictures |t| t.string :description t.references :category...

android - Disable DrawerLayout's scrim touch gesture -

Image
i need disable touch gesture on scrim (the red highlighted part). want dismiss drawer swipe. the issue when drawer layout open , need select element listview below red highlighted part, what's happend drawer closed , @ point can select element listview. i need select element listview directly, when drawer opened you have create custom drawer public class customdrawer extends drawerlayout { public customdrawer(context context) { super(context); } public customdrawer(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); } public customdrawer(context context, attributeset attrs) { super(context, attrs); } @override public boolean onintercepttouchevent(motionevent event) { if(isdraweropen(gravity.start)){ if(event.getx() > getchildat(1).getwidth()){ return false; } } return super.onintercepttouchevent(ev...

nuget - How best to support multiple versions of .net in the same library -

i creating .net library in visual studio 2015 following aims:- support .net 2, 3.5, 4 , 4.5+ pcl support (.net 4.5+) no dependencies apart json.net ideally .net 4.5+ version of library make use of async, , include methods return task etc now there seems many different ways of supporting want do, visual studio 2015/project.json release approach starting scratch today? my library relatively simple, as want re-use code don't want compromise .net 4.5 version. what sensible project structure, mean take advantage of latest .net framework, still build in support older frameworks. with beta8 of webdev tooling able target net2, net35, net40, net45, ... your library differences might use #ifdef flags in code hide methods in builds.

volt - Task not setting variables properly? -

having issues getting variable passed client. task gets run this: def getmaps $mapnames_current = [] url = 'http://s3-ap-northeast-1.amazonaws.com/splatoon-data.nintendo.net/stages_info.json' resp = net::http.get_response(uri.parse(url)) buffer = resp.body result = json.parse(buffer) result.each |gamemode| gamemode['stages'].each |stage| $mapnames_current << $mapnames.key(stage['id']) end end end and $mapnames_current gets called here: <div class="text-center"> <h2>current maps!</h2> <h3>turf war:</h3> <h2>{{ $mapnames_current[0] }}</h2> <h2>{{ $mapnames_current[1] }}</h2> <h3>ranked:</h3> <h2>{{ $mapnames_current[2] }}</h2> <h2>{{ $mapnames_current[3] }}</h2> </div> i'm not sure what's going wrong here. shouldn't $mapnames_current variable accessibl...