我想向下滚动我的网页并使用此代码滚动页面,但它无法正常工作
public ViewBasketSentToMePageObject viewSlideShare() throws InterruptedException {
Thread.sleep(500l);
Actions action1 =new Actions(getDriver());
action1.keyDown(Keys.CONTROL).sendKeys(String.valueOf('\u0030')).build().perform();
List<WebElement> function = getDriver().findElements(By.xpath("//a [@ng-click='onItemClick()']"));
function.get(13).findElement(By.xpath("//img [@ng-src='resources/images/slideshare-icon-small.png']")).click();
return getFactory().create(ViewBasketSentToMePageObject.class);
}
Run Code Online (Sandbox Code Playgroud)
寻求帮助
我有这么长的文字: -
"改善患者体验的5个简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤5改善患者体验的简单步骤"
但我只需要在页面上显示2行和更多按钮来检查完整的文本.这与angular.js有关吗?
如果是,你会建议我什么?
我有一个角度服务类: -
angular.module('triggerTips')
.service('userData', function ($rootScope, $http, $log, $firebase) {
this._log = {
service : 'userData'
};
// Synchronized objects storing the user data
var config;
var userState;
// Loads the user data from firebase
this.init = function(readyCallback) {
var log = angular.extend({}, this._log);
log.funct = 'init';
var fireRef = new Firebase('https://XYZfirebaseio.com/' + $rootScope.clientName);
config = $firebase(fireRef.child('config')).$asObject();
userState = $firebase(fireRef.child('userState').child($rootScope.userName)).$asObject();
Promise.all([config.$loaded(), userState.$loaded()]).
then(
function() {
if(config == null || Object.keys(config).length < 4) {
log.message = 'Invalid config';
$log.error(log);
return;
} …
Run Code Online (Sandbox Code Playgroud) 我有两个模型类.一个是
@Entity(name = "userTools")
@Table(uniqueConstraints = @UniqueConstraint(columnNames = { "assignToUser_id","toolsType_id" }))
@Inheritance(strategy = InheritanceType.JOINED)
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "className")
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserTools {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToOne
private ToolsType toolsType;
@OneToMany(mappedBy = "userTools", fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, orphanRemoval = true)
@Cascade(org.hibernate.annotations.CascadeType.DELETE)
@JsonManagedReference
private List<UserToolsHistory> userToolsHistory;
}
Run Code Online (Sandbox Code Playgroud)
第二是
@Entity(name = "userToolsHistory")
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserToolsHistory {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToOne …
Run Code Online (Sandbox Code Playgroud) 我正在开发jhipster Release 0.7.0并使用 spring STS 与tomcat7运行项目。
但我无法Break point
在调试模式下访问。调试器跳过该点并打开“调试”透视图。
请帮助解决调试模式下的断点不适用于jHipster
我想用java从youtube的URL获取v = id
示例Youtube URL格式:
http://www.youtube.com/watch?v=u8nQa1cJyX8&a=GxdCwVVULXctT2lYDEPllDR0LRTutYfW http://www.youtube.com/watch?v=u8nQa1cJyX8 http://youtu.be/0zM3nApSvMg http://www.youtube.com/user/IngridMichaelsonVEVO#p/a/u/1/KdwsulMb8EQ http://youtu.be/dQw4w9WgXcQ http://www.youtube.com/embed/dQw4w9WgXcQ http://www.youtube.com/v/dQw4w9WgXcQ http ://www.youtube.com/e/dQw4w9WgXcQ http://www.youtube.com/watch?v=dQw4w9WgXcQ http://www.youtube.com/?v=dQw4w9WgXcQ http://www.youtube.com/watch?feature = player_embedded&v = dQw4w9WgXcQ http://www.youtube.com/?feature=player_embedded&v=dQw4w9WgXcQ http://www.youtube.com/user/IngridMichaelsonVEVO#p/u/11/KdwsulMb8EQ http:// www .youtube-nocookie.com/v/6L3ZvIMwZFM?版本= 3&HL = EN_US&相对= 0
或任何其他youtube格式包含网址中的视频ID
我正在尝试: -
Pattern compiledPattern = Pattern.compile("(?<=v=).*?(?=&|$)",Pattern.CASE_INSENSITIVE);
Matcher matcher = compiledPattern.matcher(sourceUrl);
if(matcher.find()){
setVideoId(matcher.group());
}
Run Code Online (Sandbox Code Playgroud)
它不仅适用于一个URL: -
2014-04-23T18:30:00.000Z
需要在这个转换格式yyyy-MM-dd'T'hh:mm:sszzz
在java中
我正在使用这个
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.zzzZ");
Date newfromDate = new Date();
try {
//Convert into date
newfromDate = (Date)formatter.parse(fromDate);
// get required Format of date in string format
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:sszzz");
} catch (ParseException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
但这不起作用
错误: - java.text.ParseException: Unparseable date: "2014-03-31T18:30:00.000Z"
我正在使用 Hibernate/JPA 来执行本机 PostGIS 查询。这些查询的问题在于它们需要不是经典 X = 'value' 形式的参数。
我的查询是:-
@Modifying
@Query(value="UPDATE memo SET readMemo = true and updatedBy_id = ?1 and updatedBy = ?1 and updatedOn = ?2 where assignToUser_id = 1? and readMemo = false and deleted = false ",nativeQuery = true)
void readAllMenoByCurrentUser(Long id, Date updateTime);
Run Code Online (Sandbox Code Playgroud)
错误 :-
org.springframework.dao.InvalidDataAccessApiUsageException: Cannot mix JPA positional parameters and native Hibernate positional/ordinal parameters; nested exception is java.lang.IllegalArgumentException: Cannot mix JPA positional parameters and native Hibernate positional/ordinal parameters
Run Code Online (Sandbox Code Playgroud)
有谁知道在这种情况下如何解决?
我有实体类列表:
public class Entity
{
private long id;
private List<InnerEnity> data;
public long getId() {
return id;
}
public List<InnerEnity> getData() {
return data;
}
}
Run Code Online (Sandbox Code Playgroud)
这是 InnerEnity 类
public class InnerEnity
{
private long id;
private String data;
public long getId() {
return id;
}
public String getData() {
return data;
}
}
Run Code Online (Sandbox Code Playgroud)
我需要的是 InnerEnity id 列表。为了解决这个问题,我正在尝试类似的事情:-
List innerEnityIds = listOfEnity.stream().map(sys -> sys.getData().stream().map(obj->obj.getId().collect(Collectors.toList())));
Run Code Online (Sandbox Code Playgroud) 我试图使用带有连接的hibernate查询语言在mySQL数据库中找到Date列的最大值
@Query("select o.techid, CAST(MAX(o.last_modified) AS DATE)
from com.dw.model.user.User as u
left join com.dw.model.order.Order as o
on u.username=o.techid group by o.techid")
List<User> findUsers();
Run Code Online (Sandbox Code Playgroud)
模型类=
@Entity(name = "orders")
@Scope("prototype")
@Component
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class)
public class Order {
@Id
private long orderNumber;
private Date last_modified;
Run Code Online (Sandbox Code Playgroud)
我收到这个错误: -
引起:java.lang.IllegalStateException:没有左侧的DOT节点!
任何人都可以通过告诉我如何在Hibernate中写这个来帮助我吗?
我有一个字符串realTime = 10:15
,我1:20
从字符串 realTime 中减去了手段(一小时二十分钟)。
输出应该是 = 8:55。
我正在尝试一些东西
moment().subtract(realTime , '1:20');
Run Code Online (Sandbox Code Playgroud)
但它不起作用,帮我找到解决方案。谢谢
java ×8
angularjs ×2
hibernate ×2
asynchronous ×1
breakpoints ×1
collections ×1
date ×1
html ×1
jasmine ×1
java-8 ×1
java-stream ×1
javascript ×1
jhipster ×1
jpa ×1
jquery ×1
json ×1
momentjs ×1
mysql ×1
rest ×1
selenium ×1
spring ×1
sql ×1
unit-testing ×1
video ×1
youtube ×1