后端开发2025年07月23日
module FooModule def self.included base base.extend ClassMethods end module ClassMethods def bar puts "module" end endendmodule Klass include FooModule def self.bar puts...
数据库2025年07月20日
create table tb(id int, value varchar(10)) insert into tb values(1, 'aa') insert into tb values(1, 'bb') insert into tb values(2, 'aaa') insert into tb values(2, 'bbb') insert int...
后端开发2025年07月15日
ruby的类是单继承生物、所以出现了module、实现了多继承、 注:模块、常量和类的命名都是以大写字母开头 、 模块引用: 1、如果引用的模块在同一个文件中,则直接使用模块操作 2、如果不在同一个文件中,则需要使用require加载被引用模块所在文件。(引用的是完整名称) 可以使用module包含着各种class、再新建一个类使用include包含各种c...
前端开发2025年07月05日
<!DOCTYPE html> <html> <head> <title>HTML5上传图片预览</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="jq...
前端开发2025年07月04日
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css"&g...
数据库2025年06月30日
oracle中的转字符:to_char() oracle中的转日期:to_date() mysql中的转字符:date_format(date,'%Y-%m-%d') 相当于oracle中的to_char() mysql中的转日期:str_to_date(date,'%Y-%m-%d') 相当于oracle中的to_date() %Y:代表四位年 (相当于...
前端开发2025年06月30日
https://docs.microsoft.com/zh-cn/dotnet/api/system.icomparable-1?redirectedfrom=MSDN&amp;view=netframework-4.7.2 中文:必须至少有一个对象实现 IComparable。 序列排序时报这个错误 lstReports.OrderBy(r =&...
后端开发2025年06月27日
#encding:GBK require 'tk' module Const WIDTH_OF_PANEL = 370 HEIGHT_OF_PANEL = 520 SIZE_OF_BUTTON_H = 60 SIZE_OF_BUTTON_W = 80 HEIGHT_OF_DISPLAY_FRAME = 90 HEIGHT_OF_VALUE_LABEL = ...
前端开发2025年06月25日
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script> var m=parseInt(Math.random()*); ...
后端开发2025年06月21日
class Generator def initialize(enumerable) @enumerable = enumerable # Remember the enumerable object create_fiber # Create a fiber to enumerate it end def next # Return the next e...