程序设计

专业和发烧友程序员的问答


30
ng无法识别为内部或外部命令
运行Windows 7 Professional 32位。 我尝试npm install -g angular-cli在普通或管理员下运行。 我也尝试将其添加到PATH:下的Envirorment Variables中(C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng),但也没有成功。 我究竟做错了什么?

8
在MySQL查询的WHERE子句中使用列别名会产生错误
我正在运行的查询如下,但是出现此错误: #1054-'IN / ALL / ANY子查询'中的未知列'guaranteed_postcode' SELECT `users`.`first_name`, `users`.`last_name`, `users`.`email`, SUBSTRING(`locations`.`raw`,-6,4) AS `guaranteed_postcode` FROM `users` LEFT OUTER JOIN `locations` ON `users`.`id` = `locations`.`user_id` WHERE `guaranteed_postcode` NOT IN #this is where the fake col is being used ( SELECT `postcode` FROM `postcodes` WHERE `region` IN ( 'australia' ) ) 我的问题是:为什么我不能在同一数据库查询的where子句中使用伪列?

4
错误:使用Postgres拒绝序列city_id_seq的权限
我是Postgres(以及所有数据库信息系统)的新手。我在数据库上运行了以下sql脚本: create table cities ( id serial primary key, name text not null ); create table reports ( id serial primary key, cityid integer not null references cities(id), reportdate date not null, reporttext text not null ); create user www with password 'www'; grant select on cities to www; grant …

6
如何在moment.js中将日期格式化为ISO 8601?
该文档提到moment.ISO_8601了一种格式设置选项(从2.7.0- http: //momentjs.com/docs/#/parsing/special-formats/ ),但是这些都不起作用(甚至是2.7.0): var date = moment(); date.format(moment.ISO_8601); // error moment.format(date, moment.ISO_8601); // error (http://jsfiddle.net/b3d6uy05/1/) 如何从moment.js获取ISO 8601?


5
git在master和branch之间的信息之前/之后?
我已在test-branch我推送到的本地存储库()中创建了一个测试分支Github。 如果我转到我的Github帐户并选择此帐户,test-branch则会显示以下信息: This branch is 1 commit ahead and 2 commits behind master 我的问题是: 如何在本地显示此信息(即:一个在终端上显示此信息的命令,而不必打开Github即可查看)? 我知道我可以使用以下方法查看分支之间的差异: git diff master..test-branch 或使用Meld(我更喜欢): git difftool master..test-branch 但我想知道如果有一个办法看到前面和后面分别提交。IE:有没有一种方法可以显示出1个自己在前面提交,然后那2个自己在后面提交?
201 git  github 


7
如何模仿“地图”应用中的底部表格?
谁能告诉我如何模仿iOS 10中新Maps应用程序的底部? 在Android中,您可以使用BottomSheet模仿此行为的,但我找不到适用于iOS的类似内容。 那是一个带有内容插图的简单滚动视图,以便搜索栏位于底部吗? 我是iOS编程的新手,所以如果有人可以帮助我创建此布局,将不胜感激。 这就是我所说的“底页”:

8
从列表<Integer>中正确删除一个整数
这是我刚遇到的一个陷阱。考虑一个整数列表: List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;(); list.add(5); list.add(6); list.add(7); list.add(1); 关于执行时会发生什么的任何有根据的猜测list.remove(1)?那list.remove(new Integer(1))呢 这可能会导致一些令人讨厌的错误。 在处理整数列表时,区分remove(int index)从给定索引remove(Object o)中删除元素的和,按引用删除元素的正确方法是什么? 这里要考虑的重点是提到的@Nikita-精确参数匹配优先于自动装箱。

26
无法将“ npm”识别为内部或外部命令,可操作程序或批处理文件
我对Node.js完全陌生。我正在尝试让nodejs在Windows 2008机器上工作,以便安装Karma,我将用它来TDD AngularJs代码。到目前为止,我已经完成了以下步骤 无法识别使用Chocolatey ==&gt; npm进行的安装 无法识别使用来自nodejs.org的64位nodejs安装程序进行安装==&gt; npm 在这个阶段,跑步where npm给了我c:\User\&lt;Username&gt;\AppData\Roaming\npm一点力量 我发现nodejs已安装在中C:\Program Files\nodejs。在此目录中打开命令提示符可以npm正常工作。 所以我添加C:\Program Files\nodejs到PATH只能再次证明得到同样的错误npm is not recognized nodejs存储库上的github问题之一说,我需要重新启动机器,它将修复。但这到目前为止没有帮助 我确实Node.js在Start -&gt; Programms菜单中看到一个图标,该图标将我带到nodejs控制台,但不确定该怎么做。 我错过了过程中的任何重要步骤吗? 编辑 我发现,如果从程序文件中打开“ Nodejs命令提示符”,则可以识别npm。如何使其在正常的命令提示符下工作? 编辑 在node我开始面对另一个应用程序的类似问题之后。我在超级用户上发布了这个问题,正如已接受的答案正确指出的那样,我在PATH其中还有一个额外的引号,导致在引号之后添加的所有路径均出现问题。我感觉有些Chocolatey安装程序添加了这个令人不安的报价,但我不确定是哪个。
201 windows  node.js 




5
GitHub消息的含义:由于电子邮件隐私限制,推送被拒绝
我已经在github上接受并合并了一个Pull Request,现在我不能再提取我的提交了。 消息是: ! [remote rejected] master -&gt; master (push declined due to email privacy restrictions) error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git' git did not exit cleanly (exit code 1) (3838 ms @ 12/04/2017 21:23:11) 我现在应该怎么办 ?
201 git  github  git-push 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.