我不理解Go中的切片声明.
对于我来说,数组的第一个和第二个元素的声明必须是0:1.但它是0:2.为什么?我怎么读这个,从零到2减去1(所有时间)?
var slice = array[0:2]
Run Code Online (Sandbox Code Playgroud)
对不起我的愚蠢问题,但这对我没有意义.
目前,我正在努力制作一份清单.在左侧图像适合我的"显示flex布局"并在所有浏览器上调整大小.我的"flex-grow布局"列表1为图像,3为描述.没有图像,一切都很好,但是我的图像(100%宽度)它不适合行的1/3 ...
有人知道解决方案吗?
#main {
height: 100px;
border: 1px solid #c3c3c3;
display: -webkit-flex; /* Safari */
display: flex;
}
#main div:nth-of-type(1) {-webkit-flex-grow: 1;}
#main div:nth-of-type(2) {-webkit-flex-grow: 3;}
#main div:nth-of-type(1) {flex-grow: 1;}
#main div:nth-of-type(2) {flex-grow: 3;}
#main img { width: 100% }Run Code Online (Sandbox Code Playgroud)
<div id="main">
<div style="background-color:coral;"><img src="http://www.der-eyecatcher.de/wp-content/uploads/2016/02/Lampe-silber-Schirm_1.jpg"></div>
<div style="background-color:lightblue;">Description</div>
</div>
<hr>flex-grow without Image<hr>
<div id="main">
<div style="background-color:coral;"></div>
<div style="background-color:lightblue;">Description</div>
</div>Run Code Online (Sandbox Code Playgroud)
谢谢
西蒙
我的桌子看起来像这样
sales
----------------------------------------------------------
id ordernumber quantity category_id price
1 402-9182243-8008368 1 3 22.95
2 406-3666671-8627555 2 3 6.95
3 303-1935495-5532309 1 1 7.95
4 171-5799800-1198702 1 2 159.95
5 403-2398078-4901169 2 2 18.95
category
--------------
id name
1 bikes
2 shoes
3 planes
returns
--------------
id ordernumber quantity costs
1 402-9182243-8008368 1 22.95
2 402-9182243-8008368 5.95 // return shipping fee
Run Code Online (Sandbox Code Playgroud)
这是我的查询
SELECT c.name,
SUM(v.quantity) AS sold, # wrong
SUM(s.quantity * s.price) AS turnover, # wrong
SUM(r.costs) AS returncosts,
FROM sales …Run Code Online (Sandbox Code Playgroud)