我一直在寻找关于这个主题的一些论文(或信息).
为了避免误解:我不是在谈论在多个位置找到提供的模式.
重复图案也可以理解为表示重复图像.这里模式的定义不是抽象的.想象一下,例如,一堵砖墙.墙由单独的砖组成.墙的图片由砖的重复图像组成.
该解决方案必须优选地找到最大的重复模式.在这种情况下,大的可以用两种方式定义:像素区域或重复次数.
在上面的例子中,您可以将砖块切成两半.为了制作砖块,您可以旋转一个段并连接两半.虽然完整的砖是像素区域方面最大的重复图像,但是半块的重复次数是2倍.
有什么想法吗?
pattern-recognition image-processing image-recognition computer-vision
我有一种情况,我有一个类传递一个PublishingPage实例,我想枚举在此页面的布局页面中使用的任何和所有Web部件区域.
事实证明这很艰难.
PublishingPage有一个名为Layout的属性,它的类型为PageLayout.这与PublishingLayoutPage不同,后者(最终)继承到具有Zones属性的Page.此PageLayout类型没有任何引用具有我需要的Zones属性的普通ASP.NET页面类型.
我可以从PublishingPage.Layout属性获取SPListItem和SPFile,并以原始文本形式获取页面布局的内容,但是这不能用XmlReader解析,因为它不是有效的XML(<%标签无效).
我可以从PublishingPage.ListItem.Web获得一个SPWeb,这可以让我得到一个SPLimitedWebPartManager,在那里我可以得到一个LimitedWebParts(它有区域信息)的集合 - 但这没有用,因为在我的代码的这个阶段我有没有网页部分.
我很困惑,看起来发布基础设施与ASP.NET和SharePoint完全脱节.
更新:
我可以使用SPLimitedWebPartManager将虚拟Web部件(如新的ContentEditorWebPart)添加到Web部件区域(我有所使用的区域的名称),但是当我将其保存并检查页面时(并获取)一个新的SPLWPM),我可以恢复WebParts,但Zone属性为null(ZoneID属性已填充且正确).
sharepoint publishing sharepoint-2007 sharepoint-object-model
我正在从代码构建UI并且可以成功添加ProgressBar小部件,但是我无法将小部件的维度更改为我需要的值,它始终保持默认大小(大约50dp).我试过以下代码;
ProgressBar progressBar = new ProgressBar(activity, null, android.R.attr.progressBarStyleHorizontal);
progressBar.setMinimumHeight(20);
progressBar.setMinimumWidth(100);
Run Code Online (Sandbox Code Playgroud)
我也尝试过设置progressBar LayoutParams,但是我没有试过,我尝试将窗口小部件包装在另一个布局中,但仍然没有运气.
任何人都可以帮忙,因为我看不到怎么做?如果有使用XML的解决方案,它可以工作,但我必须在运行时设置维度和位置.
对于Progress XML,我使用了以下内容.
<ProgressBar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="10dp"
android:indeterminateOnly="false"
android:progressDrawable="@android:drawable/progress_horizontal"
android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
android:maxWidth="1000dp"
/>
Run Code Online (Sandbox Code Playgroud)
然后膨胀它的代码如下.这是我们一直在讨论的内容的混合.
LayoutInflater layoutInflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ProgressBar progressBar = (ProgressBar)layoutInflater.inflate(R.layout.progress_bar, null);
progressBar.setMinimumHeight(10);
progressBar.setMinimumWidth(200);
progressBar.setLayoutParams(new RelativeLayout.LayoutParams(200, 10);
progressBar.setMax(100);
progressBar.setProgress(getScrollBarValue());
progressBar.setIndeterminate(isIndeterminate());
progressBar.getLayoutParams().width = 200;
progressBar.invalidate();
Run Code Online (Sandbox Code Playgroud) 我想使用@property语法声明一个公开只读的合成属性,但有一个可以在类中私下调用的setter.
由于它是Objective-C,这基本上意味着该setFoo:方法将被合成,但在类本身之外调用它将导致警告(无法识别的选择器).要触发警告,我必须申报该财产readonly; 有没有办法强制合成的setter只在类中可用?
我的应用程序由两个线程组成:
我使用两个线程的原因是保持GUI响应,同时让Sim线程尽可能快地旋转.
在我的GUI线程中,我在SIM卡中以30-60的FPS渲染实体; 但是,我希望我的SIM卡能够"紧缩" - 可以这么说 - 并最终排队游戏状态(想想流媒体视频,你有一个缓冲区).
现在,对于我渲染的每个帧,我需要相应的模拟"状态".所以我的sim线程看起来像:
while(1) {
simulation.update();
SimState* s = new SimState;
simulation.getAgents( s->agents ); // store agents
// store other things to SimState here..
stateStore.enqueue(s); // stateStore is a QQueue<SimState*>
if( /* some threshold reached */ )
// push stateStore
}
Run Code Online (Sandbox Code Playgroud)
SimState 好像:
struct SimState {
std::vector<Agent> agents;
//other stuff here
};
Run Code Online (Sandbox Code Playgroud)
而Simulation :: getAgents看起来像:
void Simulation::getAgents(std::vector<Agent> &a) const
{
// mAgents is a std::vector<Agent>
std::vector<Agent> a_tmp(mAgents);
a.swap(a_tmp);
}
Run Code Online (Sandbox Code Playgroud)
这Agent本身就是一些复杂的课程.成员是一堆 …
我有一个R包,使用OpenMP很容易加速.如果您的编译器支持它,那么您将获得胜利,如果没有,那么将忽略编译指示并获得一个核心.
我的问题是如何让包构建系统使用正确的编译器选项和库.目前我有:
PKG_CPPFLAGS=-fopenmp
PKG_LIBS=-fopenmp
Run Code Online (Sandbox Code Playgroud)
在我的机器上硬编码到src/Makevars中,并使用OpenMP支持构建它.但是它会在检查时产生关于非标准编译器标志的警告,并且在没有openMP功能的机器上可能会很难.
解决方案似乎是使用configure和autoconf.这里有一些信息:
http://cran.r-project.org/doc/manuals/R-exts.html#Using-Makevars
包括一个在odbc功能中编译的复杂示例.但我看不出如何开始调整以检查openmp和libgomp.
我所看到的关于使用openMP的R软件包似乎都没有设置.
那么有没有人有一个使用OpenMP设置R包的演练?
[编辑]
我现在可能已经破解了.我有一个configure.ac脚本和一个带有@ FOO @ substitutions的Makevars.in用于编译器选项.但现在我不确定工作流程.是吗:
但是,仅仅是明确的,"autoconf的configure.in>配置"不上运行包安装-其纯粹的开发过程中创建的配置脚本的分布- amirite?
如何在重启后设置连续复制?连续复制仅在下次重新引导时才起作用.
我有一个项目,我正在尝试将序列化对象发送到服务器,然后等待"OK"或"ERROR"消息返回.
我似乎遇到了类似的问题:TcpClient发送/关闭问题
问题是,我似乎能够发送原始对象的唯一方法是关闭连接,但然后(当然)我迫不及待地想看看服务器是否成功处理了对象.
private void button4_Click(object sender, EventArgs e)
{
RequestPacket req = new RequestPacket();
/// ... Fill out request packet ...
/// Connect to the SERVER to send the message...
TcpClient Client = new TcpClient("localhost", 10287);
using (NetworkStream ns = Client.GetStream())
{
XmlSerializer xml = new XmlSerializer(typeof(RequestPacket));
xml.Serialize(ns, req);
/// NOTE: This doesn't seem to do anything....
/// The server doesn't get the object I just serialized.
/// However, if I use ns.Close() it does...
/// but then …Run Code Online (Sandbox Code Playgroud) 如何为应用程序启用多点触控支持,我希望两个用户触摸屏幕并同时发送应用程序的拖动事件.
我的组件上有这个代码
public boolean onTouchEvent(MotionEvent evt) {
if (evt.getY() > 612) {
east.notifyMotionEvent(evt);
south.notifyMotionEvent(evt);
} else {
weast.notifyMotionEvent(evt);
north.notifyMotionEvent(evt);
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
但是只发送了一个拖动事件.
我现在支持的代码是
for (int i = 0; i < evt.getPointerCount(); i++) {
float y = evt.getY(i);
if (y > 612) {
eastPad.notifyMotionEvent(evt.getX(i), evt.getY(i));
southPad.notifyMotionEvent(evt.getX(i), evt.getY(i));
} else {
weastPad.notifyMotionEvent(evt.getX(i), evt.getY(i));
northPad.notifyMotionEvent(evt.getX(i), evt.getY(i));
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个名为价格的数据库,有12列可以说.
comp1,comp2,comp3,comp4,comp5,comp6等.
然后我想运行一个查询来查找存储在该行中与id匹配的最低价格,但我认为它将null视为最低值,因为我没有得到正确的答案.
无论如何围绕这个?或者我做错了吗?
$query = "SELECT * FROM Prices WHERE id =$id" or die(mysql_error());
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$comp1= $row['comp1'];
$comp2= $row['comp2'];
$comp3= $row['comp3'];
$comp4= $row['comp4'];
$comp5= $row['comp5'];
$comp6= $row['comp6'];
$comp7= $row['comp7'];
$comp8= $row['comp8'];
$comp9= $row['comp9'];
$comp10= $row['comp10'];
$comp11= $row['comp11'];
$comp12= $row['comp12'];
$min = array( $comp1, $comp2, $comp3, $comp4, $comp5, $comp6, $comp7, $comp8, $comp8, $comp10, $comp11, $comp12);
echo min($min);
}
Run Code Online (Sandbox Code Playgroud) android ×2
c# ×1
c++ ×1
configure ×1
couchdb ×1
database ×1
layout ×1
min ×1
multi-touch ×1
objective-c ×1
openmp ×1
packages ×1
performance ×1
php ×1
progress-bar ×1
properties ×1
publishing ×1
qt ×1
r ×1
replication ×1
sharepoint ×1
simulation ×1
sockets ×1
startup ×1
tcp ×1
tcpclient ×1
width ×1