我正在尝试使用雅虎财务网络服务从BSE和NSE获取实时股票数据.我能够使用以下URL获取一些数据
http://finance.yahoo.com/webservice/v1/symbols/COALINDIA.NS/quote?format=json
Run Code Online (Sandbox Code Playgroud)
但它给了我非常有限的信息.
{
"list": {
"meta": {
"type": "resource-list",
"start": 0,
"count": 1
},
"resources": [
{
"resource": {
"classname": "Quote",
"fields": {
"name": "COAL INDIA LTD",
"price": "367.649994",
"symbol": "COALINDIA.NS",
"ts": "1418895539",
"type": "equity",
"utctime": "2014-12-18T09:38:59+0000",
"volume": "2826975"
}
}
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我需要更多的信息,如年度高,低,最后交易价格等.我找不到任何与雅虎相关的文档,它详细说明如何获取更多信息.
是否有与这些服务相关的文档?或者,如果有任何替代方案,请建议.
我想在加载Spring上下文后运行一些工作,但我不知道如何做到这一点.
你知道怎么做吗?
我们有基于spring security oauth2的应用程序.一切都很好.但我无法将默认令牌端点从"/ oauth/token"更改为"/ external/oauth/token".
我的spring-servlet.xml
<http pattern="/external/oauth/token" create-session="stateless"
authentication-manager-ref="clientAuthenticationManager"
use-expressions="true" xmlns="http://www.springframework.org/schema/security">
<intercept-url pattern="/external/oauth/token" access="isFullyAuthenticated()" />
<anonymous enabled="false" />
<http-basic entry-point-ref="clientAuthenticationEntryPoint" />
<!-- include this only if you need to authenticate clients via request parameters -->
<custom-filter ref="clientCredentialsTokenEndpointFilter" after="BASIC_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler"/>
</http>
<oauth:authorization-server client-details-service-ref="clientDetails"
token-services-ref="tokenServices"
user-approval-handler-ref="userApprovalHandler" token-endpoint-url="/external/oauth/token">
<oauth:authorization-code />
<oauth:implicit />
<oauth:refresh-token />
<oauth:client-credentials />
<oauth:password />
</oauth:authorization-server>
Run Code Online (Sandbox Code Playgroud)
但是当我访问此端点时的结果是
{
error: "unauthorized"
error_description: "An Authentication object was not found in the SecurityContext"
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?请建议.
我需要进行onetomany关系,但是这个错误出现了mappedBy引用了一个未知的目标实体属性,这是父 Caused by: org.hibernate.AnnotationException: mappedBy reference an unknown target entity property
package com.dating.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="question")
public class PsyQuestions {
@Id
@GenericGenerator(name="autoGen" ,strategy="increment")
@GeneratedValue(generator="autoGen")
@Column(name="questionid")
private long psyQuestionId;
@Column(name="questiontext")
private String question;
@OneToMany(fetch = FetchType.LAZY,mappedBy="question")
private List<PsyOptions> productlist=new ArrayList<PsyOptions>();
public PsyQuestions() {
super();
}
public List<PsyOptions> getProductlist() {
return productlist;
}
public void …Run Code Online (Sandbox Code Playgroud) 我一直在做类似suckerfish的下拉菜单.我现在有下拉式工作,但是我有一些想要放在链接两侧的图像.现在我正在使用图像大小的div,然后将background-image属性设置为我需要的图像(这样它可以使用pseudo:hover类进行更改).
这是适用的CSS:
ul#menu3 li {
color: #000000;
float: left;
/*I've done a little playing around here, doesn't seem to do anything*/
position: relative;
/*margin-bottom:-1px;*/
line-height: 31px;
width: 10em;
padding: none;
font-weight: bold;
display: block;
vertical-align: middle;
background-image: url(../../images/dropdown/button-tile.gif);
}
.imgDivRt {
width: 20px;
height: 31px;
display: inline;
float: right;
vertical-align: middle;
background-image: url(../../images/dropdown/button-right.gif);
}
.imgDivLt {
width: 20px;
height: 31px;
display: inline;
float: left;
vertical-align: middle;
background-image: url(../../images/dropdown/button-left.gif);
}
Run Code Online (Sandbox Code Playgroud)
我使用选择器来节省一些不同的类,但Internet Explorer似乎不支持它们:(
这是我的HTML适用:
<li><div class="imgDivLt"></div>Option 1<div class="imgDivRt"></div>
<ul>
<li><a …Run Code Online (Sandbox Code Playgroud) 我在一个文件夹中有一组文件,所有文件都以类似的名字开头,除了一个.这是一个例子:
Coordinate.txt
Spectrum_1.txt
Spectrum_2.txt
Spectrum_3.txt
.
.
.
Spectrum_11235
Run Code Online (Sandbox Code Playgroud)
我能够列出指定文件夹中的所有文件,但列表不是频谱号的升序.示例:执行程序时,我得到以下结果:
Spectrum_999.txt
Spectrum_9990.txt
Spectrum_9991.txt
Spectrum_9992.txt
Spectrum_9993.txt
Spectrum_9994.txt
Spectrum_9995.txt
Spectrum_9996.txt
Spectrum_9997.txt
Spectrum_9998.txt
Spectrum_9999.txt
Run Code Online (Sandbox Code Playgroud)
但这个顺序不正确.Spectrum_999.txt之后应该有Spectrum_1000.txt文件.有人可以帮忙吗?这是代码:
import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
public class FileInput {
public void userInput()
{
Scanner scanner = new Scanner( System.in );
System.out.println("Enter the file path: ");
String dirPath = scanner.nextLine(); // Takes the directory path as the user input
File folder = new File(dirPath);
if(folder.isDirectory())
{
File[] fileList = folder.listFiles();
Arrays.sort(fileList);
System.out.println("\nTotal number of items present …Run Code Online (Sandbox Code Playgroud) 我在web.xml中有一个简单的servlet配置:
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.servlet</param-name>
<param-value>org.springframework.web.servlet.DispatcherServlet</param-value>
</init-param>
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>net.org.selector.animals.config.ComponentConfiguration</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
如何为SpringBootServletInitializer重写它?
基本上我在记事本中写了一个"脚本"并将其保存为.bat文件.它只是改变目录.写得像这样:
cd C:\Users\Hello\Documents\Stuff
Run Code Online (Sandbox Code Playgroud)
它确实改变了目录,但我想在之后写更多内容cmd.防爆.选择要运行的程序.看起来很简单,但我无法弄清楚.我读到了pause,但它只是等待一个键,然后关闭.
是否有Notepad ++ 6.2.3的功能列表插件?
我在Npp 5.8中使用了TagsView插件和函数列表插件,插件有时会丢失我定义的一些函数.打开TagsView侧边栏时,它始终显示VARIABLE我不想显示的内容.我发现函数列表插件不适合Npp 6.2.3.
有没有人修改功能列表插件(或任何其他插件)以适应6.2.3?
我创建了一个扩展Exception类的类,我在Eclipse上得到了这个警告
可序列化类PhoneAlreadyExists不声明long类型的静态最终serialVersionUID字段
如何删除它?
public class PhoneAlreadyExists extends Exception {
public PhoneAlreadyExists() {
// TODO Auto-generated constructor stub
super();
}
PhoneAlreadyExists(String message) {
super(message);
}
}
Run Code Online (Sandbox Code Playgroud)