背景:
在我的数据库表中,我有两个时间戳
timeStamp1 = 2011-08-23 14:57:26.662
timeStamp2 = 2011-08-23 14:57:26.9
Run Code Online (Sandbox Code Playgroud)
当我执行"ORDER BY TIMESTAMP ASC"时,timeStamp2被认为是更大的时间戳(这是正确的).
要求:我需要得到这些时间戳的差异(timeStamp2 - timeStamp1)
我的实施:
public static String timeDifference(String now, String prev) {
try {
final Date currentParsed = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse(now);
final Date previousParsed = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse(prev);
long difference = currentParsed.getTime() - previousParsed.getTime();
return "" + difference;
} catch (ParseException e) {
return "Unknown";
}
}
Run Code Online (Sandbox Code Playgroud)
答案应该是238毫秒,但返回的值是-653毫秒.我不确定我做错了什么.有什么建议?
我注意到我的应用程序中的一些命令失败了
Caused by: ! com.netflix.hystrix.exception.HystrixRuntimeException: GetAPICommand timed-out and no fallback available.
out: ! at com.netflix.hystrix.HystrixCommand.getFallbackOrThrowException(HystrixCommand.java:1631)
out: ! at com.netflix.hystrix.HystrixCommand.access$2000(HystrixCommand.java:97)
out: ! at com.netflix.hystrix.HystrixCommand$TimeoutObservable$1$1.tick(HystrixCommand.java:1025)
out: ! at com.netflix.hystrix.HystrixCommand$1.performBlockingGetWithTimeout(HystrixCommand.java:621)
out: ! at com.netflix.hystrix.HystrixCommand$1.get(HystrixCommand.java:516)
out: ! at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:425)
out: Caused by: ! java.util.concurrent.TimeoutException: null
out: !... 11 common frames omitted
Run Code Online (Sandbox Code Playgroud)
这是我的Hystrix配置覆盖:
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=210000
hystrix.threadpool.default.coreSize=50
hystrix.threadpool.default.maxQueueSize=100
hystrix.threadpool.default.queueSizeRejectionThreshold=50
Run Code Online (Sandbox Code Playgroud)
这是什么样的超时?它是外部应用程序的读/连接超时吗?我该如何调试呢?
我想创建具有选择属性但也能够在其中编写自定义文本的输入元素。我正在使用 React 和 Material-UI。
是否可以在 Material-UI 的 TextField 组件内(在输入下方的 div 内)添加元素。
目前:Usluga grupni Pos ....
添加元素:
<div class="MuiFormControl-root-142 ...>
<label class="MuiFormLabel-root-151 ...>Usluga</label>
<div class="MuiInput-root-156 ...>
<input aria-invalid="false" ... list="services" value="">
<datalist id="services">
<li tabindex="-1" ...>grupni<span class="MuiTouchRipple-root-82"></span>
</li>
<li tabindex="-1" ...>Pos<span class="MuiTouchRipple-root-82"></span>
</li>
....
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
目前反应:
<TextField
id="service"
label="Usluga"
className={classes.textField}
margin="normal"
onChange={handleChange}
inputProps={{
list: "services"
}}
/>
<datalist id="services">
{
services.map(option => (
<MenuItem key={option.id} value={option.service}>
{ option.service }
</MenuItem>
))
}
</datalist>
Run Code Online (Sandbox Code Playgroud)
如果这是不可能的,还有什么方法可以做到这一点?
我需要打印在迁移运行时执行的原始查询.有关如何做到这一点的任何想法?
我使用--migrate选项来运行脚本.
一定有办法找到这个。我需要找出 document.body 相对于屏幕的坐标
我需要找出图像中问号的坐标。这将是文档正文相对于屏幕的位置。该图像描述了我可以使用的属性。是否可以?
要求:如果存在任何异常,请调用重新验证数据的方法
我的实施:
private void one() {
try {
//Valid data
}catch(Exception e) {
two();
}
}
private void two() {
//Process data with another input
//On entry,
one();
}
Run Code Online (Sandbox Code Playgroud)
我意识到我的用法不正确.我应该怎么处理这个?
我创建了一个 Material UIListItem
菜单,如下所示。
当我单击按钮时,它会将 URL 更新为http://localhost:3000/createIdea
,但页面不会通过路由器加载。
如果您进入浏览器 URL 窗口并点击Enter,页面就会加载。
DrawerMenu.js
有路由:
<Route exact path='/createIdea' component={() => <CreateIdea />} />
Run Code Online (Sandbox Code Playgroud)
并且App.js
-> drawerMenu.js*
-> tiledata.js
:
<ListItem button component={Link} to="/createIdea">
<ListItemIcon>
<WhatsHotIcon/>
</ListItemIcon>
<ListItemText primary="Create Idea"/>
</ListItem>
Run Code Online (Sandbox Code Playgroud)
我可以做什么来解决这个问题?
java ×3
material-ui ×2
reactjs ×2
date ×1
hystrix ×1
javascript ×1
node.js ×1
react-router ×1
sequelize.js ×1
try-catch ×1