我是Spring的新手.
这是bean注册的代码:
<bean id="user" class="User_Imple"> </bean>
<bean id="userdeff" class="User"> </bean>
Run Code Online (Sandbox Code Playgroud)
这是我的bean类:
public class User_Imple implements Master_interface {
private int id;
private User user; // here user is another class
public User_Imple() {
super();
}
public User_Imple(int id, User user) {
super();
this.id = id;
this.user = user;
}
// some extra functions here....
}
Run Code Online (Sandbox Code Playgroud)
这是我执行操作的主要方法:
public static void main(String arg[]) {
ApplicationContext context = new ClassPathXmlApplicationContext("/bean.xml");
Master_interface master = (Master_interface)context.getBean("user");
// here is my some operations..
int id = ... …Run Code Online (Sandbox Code Playgroud) CSS选择器可以使用多长时间?
我对"规范"所说的内容并不太感兴趣,而是对哪些浏览器实际可以处理.到目前为止,我只知道一个浏览器会阻塞(非常)长的选择器; 铬.
编辑:Chrome不会将CSS规则应用于某些国家 /地区的示例,例如美国,土耳其,叙利亚和英国以及CSS.有7个选择器,至少#5对于某些浏览器来说太长了.
据我所知,CSS过滤器应该可以在Chrome中的任何位置使用,但我无法将它们应用于SVG元素.
这适用于所有大多数浏览器:
div{ filter:sepia(50%) }
Run Code Online (Sandbox Code Playgroud)
但是,这在Chrome中不起作用:
rect{ filter:sepia(50%) }
Run Code Online (Sandbox Code Playgroud)
这是一个例子:
div{
width:100px;
height:50px;
background-color:red;
}
rect{
fill:red;
}
rect:hover, div:hover{
-webkit-filter:sepia(50%);
-moz-filter:sepia(50%);
filter:sepia(50%);
}Run Code Online (Sandbox Code Playgroud)
<h2>SVG</h2>
<svg width="100" height="50">
<rect x="0" y="0" width="100" height="50"/>
</svg>
<h2>DIV</h2>
<div></div> Run Code Online (Sandbox Code Playgroud)
...这里有一个小提琴:https://jsfiddle.net/LtffLagn/2/
以下是HTML5中label元素的有效用法吗?
<label for="select">Some text</label>
<select id="select">
...
</select>
<label for="select">...more text</label>
Run Code Online (Sandbox Code Playgroud)
在HTML5规范似乎没有什么可以说的.
编辑:这个问题现在已经过时了.在当前的措辞中,很明显一个元素可以有多个标签(但不是相反):
可标记元素具有与它们相关联的NodeList对象,其以树的顺序表示标签元素的列表,其标记的控件是所讨论的元素.
我想要一个SVG图像(预渲染,但在svg标签中插入js,以允许进一步操作)能够使用"pattern"标签使用预定义的模式.听起来很简单,不是吗?好吧,事实证明Chrome(Webkit?)的行为与其他任何浏览器都有所不同,现在我不确定实现这一目标的最佳方法是什么.
我的svg看起来像这样:
<svg>
<defs>
<pattern id="specialPattern">...</pattern>
</defs>
<path class="special"></path>
</svg>
Run Code Online (Sandbox Code Playgroud)
并且我希望类中的路径special具有"模式"作为填充.
我的第一次尝试就是把它放在我的CSS中:
.special { fill:url("#specialPattern");}
Run Code Online (Sandbox Code Playgroud)
这实际上适用于Chrome,但是当你想到它时,它可能不应该.我尝试的其他浏览器将此url解释为相对于它所在的文件(css文件),这更有意义.
下一次尝试:为模式提供绝对URL.
.special { fill:url("//example.com/styles/svgWithStyleDeclaration.svg#specialPattern");}
Run Code Online (Sandbox Code Playgroud)
虽然这在FF和Opera中可以正常工作,但Chrome现在重置了填充(我不知道它实际上在寻找那种风格)
内联SVG中的样式可以在任何地方使用: style="fill:url('#specialPattern')"
虽然我猜这是内容和演示之间的界限模糊的情况,但在我的情况下,至少将样式decclarations保存在其他地方会更好(尤其是因为这会使我的SVG需要更大)
我没有测试过很多浏览器,所以我不确定它是如何防水的,但在我看来,使用css hack来检测webkit浏览器会起作用:
@media screen and (-webkit-min-device-pixel-ratio:0) {
.special {fill: url("#specialPattern");}
}
.special { fill:url("//example.com/styles/svgWithStyleDeclaration.svg#specialPattern");}
Run Code Online (Sandbox Code Playgroud)
现在,必须有一种更优雅的方式来解决这个问题.应该怎么做?
编辑:原来IE的行为与Chrome一样,所以你还需要确保IE <= 9有'fill:url(#specialPattern)'
我想使用boto3更新S3存储桶中现有对象的Content-Type,但是如何在不重新上传文件的情况下更新?
file_object = s3.Object(bucket_name, key)
print file_object.content_type
# binary/octet-stream
file_object.content_type = 'application/pdf'
# AttributeError: can't set attribute
Run Code Online (Sandbox Code Playgroud)
我有没有在boto3错过的方法?
相关问题:
我有一个SVG,其中一些元素根据媒体查询旋转,如下所示:
@media (max-width: 480px) {
rect {
transform: rotate(10deg);
}
}
Run Code Online (Sandbox Code Playgroud)
元素旋转得很好,但(至少在Chrome中)它拒绝返回.这是为什么?其他指令,例如填充,在两个方向上都有效.
JSFiddle:http://jsfiddle.net/MM3VC/1/
在极坐标中,我可以获得水平最大值(到达行的一组列的最大值),如下所示:
\ndf = pl.DataFrame(\n {\n "a": [1, 8, 3],\n "b": [4, 5, None],\n }\n)\n\ndf.with_columns(max = pl.max_horizontal("a", "b"))\n\xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90\n\xe2\x94\x82 a \xe2\x94\x86 b \xe2\x94\x86 max \xe2\x94\x82\n\xe2\x94\x82 --- \xe2\x94\x86 --- \xe2\x94\x86 --- \xe2\x94\x82\n\xe2\x94\x82 i64 \xe2\x94\x86 i64 \xe2\x94\x86 i64 \xe2\x94\x82\n\xe2\x95\x9e\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xaa\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xaa\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa1\n\xe2\x94\x82 1 \xe2\x94\x86 4 \xe2\x94\x86 4 \xe2\x94\x82\n\xe2\x94\x82 8 \xe2\x94\x86 5 \xe2\x94\x86 8 \xe2\x94\x82\n\xe2\x94\x82 3 \xe2\x94\x86 null \xe2\x94\x86 3 \xe2\x94\x82\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xb4\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xb4\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98\nRun Code Online (Sandbox Code Playgroud)\n这对应于 Pandas df[["a", "b"]].max(axis=1)。
现在,我如何获取列名称而不是实际的最大值?\n换句话说,Pandas' 的 Polars 版本是什么df[CHANGE_COLS].idxmax(axis=1)?
预期输出为:
\n\xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\xac\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90\n\xe2\x94\x82 a \xe2\x94\x86 b \xe2\x94\x86 max \xe2\x94\x82\n\xe2\x94\x82 --- \xe2\x94\x86 --- …Run Code Online (Sandbox Code Playgroud) 我导出了维基百科的一个类别,检查了包含模板并将其导入到 MediWiki 安装中,但是所有页面都混乱了,如何获取所有必要的模板以便页面正确显示?
我有一个问题,@ font-face字体没有在IE9中加载.IE8及以下版本的效果非常好,我尝试过的其他浏览器也是如此.这是我的CSS(字体松鼠语法):
@font-face {
font-family: 'ssmicon';
src: url('ssmfont3.eot');
src: url('ssmfont3.eot?#iefix') format('embedded-opentype'),
url('ssmfont3.woff') format('woff'),
url('ssmfont.ttf') format('truetype'),
url('ssmfont.svg#svgssmfont') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
所有字形都处于基本的拉丁语范围内(我读过IE可能有问题的地方)和在同一台服务器上(所以没有跨域问题).我已将Access-Control-Allow-Origin设置为*以防万一.仍然没有成功(至少不是根据http://netrenderer.com/.不幸的是,我目前无法访问IE浏览器).这是受影响的页面:http://xn--ssongsmat-v2a.nu/ssm/Test3
任何其他想法IE9/10在网络字体方面可能有什么具体要求?