묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결Kotlin Android부터 Firebase 서버 그리고 훌륭한 Chatbot 만들기
recyclerview 어댑터 관련해서 질문 남깁니다!
import ai.api.AIConfiguration.SupportedLanguages.Korean import ai.api.AIConfiguration.SupportedLanguages.fromLanguageTag import ai.api.android.AIConfiguration import ai.api.AIDataService import ai.api.model.AIRequest import ai.api.model.Result import android.os.AsyncTask import android.os.Bundle import android.support.v7.app.AppCompatActivity import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView import android.text.TextUtils import android.view.View import android.widget.Button import android.widget.EditText import org.techtown.food_menu.R.id.chatText import org.techtown.food_menu.adapter.ChatAdapter import org.techtown.food_menu.adapter.MessageDTO import java.util.ArrayList class ChatActivity : AppCompatActivity() { var messageDTOs = arrayListOf<MessageDTO>() var aiDataService : AIDataService? = null private val recyclerview: RecyclerView? = null private val Adapter: ChatAdapter? = null private val llm: LinearLayoutManager? = null private val editText: EditText? = null private final var lang : ai.api.AIConfiguration.SupportedLanguages? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_chat) recyclerview?.findViewById<View>(R.id.chat_recyclerview) recyclerview?.adapter = Adapter recyclerview?.layoutManager = llm editText?.findViewById<View>(R.id.chatText) val btn = findViewById<View>(R.id.button) as Button btn.setOnClickListener { if (!TextUtils.isEmpty(editText?.text)) { messageDTOs!!.add(MessageDTO(true, editText?.text.toString())) Adapter!!.notifyDataSetChanged() recyclerview?.smoothScrollToPosition(messageDTOs.size - 1) TalkAsyncTask().execute(editText?.text.toString()) editText?.setText("") } } var config = AIConfiguration("일부러 지웟어요",Korean,AIConfiguration.RecognitionEngine.System) aiDataService = AIDataService(config) } inner class TalkAsyncTask:AsyncTask<String, Void, Result>() { override fun doInBackground(vararg params: String?): Result { var aiRequest = AIRequest() aiRequest.setQuery(params[0]) return aiDataService!!.request(aiRequest).result } override fun onPostExecute(result: Result?) { if (result != null) { makeMessage(result) } } } fun makeMessage(result: Result?) { var speech = result?.fulfillment?.speech messageDTOs.add(MessageDTO(false, speech)) recyclerview?.adapter?.notifyDataSetChanged() recyclerview?.smoothScrollToPosition(messageDTOs.size - 1) } } } 이 코드인데 하울님이 하신대로 메인액티비티에서 따라할 때는 recyclerview.adpater 이렇게 해도 어댑터 연결이 잘되던 것이 프로젝트를 합치기 위해서 메인액티비티에서 인텐트로 연결되는 ChatActivity에서 하려니까 잘 되지 않았어요 그래서 이 코드대로 했는데 E/RecyclerView: No adapter attached; skipping layout 이 오류가 뜬다고 합니다ㅠㅠ 혹시 이 문제가 MainActivity가 아니어서 그런건가요? 해결 방법 알려주시면 감사하겠습니다ㅠㅠ E/memtrack: Couldn't load memtrack module 09-26 18:26:41.770 1904-1917/? W/android.os.Debug: failed to get memory consumption info: -1 이 오류도 뜨네요...^^
-
미해결배틀로얄 게임을 만들어보며 배우는 언리얼 게임 개발
전 왜 이렇게 되죠
C:Program Files (x86)Microsoft Visual Studio2017CommunityMSBuild15.0binMicrosoft.Common.CurrentVersion.targets( 1657,5): error MSB4036: "GetReferenceNearestTargetFrameworkTask" 작업을 찾을 수 없습니다. 다음을 확인하세요. 1) 프로젝트 파일에 있는 작업 이름이 작업 클래스 이름과 같은지 확인합니다. 2.) 작업 클래스가 "public"이고 Microsoft.Build.Framework.ITask 인터페이스를 구현하는지 확인합니다. 3.) 프로젝트 파일 또는 "C:Program F iles (x86)Microsoft Visual Studio2017CommunityMSBuild15.0bin" 디렉터리에 있는 *.tasks 파일에 를 사용하 여 작업이 올바르게 선언되 었는지 확인합니다. [C:Users임성호DocumentsGitHubUnrealEngineEngineSourceProgramsUnrealBuildToolUnrealBuildTool.csproj]
-
미해결Node.js 교과서 - 기본부터 프로젝트 실습까지
파일 시스템(fs 모듈)과 콜백에 대해 궁금한게 있습니다.
fs 모듈 강좌중에 궁금한 점이 있어서 질문 올립니다. 일단 강좌중에 나온 코드 먼져 보시죠. 이하는 코드 입니다. const fs = require('fs'); fs.writeFile('./writeme.txt', '글을 써주세요', (err)=> { if(err){ throw err; } fs.readFile('./writeme.txt', (err, data)=>{<p> if (err) {</p><p> throw err;</p><p> }</p><p> console.log(data);</p><p> console.log(data.toString());</p> }) })``` 위와 같은 코드라면 처음에 콜백시에 execution stack이 쌓이고, 실행은 거꾸로 된다고 하셨는데, 그렇다면 위에서도 fs.readFile(~~ 어쩌고 저쩌고 ~~ 콜백)이 fs.writeFile 보다 먼저 실행 되어야 하는거 아닌가요? 그렇다면 결국, 없는 파일을 불러와서 에러가 나와야 하는데... 이 부분이 잘 이해가 안갑니다. ㅜ.ㅜ 마찬가지로, 그다음에 나오는(콜백들을 이용해서 동기 방식처럼 구현하는 부분)에서도, 나중에 호출된 콜백들이 먼저 실행 되어야 하는거 아닌가요? ㅇ,.ㅇ;
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
No module named 'pytube'
pytube를 아나콘다 가상환경 > section2에 설치 후, conda list로 pytube 있는 것 확인했습니다.터미널로 section2 내에 들어가서 atom 입력하여, atom 설치 하고 실행했습니다.그런데 실행 결과 No module named 'pytube' 라고 뜨네요 ㅠ___ㅠ
-
미해결유니티 게임 개발 (Unity 2D) - 시작부터 배포까지
VS comunity이가 작동이 되지 않습니다.오류만 나네요.
UnityException: Build path contains project built with "Create Visual Studio Solution" option, which is incompatible with current build settings. Consider building your project into an empty directory. UnityEditor.WindowsStandalone.WindowsDesktopStandalonePostProcessor.CheckSafeProjectOverwrite (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/WinPlayer/Extensions/Managed/WindowsDesktopStandalonePostProcessor.cs:58) DesktopStandalonePostProcessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:38) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) 랑 Build completed with a result of 'Failed'라고 오류 창에 뜨고 UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:buildslaveunitybuildEditorMonoBuildPlayerWindowBuildMethods.cs:187 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:buildslaveunitybuildEditorMonoBuildPlayerWindowBuildMethods.cs:94 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)라고 뜹니다. 뭐가 잘못된 것인가요?
-
미해결스프링 부트 개념과 활용
Intellij 사용 관련 질문 드립니다.
안녕하세요,좋은 강좌 감사 드립니다. 많은 도움이 되고 있습니다.강좌 중에 parent pom 파일을 보는 부분이 있는데요, 따라해 보려고 하니 잘 안되어서요 ^^;IntelliJ 설정이나 단축키 알려주시면 감사드리겠습니다.그리고 제 IntelliJ에서는 dependency 부분 좌측에 아이콘(버전 표시되는) 이 나오질 않네요이 부분도 알려주시면 감사요 ^^;IntelliJ가 익숙하질 않아서 질문 드립니다.남은 추석 잘 보내시길 바라며, 감사 드립니다. ^^
-
미해결유니티 게임 개발 (Unity 2D) - 시작부터 배포까지
질문있습니다.
선생님스크립트 창에서 오타 있을때 윈도우버젼기준으로 f8 누르면 빌드?? 검사가된다고하는데저는 f8눌러도 아무런 변화가 없습니다.유니티 버젼은 2017.4.0f1이라고 뜨는데요...버젼이 틀려서 그런건가요?
-
미해결메타스플로잇(Metasploit) 활용한 취약점 분석(초중급과정)
./msfcli -h를 입력하면 LoadError라는 메시지가 떠요
(사진)
-
미해결영리한 프로그래밍을 위한 알고리즘 강좌
printMaze()는 어떻게 만들어야 할까요?
Reversion의 응용 - 미로찾기 1을 듣고 있는데요. printMaze()라는 함수가 강의 내용 중 나오지 않아서 질문드립니다. 혹시 힌트라도 주시면 직접 구현해보려고 하는데 도움 부탁드려요 package test; public class Recursion_Maze { /* * 현재 위치에서 출구까지 가는 경로가 있으려면 * 1) 현재 위치가 출구이거나 혹은 * 2) 이웃한 셀들 중 하나에서 현재 위치를 지나지 않고 출구까지 가는 경로가 있거나 */ private static int N=8; private static int maze[][] = { {0, 0, 0, 0, 0, 0, 0, 1}, {0, 1, 1, 0, 1, 1, 0, 1}, {0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 0, 0, 1, 1, 0, 0}, {0, 1, 1, 1, 0, 0, 1, 1}, {0, 1, 0, 0, 0, 1, 0, 1}, {0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 1, 0, 0} }; private static final int PATHWAY_COLOUR = 0; // WHITE private static final int WALL_COLOUR = 1; // BLUE private static final int BLOCKED_COLOUR = 2; // RED private static final int PATH_COLOUR = 3; // GREEN public static void main(String[] args) { printMaze(); // 에러 findMazePath(0,0); printMaze(); // 에러 } public static boolean findMazePath(int x, int y) { if (x<0 || y<0 || x>=N || y>=N) // 좌표 내 유효한 범위인가를 체크 return false; else if(maze[x][y] != PATHWAY_COLOUR) return false; else if(x==N-1 && y==N-1) { maze[x][y] = PATH_COLOUR; return true; }else { maze[x][y] = PATH_COLOUR; if(findMazePath(x-1,y) || findMazePath(x, y+1) || findMazePath(x+1, y) || findMazePath(x, y-1)) { // 탐색하기 return true; } maze[x][y] = BLOCKED_COLOUR; // dead end 어떤 방향으로 가도 출구까지 가는 경로가 없다. return false; } } }
-
미해결자바 프로그래밍 입문 강좌 (renew ver.) - 초보부터 개발자 취업까지!!
어떻하지!!
println 을 printf로 바꾸면 오류가 뜸니다. ㅡㅡ
-
미해결블록체인 이더리움 부동산 댑(Dapp) 만들기 - 기본편
변수에서 오류가 납니다 ㅠㅠ
** 매입자의 이름이 sejong이 아닙니다.expected - actual-sejng+sejongat testTestRealEstate.js:27:16at process.tickCallback (internal/process/nexttick.js:68:7)이라고 나오고요.. 강의 따라서 *var RealEstate = artifacts.require("./RealEstate.sol");contract('RealEstate', function(accounts){var realEstateInstance;it("컨트렉의 소유자 초기화 테스팅", function(){ return RealEstate.deployed().then(function(instance){ realEstateInstance = instance ; return realEstateInstance.owner.call();}).then(function(owner){ assert.equal(owner.toUpperCase(), accounts[0].toUpperCase(), "owner가 가나슈 첫번째 계정과 동일하지 않습니다.");});});it("가나슈 두 번째 계정으로 매물 아이디 0번 매입 후 이벤트 생성 및 매입자 정보와 buyers 배열 테스팅", function() {return RealEstate.deployed().then(function(instance){realEstateInstance = instance;return realEstateInstance.buyRealEstate(0, "sejong", 13, { from: accounts[1], value: web3.toWei(1.50,"ether")});}).then(function(receipt){assert.equal(receipt.logs.length, 1, "이벤트 하나가 생성되지 않았습니다.");assert.equal(receipt.logs[0].event, "LogBuyRealEstate", "이벤트가 LogBuyRealEstate 아닙니다");assert.equal(receipt.logs[0].args._buyer, accounts[1], "매입자가 가나슈 두번째 계정이 아닙니다.");assert.equal(receipt.logs[0].args._id, 0, "매물 아이디가 0 이 아닙니다");return realEstateInstance.getBuyerInfo(0);}).then(function(buyerInfo){assert.equal(buyerInfo[0].toUpperCase(), accounts[1].toUpperCase(),"매입자의 계정이 두번째 계정과 일치하지 않습니다");assert.equal(web3.toAscii(buyerInfo[1]).replace(/o/g, ''), "sejong", "매입자의 이름이 sejong이 아닙니다.");assert.equal(buyerInfo[2], 13, "매입자의 나이가 13이 아닙니다.");return realEstateInstance.getAllBuyers();}).then(function(buyers) {assert.equal(buyers[0].toUpperCase(), accounts[1].toUpperCase(), "Buyers 배열 첫번째 인덱스의 계정이 가나슈 두번쨰 계정과 일치하지 않습니다");})})});
-
미해결블록체인 이더리움 부동산 댑(Dapp) 만들기 - 기본편
require 문 쪽에서
require(_id >= 0 && _id <= 9);똑같이 썻는데 저는 에러가 계속 되네요 .. 어떤 문제인건가요.띄어 쓰기도 똑같이했는데...
-
미해결스프링 데이터 JPA
insert 순서 질문
mysql환경에서 account와 study entity에 대한 generated value를 auto(default)로 두면sequence 기반으로 동작하는거같습니다.그런데 @GeneratedValue(strategy = GenerationType.IDENTITY) 로 두면auto_increment 기반으로 동작합니다.위 두개의 설정이 아래의 코드 결과가 다르게 출력됩니다.entityManager.persist(account);entityManager.persist(study);Account keesun = entityManager.find(Account.class, account.getId());print(keesun.getUsername());전자의 경우(sequence기반) 1차캐시에서 데이터를 가져오기때문에print 가 먼저 찍히고 난후 insert query가 동작합니다.후자의 경우(auto_increment기반) insert query가 먼저 실행된 후print가 찍힙니다.무슨 차이때문에 이런건가요?
-
미해결자바 스프링 프레임워크(renew ver.) - 신입 프로그래머를 위한 강좌
영상 소리가 너무 작습니다
기존 자바, 서블릿/JSP, Spring 다 수강했었는데요 이번에 2018 개정판으로 나온 강좌들은 소리가 너무 작아서 pc와 영상 음량을 최고로 키워야 겨우 들리는수준이네요영상 플레이어도 기존의 유튜브 플랫폼과 달라져서 좀 불편한데 변경될수 없는 부분인지 궁금합니다..이 강좌뿐만이 아니라 2018 개정판 모든 강좌에 해당하는 질문입니다.
-
미해결쉽게 배우는 Webpack
ExtractTextPlugin 오류
[package.json]"devDependencies": {"autoprefixer": "^9.1.5","babel-core": "6.24.1","babel-eslint": "7.2.3","babel-loader": "7.1.1","babel-preset-es2015": "6.24.1","bootstrap-loader": "^3.0.1","bootstrap-sass": "^3.3.7","clean-webpack-plugin": "^0.1.19","css-loader": "^1.0.0","extract-text-webpack-plugin": "^4.0.0-beta.0","file-loader": "^2.0.0","jquery": "^3.3.1","node-sass": "^4.9.3","postcss-loader": "^3.0.0","raw-loader": "^0.5.1","resolve-url-loader": "^3.0.0","sass-loader": "^7.1.0","style-loader": "^0.23.0","url-loader": "^1.1.1","webpack": "3.12.0","webpack-browser-plugin": "^1.0.20","webpack-dev-server": "^2.11.3","webpack-merge": "4.1.0","webpack-strip": "^0.1.0"}[Config]module: {rules: [{test: /.js$/,exclude: /node_modules/,use: [{loader: 'babel-loader',options: {presets: [['es2015', {modules: false}]]}}]},{test: /.css$/,// use: ['style-loader', 'css-loader']use: ExtractTextPlugin.extract({fallback: 'style-loader',use: 'css-loader'})}]},plugins : [new webpack.ProvidePlugin({$ : "jquery",jQuery : "jquery"}), new CommonsChunkPlugin({ name: "vendor" }), new ExtractTextPlugin('styles.css')][Error]> gettingstarted@1.0.0 build C:\Users\bk\Desktop\ZumInternet\gettingstarted-web-master\gettingstarted-web-masterwebpack --env=prod --progress --profile --colorsC:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_moduleswebpackbinwebpack.js:348throw err;^TypeError: Cannot read property 'thisCompilation' of undefinedat ExtractTextPlugin.apply (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_modulesextract-text-webpack-plugindistindex.js:183:20)at Compiler.apply (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_modulestapablelibTapable.js:375:16)at webpack (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_moduleswebpacklibwebpack.js:33:19)at processOptions (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_moduleswebpackbinwebpack.js:335:15)at yargs.parse (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_moduleswebpackbinwebpack.js:397:2)at Object.Yargs.self.parse (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_moduleswebpacknode_modulesyargsyargs.js:533:18)at Object. (C:UsersbkDesktopZumInternetgettingstarted-web-mastergettingstarted-web-masternode_moduleswebpackbinwebpack.js:152:7)at Module._compile (module.js:662:30)at Object.Module._extensions..js (module.js:673:10)at Module.load (module.js:575:32)at tryModuleLoad (module.js:515:12)at Function.Module._load (module.js:507:3)at Function.Module.runMain (module.js:703:10)at startup (bootstrap_node.js:193:16)at bootstrap_node.js:660:3npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! gettingstarted@1.0.0 build: webpack --env=prod --progress --profile --colorsnpm ERR! Exit status 1npm ERR!npm ERR! Failed at the gettingstarted@1.0.0 build script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:npm ERR! C:UsersbkAppDataRoamingnpm-cache_logs2018-09-24T13_06_21_834Z-debug.log이상한 error가 발생합니다... webpack.js에서 에러가 발생하네요...
-
미해결쉽게 배우는 Webpack
BootStrap을 적용하고 싶습니다.
css파일 js로 import하는 영상보고 작성해봤는데 적용이 안되서 질문드립니다. 혹시 외부라이브러리는 다른 설정방법이 있나요?[HTML]<!DOCTYPE html><html lang="ko"> helloworld ID PW E-Mail Cancle [bootstrap.js]import 'bootstrap/dist/css/bootstrap.min.css';import 'bootstrap';import 'bootstrap/js/dist/util';import 'bootstrap/js/dist/dropdown';[config]const webpack = require('webpack');const path = require('path');const webpackMerge = require('webpack-merge');const CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");const config = {entry: {helloworld: path.resolve(dirname, 'src/main/resources/static/js/helloworld.js'),vendor: ['jquery'],background: path.resolve(dirname, 'src/main/resources/templates/myStyle.css'),bootstrap: path.resolve(dirname, 'src/main/resources/static/js/bootstrap.js')},output: {path: path.resolve(dirname, 'src/main/resources/static/dist/js'),filename: '[name].js'},module: {rules: [{test: /.js$/,exclude: /node_modules/,use: [{loader: 'babel-loader',options: {presets: [['es2015', {modules: false}]]}}]},{test: /.css$/,use: ['style-loader', 'css-loader']}]},plugins : [new webpack.ProvidePlugin({$ : "jquery",jQuery : "jquery"}), new CommonsChunkPlugin({ name: "vendor" })]};module.exports = function(env) {return webpackMerge(config, require(./webpack.${env}.js))};
-
미해결Node.js 교과서 - 기본부터 프로젝트 실습까지
sns 서버에서 sequelize 질문
동영상처럼 해서 테이블들을 만들었는데, 그럼 계속 nodemon으로 켜져있어서 저장할때마다 테이블이 create된다고 계속뜨는데 이대로 두고 개발을 계속 해도 되는건가요??계속 새로운 테이블로 생기면서 바뀌는게 아닌가 해서요, 그럼 나중에 서버 끄면 db에 저장된 정보들도 날라가진 않나요?
-
미해결파이썬 웹 프로그래밍 - Django로 웹 서비스 개발하기
migrations 안됨
안녕하세요 강의 복습중인데요..!모델 만들고 makemigrations 하면왜 안될까요..이상해서 모델 클라스 네임도 바꿔보고 다른것도 해봤는데 no changes detected 만 되네요 뭐가 문제일까요..
-
미해결화이트해커가 되기 위한 8가지 웹 해킹 기술
칼리리눅스가 자꾸 안깔리네요...ㅠㅠ
virtualbox - 오류가상머신 Kali-Linux-2018.3-vbox-amd64 의 세션을 열 수 없습니다. 라고 뜨는데 뭐가 문제인건가요?? 재설치도 여러번 해봤는데 똑같더라구요. 그리고 ISO이미지로 다운받아볼려고 해도 시스템 설치중에 오류로 중지 되더라구요ㅠㅠ 뭐가 문제일까요ㅠ 칼리리눅스를 깔아야 뭘 할텐데...이것 때문에 계속 지체되고 있어요
-
미해결영리한 프로그래밍을 위한 알고리즘 강좌
동서남북 순서
서 -> 북 ->동->남 순서 아닌가요?