This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function () { | |
| alert('watch out!'); | |
| }(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Immediate function style 1 | |
| (function () { // JSLint prefers this one | |
| alert('watch out!'); | |
| }()); | |
| // Immediate function style 2 | |
| (function () { | |
| alert('watch out!'); | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Waffle() { | |
| if (!(this instanceof Waffle)) { | |
| return new Waffle(); | |
| } | |
| this.tastes = "yummy"; | |
| } | |
| Waffle.prototype.wantAnother = true; | |
| // testing invocations | |
| var first = new Waffle(), | |
| second = Waffle(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| myname = "global"; // global variable | |
| function func() { | |
| alert(myname); // "undefined" | |
| var myname = "local"; | |
| alert(myname); // "local" | |
| } | |
| func(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div><!-- 1 --> | |
| <span class="red"><!-- 1.1 --></span> | |
| </div> | |
| <div><!-- 2 --> | |
| <span class="green"><!-- 4 --><span> | |
| </div> | |
| <div><!-- 3 --> | |
| <span class="blue"><!-- 5 --></span> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div><!-- 1 --> | |
| <span class="red"><!-- 6 --></span> | |
| </div> | |
| <div><!-- 2 --> | |
| <span class="green"><!-- 4 --><span> | |
| </div> | |
| <div><!-- 3 --> | |
| <span class="blue"><!-- 5 --></span> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <br /><br /> | |
| <div id="absdiv1"> | |
| <br /><span class="bold">DIV #1</span> | |
| <br />position: absolute; | |
| </div> | |
| <div id="flodiv1"> | |
| <br /><span class="bold">DIV #2</span> | |
| <br />float: left; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var rect = { | |
| leftTop: {x: $this.offset().left + 2, y: $this.offset().top + lineHeight / 2}, | |
| bottomRight: {x: $this.offset().left + $this.width() - 2, y: $this.offset().top + limitHeight - lineHeight / 2} | |
| }; | |
| var rangeStart = doc.caretRangeFromPoint(rect.leftTop.x, rect.leftTop.y); | |
| var rangeEnd = doc.caretRangeFromPoint(rect.bottomRight.x, rect.bottomRight.y); | |
| var range = doc.createRange(); | |
| range.setStart(rangeStart.startContainer, rangeStart.startOffset); | |
| range.setEnd(rangeEnd.startContainer, rangeEnd.startOffset); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.fn.lineHeight = function() { | |
| if (this.length <= 0) return 0; | |
| var clone = $(this[0]).clone().empty().appendTo($('body')).html(' '); | |
| var baseheight = clone.height(); | |
| clone.html(' <br> '); | |
| var lineheight = clone.height() - baseheight; | |
| clone.remove(); | |
| return lineheight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public VideoFrameExtractor(Context context, String path, TextureView textureView) { | |
| mVideoPath = path; | |
| mTextureView = textureView; | |
| textureView.setSurfaceTextureListener(this); | |
| textureView.setTranslationX(-1920); | |
| if (textureView.isAvailable()) { | |
| initPlayer(textureView.getSurfaceTexture()); | |
| } |