我想在以下条件下从mysql数据库中获取记录
我有以下表格:
organization_表
organizationId | organizationname
Run Code Online (Sandbox Code Playgroud)活动表
camp_id | camp_name | adv_id | organizationId
Run Code Online (Sandbox Code Playgroud)做广告表
adv_id | adv_name
Run Code Online (Sandbox Code Playgroud)ad_display表
ad_displayId | adv_id | camp_id |
Run Code Online (Sandbox Code Playgroud)现在从ad_display表我想要获取这样的记录:
| adv_name | camp_name | organizationname
Run Code Online (Sandbox Code Playgroud)
使用WHERE
Condtion作为organizationId ==?
所以基本上我想要广告列表的campaign_id =?
注意:camapign表中相同的adv_id应该有多个条目,ad_display中的多个条目应该有相同的camp_id
任何人都可以告诉我如何用一些通用方法改变uilabel字符串部分的颜色?
让我解释 ..
我有标签
"10/05/2008 4 years",
"10/05/2011 2 years",
"20/06/1933 - 07/07/1970 37 years",
"10/05/1982 30 years",
"10/05/2008 4 years",
"10/05/2011 2 years",
"20/06/1933 - 07/07/1970 37 years"
Run Code Online (Sandbox Code Playgroud)
现在我想要的是制作年份和它的价值,例如(4年)不同的颜色和日期用不同的字体的不同颜色.
NSMutableAttributedString * string = [[NSMutableAttributedString alloc]initWithString:peopleDate.text];
[string addAttribute:NSForegroundColorAttributeName value:GraycolorForText range:NSMakeRange(10, 5)];
[peopleDate setAttributedText:string];
Run Code Online (Sandbox Code Playgroud)
这只会改变特定范围内的颜色而且不是通用的.所以任何人都可以给我任何解决方案吗?
我已经customFlowLayout
在我的 iOS 应用程序中实现了。我已经将targetContentOffsetForProposedContentOffset:withScrollingVelocity
with subclassing进行了子类化UICollectionViewFlowLayout
。现在我的问题是当用户滚动collectionview
它必须只滚动到下一个索引。现在它随机滚动。
所以任何人都知道如何使滚动限制为每个滚动只有一个项目。
以下是我的代码。
#pragma mark - UICollectionViewLayout (UISubclassingHooks)
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity {
CGSize collectionViewSize = self.collectionView.bounds.size;
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + collectionViewSize.width / 2;
CGRect proposedRect = CGRectMake(proposedContentOffset.x, 0, collectionViewSize.width, collectionViewSize.height);
UICollectionViewLayoutAttributes *candidateAttributes;
for (UICollectionViewLayoutAttributes *attributes in [self layoutAttributesForElementsInRect:proposedRect]) {
if (attributes.representedElementCategory != UICollectionElementCategoryCell) continue;
if (!candidateAttributes) {
candidateAttributes = attributes;
continue;
}
if (fabs(attributes.center.x - proposedContentOffsetCenterX) < fabs(candidateAttributes.center.x - proposedContentOffsetCenterX)) {
candidateAttributes = attributes;
}
}
proposedContentOffset.x = …
Run Code Online (Sandbox Code Playgroud) 我希望在按下按钮时继续执行工作,使用Java.释放按钮后,工作应该停止.像这样的东西:
Button_is_pressed()
{
for(int i=0;i<100;i++)
{
count=i;
print "count"
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么能实现这个目标?
我想在ajax的liferay中得到一些帮助.现在我从我的view.jsp
页面调用ajax方法来提交一些数据.
以下是我使用的示例代码view.jsp
:
<%@ include file="/init.jsp"%>
<portlet:actionURL name="AddTest" var="add1" />
<portlet:resourceURL id="AddTest" var="AddTest"></portlet:resourceURL>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
function addToDo(addToDo){
var todo =document.getElementById('toDo').value;
$.ajax({
url :addToDo,
data: {"todo":todo,"CMD":"addToDo"},
type: "GET",
dataType: "text",
success: function(data) {
$("#toDoList").html(data);
}
});
}
</script>
</head>
<body>
<portlet:resourceURL var="addToDo" id="addToDo"></portlet:resourceURL>
<form>
<input type="text" name="toDo" id="toDo">
<button name="Add" type="button" onclick="addToDo('<%=addToDo%>')">Add</button>
<div id="toDoList">
</div>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在我的portlet.java
班级中,有一个方法由这个ajax调用调用:
@Override
public void serveResource(ResourceRequest request, ResourceResponse response){
if(request.getParameter("CMD").equals("addToDo")) {
System.out.println("came here for …
Run Code Online (Sandbox Code Playgroud) 我想用Eclipse JUNO for Liferay 创建我自己的Portlet .我已经google了很多,但这只是为了让我使用netbeans所以任何人都可以指导我或者给我链接在eclipse中从头开始创建portlet的教程.
我试过以下内容
ADD->新的Liferay项目
然后它没有在liferay中显示我创建的portlet
我已经成功地在我的windows7中安装了liferay,并且我还集成了现成的书籍portlet,但只是创建了我自己的简单的hello world portlet
甚至在我甚至关注此链接http://www.youtube.com/watch?v=-EbyIbMWrCI之前, 但它在管理员帐户中的更新管理器选项中显示我的portlet状态为"UNKNOWN"
我知道您可以在路径上定义liferay日志的日志级别
/liferay-portal-6.1.10-ee-ga1/logs/liferay.yyyy-mm-dd.log通过控制面板 - >服务器管理 - >日志级别
.但这很难做到,因为有很多页面要经过这么多的类或包.有没有办法可以从一个地方将所有级别设置为WARN?
在Log4j属性文件中,我在不同的位置定义了一个日志文件,并将日志级别设置为WARN.这有效.我是否可以在此路径的相同Log4j属性文件中执行另一个设置:
/liferay-portal-6.1.10-ee-ga1/logs/liferay.yyyy-mm-dd.log?
有谁知道如何将以下字符串转换为日期?
"周五7月30日16:19:36 GMT + 02.00 2021"
我试过了:
SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy");
try {String temp = value2[i].trim();
expiry = formatter.parse(temp);
} catch (Exception e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
但是,它不起作用.
我正在为iphone开发一个应用程序,因为我UILabel
在某个特定位置的导航栏中添加了一个以上的问题.
我想要的是以下图像
在上面的图像中有一个后退按钮和一个imageview
带箭头标记的按钮.除此之外,所有白色框都是为了UILabels
在导航栏中显示不同.UIImageView
导航栏中只有一个,左侧有一个按钮.现在问题是我不知道如何添加多个UILabel
在特定位置的导航栏中.
到目前为止,我所做的只是添加按钮和UIImageView
右边的条形按钮阵列或左边的按钮阵列,但只能添加项目.
所以任何人都可以指导我如何在特定位置添加UILabel或任何其他项目.
我在使用Twig的Symfony2上,我在param中有2个数组:
我的控制器:
return $this->render('MyBundle:Default:index.html.twig',
array('checked' => $boxChecked,
'choices' => $choices));
Run Code Online (Sandbox Code Playgroud)
Vars'已检查'和'选择'是两个数组,我想显示$ checked [$ choices [$ i]]的值来与true ofr进行比较以将已检查或未应用于twig tpl的输入.
这是我的代码,但不起作用:
{% for choice in choices %}
{% if checked.{{choice}} == true %}
<div class="choice">{{ choice|capitalize }} <input type="checkbox" id="{{ choice }}" /></div>
{% else %}
<div class="choice">{{ choice|capitalize }} <input type="checkbox" id="{{ choice }}" checked="checked" /> </div>
{% endif %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
错误是: Expected name or number in "MyBundle:Default:index.html.twig" at line 22 (500 Internal Server Error)
第22行是: {% if checked.{{choice}} …