import Web3 from "web3"; import "./app.css"; import ecommerceStoreArtifact from "../../build/contracts/EcommerceStore.json"; var EcommerceStore = contract(ecommerce_store_artifacts); const App = { web3: null, account: null, start: async function() { const { web3 } = this; try { // get contract instance const networkId = await web3.eth.net.getId(); const deployedNetwork = ecommerceStoreArtifact.networks[networkId]; this.meta = new web3.eth.Contract( ecommerceStoreArtifact.abi, deployedNetwork.address ); // get accounts const accounts = await web3.eth.getAccounts(); this.account = accounts[0]; } catch (error) { console.error("Could not connect to contract or chain."); } } }; window.App = { start: function() { var self = this; //Bootstrap the Metacoin abstraction for use. EcommerceStore.setProvider(web3.currentProvider); renderStore(); } }; function renderStore() { //get the product count //loop through and fetch all products by id var instance; return EcommerceStore.deployed() .then(function(f) { instance = f; return instance.productIndex.call(); }) .then(function(count) { for (var i = 1; i <= count; i++) { renderProduct(instance, i); } }); } function renderProduct(instance, index) { instance.getProduct.call(index).then(function(f) { let node = $("<div/>"); console.log(f); }); } window.addEventListener("load", function() { if (window.ethereum) { // use MetaMask's provider App.web3 = new Web3(window.ethereum); window.ethereum.enable(); // get permission to access accounts } else { console.warn( "No web3 detected. Falling back to http://127.0.0.1:9545. You should remove this fallback when you deploy live" ); // fallback - use your fallback strategy (local node / hosted node + in-dapp id mgmt / fail) App.web3 = new Web3( new Web3.providers.HttpProvider("http://127.0.0.1:9545") ); } App.start(); }); index.js 너무 많이 바꼈네요.. ㅜ 이렇게 하면 앞에서 했던 iphoneX 크롬 개발자 도구로 ㅜ쿼리가 되던데 바뀐 index.js 코드에선 안되네요. 뭐가 잘못된 건가요?
회원가입을 하면 이런 에러가 떠요 SequelizeValidationError: notNull Violation: User.email cannot be null, notNull Violation: User.nickname cannot be null, notNull Violation: User.password cannot be null user.js 에서 allowNull: false를 지우고 회원가입 하면 SequelizeDatabaseError: (conn=154, no: 1364, SQLState: HY000) Field 'email' doesn't have a default value sql: INSERT INTO `Users` (`id`,`nickname`,`password`,`createdAt`,`updatedAt`) VALUES (DEFAULT,?,?,?,?); - parameters:['1234','1234','2019-12-06 07:23:46.708','2019-12-06 07:23:46.708'] 이메일이 왜 포함이 안되어있는지 잘모르겠네요 .. 이런 에러가 뜨네요.. 도와주세요 ㅜㅜ
안녕하세요. 강의 잘 듣고 있습니다!! 질문하나 드릴게요. 값타입 외에도 기본타입중 래퍼(Integer, String...) 에 대해서도 equals 로 비교해야될 것 같은데요. 강의를 제가 이해하기에는 값타입에 대해서만 equals 적용이 필요한 듯 설명하신것 같아서요.
과제 내용 설명쪽 상단에 있는 sub-로 시작하는 hash key를 내용에 설명하신대로 입력했는데, BackendClientError("Request to the API endpoint has failed.\nCheck your network connection and/or the server status. 위의 에러가 발생합니다. 해결방법이 있는지 알려주시면 감사하겠습니다. Terminal입력 명령어는 bash-3.2$ ./submit.sh sub-... 로 입력했고, 경로도 해당 파일이 존재하는 경로로 지정해 둔 상태입니다. 확인 부탁드립니다.
질문요약================= 왜 while앞에 입력이 먼저 들어가야하는지? // printf("Enter secret code : "); // scanf("%d", &guess); 이 두문장을 안쓰고 구동했을때, 입력을 처음에 주지 않았는데도 작동했기에 여쭤봅니다. ========================= 2:35~이후 //비교를 하기전에 입력을 꼭 받아야한다. 입력을 받고 비교를 하는 것인데, 제가 맨 처음에 예제 풀어볼때 #include <stdio.h> int main() { const int secret_code = 337; int guess=0; // printf("Enter secret code : "); // scanf("%d", &guess); //이 두문장을 안쓰고 구동했을때, 입력을 처음에 주지 않았는데도 작동했습니다. while (guess != secret_code) { printf("Enter secret code : "); scanf("%d", &guess); } printf("Good!"); return 0; } 로 구현을 했습니다. 문제없이 구동되길레 교수님것과 비슷할 것이라고 생각했는데, 앞에 한번 더 작성 하신 교수님의 답안을 보고 의아했습니다. 이 예제가 꼭 앞에 한번을 입력 받아야 하는 예제인지 궁금합니다. while의 진입조건이 선택될때 int guess=0으로 초기화 된값이 들어가서 바로 "Enter secret code : "가 출력되기에 필요한가? 에 대한 의구심이 들었습니다. 뭐에서 꼬여서 이런 생각을 하고있는건지,, 이런 질문이 괜찮은건지 모르겠네요 ㅠ 댓글 달아주시면 감사하겠습니다 !
설치 에러 learn-vue-js-master> npm install -g @vue/cli npm WARN deprecated core-js@2.6.10: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size 프로젝트 생성시 에러 vue\learn-vue-js-master> vue create vue-cli vue : 이 시스템에서 스크립트를 실행할 수 없으므로 C:\Users \Duksoo\AppData\Roaming\npm\vue.ps1 파일을 로드할 수 없습 니다. 자세한 내용은 about_Execution_Policies(https://go.mi crosoft.com/fwlink/?LinkID=135170)를 참조하십시오. 위치 줄:1 문자:1 + vue create vue-cli + ~~~ + CategoryInfo : 보안 오류: (:) [], PSSecurit yEx ception + FullyQualifiedErrorId : UnauthorizedAccess
포인터를 참조로 넘기기 위해 매개변수를 정의할 때 void foo(int *&ptr) 같이 *& 를 연속적으로 쓰셨잖아요? 그런데 나중에 typedef 할 때도 typedef int* 라고 쓰기도 하고, 애초에 ptr 을 참조로 받는다는 걸 보여주는 게 목표니까 int* &ptr 처럼 int 에 * 을 붙이고 ptr 에 & 를 붙이는 게 이해하기 쉽지 않나요? 교수님처럼 *& 를 붙여 쓰는 게 다른 이유가 있는 것인지 그냥 coding convention 인지 궁금합니다. 사실 포인터 배울 때 int * ptr = &value; 처럼 원래는 가운데에 있는 * 를 오른쪽에 붙이는(*ptr) 게 coding convention 이라고 하셨던 거 같긴 한데, 이거랑 같은 이유인가요? 왜 int* 가 아닌 *ptr 이 convention 이 됐을까요..?
Group Data 강의 중 shift 메소드에 대한 말씀을 해주신 것 중 만약 하나의 컬럼만 비어있는데 전의 값이나 후의 값으로 채우고 싶다고 한다면, 새로운 컬럼을 만들고 shift 값을 넣은 다음에 비어있는 값을 shift 값에서 가져오면 된다고 말씀을 해주셨습니다. 여기서 shift 값을 넣은 다음에 비어있는 값을 shift 값에서 가져오면 된다는 말씀이 이해가 되질 않습니다,,
한프로젝트에 Member라는 하나의 entity를 한국,미국에서 같은 소스를 사용하고 환경만 다르게 해서 사용을 하고 있다고 할때, 미국에서만 쓰여지는 특정컬럼을 추가한 경우 한국에서는 컬럼 사용여부와 상관없이 db에 신규 필드를 추가해줘야 정상적으로 사용할수 있는 상황이 생겨버리는데, 혹시 이럴경우에는 유연하게 대처할 수 있는 방법이 있을까요? (상황에 맞게 @Trasient를 붙여준다던가...) 아에 소스를 분리하는게 맞을까요?.. 조언 부탁드려요 :)
한프로젝트에 Member라는 하나의 entity를 한국,미국에서 같은 소스를 사용하고 환경만 다르게 해서 사용을 하고 있다고 할때, 부득이하게 분기처리가 되어질수 있는 부분이 생기는데요, 예를 들어 미국에서만 쓰여지는 특정컬럼을 추가한 경우 한국에서는 사용여부와 상관없이 db에 필드를 추가해줘야 정상적으로 사용할수 있는 상황이 생겨버리는데, 혹시 이럴경우에는 유연하게 가져갈수 있는 방법이 있을까요? (상황에 맞게 @Trasient를 붙여준다던가...) 아에 소스를 분리하는게 맞을까요?.. 조언 부탁드려요 :)