我有一个List,看起来像这样:
some headline content
a subheadline containing the keyword
1 2015-05-05 some data
2 2015-05-05 some data
3 2015-05-05 some data
some content
a subheadline containing another keyword
useless stuff
Run Code Online (Sandbox Code Playgroud)
所以现在我想抓住"关键字"和"另一个关键字"之间的所有内容.也许我应该找到"关键字"和"另一个关键字"的索引并使用.GetRange(),但有没有更优雅的方法来实现这一点,例如LINQ?
有没有办法使用tsql语法找出每月第二个星期二的日期?例如,3月是12日,4月是9日.
Thx&Cheers Alex
我有一个 ubuntu 服务器(16.04.4 LTS),apache2 运行 php7.0(Apache 2.0 Handler)和 php7.2(FPM/FastCGI)。
PHP7.2 工作正常,除了没有加载扩展 - 像 json 或其他任何东西。查看我的 phpinfo():
System Linux srvindkdif 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64
Build Date Jun 22 2018 08:44:50
Server API FPM/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php/7.2/fpm
Loaded Configuration File /etc/php/7.2/fpm/php.ini
Scan this dir for additional .ini files /etc/php/7.2/fpm/conf.d
Additional .ini files parsed (none)
PHP API 20170718
PHP Extension 20170718
Zend Extension 320170718
Zend Extension Build API320170718,NTS
PHP Extension Build …Run Code Online (Sandbox Code Playgroud) 我有一个按钮,在此按钮内是一个非常棒的svg。侦听器仅在按钮上,而不在svg上。但是,当我单击svg时,event.target不是按钮。
但是我只需要按钮作为目标。
这是代码:
const icon = '<svg aria-hidden="true" data-prefix="fas" data-icon="paragraph" class="svg-inline--fa fa-paragraph fa-w-14 " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M408 32H177.531C88.948 32 16.045 103.335 16 191.918 15.956 280.321 87.607 352 176 352v104c0 13.255 10.745 24 24 24h32c13.255 0 24-10.745 24-24V112h32v344c0 13.255 10.745 24 24 24h32c13.255 0 24-10.745 24-24V112h40c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24z"></path></svg>';
class App extends React.Component {
constructor(props) {
super(props);
}
handleClick(event) {
event.stopPropagation();
console.log(event.target);
}
render() {
return (
<div>
<button onClick={this.handleClick}>
<span dangerouslySetInnerHTML={{__html: icon}} />
</button>
</div> …Run Code Online (Sandbox Code Playgroud) 我有几个带有ajax加载内容的表.有时我必须td在将其导出为PDF之前手动更改内容,因此我认为最好的方法是td使用jQuery双击创建每个内容的触发器.dblclick().触发器将打开一个带有input字段的模态,并td在提交模态时更改双击的文本.
这是有效的,但是当我更改第二个,第三个等的内容时td,之前单击的每个内容td都会获得新值.
检查我的小提琴:https://jsfiddle.net/fvoufq07/
我的代码到目前为止:
$( ".sitename" ).dblclick( function() {
var sitename = $( this );
$( "#msgBox .modal-title" ).html("Change sitename");
$( "#msgBox .modal-body" ).html("Enter new sitename:<input type=\"text\" id=\"new_sitename\">");
$( "#msgBox" ).modal("show");
$( "#msgBox button.btn" ).click( function() {
sitename.text( $( "#new_sitename" ).val().trim() );
});
});
Run Code Online (Sandbox Code Playgroud) 有没有办法使用仅具有SID的UserPrincipal搜索Active Directory?我在byte []中有SID(以前用DirectorySearcher查询)并使用StringBuilder将其转换为"S-1-15 -..."和"\ 01\05 ..".
我试着这样处理它:
PrincipalContext pContext = new PrincipalContext(ContextType.Domain);
UserPrincipal pUser = new UserPrincipal(pContext);
pUser.Sid = stringBuilder.ToString();
PrincipalSearcher pSearcher = new PrincipalSearcher();
pSearcher.QueryFilter = pUser;
Console.WriteLine(pSearcher.FindOne().DistinguishedName.ToString());
Run Code Online (Sandbox Code Playgroud)
Visual Studio告诉我,Sid是写保护的.当然...
在此先感谢和干杯亚历克斯
ps:我已经尝试按照这里描述的方式解决它:如何在S#中将SID转换为帐户名,但这里没有成功.
我正在使用next.js重建用于服务器端渲染的应用程序。我有一个处理搜索请求的按钮。
在旧应用中,处理程序是这样的:
search = (event) => {
event.preventDefault();
history.push({
pathname: '/results',
state: {
pattern: this.state.searchText,
}
});
}
Run Code Online (Sandbox Code Playgroud)
在结果类中,我可以使用this.props.location.state.pattern获取状态日期。
所以现在我正在使用next.js:
import Router, { withRouter } from 'next/router'
performSearch = (event) => {
event.preventDefault();
Router.push({ pathname: '/results', state: { pattern: this.state.searchText } });
};
Run Code Online (Sandbox Code Playgroud)
在结果类中,我使用
static async getInitialProps({req}) {
return req.params;
}
Run Code Online (Sandbox Code Playgroud)
我不确定是否必须将其添加到我的server.js中:
server.get('/results', (req, res) => {
return app.render(req, res, '/results', req.params)
})
Run Code Online (Sandbox Code Playgroud)
但是,由于未定义req,因此函数getInitialProps引发错误。长文本,简短问题:如何在不使用GET参数的情况下将状态或参数传递给另一个页面?
javascript ×3
c# ×2
reactjs ×2
apache2 ×1
jquery ×1
linq ×1
next.js ×1
php ×1
php-7.2 ×1
react-router ×1
sql ×1
t-sql ×1
ubuntu-16.04 ×1