Posts

  • Interview Python

  • Table of Contents Python语言特性 1 Python的函数参数传递 2 Python中的元类(metaclass) 3 @staticmethod和@classmethod 4 类变量和实例变量 5 Python自省 6 字典推导式 7 Python中单下划线和双下划线 8 字符串格式化:%和.format 9 迭代器和生成器 10 *args and **kwargs 11 面向切面编程AOP和装饰器 12 鸭子类型 13 Python中重载 14 新式类和旧式类 15 __new__和__init__的区别 16 单例模式 1 使用__new__方法 2 共享属性 3 装饰器版本 4 import方法 17 Python中的作用域 18 GIL线程全局锁 19 协程 20 闭包 21 lambda函数 22 Python函数式编程 23 Python里的拷贝 24 Python垃圾回收机制 1 引用计数 2 标记-清除机制 3 分代技术 25 Python的List 26 Python的is 27 read,readline和readlines 28 Python2和3的区别 29 super.__init__() 30 range-and-xrange 操作系统 1 select,poll和epoll 2 调度算法 3 死锁 4 程序编译与链接 1 预处理 2 编译 3 汇编 4 链接 5 静态链接和动态链接 6...
  • Pure CSS read more toggle

  • Preview Lorem ipsum dolor sit amet, consectetur adipisicing elit. Libero fuga facilis vel consectetur quos sapiente deleniti eveniet dolores tempore eos deserunt officia quis ab? Excepturi vero tempore minus beatae voluptatem! lorem lorem 2 lorem 3 lorem 4 HIML <div> <input type="checkbox" class="read-more-state" id="post-1" /> <p class="read-more-wrap">Lorem ipsum dolor sit amet, consectetur adipisicing elit. <span class="read-more-target">Libero fuga facilis vel consectetur quos sapiente deleniti eveniet dolores tempore eos deserunt officia quis ab? Excepturi vero tempore minus beatae voluptatem!</span></p> <label for="post-1" class="read-more-trigger"></label> </div> <div> <input type="checkbox" class="read-more-state" id="post-2" /> <ul class="read-more-wrap"> <li>lorem</li> <li>lorem 2</li> <li class="read-more-target">lorem 3</li> <li class="read-more-target">lorem 4</li> </ul> <label...
  • How to set the read more feature in the content

  • Preview ... Read more Code <p> word word word <div id = "more_content"> <a onclick = "show_more_content()"> Read more </a> </div></p> <script> function show_more_content(){ document.getElementById('more_content').innerHTML = additional_content; } </script> Preview The following two divs contains a long text that will not fit in the box. As you can see, the text is clipped. This div uses "text-overflow:clip": This is some long text that will not fit in the box This div uses "text-overflow:ellipsis": This is some long text that will not fit in the box more words Code <p>The following two divs contains a long text that will not fit...
  • Embedding PDFs without JavaScript

  • PDFs can be embedded into HTML pages without JavaScript. Below are four examples of the most common techniques. Note: these examples work in all modern desktop browsers, but results will vary in older desktop browsers and mobile browsers. As of iOS 9, none of these examples work properly in Safari for iOS. <object> Using an <object> enables you to leave fallback content if the browser doesn’t support PDF embedding. PDF Preview Example fallback content: This browser does not support PDFs. Please download the PDF to view it: Download PDF. Code (In Preview, height = "100%" has revised as height =...
  • How to play audio and video in html

  • Audio Preview Your browser does not support the audio element. Note: The audio tag is not supported in Internet Explorer 8 and earlier versions. Example An audio file that will automatically start playing: <audio controls autoplay>   <source src="audio.ogg" type="audio/ogg">   <source src="audio.mp3" type="audio/mpeg">   Your browser does not support the audio element. </audio> Video Preview Your browser does not support the video tag. Note: The video tag is not supported in Internet Explorer 8 and earlier versions. Example Play a video: <video width="320" height="240" controls>   <source src="movie.mp4" type="video/mp4">   <source src="movie.ogg" type="video/ogg">   Your browser does not support...