mysql - 计数字母(mysql - count letters)
谁能告诉我如何计算MySQL中字符串中的字母?
例如:
SELECT numberOfLetters('abc123 def')
将返回6
通过信件,我的意思是AZ和az。
numberOfLetters当然不是有效的SQL,但它说明了我想要做的事情。
我正在使用的MySQL版本是5.5.27
Can anyone tell me how to count the letters in a string in MySQL?
For example:
SELECT numberOfLetters('abc123 def')
would return 6
By letter, I mean A-Z and a-z.
numberOfLetters is not valid SQL of course, but it illustrates what I am trying to do.
The version of MySQL that I'm using is 5.5.27
原文:https://stackoverflow.com/questions/13467901
最满意答案
我不认为它是AS3还是AS2与它有关。
从Web浏览器的角度来看,它们都是一个黑盒子,上面写着“Flash Player插件”。 您一次只能安装一个版本的插件,因此即使您有AS2和AS3 swf,Web浏览器也会看到它有2个“Flash播放器插件版本10”的实例
将你想要做的事情归结为:
- 创建一个页面:
- 坚持使用swf
- 在页面中添加一个div并使用CSS定位将其“覆盖”在另一个swf上
- 坚持另一个瑞士法郎。
那么,这有用吗? -
否是,非常好,但你必须在嵌入式flash对象上设置wmode="transparent"
(感谢评论中的grapefrukt)。我跑了一个测试:这是我的源代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css" media="screen"> DIV{ width: 300px; height; 300px;} #background{ border: 1px solid green; background-color: green; z-index: 0; } #foreground{ border: 1px solid red; background-color: red; z-index: 50; } </style> </head> <body> <div id="background"> <embed height="208" width="208" quality="high" bgcolor="#fff" src="bgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/> </div> <div id="foreground" style="position: absolute; left: 30px; top: 30px;"> <embed height="208" width="208" quality="high" bgcolor="#fff" src="fgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/> </div> </body> </html>
结果:
没有
wmode=transparent
,在firefox和IE中是不一致的,并且很小。 有了它,你在IE和Firefox中的确应该做到了。
swf文件的行为(从布局的角度来看)就好像它们只是图像一样。 这个很酷。I wouldn't think that whether it's AS3 or AS2 has anything to do with it.
From the point of view of the web browser, they are both a black box that says "Flash Player Plugin". You can only have one version of the plugin installed at one time, so even though you have an AS2 and an AS3 swf, the web browser just sees that it has 2 instances of "Flash player plugin version 10"
To boil it down what you seem to be trying to do is:
- Create a page:
- Stick a swf in it
- Add a div to the page and use CSS positioning to put it "over" the other swf
- Stick another swf in that div.
So, does this work? -
NoYes, very well, but you must setwmode="transparent"
on your embedded flash objects (thanks grapefrukt in comments).I ran a test: here's my source code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css" media="screen"> DIV{ width: 300px; height; 300px;} #background{ border: 1px solid green; background-color: green; z-index: 0; } #foreground{ border: 1px solid red; background-color: red; z-index: 50; } </style> </head> <body> <div id="background"> <embed height="208" width="208" quality="high" bgcolor="#fff" src="bgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/> </div> <div id="foreground" style="position: absolute; left: 30px; top: 30px;"> <embed height="208" width="208" quality="high" bgcolor="#fff" src="fgswf.swf" type="application/x-shockwave-flash" wmode="transparent"/> </div> </body> </html>
Results:
Without
wmode=transparent
, is inconsistent and minorly broken in firefox and IE. With it, does exactly what you think it should in both IE and firefox.
The swf files behave (from a layout point of view) as if they are just images. It's cool.
相关问答
更多-
AS3生成动态SWF?(AS3 to Generate Dynamic SWF?)[2022-02-16]
看看这个库,这允许您在运行时创建.swf。 https://github.com/claus/as3swf Take a look at this library, this allows you to create a .swf at runtime. https://github.com/claus/as3swf -
AVM2(AS3)动画无法加载到AVM1(AS1 / 2)动画中。 然而,反过来是可能的。 虽然短期烹饪会很有趣,但我想你可能会喜欢AS2电影播放器:P AVM2 (AS3) movies cannot be loaded into AVM1 (AS1/2) movies. The inverse is possible, however. While a short order cook would be fun for a while, I think you might enjoy an AS2 mo ...
-
AS2和AS3之间的通信并非易事,因为它们运行在不同的虚拟机中。 请查看http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html以获取一些提示。 编辑:如果您无法更改加载的as2内容,您唯一的选择是创建一个'包装器'as2加载器,它使用上面的链接示例与as3进行通信,并使用_root.varname与加载的as2内容进行交互这不是很好但是可能工作。 It's not trivial to communicate between AS ...
-
建议方法: 如果您只需要查看SWF ,可以使用在线工具: http : //blog.sitedaniel.com/2009/11/swf-info-width-height-swf-version-actionscript-version-framerate/ 如果你需要使用AS,你需要加载SWF并找出它是否是AVM1Movie你将需要一段代码,如: trace(loader.content is AVM1Movie); // true = AS1/2, false = AS3 如果AS是AS1或AS2则 ...
-
您暴露的问题是LocalConnection (由SwfBridge )是否异步调用。 换句话说,调用者脚本的执行不会暂停执行,以等待调用函数的结果。 如果您需要从LocalConnection的另一端检索值,则需要将其设置为双向工作。 即您的客户端脚本必须通过LocalConnection (本例中为SwfBridge )将结果发送回宿主对象的回调方法,而不是通过return 。 The problem your exposed towards is that the LocalConnection (u ...
-
如何使用AS3嵌入SWF文件,控件是否正在使用.play()?(How do I use AS3 to embed an SWF file and control is using .play()?)[2022-03-13]
[Embed(source="scene1.swf", symbol="scene1ID")] public var Scene1:Class; private var scene1:MovieClip = new Scene1(); scene1.play(); 这应该对你有所帮助...... http://www.bit-101.com/blog/?p=853 [Embed(source="scene1.swf", symbol="scene1ID")] public var Scene1:Cla ... -
阅读完帖子后,您可以使用一些新信息重试之前的尝试。 Actionscript 2 DOES有一种从浏览器查找文件的方法,与AS3相同。 AS2还有一个FileReference类。 看看这里的文档: http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001040.html 另外,这是一个教程: http://markshu.ca/imm/flash/tutorial/fileReference.html Well, all o ...
-
AS3:如何访问和控制外部swf中的嵌入式声音?(AS3: How to access and control embedded sounds in an external swf?)[2022-07-06]
来自Kirupa的用户SnickelFritz给了我一个很简单的代码,使用多个声音时可以非常强大。 这很棒,因为每个SWF只能使用一个预加载器,而不是每个文件都有多个加载器: main.as文件的代码 http://www.kirupa.com/forum/showthread.php?305098-Playing-a-embedded-sound-in-an-external-swf package { import flash.display.*; import flash.media. ... -
我不认为它是AS3还是AS2与它有关。 从Web浏览器的角度来看,它们都是一个黑盒子,上面写着“Flash Player插件”。 您一次只能安装一个版本的插件,因此即使您有AS2和AS3 swf,Web浏览器也会看到它有2个“Flash播放器插件版本10”的实例 将你想要做的事情归结为: 创建一个页面: 坚持使用swf 在页面中添加一个div并使用CSS定位将其“覆盖”在另一个swf上 坚持另一个瑞士法郎。 那么,这有用吗? - 否是,非常好,但你必须在嵌入式flash对象上设置wmode="transpa ...
-
在HTML中嵌入本地.swf文件(Embed Local .swf File in HTML)[2022-12-29]
使用嵌入HTML代码: