最后更新于 25 天前
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAXN=5001,INF=999999999;
int e,n,w[MAXN][MAXN],mincount[MAXN];
void prim(int k)
{
int i,j,ans=0,q,min;
for(int i=1;i<=n;i++)
{
mincount[i]=w[k][i];
}
mincount[k]=0;
for(int i=1;i<n;i++)
{
min=INF;
for(int j=1;j<=n;j++)
{
if(mincount[j]<min and mincount[j]!=0)
{
min=mincount[j];
q=j;
}
}
mincount[q]=0;
ans+=min;
for(int j=1;j<=n;j++)
{
if(w[k][j]<mincount[j])
mincount[j]= w[k][j];
}
}
cout<<ans<<endl;
}
void init()
{
int o,p;
freopen("mst.in","r",stdin);
cin>>n>>e;
for(int i=0;i<=MAXN;i++)
{
for(int j=0;j<=MAXN;j++)
w[i][j]=INF;
}
for(int i=1;i<=e;i++)
{
int t;
cin>>o>>p>>t;
// if(w[o][p]<w[o][p])
w[p][o]=w[o][p]=t;//无向图,若为有向图,则删掉此代码。
}
}
int main()
{
init();
prim(1);
//为啥
//网上有的这里调用的时候用的是:
// prim(1>>n);
return 0;
}
最后更新于 6 月前
import org.junit.*;
import static org.junit.Assert.*;
public class FizzBuzzTest {
@Test
public void one_should_show_1() {
FizzBuzz.Digit one = new FizzBuzz.Digit("1");
assertEquals("1", one.toString());
}
@Test
public void one_succeed_get_two() {
FizzBuzz.Digit one = new FizzBuzz.Digit("1");
FizzBuzz.Digit two = new FizzBuzz.Digit("2");
one.setNext(two);
assertEquals("2", one.next().toString());
}
@Test
public void next_of_ordinal_is_same_as_1_digit() {
FizzBuzz.Ordinal one = FizzBuzz.OrdinalOf(FizzBuzz.ONE);
assertEquals("1", one.toString());
assertEquals("2", one.next().toString());
assertEquals("5", one.next().next().next().next().toString());
}
@Test
public void next_of_ordinal_9_is_10() {
FizzBuzz.Ordinal nine = FizzBuzz.OrdinalOf(FizzBuzz.NINE);
assertEquals("10", nine.next().toString());
}
@Test
public void next_of_ordinal_19_is_20() {
FizzBuzz.Ordinal ninteen = FizzBuzz.OrdinalOf(FizzBuzz.NINE,
FizzBuzz.OrdinalOf(FizzBuzz.ONE));
assertEquals("19", ninteen.toString());
assertEquals("20", ninteen.next().toString());
}
@Test
public void start_of_fizzbuzz_is_1() {
assertEquals("1", FizzBuzz.start().toString());
}
@Test
public void third_of_fizzbuzz_is_fizz() {
assertEquals("Fizz", FizzBuzz.start().next().next().toString());
}
@Test
public void fifth_of_fizzbuzz_is_buzz() {
FizzBuzz.Ordinal fifth = FizzBuzz.start()
.next().next().next().next();
assertEquals("Buzz", fifth.toString());
}
@Test
public void fifteenth_of_fizzbuzz_is_fizzbuzz() {
FizzBuzz.Ordinal fifteenth = FizzBuzz.start()
.next().next().next().next().next()
.next().next().next().next().next()
.next().next().next().next();
assertEquals("FizzBuzz", fifteenth.toString());
}
}
最后更新于 9 月前
{
AKDeviceUnlockState = 1;
AKLastCheckInAttemptDate = "2017-04-03 09:04:15 +0000";
AKLastCheckInSuccessDate = "2017-04-03 09:04:15 +0000";
"Apple Inc. Apple Watch Magnetic Charging Cable" = 1;
"Apple Inc. iPhone" = 1;
AppleActionOnDoubleClick = Maximize;
AppleAntiAliasingThreshold = 4;
AppleFirstWeekday = {
gregorian = 2;
};
AppleKeyboardUIMode = 2;
AppleLanguages = (
"en-IE",
en
);
AppleLanguagesDidMigrate = "10.12.4";
AppleLocale = "en_IE";
AppleMeasurementUnits = Centimeters;
AppleMetricUnits = 1;
AppleMiniaturizeOnDoubleClick = 0;
AppleTemperatureUnit = Celsius;
"General USB Flash Disk" = 1;
"Hewlett-Packard HP Color LaserJet CP4520 Series" = 1;
NSAutomaticCapitalizationEnabled = 1;
NSAutomaticDashSubstitutionEnabled = 1;
NSAutomaticPeriodSubstitutionEnabled = 1;
NSAutomaticQuoteSubstitutionEnabled = 1;
NSAutomaticSpellingCorrectionEnabled = 1;
NSLinguisticDataAssetsRequestTime = "2017-04-03 09:28:12 +0000";
NSLinguisticDataAssetsRequested = (
en,
"en_IE",
"en_GB",
zh,
"zh_Hans",
"en_US",
it
);
NSNavPanelFileLastListModeForOpenModeKey = 1;
NSNavPanelFileListModeForOpenMode2 = 1;
NSNavPanelSidebarKeyForOpen = (
);
NSNavRecentPlaces = (
"~/Documents/OneDrive-2017-03-20",
"~/Workspace/HabiticaChrome/dist/chrome",
"~/Projects/Intl-Checkout/billing-record-service/target",
"~/Pictures",
"~/Workspace/crx-transit/build"
);
NSPersonNameDefaultDisplayNameOrder = 0;
NSPersonNameDefaultShortNameFormat = 0;
NSPersonNameDefaultShouldPreferNicknamesPreference = 0;
NSPreferredWebServices = {
NSWebServicesProviderWebSearch = {
NSDefaultDisplayName = Google;
NSProviderIdentifier = "com.google.www";
};
};
NSUserDictionaryReplacementItems = (
{
on = 1;
replace = omw;
with = "On my way!";
}
);
NavPanelFileListModeForOpenMode = 1;
"RICOH MP C3504" = 1;
SyncServicesServerWasActive = 1;
"Topre Corporation HHKB Professional" = 1;
WebAutomaticSpellingCorrectionEnabled = 1;
"Yubico Yubikey 4 OTP+U2F" = 1;
"com.apple.sound.beep.flash" = 0;
"com.apple.springing.delay" = "0.5";
"com.apple.springing.enabled" = 1;
"com.apple.trackpad.forceClick" = 1;
}
最后更新于 10 月前
#include "CountCoins.hpp"
enum class CoinsType:int{
ZERO = 0,
PENNY=1,
NICKEL=5,
DIME=10,
QUARTER=25
} ;
int operator /(int value, CoinsType type)
{
return value / static_cast<int>(type);
}
int operator *(int value, CoinsType type)
{
return value * static_cast<int>(type);
}
int operator -(int value, CoinsType type)
{
return value - static_cast<int>(type);
}
CoinsType operator -- (CoinsType type, int)
{
switch (type){
case CoinsType::QUARTER:
return CoinsType::DIME;
case CoinsType::DIME:
return CoinsType::NICKEL;
case CoinsType::NICKEL:
return CoinsType::PENNY;
case CoinsType::PENNY:
return CoinsType::ZERO;
default:
return CoinsType::PENNY;
}
}
int makeChangesWithoutCurrentType(int totalCents, CoinsType type)
{
return makeChangesWith(totalCents, type--);
}
int makeChangesWithCurrentType(int totalCents, CoinsType type)
{
int ways = 0;
for( int i = 1; i <= totalCents / type; i++)
{
int smallerNorminalCents = totalCents - i * type;
ways += makeChangesWith(smallerNorminalCents, type--);
}
return ways;
}
int makeChangesWith(int totalCents, CoinsType type)
{
if( type == CoinsType::PENNY)
{
return 1;
}
int ways = 0;
ways += makeChangesWithCurrentType(totalCents, type);
ways += makeChangesWith(totalCents, type--);
return ways;
}
int makeChange(int totalCents)
{
if( totalCents >= 1 )
{
return makeChangesWith(totalCents, CoinsType::QUARTER);
}
return 0;
}
最后更新于 10 月前
int coin_type[] = { 25, 10, 5 };
int func(int nCoins, int nType)
{
if (nCoins <= 0 || nType > 2)
return 1;
int nCount = 0;
for (int i = nType; i < sizeof(coin_type) / sizeof(int); ++i)
{
int nQuot = nCoins / coin_type[i];
for (int j = 1; j <= nQuot; ++j)
{
nCount += func(nCoins - coin_type[i] * j, i + 1);
}
}
return nCount + 1;
}
最后更新于 10 月前
int coin_type[] = { 25, 10, 5 };
int func(int nCoins, int nType)
{
if (nCoins <= 0 || nType > 2)
return 1;
int nCount = 0;
for (int i = nType; i < sizeof(coin_type) / sizeof(int); ++i)
{
int nQuot = nCoins / coin_type[i];
for (int j = 1; j <= nQuot; ++j)
{
nCount += func(nCoins - coin_type[i] * j, i + 1);
}
}
return nCount + 1;
}
最后更新于 11 月前
public class Solution {
public class NaiveHashSet {
static final int VALUE_IDX = 0;
static final int SEQUE_IDX = 1;
static final int NEXT_IDX = 2;
int[][] array;
int[] indexRing;
int size;
int seq;
public NaiveHashSet(int size) {
this.size = size;
array = new int[3][size];
indexRing = new int[size];
}
public boolean add(int value) {
seq += 1;
int startIndex = getIndex(value);
int index = startIndex;
int moveValue = value;
int moveSeq = seq;
int moveFrom = -1;
for (; ; index = nextIndex(index)) {
if (isEmptyCell(index)) {
setValue(index, moveValue, moveSeq);
setNoMoreInList(index);
setValueMovedLink(moveFrom, index);
if (moveFrom != -1) {
indexRing[getIndex(moveSeq)] = index;
}
break;
}
if (getValue(index) == value) return false;
if (canOverWrite(index)) {
setValue(index, moveValue, moveSeq);
setValueMovedLink(moveFrom, index);
if (moveFrom != -1) {
indexRing[getIndex(moveSeq)] = index;
}
break;
}
if (index == startIndex || movedFromOthers(index)) {
int tempValue = moveValue;
int tempSeq = moveSeq;
int tempMoveFrom = moveFrom;
moveValue = getValue(index);
moveSeq = getSeq(index);
moveFrom = index;
setValue(index, tempValue, tempSeq);
if (tempMoveFrom != -1) {
indexRing[getIndex(tempSeq)] = index;
}
}
}
recordLastIndex(startIndex);
return true;
}
void recordLastIndex(int index) {
indexRing[getIndex(seq)] = index;
}
int getEarliestIndex() {
return indexRing[getIndex(seq-size)];
}
int getNextIndexInList(int index) {
return array[NEXT_IDX][index];
}
void setNoMoreInList(int index) {
array[NEXT_IDX][index] = -1;
}
void setValueMovedLink(int from, int to) {
if (from >= 0) {
array[NEXT_IDX][from] = to;
}
}
int getIndex(int value) {
int index = value % size;
return index >= 0 ? index : index+size;
}
int nextIndex(int index) {
int next = getNextIndexInList(index);
if (next < 0) {
if (isFull()) {
next = getEarliestIndex();
} else {
next = getIndex(index + 1);
}
}
return next;
}
boolean isFull() {
return seq > size;
}
boolean isEmptyCell(int index) {
return getSeq(index) == 0;
}
int getSeq(int index) {
return array[SEQUE_IDX][index];
}
int getValue(int index) {
return array[VALUE_IDX][index];
}
void setValue(int index, int value, int seq) {
array[VALUE_IDX][index] = value;
array[SEQUE_IDX][index] = seq;
}
boolean canOverWrite(int index) {
return seq - getSeq(index) == size;
}
boolean movedFromOthers(int index) {
int testValue = getValue(index);
return getIndex(testValue) != index;
}
}
public boolean containsNearbyDuplicate(int[] nums, int k) {
if (k==0) return false;
NaiveHashSet set = new NaiveHashSet(k);
int size = nums.length;
for (int i=0; i<size; i++) {
if (!set.add(nums[i])) return true;
}
return false;
}
}
最后更新于 1 年前
# This file provided by Facebook is for non-commercial testing and evaluation
# purposes only. Facebook reserves all rights not expressly granted.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import json
import os
import time
from datetime import timedelta
from functools import update_wrapper
from flask import Flask, Response, request, abort, current_app, make_response
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
# @app.after_request
# def after_request(response):
# response.headers.add('Access-Control-Allow-Origin', '*')
# response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
# response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE')
# return response
@app.route('/api/comments/<comment_id>', methods=['GET'])
def comments_get(comment_id):
with open('comments.json', 'r') as f:
comments = json.loads(f.read())
comment = None
for c in comments:
if str(c['id']) == comment_id:
comment = c
break
if not comment:
abort(404)
return Response(
json.dumps(comment),
mimetype='application/json'
)
@app.route('/api/comments', methods=['GET', 'POST'])
def comments_handler():
with open('comments.json', 'r') as f:
comments = json.loads(f.read())
if request.method == 'POST':
new_comment = request.form.to_dict()
if new_comment:
new_comment['id'] = int(time.time() * 1000)
comments.append(new_comment)
with open('comments.json', 'w') as f:
f.write(json.dumps(comments, indent=4, separators=(',', ': ')))
return Response(
json.dumps(comments),
mimetype='application/json'
)
if __name__ == '__main__':
app.run(port=int(os.environ.get("PORT", 3000)))
最后更新于 1 年前
class RspecOutputCleanner
def initialize(filename)
@filename = filename
end
def process
read_source
remove_tails
unique_lines
write_result
end
private
def read_source
@lines = IO.readlines(@filename, "\n")
end
def remove_tails
@lines = @lines.map do |line|
line.gsub(/#.*$/, '')
.gsub(/:\d+/, '')
.gsub(/\[(.*?)\]/, '')
.gsub(/\'/, '')
end
end
def unique_lines
@lines.sort!.uniq!
end
def write_result
@lines.each { |line| puts line }
end
end
RspecOutputCleanner.new(ARGV.first).process
最后更新于 1 年前
//从配置文件中读取数据库连接字符串
private readonly string connString = ConfigurationManager.ConnectionStrings["MySchoolConnectionString"].ToString();
private void Form1_Load(object sender, EventArgs e)
{
List<Student> list = new List<Student>();
//1.创建数据库连接对象
SqlConnection connection = new SqlConnection(connString);
//2.构建sql语句
string sql = "select StudentId,StudentNO,StudentName,Sex,Phone,Address from Student";
//3.创建命令对象
SqlCommand command = new SqlCommand(sql,connection);
//4.打开连接
try
{
connection.Open();
//5.执行命令
SqlDataReader dataReader = command.ExecuteReader();
//6.循环读数据(读到的信息封装到学生对象然后添加到集合中)
while (dataReader.Read())
{
Student student = new Student();
student.StudentId = dataReader.GetInt32(0);
student.StudentNO = dataReader.GetString(1);
student.StudentName = dataReader.GetString(2);
student.Sex = dataReader.GetString(3);
student.Phone = dataReader.GetString(4);
student.Address = dataReader.GetString(5);
list.Add(student);
}
//7.关闭SqlDataReader对象
dataReader.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
//8.关闭连接对象
connection.Close();
}
//9.绑定数据源
dgvStudent.DataSource = list;
最后更新于 1 年前
第一条数据:
{
"_id":1,
"function":{
"name":"张三",
"age":18
},
"function_next":{
"_id":1
"todo":"just one"
}
}
第二条数据:
{
"_id":2,
"function":{
"name":"李四",
"age":24
},
"function_next":{
"_id":1
"todo":"just one"
}
}
第三条数据:
{
"_id":3,
"functioin":{
"name":"张三",
"age":18
},
"function_next":{
"_id":2
"todo":"just one"
}
}
期望结果:
{
"items":[
{
"function":{
"name":"张三",
"age":18
},
"function_next_arr":[
"function_next":{
"_id":1
"todo":"just one"
},
"function_next":{
"_id":2
"todo":"just one"
}
]
},
{
"function":{
"name":"李四",
"age":24
},
"function_next_arr":[
"function_next":{
"_id":1
"todo":"just one"
},
]
}
]
}
最后更新于 1 年前
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>vue-test</title>
</head>
<body>
<div id="app"></div>
<script src="dist/build.js"></script>
</body>
</html>
最后更新于 1 年前
#!/bin/bash
REPORT_FILE=/tmp/report.csv
sudo rm -f $REPORT_FILE
mysql -uroot -proot --execute "$1 into outfile '$REPORT_FILE' fields terminated by ','" yizaoyiwan_dev
curl https://api.mailgun.net/v3/sandbox698c6abd28c14f05a4a4ae76fec18271.mailgun.org/messages \
-s --user 'api:key-xxxxxxx' \
-F from='yourname@gmail.com' \
-F to="$2" \
-F subject='New report here' \
-F text='Here is the new report, check it.' \
-F attachment=@$REPORT_FILE \
最后更新于 1 年前
[loggers]
keys=root,services
[logger_root]
handlers=consoleHandler,fileHandler
[handlers]
keys=consoleHandler,fileHandler
[handler_consoleHandler]
class=StreamHandler
formatter=simpleFormatter
level=INFO
args=(sys.stdout,)
[handler_fileHandler]
class=FileHandler
formatter=simpleFormatter
level=INFO
args=('barnes.log',)
[formatters]
keys=simpleFormatter
[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
[logger_services]
level=INFO
handlers=consoleHandler,fileHandler
qualname=services
propagate=0
最后更新于 1 年前
SELECT td.td_token_id, td.td_br_id
FROM token_data td
WHERE td.td_token_store = 'ADYEN'
AND td.td_br_id IN (
SELECT id
FROM billing_record
WHERE br_p_id IN (
SELECT pd_p_id
FROM psp_purchaser_data
WHERE pd_purchaser_ref IN (
%s
)
)
);
最后更新于 1 年前
huawei:~$ /mnt/squash/local/pyhome/bin/python2.7
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/mnt/squash/local/pyhome/lib/python2.7/site.py", line 563, in <module>
main()
File "/mnt/squash/local/pyhome/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/mnt/squash/local/pyhome/lib/python2.7/site.py", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/mnt/squash/local/pyhome/lib/python2.7/site.py", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/mnt/squash/local/pyhome/lib/python2.7/site.py", line 243, in getuserbase
USER_BASE = get_config_var('userbase')
File "/mnt/squash/local/pyhome/lib/python2.7/sysconfig.py", line 521, in get_config_var
return get_config_vars().get(name)
File "/mnt/squash/local/pyhome/lib/python2.7/sysconfig.py", line 420, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/mnt/squash/local/pyhome/lib/python2.7/sysconfig.py", line 288, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr1/projects/br_AR_V2R8C00_SysAdmin/opensrc/python/target/lib/python2.7/config/Makefile (No such file or directory)
最后更新于 1 年前
local current_dir='${PWD/#$HOME/~}'
YS_VCS_PROMPT_PREFIX1="%{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
YS_VCS_PROMPT_SUFFIX="%{$reset_color%} "
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}❌"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}✅"
local git_info='$(git_prompt_info)'
local git_last_commit='$(git log --pretty=format:"%h \"%s\"" -1 2> /dev/null)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
PROMPT="
%{$fg[green]%}%* \
%{$fg[cyan]%}%n $fg[white]in\
%{$terminfo[bold]$fg[yellow]%} [${current_dir}]%{$reset_color%} \
${git_info}\
➜ %{$reset_color%}"
最后更新于 1 年前
java.sql.SQLException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'train_cloud.ts.train_no' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by Query: select ts.id, ts.train_no trainNo, ts.duration, ts.railways_bureau railwaysBureau, ts.train_line trainLine, count(s.id) stationCount from train_schedules ts left join station_infos s on ts.id = s.train_schedules_id group by ts.id Parameters: []
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:392)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:351)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:289)
at com.ornos.traincloud.dao.impl.BaseDaoImpl.getResultBySQL(BaseDaoImpl.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:266)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy29.getResultBySQL(Unknown Source)
at com.ornos.traincloud.dao.impl.TrainScheduleDaoImpl.getAll(TrainScheduleDaoImpl.java:33)
at com.ornos.traincloud.service.impl.TrainScheduleServiceImpl.getAll(TrainScheduleServiceImpl.java:22)
at com.ornos.traincloud.controller.TrainScheduleController.get(TrainScheduleController.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
最后更新于 1 年前
<template>
<div class="posts">
<h1>Load posts</h1>
<div class="panel panel-default">
<div class="panel-body" v-for="post in posts">
<a href="#">{{ post.title }}</a>
</div>
</div>
</div>
</template>
<script>
export default {
ready() {
this.$http.get('http://127.0.0.1:8080/v1/posts').then((response) => {
this.$set('posts', response.json())
}, (response) => {
console.log('error!');
})
},
data() {
return {
}
}
}
</script>
最后更新于 1 年前
95 会员 0
136 代码集合 0
16 评论 0
98 收藏夹 0