我的网站拥有可通过以下网址访问的用户个人资料:www.domain.com/profile/123/....我想向用户显示他们的个人资料的页面查看统计信息,但需要能够做通配符.
例如,这有效:
filters=ga:pagePath==/profile/123/
Run Code Online (Sandbox Code Playgroud)
问题是可能存在其他URI段/profile/123/.我想做这样的事情(不起作用):
filters=ga:pagePath==/profile/123/*
Run Code Online (Sandbox Code Playgroud)
建议?
我有以下功能设置,每2分钟从服务器接收数据.我第一次调用函数它似乎工作,但然后它冻结在recv永远不会返回的调用.我是否需要在每次调用时分配缓冲区,即使服务器没有任何内容可以发送?
#define RCVBUFSIZE 32
void Receive()
{
UINT totalBytesRcvd = 0, bytesRcvd = 0;
char buffer[RCVBUFSIZE]; /* Buffer for string */
/* Receive up to the buffer size (minus 1 to leave space for
a null terminator) bytes from the sender */
bytesRcvd = recv(sockClient, buffer, RCVBUFSIZE - 1, 0);
if (bytesRcvd)
{
buffer[bytesRcvd] = '\0';
MessageBox(0, buffer, 0, 0); //some way to display the received buffer
}
else if (bytesRcvd == SOCKET_ERROR)
{
return;
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试更改vim中突出显示的组合"折叠".我正在使用颜色方案"koehler",我的折叠线在gvim的灰色背景上显示为青色,这是完全不可读的.我以为我可以在koehler.vim颜色方案文件中编辑负责此组的:highlight命令,但该文件中没有"折叠"的定义.
我确认我有配色方案koehler:
:echo g:colors_name
koehler
Run Code Online (Sandbox Code Playgroud)
然后我用另一篇文章中的命令列出了所有突出显示的组:
:so $VIMRUNTIME/syntax/hitest.vim
Highlighting groups for various occasions
-----------------------------------------
[...]
Folded Folded
FoldColumn FoldColumn
[...]
Run Code Online (Sandbox Code Playgroud)
"折叠"组以我在文件中看到的丑陋颜色显示.我正在编辑的文件是一个"viki"文件,但我对perl脚本完全相同,因此必须在中心位置定义"折叠"的突出显示.我的.vimrc中没有任何:hilight命令.
我怎样才能找出这个组的定义?
我使用hirbernate重载java应用程序.我曾经使用连接池DBCP,但它有连接丢失的问题.比我切换到c3p0.但现在它有时会破解线程,我不知道为什么.像这儿:
"1343694829@qtp-515693101-1941" prio=10 tid=0x00007fa6b0940000 nid=0x4e12 runnable [0x00007fa6f8f1c000]
java.lang.Thread.State: RUNNABLE
at com.mchange.v2.resourcepool.BasicResourcePool.doCheckinManaged(BasicResourcePool.java:1258)
at com.mchange.v2.resourcepool.BasicResourcePool.checkinResource(BasicResourcePool.java:647)
- locked <0x00007fa7286d9728> (a com.mchange.v2.resourcepool.BasicResourcePool)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$ConnectionEventListenerImpl.doCheckinResource(C3P0PooledConnectionPool.java:636)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$ConnectionEventListenerImpl.connectionClosed(C3P0PooledConnectionPool.java:630)
at com.mchange.v2.c3p0.util.ConnectionEventSupport.fireConnectionClosed(ConnectionEventSupport.java:55)
at com.mchange.v2.c3p0.impl.NewPooledConnection.fireConnectionClosed(NewPooledConnection.java:510)
at com.mchange.v2.c3p0.impl.NewPooledConnection.markClosedProxyConnection(NewPooledConnection.java:381)
at com.mchange.v2.c3p0.impl.NewProxyConnection.close(NewProxyConnection.java:1246)
- locked <0x00007fa794ccf020> (a com.mchange.v2.c3p0.impl.NewProxyConnection)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.closeConnection(LocalDataSourceConnectionProvider.java:96)
at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:474)
at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:408)
at org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:347)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:325)
at org.springframework.orm.hibernate3.SessionFactoryUtils.closeSession(SessionFactoryUtils.java:791)
at org.springframework.orm.hibernate3.SessionFactoryUtils.closeSessionOrRegisterDeferredClose(SessionFactoryUtils.java:777)
at org.springframework.orm.hibernate3.SessionFactoryUtils.releaseSession(SessionFactoryUtils.java:755)
Run Code Online (Sandbox Code Playgroud)
'我的堆栈跟踪转储显示此线程阻止了我的所有其他线程,锁定<0x00007fa7286d9728>,因此在一段时间内服务器被完全阻止.我不知道这个线程运行了多长时间,如果一个线程长时间阻塞所有其他线程,或者这个线程消耗的时间非常长,但结果是,我的系统被完全阻塞并且极其缓慢.我google了很多,但我不知道如何解决这个问题.我需要游泳池关闭连接并尽快完成胎面.我应该使用其他一些连接池吗?对我来说,绝对必要的是,这个池库是100%保存,没有死锁,生命周期,starvations,甚至它比其他库慢一点.
谢谢你的帮助
java database-connection connection-pooling c3p0 apache-commons-dbcp
我需要在位图中绘制组件及其所有子组件的内容.如果我想绘制整个组件,以下代码可以正常工作:
public void printComponent(Component c, String format, String filename) throws IOException {
// Create a renderable image with the same width and height as the component
BufferedImage image = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
// Render the component and all its sub components
c.paintAll(image.getGraphics());
// Render the component and ignoring its sub components
c.paint(image.getGraphics());
// Save the image out to file
ImageIO.write(image, format, new File(filename));
Run Code Online (Sandbox Code Playgroud)
}
但我没有找到一种只绘制该组件区域的方法.任何的想法 ?
一个非常无聊的问题,抱歉,但我真的不知道那个;)我已经尝试过始终string.empty,但是使用小数会产生错误.
有什么功能吗?不幸的是,对于最简单的问题,谷歌没有答案
我设置
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 0f, this);
它有一个奇怪的行为,locationChanged每秒调用一次而不是接近1分钟的任何时间.其次,locationChanged每秒被调用10秒,然后完全停止,gps satalites图标消失,然后仅在屏幕从显示超时返回时再次恢复.
怎么了?
我目前在Android 1.5上.
R中是否有内置功能可以对字符向量进行排序?sort并order忽略这种情况:
tv <- c("a", "A", "ab", "B")
sort(tv)
## [1] "a" "A" "ab" "B"
Run Code Online (Sandbox Code Playgroud)
到目前为止这是我的解决方案:
CAPS <- grep("^[A-Z]", tv)
c(sort(tv[CAPS]), sort(tv[-CAPS]))
## [1] "A" "B" "a" "ab"
Run Code Online (Sandbox Code Playgroud) 我需要我的Java程序有两种显示模式:GUI界面和命令行界面.如果我在Windows,OS X或其他图形环境中运行它,我应该获得GUI界面,但如果我通过SSH运行它,我应该得到命令行界面.
如何检测GUI是否可以显示或是否应该使用命令行界面?
java ×3
.net ×1
android ×1
bitmap ×1
c# ×1
c++ ×1
c3p0 ×1
character ×1
color-scheme ×1
command-line ×1
components ×1
highlighting ×1
integer ×1
paint ×1
r ×1
sorting ×1
tcp ×1
value-type ×1
vb.net ×1
vector ×1
vim ×1
windows ×1
winforms ×1