Posts

android - Class must either be declared abstract or implement abstract method? -

this question has answer here: class must either declared abstract or implement abstract method error 3 answers it loos i'm doing right here must missing something. hoping explanation why i'm getting error in first line of code , should fix type of problem? i'm new android dev. public class page2 extends appcompatactivity implements onclicklistener { /** * attention: auto-generated implement app indexing api. * see https://g.co/appindexing/androidstudio more information. */ private googleapiclient client; imagebutton rock, scissors, paper; random randomnum = new random(); int cpumov; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activitypage2); //set xml page style display rock = (imagebutton) findviewbyid(r.id.imagebuttonrock); scissors = (imagebutton...

javascript - Tinder like function, appcelerator -

i tried re create tinder function. i found code : var win = titanium.ui.createwindow({ backgroundcolor: "#ffffff", title: "win" }); // animations var animateleft = ti.ui.createanimation({ left: -520, transform: ti.ui.create2dmatrix({rotate: 60}), opacity: 0, duration: 300 }); var animateright = ti.ui.createanimation({ left: 520, transform: ti.ui.create2dmatrix({rotate: -60}), opacity: 0, duration: 300 }); var curx = 0; win.addeventlistener('touchstart', function (e) { curx = parseint(e.x, 10); }); win.addeventlistener('touchmove', function (e) { if (!e.source.id || e.source.id !== 'oferta') { return; } // subtracting current position starting horizontal position var coordinates = parseint(e.x, 10) - curx; // defining coordinates final left position var matrix = ti.ui.create2dmatrix({rotate: -(coordinates / 10)}); var animate = ti.ui.createanimation(...

swing - How do you access your computer's menu bar in java? -

i making gui text editor in java. know java's swing interface provides menu bars in form of jmenubars, want doesn't take space in window. picture shows jmenubar i know enough, want looks this: picture shows computer's menu is there way programmatically? in advance.

algorithm - Can I assume that a bitwise AND operation is O(1)? If so why? -

my processor can arithmetic operations on 8-bit or 16-bit unsigned integers. 1) means word size processor 16 bits, correct? operations on words o(1). the reason has actual circuit-level implementation of how processor works, correct? if add 2 words, , result number more 16-bits, state following? 1) processor can add numbers report 16 least significant digits. 2) report more 16 bits, processor must have software permits these operations large numbers (numbers don't fit in word). finally, let's have word w 16-bit digit , want 8 least significant digits. can w & 0xff. time complexity of operation? o(1) because of circuit level implementation of processor well? short answer: yes, single bitwise , considered o(1) . a little more detail: even if looked @ number of operations on each bit still o(1) . actual number of bit operations may vary variable type, e.g. 8 bits vs. 16 bits vs. 32 bits vs. 64 bits (even 128 bits or more). key no matter under...

html - Javascript: is it possible to read the raw code of external scripts? -

given typical script tag: <script src="foo.com/myscript.js"></script> would possible directly read contents of myscript.js string or something? example: <script id="myscript" src="foo.com/myscript.js"></script> <script> var inners = document.getelementbyid("myscript").//raw contents of myscript.js </script> no. can read contents of inline script tag, because have content: <script id="myscript"> var inners = document.getelementbyid("myscript").textcontent; </script> but external js, script contents not put dom; need re-fetch using ajax (it cached unless anti-caching measures taken, not take time re-fetch).

reactjs - Use React-Redux To Develop a Login Page -

i try use react-redux develope login page , encounter problems. i want send textfields account , password server ajax, when click login button, login button can not value of textfields. i not want use "form tag" , try best solve problem myself, still suspect solution, want find advise problem. my solution following textfields trigger action set login info next state. login button send these info server only. the following part of codes. textfield: class baseinputcomponent extends react.component { constructor(props) { super(props); this._handlechange = this._handlechange.bind(this); } _handlechange(e) { this.props.onchange({infotype: this.props.datatype, data: e.target.value}) } render() { var style = { marginbottom: 30 }; return ( <div style={style}> <textfield hinttext={ this.props.hinttext } floati...

html - Setting width and height of the video -

i facing problem regarding width , height of video. right now, occupying full screen want full sized in width , setting height want. example, refer http://airbnb.com . if me out. <div align="center"> <video autoplay loop id="video" class="con"> <source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4> </video> <div class="overlay"> <form> <label for="input">form input label</label> <input id="input" name="input" value="" /> <button type="submit">submit</button> </form> </div> </div> this css using. .con { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; transform: translatex(-50%) translatey(-50%); transition: 1s opacity; } .overlay { position:absolute; top:0; left:0; z-index:1; } it see...