Posts

Showing posts from June, 2012

javascript - Using toggleClass in jQuery to shrink a div -

i have div , i'm trying shrink when click button. , when click again, want original size. i'm using toggleclass this, did wrong code, , i'm not sure where. please take look. thanks. //********************************************************************* <style> div { border: 1px solid black; width: 500px; height: 500px; } .shrink { width: 250px; height: 250px; } </style> //********************************************************************* <button type = "button"> click me </button> <div> can tell me secret? </div> //********************************************************************* <script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type = "text/javascript"> $(document).ready($function { $("button").click(function(){ $("div").toggleclass("shrink...

python - Moore Neighborhood in a matrix -

Image
i have 2d text file converted image(the shape of 5 in case) , i'm trying implement moore neighborhood trace algorithm. problem when reach point in middle of matrix program starts visiting cells have been visited before never reaching bottom of matrix. input: 00000000000000000000 00000000000000000000 00000000000000000000 00001111111111100000 00001111111111100000 00001100000000000000 00001111111110000000 00001111111111100000 00000000000001110000 00000000000000110000 00011000000000110000 00011100000001110000 00001111111111110000 00000111111111000000 00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000 my output( 'x' border , cell after n iterations) 00000000000000000000 00000000000000000000 00000xxxxxxxxxx00000 000011111111111x0000 000011111111111x0000 000011xxxxxxxxx00000 0000111111111x000000 000011111111a1100000 000000000000x1110000 00000000000000110000 00011000000000110000 0001110000000111000...

asp.net - Unable to debug web control click handler -

asp.net webforms application. there custom web control (ie inherits system.web.ui.webcontrols.webcontrol). can put breakpoints anywhere in createchildcontrols() or other overloaded method , these breakpoints work fine. however, if try add breakpoint method bound button on page, error on breakpoint: the breakpoint not hit. no executable code of debugger's target code associated line. possible causes include: conditional compilation, compiler optimizations, or target architecture of line not supported current debugger code type. i've tried cleaning solution, deleting bin/obj folders, restarting local iis, recycling app pool, no avail. code in vb.net (sorry). here function definition (in webcontrol code): private sub addtocartclick(byval sender object, byval e system.eventargs) // breakpoint on line 1 here code ties function button: dim button = new button addhandler button.click, addressof addtocartclick the code executes , has worked long time, ca...

Drag the image outside of the window to create a file using Java -

Image
the image see below bufferedimage representation of pdf. bufferedimage in imageicon contained in jlabel. what attempting here able drag image out application in system. if drag document (including images) application accepts it. need drag drop application pdf. using pdfbox manipulate pdfs. end users have have implemented drag drop. other application accepting these documents written in way once document in system cannot removed , drag drop best way them so. because, however, image contained in jlabel cannot drag out, or @ least cannot find way so. can drag jlabel, dragging out not appear option. this first attempt @ doing drag drop built application of mine , can see ability drag file url onto desktop. there way me able drag (url or otherwise) out of window @ least onto desktop? thinking if can onto desktop can other application. i can save file temporarily pdf believe going have do, don't know how file out of jlabel. appreciated. my design wrong why dnd not ...

c++ - Print Index of a multilist -

Image
i trying print index of multi linked list. each node has 2 elements- warehouse number , tool number. printing tools in each warehouse. having problem iterating correctly through list. i not getting correct values , having trouble finding problem in method. struct node { int warehousenumber; int toolnumber; struct node *n; } void showwarehouses() { int tempvalue; bool flag = false; struct node *s; s = start; if (start == null) { cout<<"unable"; return; } s->warehousen = tempvalue; cout<<"warehouse "<<tempvalue<< ": tool "; while(s != null) { if (s->warehousen == tempvalue) { flag = true; cout<< s->tooln <<" "; s = s->next; } } } you haven't assigned values tempvalue causes undefined behavior. read this post. also based on ha...

javascript - What is causing "Uncaught Error: write after end" in my tests? -

i have following code: var promise = require('bluebird'); promise.longstacktraces(); var path = require('path'); var fs = promise.promisifyall(require('fs-extra')); var clone = require('nodegit').clone.clone; var tar = require('tar-fs'); var zlib = require('zlib'); var gzip = zlib.creategzip(); var globasync = promise.promisify(require('glob')); module.exports = archive; function archive(pkg) { var self = this; var tmp_dir_name = '.tmp'; var code_dir_name = 'code'; var files_dir_name = 'files'; var output_dir_name = 'archives'; var coverall_docs_dir_name = 'coverall_documents'; // archive's name (no extension): self.name = pkg.name; self.recipient_name = pkg.recipient_name; // path letter.tex: self.tex_letter_path = path.resolve(pkg.files.letter); // path resume.tex: self.tex_resume_path = path.resolve(pkg.files.resume); // path merged.pdf (letter.pdf...

awk to include name in field between location and average -

in awk below location $1 , calculated average $4 printed. can not seem syntax correct include $2 in output between $1 , $4 . thank :). awk '{ if(len==0){ last=$1;total=$4;len=1;getline } if($1!=last){ printf("%s\t%f\n", last, total/len); last=$1;total=$4;len=1 } else{ total+=$4;len+=1 } } end{ printf("%s\t%f\n", last, total/len) }' input.bed > output.txt input.bed chr1:955542-955763 agrn:exon.1 1 0 chr1:955542-955763 agrn:exon.1 2 0 chr1:955542-955763 agrn:exon.2 3 0 chr1:955542-955763 agrn:exon.2 4 1 current output.txt chr1:955542-955763 21.289593 chr1:957570-957852 304.861702 desired output.txt chr1:955542-955763 agrn:exon.1 21.289593 chr1:957570-957852 agrn:exon.2 304.861702 maybe awk '{if(len==0){last=$1;**name=$2**,total=$4;len=1;getline}if($1!=last){printf("%s\t%f\n", last, ,**name**, total/len);last=$1;name=$2;total=$4;len=1}else{total+=$4;len+=1}}end{pr...

php - How to create a dynamic array variable -

i have these arrays , want loop through every array creating dynamic variable put name in foreach loop automatically this foreach ($activities.$i &$activity) { //$i = 1,2,3,4.. //code } //activities $activities1 = $_post["activities1"]; $activities2 = $_post["activities2"]; $activities3 = $_post["activities3"]; $activities4 = $_post["activities4"]; easier method use array naming hack: <input name="activities[1]" ..> <input name="activities[2]" ..> <input name="activities[3]" ..> which makes $_post['activities'] array: foreach($_post['activities'] $i => $value) { // $i -> 1,2,3,4 } but if insist on embedding index inside key's name, then: foreach(range(1,4) $i) { foreach($_post["activities{$i}"] $value) { ... } }

Can I use the same button on multiple Android activities and return to original activity? -

i'm new android , making very, rough sketch of how app display information users. making app not providing text displays. what want have multiple activities text box , underneath have button using oncreate method (i believe correct method) have exact same button on each activity linking main activity. want make don't have recreate intent or button code on every page, make single line "display button id=home" on each activity. want make simple possible because i'll making a lot of activities text display. when figure out i'm going drop buttons , use navigation drawer access info need draft team start organizing information displays. i hope explaining final product can show want do. in advance! create button programmatically. linearlayout.layoutparams layoutparams = new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); button button1 = createbutton(this); layout.addview(button1); public static button createbu...

c# - LINQ conversion to List object -

i using following code return ilist: filename = path.getfilename(files[i]); ilist<datax> querylistfromftp = datax.getlistfromftp(filename); querylistfromftp = (ilist<datax>)querylistfromftp .select(x => new { x.user_id, x.date, x.application_id }) .tolist() .distinct(); however keep getting error: unable cast object of type 'd__7a 1[<>f__anonymoustype0 3[system.string,system.string,system.string]]' type 'system.collections.generic.ilist`1[dataxlibrary.datax]'. what doing wrong? if want list < datax > need is: ilist<datax> querylistfromftp = datax.getlistfromftp(filename).distinct().tolist(); // use querylistfromftp here. if want list of different type of object result of .select, need store result in list of object of type i.e. anonymous if that's want.

swift - How do I get the instance from a Generic? -

i cannot understand why causes errors (errors shown comments in code): class someclass { var id = 123 } class anotherclass { func myfunc<t>(object: t) { t.id = 555 // error: type 't' has no member 'id' object.id = 555 // error: value of type 't' has no member 'id' } } let someclass = someclass() let anotherclass = anotherclass() anotherclass.myfunc(someclass) how instance of someclass after passing generic function? also, can't named downcasting inside anotherclass (as expect generic). you have little bit more generics. t has no member called id - correct! because pass in some t has member (someclass) not matter compiler since @ other point can insert else int or [double] or anything. consider adding following line code anotherclass.myfunc(1) what should happen? should .id do??? fail because 1 not have member called id . your t has no generic constraint telling compiler anything, t...

xml - NoSuchBeanDefinitionException caused by nested bean definition for Spring JPA -

spring jpa 4.2.1 nested bean definition looks below gets nosuchbeandefinitionexception : "no qualifying bean of type [javax.persistence.entitymanagerfactory] defined" <bean id="tm" class="...jpatransactionmanager"> <property name="entitymanagerfactory"> <bean class="...localcontainerentitymanagerfactorybean"> <property name="datasource"> <bean class="...basicdatasource" p:driverclassname="..." p:url="..."> </bean> </property> </bean> </property> </bean> only flat definition works below, why? <bean id="tm" class="...jpatransactionmanager"> <property name="entitymanagerfactory" ref="emf" /> </bean> <bean id="emf" class="...localcontainerentitymanager...

javascript - Trying to make a Bookmarklet to set a cookie every 6 seconds -

i not experienced javascript trying make bookmarklet run document.cookie (with arguments) every 6 seconds. can bookmarklet to cookie cannot figure out how make loop. tried googling how make loop , putting javascript bookmarklet generator didn't work. can please give me bookmarklet code (like javascript:blablabla) every 6 seconds? thank reading this edit: also bookmarklet goes different page new cookie data never goes original page, can guys tell me how set cookie without going page? use setinterval(); , wil execute given function every x milliseconds w3 schools page .

sql server - Case statement not correctly matching expected values -

i'm trying generate randomized data, , i've been using newid() seed functions since called once every row , guaranteed return different result each time. i'm getting values somehow not equal integers in expected range. i've tried few variations, including highly upvoted one , result in same issue. i've put script shows problem: declare @test table (id uniqueidentifier) insert @test select newid() sys.objects select floor(rand(checksum(id)) * 4), case isnull(floor(rand(checksum(id)) * 4), -1) when 0 0 when 1 1 when 2 2 when 3 3 when -1 -1 else 999 end, floor(rand(checksum(newid())) * 4), case isnull(floor(rand(checksum(newid())) * 4), -1) when 0 0 when 1 1 when 2 2 when 3 3 when -1 -1 else 999 end @test i expect results in range 0 3 4 columns. when unique identifiers retrieved table, results correct (first 2 columns.) similarly, when...

php - Return textbox value after press cancel button -

i have code this: <?php $name = "edward"; $country = "indonesia"; ?> <form id="bio"> <input type="text" id="name" value="<?= $name ?>"> <input type="text" id="country" value="<?= $country?>"> </form> <button class="clear">cancel</button> so when first load, textboxes filled according variable defined before. change / type in both textbox name or country. how make text box value value before (textbox name filled edward, , country filled indonesia - both filled it's default value) when press cancel button ? helping :) in html5 use <form> <input type="text" id="name" placeholder="<?= $name ?>"> <input type="text" id="country" placeholder="<?= $country?>"> <button class="clear" type="reset...

sql server - How to use MERGE's 'When not matched' to insert a new record in same table? -

i trying upsert single table using sql server's merge statement. declare @mergeoutput table (action varchar(50)) declare variables ... merge usertable target using (select .... usertable filter conditions using variables) source (column names..) on source.... = target.... (multiple statements) when matched update set.... when not matched target insert (...) values (...) output $action @mergeoutput; select * @mergeoutput the update works if there's match insert doesn't happen when there's no match. @mergeout empty. update , insert statements should take action on 1 row. how merge work when using statement empty set , want insert new row? update: sql run everything. expected @mergeoutput return 'insert' , person table have new row. create table person ( name varchar(20) ) declare @mergeoutput table (action varchar(50)) declare @newname varchar(20) select @newname = 'john' merge person target using (select name person na...

python - sqlalchemy: Making schema reflection find/use a custom type for all instances -

i'm trying override sqlalchemy datetime2 type (from ms sql server) discard digits of subsecond precision if necessary coerce native python datetime type, described in replacing bind result processing of existing types section of docs, so: import re import sqlalchemy.dialects sa_dialects class truncatingprecisiondatetime2(sa_dialects.mssql.base.datetime2): __visit_name__ = 'datetime2' _reg = re.compile(r"(\d+):(\d+):(\d+)(?:\.(\d{0,6})\d*)?") def process_result_value(self, value, dialect): if isinstance(value, util.string_types): return datetime.time(*[ int(x or 0) x in self._reg.match(value).groups()]) else: return value def adapt(self, impltype): return truncatingprecisiondatetime2() however, when call meta.reflect() , , inspect type of 1 column of type datetime2 in database, it's instance of sqlalchemy.dialects.mssql.base.datetime2 rather truncating...

html - Parse <tr> block into UITableCell -

Image
i'm using hpple parse html of website onto app. parsing working great instead of contents of tr block in 1 cell, each of td elements in tr block table cells of own. here's mean. tr block: <tr> <td>2</td> <td>down 1</td> <td>1</td> <td>5</td> <td>justin bieber</td> <td>what mean?</td> </tr> what looks in app: when want this: the code i'm using parsing looks this: - (void)loadsongs { // 1 nsurl *tutorialsurl = [nsurl urlwithstring:@"http://www.bbc.co.uk/radio1/chart/singles/print"]; nsdata *tutorialshtmldata = [nsdata datawithcontentsofurl:tutorialsurl]; // 2 tfhpple *tutorialsparser = [tfhpple hpplewithhtmldata:tutorialshtmldata]; // 3 nsstring *tutorialsxpathquerystring = @"//tr/td"; nsarray *tutorialsnodes = [tutoria...

javascript - How can I retrieve an extended property for a Google Calendar event? -

i have several extended properties i've added various events using php. want retrieve them using google apps script in google sheets. i'm able access calendar, events , standard data elements this: var mycal = "... calendar id ...."; var cal = calendarapp.getcalendarbyid(mycal); var events = cal.getevents(new date("january 12, 2015 00:00:00 cst"), new date("january 18, 2017 23:59:59 cst")) (var i=0; < events.length; i++) { var mystart = events[i].getstarttime(); var mytitle = events[i].gettitle(); var mydesc = events[i].getdescription(); var mytalkno = ?? } how query private extended property named "talk-number" on each event? within google apps script have 2 ways interact google calendar; calendar service , advanced calendar service (aka calendar api) must enabled via advanced google services. the acs uses resource representations google calendar api , extendedproperties available...

Javascript listen for 2nd click -

i have script using.i when user clicks once changes var 0 when user clicks again changes var 3 , repeats. click again 0 3 @ moment part want detect 2nd click 'mousemove'.can please below code. window.addeventlistener('load', function () { function go() { = < height ? + step : 1; m.style.margintop = -i + 'px'; } var = 0, step = 3, space = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; var m = document.getelementbyid('marquee'); var t = m.innerhtml; m.innerhtml = t + space; m.style.position = 'absolute'; var height = (m.clientheight + 1); m.style.position = ''; m.innerhtml = t + space + t + space + t + space + t + space + t + space + t + space + t + space; // first click m.addeventlistener('click', function () { step = 0; }, true); // second click m.addeventlistener('mousemove', functi...

3d - Monogame imported Blender .FBX unaffected by lighting -

Image
i upgraded old monogame project latest version of monogame. running used to, however, imported .fbx models appearing pure black (implying they're not being lit up). (the burgers+tapes made dynamically using quads @ runtime. affected lighting should be). my code (which worked in older versions of monogame) displaying model follows: public override void draw() { foreach (modelmesh mesh in model.meshes) { foreach (basiceffect effect in mesh.effects) { effect.world = matrix.createrotationz(rotx); effect.world *= matrix.createrotationx(roty); effect.world *= matrix.createtranslation(new vector3(pos.x, pos.y, 0f)); effect.view = maingame.matrixview; effect.projection = maingame.matrixproj; effect.textur...

In c++ 11, how to invoke an arbitrary callable object? -

the concept of callable defined in http://en.cppreference.com/w/cpp/concept/callable . suppose have callable object f has 1 argument of type t* , return type void . f can callable type (a function object, pointer member function, pointer data member, etc). how can invoke f ? simply calling f(x) fails since f can pointer member function or data member. there simple way call f ? 1 possible solution std::bind(f, x)(), solution becomes more complex when f has more arguments. this std::invoke does, won't standard until c++17. can make own version, can pretty complicated if general. here's basic idea 2 cases (code taken cppreference.com): template <class f, class... args> inline auto invoke(f&& f, args&&... args) -> decltype(std::forward<f>(f)(std::forward<args>(args)...)) { return std::forward<f>(f)(std::forward<args>(args)...); } template <class base, class t, class derived> inline auto inv...

arrays - Python/Tornado Class wrapper caching issue -

i'm implementing wrapper around python's array data structure. i'm doing practical reasons in application, example code provided reproduce problem. array doesn't seem 'cleared' each request through tornado abstraction. if don't use array abstraction, there no problem. leads me believe there bug somewhere in cpython implementation. from tornado import websocket, web, ioloop import json class array(): _data = [] def push(self, value): self._data.append(value) def json(self): return json.dumps(self._data) class clienthandler(web.requesthandler): def prepare(self): self.set_header("content-type", "application/json") def get(self): array = array() in range(0, 6): array.push({'id': i}) self.write(array.json()) self.finish() app = web.application([ (r'/client', clienthandler), ], debug=true) if __name__ == '__main__...

Referencing bootstrap class in JQuery for ASP generated HTML -

my page uses asp (vbscript) generate div bootstrap class 'alert' upon successful sql submission. want happen - once user submits form , alert div appears, click on first input field of form, want alert div disappear. have feeling issue lies with: a.) referencing div generated asp in jquery b.) referencing div multiple bootstrap classes c.) maybe i'm breaking golden rule knows , don't. any appreciated. code below: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script> $(function(){ $("qname").click(function(){ $(".alert").hide(); }); }); </script> </head> <body> <!-- #include virtual="/navbar.asp" --> <section> <div class='container'> <div class='row well-lg'> <% if intstatus = 1 response.write("<div class='alert alert-s...

android - Adapter not dislpaying correct data -

i new android. develping application in getting large json data server. want display in list view. getting same value repeated. no of items shown list view proper. same data repeated in list items. here code. public class historyactivity extends appcompatactivity { private toolbar toolbar; string strserverresponse = null; progressdialog ndialog; arraylist<string>clicklat; arraylist<string>clicklong; arraylist<string>dttime; arraylist<pojo> history; historyadapter myadapter; listview list; public string date, intime, outtime, inlat, inlong; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_history); toolbar = (toolbar) findviewbyid(r.id.app_bar); toolbar.settitle("history"); clicklat=new arraylist<string>(); clicklong=new arraylist<string>(); dttime=new arraylist<string>(); setsupportactionbar(toolbar); getsup...

javascript - Stop jQuery animation when mouse enters div -

i have div box changes heights , hides text. in jquery have : fiddle $("#nav_bar").mousedown(function() { var mousepos; $(this).animate({height: "3.750em"}, 500, "swing"); $("#home, #videos, #about_us, #unknown").show(); $(this).mouseleave(function() { mousepos = 1; $(this).delay(1000).animate({height: "1em"}, 500, "swing"); $("#home, #videos, #about_us, #unknown").delay(1000).hide(250); $(this, "#home, #videos, #about_us, #unknown").mouseenter(function({ mousepos = 0; }); if(mousepos == 1) { $("#nav_bar").animate({height: "1em"}, 500, "swing"); $("#home, #videos, #about_us, #unknown").hide(250); } else if (mousepos == 0) { $("#nav_bar").stop(true, true); $("#home, #videos, #about_us, #unknown").stop(true, true...

html5 - How to validate with Javascript? -

thanks having work much, confused on javascript. have tried many things , have not gotten form validate once. have use plain javascript to: **validate email - email must have @ , domain should yahoo.com phone no.: must contain 10 digits age: must positive number less 120 the validation should happen when user submits form. in case of above validation fails, corresponding fields should highlighted in red if validation successful, page should redirect http://yahoo.com ** i'm not looking give me exact answer, push me in right direction, because have basic understanding of js. <!doctype html> <div id="form"> <form name="myform" action="http://fsu.edu" onsubmit="return validateform()" method="post"> <head> <link rel="stylesheet" href="c:\users\neshia\desktop\cgs3066\form validation style sheet.css" type="text/css"> <script> function validatemyfo...

c# - SMTP authentication using GMAIL, error 5.5.1 -

i'm getting little trouble when try using smtp , mailmessage in c# : it's first time using smtp , mailmessage , so, might wrong lines, i've done far , need of guys. i have searched lot of things , here on stackoverflow, far, can't think anymore i'm doing wrong it. when try running (mode debugging , normal run) application console (just tests on console, pretty simple) gives me error the smtp server requires secure connection or client not authenticated. server response was: 5.5.1 authentication required. learn more at i understood following error on visual studio 2013 , problem because don't know properties , methods of class smtp , mailmessage , , makes me not understand i'm doing wrong on code, below, class email on my console application /// <summary> /// email server /// </summary> protected smtpclient smtpclient { get; set; } /// <summary> /// message content /// </summary...

html - Default jQuery Mobile CSS styling won't apply, multiple browsers tested -

Image
i'm trying play around , learn jquery mobile, can't basic css styling apply. referencing css link jquery mobile website, , connected internet (but have tried loading css locally html, still wouldn't apply) here test code: <!doctype html> <html> <head> <meta charset="utf-8"> <title>2test</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src="http://code.jquery.com/jquery-1.4.5.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> </head> <body> <div data-role="page"> <div id="header" data-role="header"> <h1>my photos</h1> </...

c# - How to show Confirmation message in jquery on button click event -

i developing web application in asp.net. requirement show confirmation message on every button click event (insert,update , delete buttons). using jquery message box in through out application successfull insert,update , delete. function messagebox(title, innertext) { try { var dialog = $('<p class="messagebox">' + innertext + '</p>').dialog({ title: title, width: "240", modal: true, buttons: { "ok": function () { dialog.dialog('close'); } } }); } catch (e) { messagebox('tracker alert', e); } } call on button click event result = save_updatedata(2); if (result > 0) { scriptmanager.registerstartupscript(this, gettype(), "msg", "messagebox('tracker alert', 'record updated succesfully');", tru...

mysql - Counting data based on decades -

i have table books column release year of book (type: year). want count number of books released in every decade. i have tried following: select count(*) count, concat(decade, '-', decade + 9) releaseyear ( select floor('releaseyear' / 10) * 10 decade book ) t group decade; but returns 0 results. when try year('releaseyear') returns nulls. create decade value each row , find count(decade) .. group decade. query select t.decade,count(t.decade) bookscount ( select *, concat((releaseyear - ((releaseyear % 10)-1)),'-',((releaseyear - ((releaseyear % 10)-1))+ 9)) decade books )t group t.decade; sql fiddle

mysql - Remote db connection issues -

i trying log mysql using ssh using command: mysql -u username -p -h hostname where 'username' , 'hostname' , placeholders real params. however, above gives error : error 1045 (28000): access denied user 'username'@'vps-xxxxxx.xxxx.com' (using password: yes) why appending "@vps-xx...." remote server username? place on root grant privileges on *.* 'username'@'ip' identified 'password' grant options; privileges provided mysql once have finalized permissions want set new users, sure reload privileges. flush privileges; how grant different user permissions here short list of other common possible permissions users can enjoy. all privileges - saw previously, allow mysql user access designated database (or if no database selected, across system) create - allows them create new tables or databases drop - allows them them delete tables or databases delete - allows them delete rows tabl...

html - Why would IE8 remove custom data attribute from the body element/tag? -

im having real strange issue ie8 isn't parsing data attributes on <body> tag. for example, have following html: <body data-controller="homectrl"> when inspect page in ie8 developer tools attribute missing. confirmed when execute javascript in console (it returns null!): document.body.getattribute('data-controller') if view source, data attribute indeed there, ie8 seems ignore or remove it?!? more strangely, if have div within body.. example <div id="main" data-controller="homectrl"> this works! can see in developer tools , can read value javascript. bizarre! has come across before? cause happen?

Unable to play Youtube videos using YouTube Android Player API -

i getting error "cannot load modern controls ui. upgrade latest version of android youtube api." used youtubeplayer.addfullscreencontrolflag(youtubeplayer.fullscreen_flag_control_system_ui); but still getting same error go through unable play youtube videos using youtube android player api but still getting error. i faced bug because using fragment inside youtube fragment. removed inner fragment problem solved , youtube videos working properly.