Unable to determine HOST_OS from uname -sm 1C

导入android 源码到android studio查看过程遇到问题:网上找不到相关信息,不知道为什么报这个错。。
在windows7 64 bit下使用cygwin,输入命令$ mmm development/tools/idegen/,出现以上问题,android 源码版本是revision="refs/tags/android-7.1.0_r1"
图片说明

2个回答

这个是你系统的OS,源码不能识别出平台来。最好是放到linux上编译

在Windows里新建一个环境变量HOSTOS,值设置为CROSS_windows,然后,在Path中加入%HOST_OS%\bin,重启Cygwin,再lunch应该就OK了~

turtlejj
二二的二姐夫 新建环境变量HOST_OS,少打了个下划线
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
FFmpeg C++ 的 avcodec_encode_video2 返回 -40

我想通過avcodec_encode_video2 覆蓋packet中的memory來達到刷新我做過特殊渲染的影像,但avcodec_encode_video2 的返回值是不成功-40問題: 我正常撥放輸出都沒問題 就是沒辦法蓋過圖層,是不是哪邊memory寫法不正確呢? 代碼如下: AVOutputFormat* ofmt = NULL; //Input AVFormatContext and Output AVFormatContext AVFormatContext* i_pFormatCtx = NULL, * out_pFormatCtx = NULL; AVCodecContext* pCodecCtx;//視頻解碼器 AVCodecContext* pCodecCtxAudio;//音頻解碼器 AVCodec* pCodec; AVCodec* pCodecAudio; AVPacket packet; string in_filename; string out_filename; int ret, i; int videoindex = -1; int audioindex = -1; int frame_index = 0; int64_t start_time = 0; uint8_t* buffer; AVFrame* pFrame; AVFrame* pFrameRGB; int frameFinished; int frameAudioFinished; int numBytes; AVStream* in_stream, * out_stream; vector<AVPacket> BIGpacket; in_filename = "D:/yolo/data_movie/f1.mp4"; out_filename = "rtmp://localhost:1935/live/home";//怀堤 URLㄗOutput URLㄘ[RTMP] //================ // 註冊: av_register_all(); //================ //Network avformat_network_init(); //======================= //Input if ((ret = avformat_open_input(&i_pFormatCtx, in_filename.c_str(), 0, 0)) < 0) { //printf("Could not open input file."); goto end; } if ((ret = avformat_find_stream_info(i_pFormatCtx, 0)) < 0) { //printf("Failed to retrieve input stream information"); goto end; } for (i = 0; i < i_pFormatCtx->nb_streams; i++) { if (i_pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { videoindex = i; } if (i_pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { audioindex = i; } } av_dump_format(i_pFormatCtx, 0, in_filename.c_str(), 0); //Output avformat_alloc_output_context2(&out_pFormatCtx, NULL, "flv", out_filename.c_str()); //RTMP if (!out_pFormatCtx) { //printf("Could not create output context\n"); ret = AVERROR_UNKNOWN; goto end; } ofmt = out_pFormatCtx->oformat; for (i = 0; i < i_pFormatCtx->nb_streams; i++) { //Create output AVStream according to input AVStream AVStream* in_stream = i_pFormatCtx->streams[i]; AVStream* out_stream = avformat_new_stream(out_pFormatCtx, in_stream->codec->codec); if (!out_stream) { AfxMessageBox(L"Failed allocating output stream"); //printf("Failed allocating output stream\n"); ret = AVERROR_UNKNOWN; goto end; } //Copy the settings of AVCodecContext ret = avcodec_copy_context(out_stream->codec, in_stream->codec); if (ret < 0) { //printf("Failed to copy context from input to output stream codec context\n"); goto end; } out_stream->codec->codec_tag = 0; if (out_pFormatCtx->oformat->flags & AVFMT_GLOBALHEADER) out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; } //====================================================================== // 打开視頻解码器 pCodecCtx = i_pFormatCtx->streams[videoindex]->codec; pCodec = avcodec_find_decoder(pCodecCtx->codec_id); if (avcodec_open2(pCodecCtx, pCodec, 0) < 0) { DbgPrint("Could not open codec"); return; } //====================================================================== // 打开音頻解码器 pCodecCtxAudio= i_pFormatCtx->streams[audioindex]->codec; pCodecAudio= avcodec_find_decoder(pCodecCtxAudio->codec_id); if (avcodec_open2(pCodecCtxAudio, pCodecAudio, 0) < 0) { DbgPrint("Could not open codec"); return; } #if OUTPUT_PCM pFile = fopen("output.pcm", "wb"); #endif** packet = *(AVPacket*)av_malloc(sizeof(AVPacket)); av_init_packet(&packet); //===================================================================== // 破解視頻某些编解码器可能生成的错误帧速率 if (pCodecCtx->time_base.num > 1000 && pCodecCtx->time_base.den == 1) { pCodecCtx->time_base.den = 1000; } // 分配视频帧 pFrame = av_frame_alloc(); // Allocate an AVFrame structure pFrameRGB = av_frame_alloc(); if (pFrameRGB == NULL) return; numBytes = avpicture_get_size(AV_PIX_FMT_RGB24, pCodecCtx->width,pCodecCtx->height);// Determine required buffer size and allocate buffer buffer = (uint8_t*)av_malloc(numBytes * sizeof(uint8_t)); avpicture_fill((AVPicture*)pFrameRGB, buffer, AV_PIX_FMT_RGB24,pCodecCtx->width, pCodecCtx->height);// Assign appropriate parts of buffer to image planes in pFrameRGB long prepts = 0; //Dump Format------------------ av_dump_format(out_pFormatCtx, 0, out_filename.c_str(), 1); //Open output URL if (!(ofmt->flags & AVFMT_NOFILE)) { ret = avio_open(&out_pFormatCtx->pb, out_filename.c_str(), AVIO_FLAG_WRITE); if (ret < 0) { AfxMessageBox(L"Could not open output URL"); //printf("Could not open output URL '%s'", out_filename); goto end; } } //Write file header ret = avformat_write_header(out_pFormatCtx, NULL); if (ret < 0) { //printf("Error occurred when opening output URL\n"); goto end; } start_time = av_gettime(); while (1) { //Get an AVPacket ret = av_read_frame(i_pFormatCtx, &packet); if (ret < 0) { break; } if (G_PAUSE) { break; } /* if (packet.stream_index == audioindex) { //聲音: ret = avcodec_decode_audio4(pCodecCtx, pFrame, &frameAudioFinished,&packet); } */ //Important:Delay if (packet.stream_index == videoindex) { //==================================================================================== //幀解碼器: int a=avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);// Decode video frame //ret = avcodec_encode_video2(pCodecCtx, &packet, pFrameRGB, &frameFinished); if (frameFinished) { static struct SwsContext* img_convert_ctx; if (img_convert_ctx == NULL) { int w = pCodecCtx->width; int h = pCodecCtx->height; img_convert_ctx = sws_getContext(w, h, pCodecCtx->pix_fmt, w, h, AV_PIX_FMT_RGB24, 4, NULL, NULL, NULL); if (img_convert_ctx == NULL) { fprintf(stderr, "Cannot initialize the conversion context!\n"); exit(1); } } int ret = sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize); if (ret == 0) { fprintf(stderr, "SWS_Scale failed [%d]!\n", ret); continue; } // Save the frame to disk if (i++ <= 5) { SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i); } CopyDate(pFrameRGB, pCodecCtx->width, pCodecCtx->height, packet.pts - prepts); ret =avcodec_encode_video2(pCodecCtx, &packet, pFrameRGB, &frameFinished); if (ret < 0) { AfxMessageBox(L"Encoding失敗"); } prepts = packet.pts; } //============================================================================================== AVRational time_base = i_pFormatCtx->streams[videoindex]->time_base; AVRational time_base_q = { 1,AV_TIME_BASE }; int64_t pts_time = av_rescale_q(packet.dts, time_base, time_base_q); int64_t now_time = av_gettime() - start_time; if (pts_time > now_time) { av_usleep(pts_time - now_time); } } //Simple Write PTS if (packet.pts == AV_NOPTS_VALUE) { //Write PTS AVRational time_base1 = i_pFormatCtx->streams[videoindex]->time_base; //Duration between 2 frames (us) int64_t calc_duration = (double)AV_TIME_BASE / av_q2d(i_pFormatCtx->streams[videoindex]->r_frame_rate); //Parameters packet.pts = (double)(frame_index * calc_duration) / (double)(av_q2d(time_base1) * AV_TIME_BASE); packet.dts = packet.pts; packet.duration = (double)calc_duration / (double)(av_q2d(time_base1) * AV_TIME_BASE); } in_stream = i_pFormatCtx->streams[packet.stream_index]; out_stream = out_pFormatCtx->streams[packet.stream_index]; /* copy packet */ //Convert PTS/DTS packet.pts = av_rescale_q_rnd(packet.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)); packet.dts = av_rescale_q_rnd(packet.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX)); packet.duration = av_rescale_q(packet.duration, in_stream->time_base, out_stream->time_base); packet.pos = -1; //Print to Screen if (packet.stream_index == videoindex) { //printf("Send %8d video frames to output URL\n", frame_index); frame_index++; //ret = av_interleaved_write_frame(out_pFormatCtx, &packet); } //ret = av_write_frame(ofmt_ctx, &pkt); ret = av_interleaved_write_frame(out_pFormatCtx, &packet); if (ret < 0) { //printf("Error muxing packet\n"); break; } av_free_packet(&packet); } //Write file trailer av_write_trailer(out_pFormatCtx); end: AfxMessageBox(L"Stream is closed"); avformat_close_input(&i_pFormatCtx); /* close output */ if (out_pFormatCtx && !(ofmt->flags & AVFMT_NOFILE)) avio_close(out_pFormatCtx->pb); avformat_free_context(out_pFormatCtx); if (ret < 0 && ret != AVERROR_EOF) { //printf("Error occurred.\n"); return ; } return;

关于selenium/standalone-chrome的启动报错Unable to determine type from: <. Last 1 characters read: <

### 1. java的报错信息 ```html Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to parse remote response: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/> <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" /> <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script> <script src="/assets/displayhelpservlet.js" type="text/javascript"></script> <script type="text/javascript"> var json = Object.freeze('{"consoleLink": "\u002fwd\u002fhub","type": "Standalone","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}'); </script> </head> <body> <div id="content"> <div id="help-heading"> <h1><span id="logo"></span></h1> <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2> </div> <div id="content-body"> <p> Whoops! The URL specified routes to this help page. </p> <p> For more information about Selenium <span class="se-type"></span> please see the <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>. <span id="console-item"> Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>. </span> </p> <p> Happy Testing! </p> </div> <div> <footer id="help-footer"> Selenium is made possible through the efforts of our open source community, contributions from these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>. </footer> </div> </div> </body> </html> at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:115) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144) at org.zhangmeng.zhi_hui_tree.ZhiHuiTreeApplication.main(ZhiHuiTreeApplication.java:21) Caused by: org.openqa.selenium.json.JsonException: Unable to determine type from: <. Last 1 characters read: < Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'zhangmengdeMacBook-Pro.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.2', java.version: '1.8.0_221' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:122) at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:140) at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:126) at org.openqa.selenium.json.Json.toType(Json.java:69) at org.openqa.selenium.json.Json.toType(Json.java:55) at org.openqa.selenium.json.Json.toType(Json.java:50) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:112) ... 7 more ``` ### 2. 运行环境 这个selenium/standalone-chrome我是拉的这个(镜像)[https://github.com/SeleniumHQ/docker-selenium] 然后就是启动镜像 ``` docker run -d -p 4444:4444 --shm-size=2g --name selenium selenium/standalone-chrome ``` 我的java代码是这样的 ```java SpringApplication.run(ZhiHuiTreeApplication.class, args); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("headless", "no-sandbox", "window-size=1200x800"); WebDriver webDriver = new RemoteWebDriver(new URL("http://127.0.0.1:4445"), chromeOptions); webDriver.get("https://www.baidu.com/"); Thread.sleep(2000); WebElement element = webDriver.findElement(By.xpath("//*[@id=\"tsf\"]/div[2]/div[1]/div[3]/center/input[1]")); System.out.println(element.getText()); webDriver.quit(); ``` 我的maven信息 ```java <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.141.59</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-chrome-driver</artifactId> <version>3.141.59</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>3.141.59</version> </dependency> ``` ### 3. 忙活半天了,不知道怎么解决,求懂的大神帮忙看看,感谢

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'?

更新了一下flutter,就突然一片红 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. Required by: project :app > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/flutter_embedding_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/flutter_embedding_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/flutter_embedding_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/flutter_embedding_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/flutter_embedding_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/flutter_embedding_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:x86_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. Required by: project :app > Could not resolve io.flutter:x86_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:x86_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:x86_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:x86_64_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. Required by: project :app > Could not resolve io.flutter:x86_64_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_64_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_64_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_64_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_64_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:x86_64_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_64_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_64_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_64_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_64_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https > Could not resolve io.flutter:x86_64_debug:1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347. > Could not get resource 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_64_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_64_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > Could not GET 'https://https/storage.flutter-io.cn/download.flutter.io/io/flutter/x86_64_debug/1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347/x86_64_debug-1.0.0-9b905d3f03f27a332ad861934da0f5111c24d347.pom'. > https * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 26s

python 3.7引用docx操作word文档报错exception 该怎么办?

我的是ubuntu系统 按照网上的其他说法下载了python__docx-0.8.7-py2.py3-none-any.whl 可是在终端上执行命令:pip3 install python_docx-0.8.10-py2.py3-none-any-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com 又报错: Cannot unpack file /tmp/pip-unpack-x4ntu6_w/simple.htm (downloaded from /tmp/pip-req-build-rhoda3ha, content-type: text/html); cannot detect archive format Cannot determine archive format of /tmp/pip-req-build-rhoda3ha 各路大神帮帮忙阿

IBM Cloud-Cloud Foundry App Go部署失败

<div class="post-text" itemprop="text"> <p>I am trying to start a Go Cloud Foundry App on IBM Cloud but the deploying is not working. The error states </p> <pre><code> Unable to determine Go version to install: no match found for 1.8.3 in 1.6.3 1.6.4 1.7.5 1.7.6 1.8.6 1.8.7 1.9.3 1.9.4 1.10] </code></pre> <p>Is this something I can fix or is this something IBM Cloud needs to fix? I work at IBM so any IBM employee can contact me through our internal communication systems preferable slack.</p> <p>The full build error is </p> <pre><code>Getting app info... Updating app with these attributes... name: go-logs path: /home/pipeline/452c2d32-763b-4da7-ba9a-c6447b37016c disk quota: 1G health check type: port instances: 1 memory: 128M stack: cflinuxfs2 routes: go-logs.eu-de.mybluemix.net Updating app [36;1mgo-logs[0m... Mapping routes... Comparing local files to remote cache... Packaging files to upload... Uploading files... 0 B / 27.80 KiB 0.00% 27.80 KiB / 27.80 KiB 100.00% 27.80 KiB / 27.80 KiB 100.00% 27.80 KiB / 27.80 KiB 100.00% 27.80 KiB / 27.80 KiB 100.00% 27.80 KiB / 27.80 KiB 100.00% 27.80 KiB / 27.80 KiB 100.00% 1s Waiting for API to complete processing files... Staging app and tracing logs... Downloading python_buildpack... Downloading liberty-for-java_v3_26-20181023-1545... Downloading sdk-for-nodejs_v3_25-20181219-1036... Downloading swift_buildpack_v2_0_15-20180920-0051... Downloading liberty-for-java... Downloaded sdk-for-nodejs_v3_25-20181219-1036 Downloading sdk-for-nodejs... Downloaded liberty-for-java_v3_26-20181023-1545 Downloading dotnet-core... Downloaded swift_buildpack_v2_0_15-20180920-0051 Downloading swift_buildpack... Downloaded python_buildpack Downloading staticfile_buildpack... Downloaded liberty-for-java Downloading java_buildpack... Downloaded swift_buildpack Downloading ruby_buildpack... Downloaded sdk-for-nodejs Downloading nodejs_buildpack... Downloaded dotnet-core Downloading go_buildpack... Downloaded staticfile_buildpack Downloading liberty-for-java_v3_27-20181130-1702... Downloaded java_buildpack Downloading swift_buildpack_v2_0_16-20181214-0434... Downloaded ruby_buildpack Downloading php_buildpack... Downloaded nodejs_buildpack Downloading xpages_buildpack... Downloaded go_buildpack Downloading sdk-for-nodejs_v3_24-20181128-1339... Downloaded liberty-for-java_v3_27-20181130-1702 Downloading binary_buildpack... Downloaded swift_buildpack_v2_0_16-20181214-0434 Downloading dotnet-core_v2_0-20180918-1356... Downloaded sdk-for-nodejs_v3_24-20181128-1339 Downloading dotnet-core_v2_1-20181205-1536... Downloaded xpages_buildpack Downloaded binary_buildpack Downloaded php_buildpack Downloaded dotnet-core_v2_0-20180918-1356 Downloaded dotnet-core_v2_1-20181205-1536 Cell 49d42072-0d96-446e-ae6f-b172ba8b41d3 creating container for instance f786b6b1-1abc-445b-a7fe-6bdc8c8adbcc Cell 49d42072-0d96-446e-ae6f-b172ba8b41d3 successfully created container for instance f786b6b1-1abc-445b-a7fe-6bdc8c8adbcc Downloading app package... Downloaded app package (27.5K) -----&gt; Go Buildpack version 1.8.20 -----&gt; Checking Godeps/Godeps.json file -----&gt; Installing godep v80 Download [https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v80-linux-x64-3b019ddc.tgz] -----&gt; Installing glide v0.13.1 Download [https://buildpacks.cloudfoundry.org/dependencies/glide/glide-v0.13.1-linux-x64-4959fbf0.tgz] -----&gt; Installing dep v0.4.1 Download [https://buildpacks.cloudfoundry.org/dependencies/dep/dep-v0.4.1-linux-x64-c678d9fc.tgz] [31;1m**ERROR**[0m Unable to determine Go version to install: no match found for 1.8.3 in [1.6.3 1.6.4 1.7.5 1.7.6 1.8.6 1.8.7 1.9.3 1.9.4 1.10] [31mFailed to compile droplet: Failed to run all supply scripts: exit status 16[0m Exit status 223 Error staging application: App staging failed in the buildpack compile phase [31;1mFAILED[0m Finished: FAILED </code></pre> </div>

GIGA Universe Cup 计算概率几分

Description Following FIFA World Cup, a larger competition called "GIGA Universe Cup" is taking place somewhere in our universe. Both FIFA World Cup and GIGA Universe Cup are two rounds competitions that consist of the first round, also known as "group league", and the second called "final tournament." In the first round, participating teams are divided into groups of four teams each. Each team in a group plays a match against each of the other teams in the same group. For example, let's say we have a group of the following four teams, "Engband, Swedon, Argontina, and Nigerua." They play the following six matches: Engband - Swedon, Engband - Argontina, Engband - Nigerua, Swedon - Argontina, Swedon - Nigerua, and Argontina - Nigerua. The result of a single match is shown by the number of goals scored by each team, like "Engband 1 - 0 Argontina," which says Engband scored one goal whereas Argontina zero. Based on the result of a match, points are given to the two teams as follows and used to rank teams. If a team wins a match (i.e., scores more goals than the other), three points are given to it and zero to the other. If a match draws (i.e., the two teams score the same number of goals), one point is given to each. The goal difference of a team in given matches is the total number of goals it scored minus the total number of goals its opponents scored in these matches. For example, if we have three matches "Swedon 1 - 2 Engband," "Swedon 3 - 4 Nigerua," and "Swedon 5 - 6 Argontina," then the goal difference of Swedon in these three matches is (1 + 3 + 5) - (2 + 4 + 6) = -3. Given the results of all the six matches in a group, teams are ranked by the following criteria, listed in the order of priority (that is, we first apply (a) to determine the ranking, with ties broken by (b), with ties broken by (c), and so on). (a) greater number of points in all the group matches, (b) greater goal difference in all the group matches, (c) greater number of goals scored in all the group matches. If two or more teams are equal on the basis of the above three criteria, their place shall be determined by the following criteria, applied in this order: (d) greater number of points obtained in the group matches between the teams concerned, (e) greater goal difference resulting from the group matches between the teams concerned, (f) greater number of goals scored in the group matches between the teams concerned, If two or more teams are still equal, apply (d), (e), and (f) as necessary to each such group. Repeat this until those three rules to equal teams do not make any further resolution. Finally, teams that still remain equal are ordered by : (g) drawing lots by the Organizing Committee for the GIGA Universe Cup. The two teams coming first and second in each group qualify for the second round. Your job is to write a program which, given the results of matches played so far in a group and one team specified in the group, calculates the probability that the specified team will qualify for the second round. You may assume each team has played exactly two matches and has one match to play. In total, four matches have been played and two matches are to be played. Assume the probability that any team scores (exactly) p goals in any match is: 8!/(P!(8 - P)!)*(1/4)^p*(3/4)^(8-p) , for p <= 8, and zero for p > 8. Assume the lot in the step (g) is fair. Input The first line of the input is an integer, less than 1000, that indicates the number of subsequent records. The rest of the input is the indicated number of records. A single record has the following format: (empty) (-) (team)1 (-) (team)2 (-) (team)3 (-) (team)4 (team)1 (-) (empty) (-) (m)12 (-) (m)13 (-) (m)14 (team)2 (-) (empty) (-) (empty) (-) (m)23 (-) (m)24 (team)3 (-) (empty) (-) (empty) (-) (empty) (-) (m)34 (team)4 (-) (empty) (-) (empty) (-) (empty) (-) (empty) In the above, (-) is a single underscore (-) and (empty) a sequence of exactly four underscores (____). Each of (team)1,?,(team)4 is either an asterisk character (*) followed by exactly three uppercase letters (e.g., *ENG) , or an underscore followed by exactly three uppercase letters (e.g., _SWE). The former indicates that it is the team you are asked to calculate the probability of the second round qualification for. You may assume exactly one of (team)1,?, (team)4 is marked with an asterisk. Each (m)ij (1 <= i < j <= 4) is a match result between the (team)i and (team)j. Each match result is either __-_ (i.e., two underscores, hyphen, and another underscore) or of the form _x-y where each of x and y is a single digit (<= 8). The former indicates that the corresponding match has not been played, whereas the latter that the result of the match was x goals by (team)i and y goals by (team)j. Since each team has played exactly two matches, exactly two match results are in the former format. Output The output should consist of n lines where n is the number of records in the input. The ith line should show the probability that the designated team (marked with an asterisk) will qualify for the second round in the ith record. Numbers should be printed with exactly seven digits after the decimal point. Each number should not contain an error greater than 10^(-7). Sample Input 5 _____*AAA__BBB__CCC__DDD *AAA_______0-0__0-0___-_ _BBB_____________-___0-0 _CCC_________________0-0 _DDD____________________ ______CHN__CRC__TUR_*BRA _CHN_______0-2___-___0-4 _CRC____________1-1___-_ _TUR_________________1-2 *BRA____________________ ______CMR_*KSA__GER__IRL _CMR_______1-0___-___1-1 *KSA____________0-8___-_ _GER_________________1-1 _IRL____________________ ______TUN__JPN_*BEL__RUS _TUN________-___1-1__0-2 _JPN____________2-2__1-0 *BEL__________________-_ _RUS____________________ ______MEX__CRO_*ECU__ITA _MEX_______1-0__2-1___-_ _CRO_____________-___2-1 *ECU_________________0-2 _ITA____________________ Sample Output 0.5000000 1.0000000 0.0000000 0.3852746 0.0353304

GIGA Universe Cup

Following FIFA World Cup, a larger competition called "GIGA Universe Cup" is taking place somewhere in our universe. Both FIFA World Cup and GIGA Universe Cup are two rounds competitions that consist of the first round, also known as "group league", and the second called "final tournament". In the first round, participating teams are divided into groups of four teams each. Each team in a group plays a match against each of the other teams in the same group. For example, let's say we have a group of the following four teams, "Engband, Swedon, Argontina, and Nigerua." They play the following six matches: Engband - Swedon, Engband - Argontina, Engband - Nigerua, Swedon - Argontina, Swedon - Nigerua, and Argontina - Nigerua. The result of a single match is shown by the number of goals scored by each team, like "Engband 1 - 0 Argontina", which says Engband scored one goal whereas Argontina zero. Based on the result of a match, points are given to the two teams as follows and used to rank teams. If a team wins a match (i.e., scores more goals than the other), three points are given to it and zero to the other. If a match draws (i.e., the two teams score the same number of goals), one point is given to each. The goal difference of a team in given matches is the total number of goals it scored minus the total number of goals its opponents scored in there matches. For example, if we have three matches "Swedon 1 - 2 Engband", "Swedon 3 - 4 Nigerua", and "Swedon 5 - 6 Argontina", then the goal difference of Swedon in these three matches is (1 + 3 + 4) - (2 + 4 + 6) = -3. Given the results of all the six matches in a group, teams are ranked by the following criteria, listed in the order of priority (that is, we first apply (a) to determine the ranking, with ties broken by (b), with ties broken by (c), and so on). (a) greater number of points in all the group matches; (b) greater goal difference in all the group matches; (c) greater number of goals scored in all the group matches. If two or more teams are equal on the basis of the above three criteria, their place shall be determined by the following criteria, applied in this order: (d) greater number of points obtained in the group matches between the teams concerned; (e) greater goal difference resulting from the group matches between the teams concerned; (f) greater number of goals scored in the group matches between the teams concerned; If two or more teams are still equal, apply (d), (e), and (f) as necessary to each such group. Repeat this until those three rules to equal teams do not make any further resolution. Finally, teams that still remain equal are ordered by: (g) drawing lots by the Organizing Committee for the GIGA Universe Cup. The two teams coming first and second in each group qualify for the second round. Your job is to write a program which, given the results of matches played so far in a group and one team specified in the group, calculates the probability that the specified team will qualify for the second round. You may assume each team has played exactly two matches and has one match to play. In total, four matches have been played and two matches are to be played. Assume the probability that any team scores (exactly) p goals in any match is: For p <= 8, and zero for p > 8. Assume the lot in the step (g) is fair. Input The first line of the input is an integer, less than 1000, that indicates the number of subsequent records. The rest of the input is the indicated number of records. A single record has the following format: <empty> <_> <team>1 <_> <team>2 <_> <team>3 <_> <team>4 <team>1 <_> <empty> <_> <m>12 <_> <m>13 <_> <m>14 <team>2 <_> <empty> <_> <empty> <_> <m>23 <_> <m>24 <team>3 <_> <empty> <_> <empty> <_> <empty> <_> <m>34 <team>4 <_> <empty> <_> <empty> <_> <empty> <_> <empty> In the above, <_> is a single underscore (_) and <empty> a sequence of exactly four underscores (____). Each of <team>1, ..., <team>4 is either an asterisk character (*) followed by exactly three uppercase letters (e.g., *ENG), or an underscore followed by exactly three uppercase letters (e.g., _SWE). The former indicates that it is the team you are asked to calculate the probability of the second round qualification for. You may assume exactly one of <team>1, ..., <team>4 is marked with an asterisk. Each <m>ij (1 <= i < j <= 4) is a match result between the <team>i and <team>j. Each match result is either __-_ (i.e., two underscores, hyphen, and another underscore) or of the form _x-y where each of x and y is a single digit (<=8). The former indicates that the corresponding match has not been played, whereas the latter that the result of the match was x goals by <team>i and y goals by <team>j. Since each team has played exactly two matches, exactly two match results are in the former format. Output The output should consist of n lines where n is the number of records in the input. The ith line should show the probability that the designated team (marked with an asterisk) will qualify for the second round in the ith record. Numbers should be printed with exactly seven digits after the decimal point. Each number should not contain an error greater than 10^-7. Sample Input 5 _____*AAA__BBB__CCC__DDD *AAA_______0-0__0-0___-_ _BBB_____________-___0-0 _CCC_________________0-0 _DDD____________________ ______CHN__CRC__TUR_*BRA _CHN_______0-2___-___0-4 _CRC____________1-1___-_ _TUR_________________1-2 *BRA____________________ ______CMR_*KSA__GER__IRL _CMR_______1-0___-___1-1 *KSA____________0-8___-_ _GER_________________1-1 _IRL____________________ ______TUN__JPN_*BEL__RUS _TUN________-___1-1__0-2 _JPN____________2-2__1-0 *BEL__________________-_ _RUS____________________ ______MEX__CRO_*ECU__ITA _MEX_______1-0__2-1___-_ _CRO_____________-___2-1 *ECU_________________0-2 _ITA____________________ Sample Output 0.5000000 1.0000000 0.0000000 0.3852746 0.0353304

拒绝连接:使用docker-compose从应用容器访问Postgres容器

<div class="post-text" itemprop="text"> <p>I'm new to Docker. This project is just for my own understanding. It's likely that I use incorrect terminology and/or am more confused than I think I am. Corrections are gratefully accepted.</p> <p>I'm using two docker images: the official postgres image and my own Go app and Dockerfile. Using <code>docker-compose up</code> I get the <code>connection refused</code> error.</p> <p>I think that there are potentially two different problems: </p> <ul> <li><p>One, the database is not running when the app is trying to connect. </p></li> <li><p>Two, the app is simply using an invalid IP.</p></li> </ul> <p>I have app code that should be giving the database time to start up to address the first potential problem (see code below). Judging by the error message, I don't think I'm even getting that far.</p> <p>I have two services: db-access (that's the Go app) and postgres-db.</p> <p>I have tried using these host names in the app connection string: </p> <ul> <li><p>"localhost", </p></li> <li><p>"postgres-db" (as it's named in the docker-compose.yml), </p></li> <li><p>"0.0.0.0".</p></li> </ul> <p>Using the <code>postgres-db</code> as the hostname:</p> <ul> <li><p>The app container is trying: dial tcp 172.22.0.2:5432.</p></li> <li><p>Postgres is saying: listening on IPv4 address "0.0.0.0", port 5432.</p></li> </ul> <p>In the <code>docker-compose.yml</code> I have tried using these statements: </p> <pre><code>depends_on: - postgres-db </code></pre> <p>and</p> <pre><code>links: - postgres-db </code></pre> <p>I have tried reversing the order of the services in the docker-compose.yml but they appear to start up in the same order either way.</p> <p>When I run the postgres container and the Go app separately I get the expected behavior. To run them separately I'm using these commands:</p> <pre><code>docker run --rm --name postgres-db -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v /Users/ForeignFood/Development/go/src/github.com/skillitzimberg/docker/volumes/postgres:/var/lib/postgresql/data postgres </code></pre> <p>followed by</p> <p><code>go run basicapi</code></p> <p>I can also run <code>docker-compose up</code>, which gives the connection refused error, then <code>ctrl+C</code>, then run <code>go run basicapi</code> and get the expected behavior.</p> <p>Here are the project files . . .</p> <p>main.go:</p> <pre><code>package main import ( "basicapi/models" "fmt" "net/http" _ "github.com/lib/pq" ) const ( host = "postgres-db" port = 5432 user = "postgres" password = "docker" dbname = "myfirstdb" ) var psqlDatabaseConnectionString = fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", host, port, user, password, dbname) func main() { models.InitDB(psqlDatabaseConnectionString) http.HandleFunc("/users", usersList) http.ListenAndServe(":3000", nil) } func usersList(w http.ResponseWriter, r *http.Request) { if r.Method != "GET" { http.Error(w, http.StatusText(405), 405) return } usrs, err := models.AllUsers() if err != nil { fmt.Println(err) http.Error(w, http.StatusText(500), 500) return } for _, usr := range usrs { fmt.Fprintf(w, "%d, %s, %s, %.s ", usr.ID, usr.FirstName, usr.LastName, usr.Email) } } </code></pre> <p>models/db.go:</p> <pre><code>package models import ( "database/sql" "fmt" "log" "time" _ "github.com/lib/pq" ) var db *sql.DB func InitDB(dataSourceName string) { var err error for i := 0; i &lt; 10; i++ { db, err = sql.Open("postgres", dataSourceName) if err != nil { fmt.Println(i) fmt.Println(err) time.Sleep(time.Second * 10) } } if err != nil { log.Panic(err) } if err = db.Ping(); err != nil { log.Panic(err) } fmt.Printf("Connection to database successful! ") } </code></pre> <p>models/users.go:</p> <pre><code>package models import "fmt" type User struct { ID int Age int FirstName string LastName string Email string } func AllUsers() ([]*User, error) { fmt.Println("Got to AllUsers") rows, err := db.Query("SELECT * FROM users") if err != nil { fmt.Println(err) return nil, err } defer rows.Close() users := make([]*User, 0) for rows.Next() { user := new(User) err := rows.Scan(&amp;user.ID, &amp;user.Age, &amp;user.FirstName, &amp;user.LastName, &amp;user.Email) if err != nil { return nil, err } users = append(users, user) } if err = rows.Err(); err != nil { return nil, err } return users, nil } </code></pre> <p>Dockerfile:</p> <pre><code>FROM golang WORKDIR /app COPY ./go.mod ./go.mod COPY ./go.sum ./go.sum RUN go mod download COPY . . RUN go build -o /bin/app CMD [ "app" ] </code></pre> <p>docker-compose.yml</p> <pre><code>services: db-access: build: . depends_on: - postgres-db ports: - "3000:3000" postgres-db: image: postgres volumes: - /Users/ForeignFood/Development/go/src/github.com/skillitzimberg/docker/volumes/postgres:/var/lib/postgresql/data ports: - "5432:5432" environment: POSTGRES_USER: "postgres" POSTGRES_PASSWORD: "docker" POSTGRES_DATABASE: "myfirstdb" </code></pre> <p>Expected results: Navigating to localhost:3000/users shows:</p> <pre><code>1, Someone, Alastname, 2, SomeoneElse, AnotherLastName, etc... </code></pre> <p>Actual results:</p> <ul> <li><p>browser: <code>This site can't be reached</code></p></li> <li><p>terminal: </p></li> </ul> <pre><code>~/ &gt;&gt; docker-compose up Starting basicapi_postgres-db_1 ... done Starting basicapi_db-access_1 ... done Attaching to basicapi_postgres-db_1, basicapi_db-access_1 db-access_1 | 2019/05/17 16:53:54 dial tcp 172.22.0.2:5432: connect: connection refused db-access_1 | panic: dial tcp 172.22.0.2:5432: connect: connection refused db-access_1 | db-access_1 | goroutine 1 [running]: db-access_1 | log.Panic(0xc0000c3f40, 0x1, 0x1) db-access_1 | /usr/local/go/src/log/log.go:333 +0xac db-access_1 | basicapi/models.InitDB(0xc000062120, 0x55) db-access_1 | /app/models/db.go:30 +0x27c db-access_1 | main.main() db-access_1 | /app/main.go:23 +0x3d basicapi_db-access_1 exited with code 2 postgres-db_1 | 2019-05-17 16:53:58.770 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres-db_1 | 2019-05-17 16:53:58.770 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres-db_1 | 2019-05-17 16:53:58.776 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres-db_1 | 2019-05-17 16:53:58.905 UTC [22] LOG: database system was shut down at 2019-05-17 16:53:23 UTC postgres-db_1 | 2019-05-17 16:53:58.952 UTC [1] LOG: database system is ready to accept connections </code></pre> <p>Thank you for any insights.</p> </div>

Golang Dep无法读取元数据

<div class="post-text" itemprop="text"> <p>I use this command:</p> <pre><code>dep init -gopath -v </code></pre> <p>in my gopath,like this:</p> <pre><code>gopath/src/aaa.com/bbb/ccc.v2 </code></pre> <p>in my code, import is:</p> <pre><code>import ("aaa.com/bbb/ccc.v2") </code></pre> <p>final got this:</p> <pre><code>init failed: unable to determine direct dependencies: unable to deduce repository and source type for "aaa.com/bbb/ccc.v2": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://aaa.com/bbb/ccc.v2?go-get=1": Get http://aaa.com/bbb/ccc.v2?go-get=1: context canceled </code></pre> <p>actually,aaa.com don`t exists,it just a dir in my gopath</p> <p>WHY dep still request the network to get metadata even if I specified the <code>-gopath</code> param?</p> </div>

Storm-kafka集成问题,求解答

Read partition information from: /f-k-s/wordCount/partition_0 --> null 67357 [Thread-108-kafka_spout-executor[18 18]] INFO o.a.s.k.PartitionManager - No partition information found, using configuration to determine offset 67357 [Thread-108-kafka_spout-executor[18 18]] INFO o.a.s.k.PartitionManager - Starting Kafka 192.168.1.19 Partition{host=192.168.1.19:9092, topic=f-k-s, partition=0} from offset 4731080 本地模式启动!日志打印可以看到偏移量 但是zookeeper 客户端登录无法查看偏移量 如果在storm tuple里获取到偏移量值

QT交叉编译 缺少sys/cdefs.h

交叉编译QT,因为要用的xcb等库,所以直接把开发板内的/lib /usr/lib /usr/include拷贝到了虚拟机, 解压qt源码,配置qmake.conf # # qmake configuration for building with aarch64-linux-gnu-g++ # MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) QMAKE_CXXFLAGS += -I/home/ubuntu/yk/usr/include QMAKE_CXXFLAGS += -I/home/ubuntu/yk/usr/include/aarch64-linux-gnu QMAKE_CFLAGS += -I/home/ubuntu/yk/usr/include QMAKE_CFLAGS += -I/home/ubuntu/yk/usr/include/aarch64-linux-gnu QMAKE_LFLAGS += /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/lib/ QMAKE_LFLAGS += -L/home/ubuntu/yk/lib/aarch64-linux-gnu QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/lib/aarch64-linux-gnu QMAKE_LFLAGS += -L/home/ubuntu/yk/usr/lib/aarch64-linux-gnu QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/usr/lib/aarch64-linux-gnu QMAKE_LFLAGS += -L/home/ubuntu/yk/lib QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/lib QMAKE_LFLAGS += -L/home/ubuntu/yk/usr/lib QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/usr/lib QMAKE_LIBS += -lpthread -lgobject-2.0 -lglib-2.0 -lpcre QMAKE_CFLAGS += -O2 -march=armv7-a -mfpu=neon -mfloat-abi=hard QMAKE_CXXFLAGS += -O2 -march=armv7-a -mfpu=neon -mfloat-abi=hard QMAKE_LFLAGS += -L/home/ubuntu/yk/lib QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/lib QMAKE_LFLAGS += -L/home/ubuntu/yk/usr/lib QMAKE_LFLAGS += -Wl,-rpath-link,/home/ubuntu/yk/usr/lib # modifications to g++.conf QMAKE_CC = aarch64-linux-gnu-gcc QMAKE_CXX = aarch64-linux-gnu-g++ QMAKE_LINK = aarch64-linux-gnu-g++ QMAKE_LINK_SHLIB = aarch64-linux-gnu-g++ # modifications to linux.conf QMAKE_AR = aarch64-linux-gnu-ar cqs QMAKE_OBJCOPY = aarch64-linux-gnu-objcopy QMAKE_NM = aarch64-linux-gnu-nm -P QMAKE_STRIP = aarch64-linux-gnu-strip load(qt_config) 执行configure后提示错误 ubuntu@ubuntuPC:~/yk/qt-everywhere-opensource-src-5.8.0$ ./configure -release -nomake examples -no-iconv -qt-xcb -qpa xcb -no-opengl -sysroot /home/ubuntu/yk/ -xplatform linux-arm-gnueabi-g++ -prefix /home/ubuntu/Qt5.8.0_arm -opensource -confirm-license + cd qtbase + /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/configure -top-level -release -nomake examples -no-iconv -qt-xcb -qpa xcb -no-opengl -sysroot /home/ubuntu/yk/ -xplatform linux-arm-gnueabi-g++ -prefix /home/ubuntu/Qt5.8.0_arm -opensource -confirm-license This is the Qt Open Source Edition. You are licensed to use this software under the terms of the GNU Lesser General Public License (LGPL) version 3. You are also licensed to use this software under the terms of the GNU General Public License (GPL) version 2. You have already accepted the terms of the Open Source license. Creating qmake... ........................................................................................Done. Info: creating stash file /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/.qmake.stash Info: creating super cache file /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/.qmake.super Running configuration tests... Checking for gold linker... yes Checking for valid makespec... yes Checking for target architecture... Project ERROR: Could not determine target architecture. See config.log for details. 查看config.log executing config test architecture + cd /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/arch && /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/bin/qmake -qtconf /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker console" "QMAKE_CFLAGS += --sysroot=/home/ubuntu/yk/" "QMAKE_CXXFLAGS += --sysroot=/home/ubuntu/yk/" "QMAKE_LFLAGS += --sysroot=/home/ubuntu/yk/" /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/arch + cd /home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/arch && MAKEFLAGS= /usr/bin/make > g++ -c -pipe --sysroot=/home/ubuntu/yk/ -g -Wall -W -fPIC -I. -I/home/ubuntu/yk/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/linux-g++ -o arch.o arch.cpp > In file included from /home/ubuntu/yk/usr/include/stdio.h:27:0, > from arch.cpp:43: > /home/ubuntu/yk/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory > compilation terminated. > Makefile:167: recipe for target 'arch.o' failed > make: *** [arch.o] Error 1 找不到sys/cdefs.h 但是我配置的目录下面 /home/ubuntu/yk/usr/include/aarch64-linux-gnu 有sys/cdefs.h 找了一天问题了,还缺少配置什么路径?

成功登录后,无法在magento的管理面板中打开任何内容?

<div class="post-text" itemprop="text"> <p>i have just installed magento store, but when i am trying to add product and anything in admin panel this error displays.</p> <p>There has been an error processing your request</p> <p>Exception printing is disabled by default for security reasons.</p> <p>Error log record number: 1564392442 Magento is a trademark of Magento Inc. Copyright © 2013 Magento Inc.</p> <p>And in error report below detail is generated.</p> <pre><code>a:5:{i:0;s:71:"Could not determine temp directory, please specify a cache_dir manually";i:1;s:4124:"#0 D:\EmpiricalEdgeINC\Projects\Magento\lib\Zend\Cache\Backend.php(197): Zend_Cache::throwException('Could not deter...') #1 D:\EmpiricalEdgeINC\Projects\Magento\lib\Zend\Cache\Backend\File.php(123): Zend_Cache_Backend-&gt;getTmpDir() #2 D:\EmpiricalEdgeINC\Projects\Magento\lib\Zend\Cache.php(153): Zend_Cache_Backend_File-&gt;__construct(Array) #3 D:\EmpiricalEdgeINC\Projects\Magento\lib\Zend\Cache.php(94): Zend_Cache::_makeBackend('File', Array, false, false) #4 D:\EmpiricalEdgeINC\Projects\Magento\lib\Zend\Locale\Data.php(314): Zend_Cache::factory('Core', 'File', Array, Array) #5 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Html\Calendar.php(42): Zend_Locale_Data::getList('en_US', 'days') #6 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Html_Calendar-&gt;_toHtml() #7 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract-&gt;toHtml() #8 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract-&gt;_getChildHtml('calendar', true) #9 D:\EmpiricalEdgeINC\Projects\Magento\app\design\adminhtml\default\default\template\page\head.phtml(33): Mage_Core_Block_Abstract-&gt;getChildHtml('calendar') #10 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Template.php(241): include('D:\EmpiricalEdg...') #11 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template-&gt;fetchView('adminhtml\defau...') #12 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template-&gt;renderView() #13 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Core_Block_Template-&gt;_toHtml() #14 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(637): Mage_Core_Block_Abstract-&gt;toHtml() #15 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(581): Mage_Core_Block_Abstract-&gt;_getChildHtml('head', true) #16 D:\EmpiricalEdgeINC\Projects\Magento\app\design\adminhtml\default\default\template\page.phtml(43): Mage_Core_Block_Abstract-&gt;getChildHtml('head') #17 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Template.php(241): include('D:\EmpiricalEdg...') #18 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Template.php(272): Mage_Core_Block_Template-&gt;fetchView('adminhtml\defau...') #19 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Template.php(286): Mage_Core_Block_Template-&gt;renderView() #20 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Adminhtml\Block\Template.php(81): Mage_Core_Block_Template-&gt;_toHtml() #21 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Block\Abstract.php(919): Mage_Adminhtml_Block_Template-&gt;_toHtml() #22 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Model\Layout.php(555): Mage_Core_Block_Abstract-&gt;toHtml() #23 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Controller\Varien\Action.php(390): Mage_Core_Model_Layout-&gt;getOutput() #24 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Adminhtml\controllers\Customer\GroupController.php(58): Mage_Core_Controller_Varien_Action-&gt;renderLayout() #25 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Adminhtml_Customer_GroupController-&gt;indexAction() #26 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action-&gt;dispatch('index') #27 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard-&gt;match(Object(Mage_Core_Controller_Request_Http)) #28 D:\EmpiricalEdgeINC\Projects\Magento\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front-&gt;dispatch() #29 D:\EmpiricalEdgeINC\Projects\Magento\app\Mage.php(684): Mage_Core_Model_App-&gt;run(Array) #30 D:\EmpiricalEdgeINC\Projects\Magento\index.php(87): Mage::run('', 'store') #31 {main}";s:3:"url";s:75:"/index.php/admin/customer_group/index/key/b2fae5e1d3af811ecf33afc28e846de0/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";} </code></pre> <p>How to solve this please help</p> </div>

python3.6安装pypsa包时报错,无法安装。

在使用pip install pypsa,安装报错如下![图片说明](https://img-ask.csdn.net/upload/201910/15/1571110476_72432.png)![图片说明](https://img-ask.csdn.net/upload/201910/15/1571110486_931164.png) ERROR: Command errored out with exit status 1: command: 'd:\python3\python.exe' 'd:\python3\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\xyrrrr\AppData\Local\Temp\tmpk8s4cp1x' cwd: C:\Users\xyrrrr\AppData\Local\Temp\pip-install-y9r5hyt9\cartopy Complete output (3 lines): setup.py:171: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail. '.'.join(str(v) for v in GEOS_MIN_VERSION), )) Proj 4.9.0 must be installed. ---------------------------------------- ERROR: Command errored out with exit status 1: 'd:\python3\python.exe' 'd:\python3\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\xyrrrr\AppData\Local\Temp\tmpk8s4cp1x' Check the logs for full command output. 查了很多,真的不懂如何解决,小白求专业人士帮助!谢谢。 一天也没解决,我就是一个刚下载python的小白 饶了我吧

将yii项目复制到本地服务器不起作用

<div class="post-text" itemprop="text"> <p>I'm new to this so sorry for my questions. I have access to a running yii-project with password-protected backend. I want to copy this to my synology where I have phpmyadmin, apache installed. The sql database is already exported an imported to the local environment. I copied everything of the directory <code>/var/www</code> from the yii-project to my local server. </p> <p>What do I have to change to run the site on my local environment? Actually error 403 is shown when I try to start the site with local address <code>192.x.x.x</code>. Could you please help me?</p> <blockquote> <p>Update: Following yii\base\ErrorException occurses when starting the index.php: Uninitialized string offset: 0 Details: /vendor/yiisoft/yii2/web/Request.php (Version: Apache/2.4.25 (Unix) Yii Framework/2.0.3)</p> </blockquote> <pre><code> $pathInfo = substr($pathInfo, strlen($scriptUrl)); } elseif ($baseUrl === '' || strpos($pathInfo, $baseUrl) === 0) { $pathInfo = substr($pathInfo, strlen($baseUrl)); } elseif (isset($_SERVER['PHP_SELF']) &amp;&amp; strpos($_SERVER['PHP_SELF'], $scriptUrl) === 0) { $pathInfo = substr($_SERVER['PHP_SELF'], strlen($scriptUrl)); } else { throw new InvalidConfigException('Unable to determine the path info of the current request.'); } if ($pathInfo[0] === '/') { $pathInfo = substr($pathInfo, 1); } return (string) $pathInfo; } </code></pre> </div>

CentOS 7无法连接clamd.sock文件(权限被拒绝错误)

<div class="post-text" itemprop="text"> <p>I am trying to scan uploaded files on PHP server using clamAV. I've installed ClamAV on my server (Centos 7). Currently, I am using PHP 7, so I am using Clamd socket connection to scan uploaded files. I've enabled PHP sockets, clamd.sock file is present at <code>/var/run/clamd.scan/</code> folder with apache owner. </p> <p>My Socket connection code - </p> <pre><code> $socket = socket_create(AF_UNIX, SOCK_STREAM, 0); if(socket_connect($socket, '/var/run/clamd.scan/clamd.sock')) { return $socket; } </code></pre> <p>When I try to run above code on the browser I am getting error as <code>socket_connect(): unable to connect [13]: Permission denied</code>, But if I run the PHP code through command line with a user as root it is working fine.</p> <p>I know there is some issue with SELinux policy with Centos as if I disable SELinux policy everything is working fine from the browser as well. I have checked <code>httpd_can_network_connect --&gt; on</code> and <code>antivirus_can_scan_system --&gt; on</code> both are on. </p> <p>The issue is with accessing anything inside <code>/var/run/</code> folder for <code>apache</code> user, there is something (some policy) from SELinux which is stopping apache to connect to clamd socket file. Any ideas? </p> </div>

openstack验证nova时执行openstack host list命令报错

``` ``` 这是执行命令后报的错误 The server is currently unavailable. Please try again at a later time.<br /><br /> (HTTP 503) (Request-ID: req-cc86ee4c-b854-4577-ba9a-57190d2cf39c) 这是日志中报的错误 2019-04-09 20:37:56.792 1778 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}} 2019-04-09 20:37:56.793 1778 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data 这是我改的配置文件(基于n版) [root@bogon ~]# egrep "^[a-z]" /etc/nova/nova.conf use_neutron=True firewall_driver = nova.virt.firewall.NoopFirewallDriver enabled_apis=osapi_compute,metadata auth_strategy=keystone connection=mysql+pymysql://nova:nova@192.168.131.129/nova_api connection=mysql+pymysql://nova:nova@192.168.131.129/nova api_servers=http://192.168.131.129:9292 auth_uri = http://192.168.131.129:5000 auth_url = http://192.168.131.129:35357 memcached_servers = 192.168.131.129:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = nova lock_path=/var/lib/nova/tmp transport_url=rabbit://openstack:openstack@192.168.131.129 vncserver_listen=0.0.0.0 vncserver_proxyclient_address=192.168.131.129 我确定nova的用户和密码是正确的,以及服务也创建成功了的 ```

arm-linux-gcc编译出错

![![图片说明](https://img-ask.csdn.net/upload/201604/15/1460686955_553790.png)图片说明](https://img-ask.csdn.net/upload/201604/15/1460686947_433104.png)

转到AWS开发工具包“无法确定要授权的服务/操作名称”

<div class="post-text" itemprop="text"> <p>I am using the Go SDK to connect to the Kinesis Video Streams service. When issuing a <code>GetMedia</code> request, I'm receiving a 403 response with the following body:</p> <pre><code>&lt;AccessDeniedException&gt; &lt;Message&gt;Unable to determine service/operation name to be authorized&lt;/Message&gt; &lt;/AccessDeniedException&gt; </code></pre> <p>I am using LogLevel <code>LogDebugWithHTTPBody</code> to see this since the SDK is expecting JSON and receives XML, causing a <code>SerializationError</code>. </p> <p>I am using Go 1.9.2 and have attempted this operation with both v1 and v2 of aws-sdk-go with the same result.</p> <p>Here is my request:</p> <pre><code>POST /getMedia HTTP/1.1 Host: kinesisvideo.us-west-2.amazonaws.com User-Agent: aws-sdk-go/2.0.0-preview.1 (go1.9.2; darwin; amd64) Content-Length: 141 Authorization: AWS4-HMAC-SHA256 Credential=AKIAXXXXXXXXXXXXXX/20180112/us-west-2/kinesisvideo/aws4_request, SignedHeaders=content-length;host;x-amz-date, Signature=60c625357b67c64caed32f5a0924882f26ffc776211801e94e7ecae84e7213c2 X-Amz-Date: 20180112T012511Z Accept-Encoding: gzip {"StartSelector":{"StartSelectorType":"NOW"},"StreamARN":"arn:aws:kinesisvideo:us-west-2:XXXXXXXXXXXXX:stream/StreamTest/XXXXXXXXXXXXX"} </code></pre> <p>Response:</p> <pre><code>HTTP/1.1 403 Forbidden Content-Length: 130 Date: Fri, 12 Jan 2018 01:25:11 GMT X-Amzn-Requestid: 6f1701aa-f737-11e7-bcd5-c70a68e72add &lt;AccessDeniedException&gt; &lt;Message&gt;Unable to determine service/operation name to be authorized&lt;/Message&gt; &lt;/AccessDeniedException&gt; </code></pre> <p>Any help would be greatly appreciated.</p> <p>To follow up, I have tried to issue the HTTP request above directly with the <code>Content-Type: application/json</code> header added, and the response is now:</p> <pre><code>{ "Output": { "__type": "com.amazon.coral.service#UnknownOperationException", "message": null }, "Version": "1.0" } </code></pre> </div>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

立即提问
相关内容推荐