程序设计

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

14
有效测试Linux是否打开了端口?
从bash脚本中,我如何快速找出445服务器上端口是否处于打开/侦听状态。 我已经尝试了几个选项,但我想要的东西快: 1 lsof -i :445 (只需几秒钟) 2. netstat -an |grep 445 |grep LISTEN(只需几秒钟) 3. telnet(不返回) 4 nmap,netcat不可用在服务器上 很高兴知道一种不会先枚举然后在此之后摸索的方式。
197 linux  bash  shell  port 

3
默认情况下如何显示隐藏字符(零宽度空间,即&#8203)
我只是因为这个周末而失去了一部分...小丑-零宽度的空间。我只是使用了来自Google网上论坛的一些代码片段,却不知道字符有加倍,因为Idea(11)没有显示它们,这导致解析我的应用程序的配置文件时出现了问题...我在vi中偶然发现了它。 有什么方法可以在IntelliJ中显示此类内容(或通过其他方式检查文件),而无需使用外部编辑器。 IntelliJ 11 / Mac OS 10.7 编辑-样本 在浏览器和Idea中,这两行看起来都是相同的。您可以在页面的代码中看到,在第一行-注释行中,mysql://和之间隐藏了零宽度空格localhost,这会引起问题。当然,如果您希望使用“小丑”,则可以尝试使用搜索替换它,但是没人希望该符号不存在,特别是如果他无法以任何方式看到它时。 #db.default.url="jdbc:mysql://​localhost/play-fullcalendar" db.default.url="jdbc:mysql://localhost/play-fullcalendar"

30
Post参数始终为null
自从为WebAPI升级到RC以来,在WebAPI上调用POST时遇到了一些真正的奇怪问题。我什至回到了在新项目上生成的基本版本。所以: public void Post(string value) { } 并从Fiddler致电: Header: User-Agent: Fiddler Host: localhost:60725 Content-Type: application/json Content-Length: 29 Body: { "value": "test" } 当我调试时,字符串“值”从未分配给它。它始终是NULL。有人遇到这个问题吗? (我首先看到了一个更复杂的类型的问题) 该问题不仅与ASP.NET MVC 4绑定,在RC安装后,对于新的ASP.NET MVC 3项目也会发生相同的问题


14
版本冲突更新到8.4.0
错误: 任务':app:processDebugGoogleServices'的执行失败。请通过更新google-services插件的版本(此处提供有关最新版本的信息)或将com.google.android.gms的版本更新为8.3.0来解决版本冲突 。 我已经做了所有发现的事情。 dependencies { // This does not break the build when Android Studio is missing the JRebel for Android plugin. classpath 'com.zeroturnaround.jrebel.android:jr-android-gradle:1.0.+' classpath 'com.android.tools.build:gradle:2.0.0-alpha3' classpath 'com.google.gms:google-services:2.0.0-alpha3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } 并在应用程序gradle中 compile …

10
Python线程中的join()有什么用?
我正在研究python线程并遇到了join()。 作者告诉我们,如果线程处于守护程序模式,那么我需要使用它,join()以便线程可以在主线程终止之前完成自身。 但我一直在使用也没见他t.join()即使t不daemon 示例代码是这个 import threading import time import logging logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s', ) def daemon(): logging.debug('Starting') time.sleep(2) logging.debug('Exiting') d = threading.Thread(name='daemon', target=daemon) d.setDaemon(True) def non_daemon(): logging.debug('Starting') logging.debug('Exiting') t = threading.Thread(name='non-daemon', target=non_daemon) d.start() t.start() d.join() t.join() 我不知道这是什么用途,t.join()因为它不是守护程序,即使删除它也看不到任何变化

4
链接到GitHub上的其他Wiki页面?[关闭]
关闭。这个问题是题外话。它当前不接受答案。 想改善这个问题吗? 更新问题,使其成为Stack Overflow 的主题。 7年前关闭。 改善这个问题 GitHub Wiki允许您像这样链接到Wiki中的其他页面: [[Wiki Page Name]] 但是,建立链接时,我想显示与Wiki页面名称不同的文本。有没有办法做到这一点?我链接到Wiki页面是否全部错误?
197 github 

4
Java 8流和对数组的操作
我刚刚发现了新的Java 8流功能。来自Python,我想知道现在是否有一种巧妙的方法可以对数组进行操作,例如求和,以“单行pythonic”的方式将两个数组相乘? 谢谢

1
用Python方式添加datetime.date和datetime.time对象
我有两个代表同一事件实例的对象-一个保存日期,另一个保存该事件的时间,我想创建一个datetime对象。 由于不能简单地添加日期和时间对象(以下调用失败): datetime.date(2011, 01, 01) + datetime.time(10, 23)
197 datetime  python 


13
NodeJS-使用NPM安装时出错
Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Windows\system32>npm install caress-server npm http GET https://registry.npmjs.org/caress-server npm http 304 https://registry.npmjs.org/caress-server npm http GET https://registry.npmjs.org/jspack/0.0.1 npm http GET https://registry.npmjs.org/buffertools npm http 304 https://registry.npmjs.org/jspack/0.0.1 npm http 304 https://registry.npmjs.org/buffertools > buffertools@2.0.1 install C:\Windows\system32\node_modules\caress-server\node_ modules\buffertools > node-gyp rebuild C:\Windows\system32\node_modules\caress-server\node_modules\buffertools>node "G: \nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node- gyp.js" …
197 node.js  npm 


5
使用SQL Server Server Management Studio导入/导出数据库
我以为这是微不足道的,但事实并非如此……我敢肯定有一种简单的方法可以做到,但我找不到它。真可惜 我想导入/导出数据库本身,表,约束(外键等)。我宁愿不获取数据,但如果没有其他方法,我可以摆脱它。 那么...如何使用MS SQL Server Management Studio导出数据库?如何导入? 我找到的唯一解决方案是右键单击表和“创建脚本”,但是我有100个左右的表,所以我宁愿避免这种情况。 谢谢!


8
return语句vs main()中的exit()
我应该使用exit()还是仅使用return语句main()?就我个人而言,我喜欢这些return语句,因为我感觉就像在读取代码时读取任何其他函数和流程控制一样(我认为)。即使我想重构该main()函数,return似乎也比拥有更好的选择exit()。 有exit()没有特别之处return吗?
197 c++  c  coding-style  return  exit 

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.