我知道混淆是一个坏主意.但我希望我的所有html代码都有一个很长的单行.所有的html标签都是通过PHP生成的,所以我认为它是可能的.我知道\n\r从正则表达式替换,但不知道如何做到这一点.如果我不清楚这里是一个例子
$output = '<p>
<div class="title">Hello</div>
</p>';
echo $output;
Run Code Online (Sandbox Code Playgroud)
要在源查看器中查看为 <p><div class="title">Hello</div></p>
我想用空格替换换行符(\ r \n),但我想保留空白行.换句话说,如果\ r \n前面没有另一个\ r \n,我想用\'替换\ r \n.例如:
line 1
line 2
line 3
line 4
Run Code Online (Sandbox Code Playgroud)
Shold最终成为......
line 1
line 2 line 3 line 4
Run Code Online (Sandbox Code Playgroud)
但不是"1号线2号线3号线4号线",这就是我现在正在做的事情
preg_replace("/\r\n/", " ", $string);
Run Code Online (Sandbox Code Playgroud) 我在向地图添加标记聚类功能时遇到问题.我想要的是为我的标记使用自定义图标,每个标记都有自己的信息窗口,我希望能够编辑.
我确实做到了,但现在我在添加marker clusterer库功能时遇到了问题.我读了一些关于向数组中添加标记的内容,但我不确定它究竟意味着什么.此外,我发现的所有数组示例都没有信息窗口,搜索代码我没有找到合适的方法来添加它们.
这是我的代码(主要来自Geocodezip.com):
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js"></script>
<style type="text/css">
html, body { height: 100%; }
</style>
<script type="text/javascript">
//<![CDATA[
var map = null;
function initialize() {
var myOptions = {
zoom: 8,
center: new google.maps.LatLng(43.907787,-79.359741),
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
var mcOptions = {gridSize: 50, maxZoom: 15};
var mc = new MarkerClusterer(map, [], mcOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
// Add markers to the map
// …Run Code Online (Sandbox Code Playgroud) 我似乎无法使用PHP安全地绑定到Active Directory.未加密的连接工作正常.使用其他客户端可以安全绑定,例如通过SSL使用LDAPAdmin进行连接.这里有什么问题?是否有一些我缺少的LDAP SSL模块?如何使用PHP安全绑定到服务器?
我注意到phpinfo()cURL支持ldap/ldaps - 利用它在php中执行安全绑定有什么好的例子?这是一个可行的解决方法吗?
的phpinfo();
ldap
LDAP Support enabled
RCS Version $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $
Total Links 0/unlimited
API Version 3001
Vendor Name OpenLDAP
Vendor Version 20421
SASL Support Enabled
Run Code Online (Sandbox Code Playgroud)
尝试使用Ubuntu 10.04 repo中的PHP版本5.3.2-1ubuntu4.7绑定到Active Directory服务器
$username = 'user';
$password = 'passwd';
$account_suffix = '@example.com';
$hostnameSSL = 'ldaps://ldap.example.com:636';
$hostnameTLS = 'ldap.example.com';
$portTLS = 389;
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
// Attempting fix from http://www.php.net/manual/en/ref.ldap.php#77553
putenv('LDAPTLS_REQCERT=never');
####################
# SSL bind attempt #
####################
// Attempting syntax from http://www.php.net/manual/en/function.ldap-bind.php#101445 …Run Code Online (Sandbox Code Playgroud) 如果我尝试在我的服务器上安装任何gem,那么我会得到302重定向,例如
gem install clickatell -V
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
HEAD http://rubygems.org/specs.4.8.gz
connection reset after 2 requests, retrying
HEAD http://rubygems.org/specs.4.8.gz
302 Found
Run Code Online (Sandbox Code Playgroud)
一篇关于rubygems的文章建议做一个gem更新--system
http://help.rubygems.org/kb/rubygems/why-do-i-get-http-response-302-or-301-when-installing-a-gem
gem update --system -V
Updating RubyGems
GET 302 Found: http://gems.rubyforge.org/latest_specs.4.8.gz
connection reset after 2 requests, retrying
HEAD 302 Found: http://gems.rubyforge.org/specs.4.8.gz
connection reset after 2 requests, retrying
HEAD 302 Found: http://gems.rubyforge.org/yaml
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: Connection timed out - connect(2) (http://gems.rubyforge.org/yaml)
Run Code Online (Sandbox Code Playgroud)
这当然只是宝石本身的更新.
我正在运行rubygems 1.3.1最新版本是1.6.1
有没有办法可以更新Rubygems而不会陷入我的302重定向陷阱.
问候, …
即时通讯使用JPA2和Hibernate 3.6.x.
我在@Version上做了一个简单的测试.
假设我们有2个实体,
以下是场景:
每当对团队/玩家实体之一进行修改时,团队/玩家的版本将在刷新/提交时增加(修改后的记录上的版本增加).
使用持久性将新的玩家实体添加到团队的集合中,在持久化之后将为团队的版本分配实体(添加新实体,新实体将获得它的版本).
每当对其中一个玩家实体进行添加/修改/删除时,团队的版本将在刷新/提交时增加.(添加/修改/删除子记录,父版本也增加了)
我能理解数字1和2,但数字3,我不明白,为什么团队的版本增加了?
这让我想到了其他问题:
这是我的实验中的代码示例,证明当ReceivingGoodDetail是拥有方时,并且在刷新后版本在ReceivingGood中增加了.很抱歉,这使用其他实体,但ReceivingGood就像团队一样,ReceivingGoodDetail就像玩家一样.1 ReceivingGood/Team,很多ReceivingGoodDetail/Player.
/*
Hibernate: select receivingg0_.id as id9_14_, receivingg0_.creationDate as creation2_9_14_, .. too long
Hibernate: select product0_.id as id0_4_, product0_.creationDate as creation2_0_4_, .. too long
before persisting the new detail, version of header is : 14
persisting the detail 1c9f81e1-8a49-4189-83f5-4484508e71a7
printing the size of the header :
Hibernate: select details0_.receivinggood_id as receivi13_9_8_, details0_.id as id8_, details0_.id as id10_7_, .. too long …Run Code Online (Sandbox Code Playgroud) 我的应用程序中有一个Winforms DataGridView.
我有两个复选框列以及数据库中的其他5列.使用DataGridViewCheckBoxColumn添加这两个复选框列.
当用户单击第二个复选框时,如果未检查该行的第一个复选框,则需要向用户显示一条消息.
我该怎么做?我尝试过这个,但是单元格值是空的.我究竟做错了什么?
private void dgTest_CellClick(System.Object sender, DataGridViewCellEventArgs e)
{
DataGridViewCheckBoxCell officialCbCell = row.Cells[1] as DataGridViewCheckBoxCell;
DataGridViewCheckBoxCell includeCbCell = row.Cells[0] as DataGridViewCheckBoxCell;
if (officialCbCell != null)
{
if (officialCbCell.Value != null && (bool)officialCbCell.Value == true)
{
if (includeCbCell != null && (bool)includeCbCell.Value == false)
{
MessageBox.Show("INVALID");
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我需要你对以下任务的建议和指导.
我有一个框架有两个JComboBoxes,假设它们被命名为combo1和combo2,一个JTable和其他组件.
在使用上述组件可见框架的初始阶段.combo1组合框中填充了一些值,但在初始阶段没有选择任何值,combo2组合框被禁用,表格为空.
我在combo1和combo2上添加了一个actionListener.combo1中有两种类型的值,假设这些值是type1和type2.
条件1:当我们从Combo1中选择值type1时,将调用actionListener方法combo1,该方法调用combo2保持禁用的方法,并将一些行添加到与combo1中的选定值type1相关的表中.
条件2:当我们从combo1中选择值type2时,将调用actionListener方法combo1,该方法调用一个方法,该方法使combo2填充了与type2相关的一些值并被启用但是没有从combo2中选择任何值,并且在我们选择之前表也应保持为空combo2中的任何值.
每次向combo2添加值时,表都会触发combo2的动作侦听器方法.在combo2的actionListener方法中,它获取了combo2选择的值,但是这里没有选择的combo2值导致NullPointerException.
那么我应该怎么做才能在将值添加到combo2之后才能执行combo2的动作列表器方法.
我想在JBoss jmx-console中使我的标准MBean详细.DynamicMBean有getMBeanInfo()来做.方法返回MBeanInfo,其中包含MBean的描述.但是我怎么能为Standard MBean做同样的事情呢?例如,我有以下MBean接口:
public interface MyMBean {
String f();
}
Run Code Online (Sandbox Code Playgroud)
......以下实施:
public class My implements MyMBean {
public String f() {
return "test";
}
}
Run Code Online (Sandbox Code Playgroud)
在这样的例子中应该怎么做才能添加描述?
谢谢
谷歌中的第一个javascript <script> </ script>看起来像这样:(注意我已经使用了jsbeautifier.org来很好地渲染它)
window.google = {
kEI: "Eqx4TailJIez8QOhrtAxSw",
kEXPI: "17259,17291,28460,21559,28595,28605,29014,29135,29249,29254,29265,29279",
kCSI: {
e: "17159,17291,21460,28559,28595,28605,29014,29135,29249,29254,29265,29279",
ei: "Ex4TailJIez8QOhrtGwBA",
expi: "17159,17291,28460,28559,28595,28605,29014,29135,29249,29254,29265,29279"
},
ml: function () {},
pageState: "#",
kHL: "en",
time: function () {
return (new Date).getTime()
},
log: function (c, d, b) {
var a = new Image,
e = google,
g = e.lc,
f = e.li;
a.onerror = (a.onload = (a.onabort = function () {
delete g[f]
}));
g[f] = a;
b = b || "/gen_204?atyp=i&ct=" + c + "&cad=" …Run Code Online (Sandbox Code Playgroud) php ×3
java ×2
javascript ×2
datagridview ×1
gem ×1
google-maps ×1
hibernate ×1
html ×1
jboss ×1
jcombobox ×1
jmx ×1
jpa ×1
jpa-2.0 ×1
ldap ×1
line-breaks ×1
newline ×1
obfuscation ×1
preg-replace ×1
regex ×1
ruby ×1
rubygems ×1
ssl ×1
swing ×1
whitespace ×1
winforms ×1