如何在C语言的Linux/OS X上进行非阻塞控制台IO?
我有一个400px宽的DIV,它包含两个并排的DIV,每个DIV的宽度为400px,高度为600px.两个DIV的宽度是固定的,但高度可以变化.我想隐藏第二个DIV并完全显示第一个DIV,而DIV内部没有滚动.
我想,我的解决方案是隐藏溢出-x.这似乎也隐藏了y溢出.
这是我的代码:
#schools-sub-nav {
}
#schools-container {
width: 400px; /* Set the width of the visible portion of content here */
background-color: fuchsia;
position: relative;
overflow-x: hidden;
}
#schools-list {
width: 400px; /* Set the width of the visible portion of content here */
height: 600px; /* Delete the height, let the content define the height */
background-color: purple;
position: absolute;
top: 0;
left: 0;
}
#boards-list {
width: 400px; /* Set the width of the visible portion of …Run Code Online (Sandbox Code Playgroud)我正在尝试使用froogaloop API识别vimeo的onPlay,onPause和onFinish事件.我尝试过用这个东西想象的一切,没有运气.
我在Firefox上遇到此错误:
在Chrome中:
从CDN导入froogaloop:
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
我的JS:
$(function(){
var vimeoPlayer = document.querySelector('iframe');
$f(vimeoPlayer).addEvent('ready', ready);
function ready(player_id) {
froogaloop = $f(player_id);
function setupEventListeners() {
function onPlay() {
froogaloop.addEvent('play',
function(data) {
console.log('play event');
});
}
function onPause() {
froogaloop.addEvent('pause',
function(data) {
console.log('pause event');
});
}
function onFinish() {
froogaloop.addEvent('finish',
function(data) {
console.log('finish');
});
}
onPlay();
onPause();
onFinish();
}
setupEventListeners();
}
})
Run Code Online (Sandbox Code Playgroud)
我的HTML:
<iframe src="http://player.vimeo.com/video/3718294?api=1" width="623" height="350" frameborder="0" id="iframe-video"></iframe>
Run Code Online (Sandbox Code Playgroud) 该命令:Gdiff相当于git diff在该文件上运行.
什么相当于git diff --staged或git diff --cached?
无法弄清楚如何在OSX Lion的virtualenv中安装PyGame.如果可能的话,我真的想保留virtualenv中包含的内容.
我已经尝试下载PyGame的源代码并运行setup.pyvirtualenv中包含的内容,但是即使在通过Homebrew安装之后,它似乎也有很多问题需要查找SDL.
有人提出的任何提示吗?
因此,电话号码始终是ltr(从左到右).
在多语言网站上工作我需要在一个带有方向rtl的文本段落中插入一个电话号码(带有'+'前缀和数字用' - '分隔)(当然对于相关语言)
所以我有这样的事情:
.ltr #test {direction:ltr}
.rtl #test {direction:rtl}
#phone {direction:ltr}Run Code Online (Sandbox Code Playgroud)
<div class="ltr"><p id="test">Please call to <span id="phone">+44-123-321</span> for some help.</p></div>
<div class="rtl"><p id="test">Please call to <span id="phone">+44-123-321</span> for some help.</p></div>Run Code Online (Sandbox Code Playgroud)
当然这不起作用,因为' direction'仅适用于块元素,' span'是内联元素.我需要电话号码在段落内,所以我不能改变' span'到' display:inline'
我很清楚?
如何使它工作?
看看我拥有并运行的网站的这个页面设计:
http://www.jungledragon.com/image/9472/barn_owl_close-up.html
如您所见,这涉及经典的双列布局.事情的顺序很重要.例如,您可以直接在照片旁边看到这个问题.
我现在正在编写针对该网站的响应式设计,并面临挑战.想象一下在狭窄的智能手机视口上的页面.经典的策略是简单地"堆叠"左侧下方的右列,让用户垂直滚动.然而,就元素的排序而言,这远非理想."specie"区块将位于照片下方,用户首先必须滚动评论之类的内容才能看到照片与硬币之间的关系.
我正试图解决这个问题,而这篇解释CSS的flexbox作为可能的解决方案的文章听起来非常有希望:
http://www.jordanm.co.uk/post/21863299677/building-with-content-choreography
这里的想法是只使用CSS,可以改变元素的视觉顺序,正是我需要的.不幸的是,从那时起,我了解到该文章使用了过时的规范,并且新规范几乎不受任何浏览器的支持:
http://css-tricks.com/old-flexbox-and-new-flexbox/
这种废墟对我而言.不过,我还是想在概念层面提出我的问题:
我见过的关于flexbox的所有演示都有这样简单的标记:
<div id="somecontainer">
<div id="child1"></div>
<div id="child2"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
接下来,容器被声明为flexbox,方向垂直.最后,为每个子元素分配一个订单.这允许例如使用单个CSS语句将child2移动到child1之上.
现在问题就在这里.如果实际标记在某些意义上更复杂,那么还有其他层次结构在起作用?一个例子:
<div id="somecontainer">
<div id="colmain">
<div id="content1"></div>
<div id="content2"></div>
<div id="content3"></div>
</div>
<div id="colside">
<div id="content4"></div>
<div id="content5"></div>
<div id="content6"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
如您所见,此标记具有其他层次结构,要重新排序的实际内容块不是最高级别容器的直接子元素.他们是孩子,但不是直接的孩子.
flexbox和子元素的重新排序是否适用于这种情况?例如,"content5"可以在"content1"和"content2"之间移动吗?
无论浏览器支持不佳,我都试图在概念上理解是否支持它.我问的原因是因为额外的列层次结构在标记中非常常见,如果flexbox重新排序仅适用于直接子节点,那将完全糟糕.
合并提交是至少有两个父级的提交.这些父母按特定顺序排列.
如果我当前在分支上master,并且我在分支中合并feature,我创建一个新的提交,其第一个父是提交master,第二个提交是提交feature.这个顺序通过跑步特别明显git log --first-parent.
* The merge commit
|\
| * The commit from `feature`
* | The commit from `master`
Run Code Online (Sandbox Code Playgroud)
说我现在认识到的顺序是南辕北辙:我打算到分支合并master到feature运行git checkout feature; git merge master.我想交换合并提交的父级的顺序,但我不想经历再次解决所有合并冲突的麻烦.我怎样才能做到这一点?
* The merge commit
|\
* | The commit from `feature`
| * The commit from `master`
Run Code Online (Sandbox Code Playgroud) 我已升级到Django 2.1,当我加载管理界面时,我看到了这个错误:
Run Code Online (Sandbox Code Playgroud)TypeError at /admin/foo/bar/1/change/ render() got an unexpected keyword argument 'renderer'
css ×3
html ×2
macos ×2
bidi ×1
c ×1
css3 ×1
django ×1
flexbox ×1
froogaloop ×1
git ×1
iframe ×1
io ×1
javascript ×1
jquery ×1
linux ×1
multilingual ×1
nonblocking ×1
overflow ×1
pygame ×1
pypi ×1
python ×1
vim-fugitive ×1
vimeo ×1
virtualenv ×1