在OSX终端中:
du -h | sort -nr
-bash: sort: command not found
which sort
/usr/bin/sort
Run Code Online (Sandbox Code Playgroud)
奇怪的是:我尝试重现错误,它似乎是完全随机的.我的PATH回应道:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/texbin:/Users/sytycs/.rvm/bin
Run Code Online (Sandbox Code Playgroud)
这种情况只发生在管道与发生grep,more,less等任何想法是什么原因造成的?
我在Mac OS X Lion上,刚刚使用MacPorts安装了mysql5.
然后我成功跑了:
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
Run Code Online (Sandbox Code Playgroud)
我能够启动服务器并以"root"连接正常,但我无法创建任何数据库.
$ mysql5 -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61 Source distribution
mysql> create database dbname;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'dbname'
Run Code Online (Sandbox Code Playgroud)
我已经做了很多谷歌试图解决这个问题,似乎问题可能与/ opt/local/var/db/mysql5的文件系统权限有关,但我试过改变它们无济于事:
$ ls -l /opt/local/var/db/
total 0
drwxrwxrwx 8 _mysql _mysql 272 Apr 12 11:55 mysql5
Run Code Online (Sandbox Code Playgroud)
我已经尝试过使用'_mysql','mysql'和'root:wheel',但是没有一个有所作为.
我有一个在Mac上运行的lua脚本,需要调用sudo.
我希望Mac OS会自动调出一个密码请求对话框,但是命令失败后返回256.
无论如何我能实现目标吗?
蒂姆
无论如何在Mac OS Lion附带的python 2.6.7上安装numpy和scipy?我知道Lion也有Python 2.7.但我需要坚持使用Python 2.6,因为我使用的模块在Python 2.7上不起作用.
我在Cocoa应用程序中使用AVPlayer,并且我实现了一个跳转到视频末尾的命令.
问题是,AVPlayer没有寻求我告诉它的地方.
例如,我有一个视频是4分14秒.当我寻求结束时,AVPlayer寻求4分12秒 - 两秒钟.如果我然后点击播放,播放器将播放两秒钟,然后到达结尾.
我的第一次尝试是这样的:
[self.player seekToTime:self.player.currentItem.duration];
Run Code Online (Sandbox Code Playgroud)
我把它换成了这个:
[self.player seekToTime:self.player.currentItem.duration
toleranceBefore:kCMTimePositiveInfinity
toleranceAfter:kCMTimeZero];
Run Code Online (Sandbox Code Playgroud)
两者都没有比另一个更好.
我也试过去寻求kCMTimePositiveInfinity.那时它只是忽略了我.
播放器是否已加载视频的那部分似乎并不重要.我甚至可以寻求不完全结束,玩到真正的结局,然后再次尝试寻求到最后,它将跳回到不完全结束.
缺口并不总是两秒钟.在我的一些视频中,它或多或少地完全正确地工作,如果不完全正确,则跳得非常接近真实的结束.在至少一个,它短至三秒钟.长度似乎不是一个因素; 所有这些都是大约相同的长度,除了一个,超过一个小时,并寻求短短两秒.
那么,为什么AVPlayer在我告诉它的地方跳了多达三秒钟,我怎么说服它跳到我要求的那一刻?
我正在尝试使用以下方法在Mac OS X Lion上安装GDAL 1.7.1:
python setup.py build
python setup.py install
Run Code Online (Sandbox Code Playgroud)
并得到错误:
running build
running build_py
running build_ext
building 'osgeo._gdal' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch i386 -arch x86_64 -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-x86_64.egg/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.7/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/extensions/gdal_wrap.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
这是正确的编译器吗?我怎样才能使这个工作?
更新: …
我正在使用makeOSX Lion构建一个大型项目.这些脚本在OSX上运行得很好,直到Snow Leopard,但现在它失败了.
结果是在构建某些模块后,我得到类似于以下内容的错误:
touch my.app/Contents/Resources
touch my.app
make[2]: write error
make[1]: *** [all] Error 1
make: *** [all] Error 1
Run Code Online (Sandbox Code Playgroud)
如果我然后make再次键入它,它会从失败的地方恢复并成功构建(直到它遇到另一个这样的错误).它总是发生在项目的同一个模块中,我不能为我的生活找出原因.
如果我能提供更多有用的信息,请告诉我.
这是输出make -d:
...
Finished prerequisites of target file `DesktopConn.o'.
Prerequisite `DesktopConn.cxx' is older than target `DesktopConn.o'.
No need to remake target `DesktopConn.o'.
Considering target file `List.o'.
Looking for an implicit rule for `List.o'.
Trying pattern rule with stem `List'.
Trying implicit prerequisite `/bin/sh: line 1: 6733 Segmentation fault: 11 make …Run Code Online (Sandbox Code Playgroud) 首先,我正在尝试编译所有源代码,我不使用MacPorts或HomeBrew.
我已经安装了pcre /usr/local/pcre-8.21并将其符号链接到/usr/local/pcre.
我在这里设置/usr/local/pcre/bin了我的PATH变量.
`/usr/local:/usr/local/mysql/bin:/usr/local/pcre/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin`
Run Code Online (Sandbox Code Playgroud)
我现在正在尝试安装Nginx,但我不断收到此消息:
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
我尝试过设置,--with-pcre=/usr/local/pcre/bin但它只是尝试重新安装PCRE.
任何人都可以帮我解决这个问题吗?谢谢.
我正在将我的Lion应用程序转换为使用App Sandbox.我正在尝试使用10.7.3中引入的安全范围书签功能来允许对文件夹的持久访问.我下面的代码返回一个零书签,并生成以下日志消息:XPC couldn't look up the Mach service for scoped bookmarks agent.
我将User Selected File Access权利设置为Read/Write Access,并且在有和没有周围..AccessingSecurityScopedResource呼叫的情况下尝试.
我认为我根据文档做的一切正常,所以我很感激任何指针.在开始沙盒化应用程序之前,代码正在检索纯URL.
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel setAllowsMultipleSelection:NO];
NSInteger result = [openPanel runModal];
if( result == NSFileHandlingPanelCancelButton ) {
return;
}
NSArray *urls = [openPanel URLs];
if( urls != nil && [urls count] == 1 ) {
NSURL *url = [urls objectAtIndex:0];
NSData *bookmark = nil;
NSError *error = …Run Code Online (Sandbox Code Playgroud) 首先我安装了macports
然后我通过macports安装了Scala和Play:为了确保安装正常,我在eclipse上运行了一个"hello world".有用!
但由于我的目标是使用Intellij,我尝试按照http://confluence.jetbrains.com/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin上的说明进行操作
在说明(部分Creating a Project)的第3步下use scala distribution,我不知道要输入什么.有人请告诉我要输入什么?我正在使用mac os x mountain lion.我不知道scala安装的路径.
我很感激帮助.我已经查看了Scala的Intellij Idea设置,需要澄清.没有帮助.我的Intellij版本是12.0.3我的scala安装2.10.