我想通知每当有一定NSView的- (NSRect)visibleRect变化,因为我想根据可见矩形做一些花哨的子视图布局.坦率地说,现在我很难过; -visibleRect不会发出KVO通知(这是有意义的),并且似乎没有办法在没有显式调用的情况下找出可见的rect是否发生了变化-visibleRect.
这是可能吗?(或者这是一个可怕的,可怕的想法?)
安装MacFUSE并打开系统首选项 - > MacFuse后,它看起来与Mac Lion不兼容,并说:
似乎没有安装MacFUSE
任何解决方案?
我尝试将我的php从5.3.13升级到5.4.5我手动下载php 5.4.5和./configure的源代码然后sudo make install it.
在那之后,我跑了
php -v
Run Code Online (Sandbox Code Playgroud)
它显示5.4.5,而我跑
<?php phpinfo(); ?>
Run Code Online (Sandbox Code Playgroud)
它显示5.3.13.这里有什么问题以及如何解决它.谢谢
我正在尝试使用MAMP在OS X Lion中设置开发环境.我历史上使用它的默认设置MAMP设置,但现在我需要使用虚拟主机进行环境设置.为此,我做了以下事情:
1)添加到hosts文件:
127.0.0.1 test.com
127.0.0.1 my.test.com
Run Code Online (Sandbox Code Playgroud)
2)编辑了httpd.conf和httpd-vhosts.conf(都位于MAMP文件夹中).对于httpd.conf,我只是取消注释该Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf行.对于httpd-vhosts.conf,我添加了:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Users/username/Sites/test.com"
ServerName test.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/username/Sites/my.test.com"
ServerName my.test.com
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
3)我将MAMP中的端口更改为80(Apache)和3306(MySQL).
4)我关闭了系统首选项中的个人Web共享.
现在,有了这个集合,当我导航到"test.com"到test.com:8888时,我会遇到重定向.我不知道它来自哪里.然后,当我去"http:// localhost时",我得到了"It Works!"的问候,表明OS X Lion Apache服务器正在运行.
我错过了这种配置的东西吗?有什么想法吗?
非常感谢你的帮助!
我一直试图让一个超级简单的SDL程序工作.我正在使用Mac OS X Lion.我有SDL在Snow Leopard工作,但它似乎不想在狮子身上工作.到目前为止我有这个:
#include <iostream>
#include "SDL/SDL.h"
using namespace std;
/*
#ifdef main
# undef main
#endif
*/
int main( int argc, char* args[] )
{
SDL_Surface* hello = NULL;
SDL_Surface* screen = NULL;
SDL_Init( SDL_INIT_EVERYTHING );
screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
hello = SDL_LoadBMP( "hello.bmp" );
SDL_BlitSurface( hello, NULL, screen, NULL );
SDL_Flip( screen );
SDL_Delay( 2000 );
SDL_FreeSurface( hello );
SDL_Quit();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
当我尝试编译此代码时(在Xcode 4.1中),它给了我这个错误:
Undefined symbols for architecture x86_64:
"_main", referenced …Run Code Online (Sandbox Code Playgroud) 我正在尝试将Neo4j用于一个项目,并希望通过Python与它进行交互,因为我是编程的新手并且不知道任何Java.我正在按照安装说明操作,但我坚持第一步,即安装JPype.
我正在使用OS X 10.7(狮子).我认为我的配置非常标准,从Python网站下载的Python 2.7.2和从Apple网站下载的Java 1.6.0.
我跑的时候
% sudo python setup.py install
Run Code Online (Sandbox Code Playgroud)
在JPype安装程序中,我得到大约100行关于各种.h文件的错误代码,然后它以行终止:
lipo: can't figure out the architecture type of: /var/tmp//
ccwOzLi9.out
error: command 'gcc-4.2' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
我发现了一篇关于JPype的gcc错误的博客文章,但我按照那里的说明无济于事.我还通过电子邮件发送了该帖子的作者,他告诉我从未实际使用过JPype,曾经在OS X 10.6中工作,并且没有任何见解.
我还通过电子邮件发送了JPype的创建者,他告诉我他只使用Windows,并且不知道如何在OS X上安装.但是如果我们能解决这个问题,我可以指出他的答案,也许他可以添加JPype文档的解决方案,也帮助了很多其他人!
那么,有谁知道我做错了什么?我想使用Neo4j,但我不懂Java,所以我完全不知道如何解决编译错误.
基于阅读所有可用的Google结果,我的两个运行理论是:
我在某种程度上使用32位版本的Python或Java(虽然我使用标准的官方安装,但无法弄清楚如何切换到64位或甚至可能)
JPype文件只能使用GCC 4.0而不是4.2编译.但我无法在网上找到有关如何回滚到GCC 4.0的任何内容(或者它是否附带2011款MacBooks,并且有一些方法可以强制JPype使用它进行编译).
还有另一个类似的问题,但解决方案是使用不同的适配器,通过REST而不是直接挂钩到Java.如果必须,我会尝试,但如果可能的话,我宁愿使用推荐的Neo4j方法.
我正在尝试在Rails项目中使用Paperclip gem,因此遵循文档并首先使用Homebrew配方安装Imagemagick.
我在我的模型中添加了我的附件
has_attached_file :screenshot
Run Code Online (Sandbox Code Playgroud)
这工作正常,文件上传按预期运行
然后我想为此添加缩略图,所以再次按照文档添加到模型中
has_attached_file :screenshot,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
Run Code Online (Sandbox Code Playgroud)
此时上传不再有效
我查看了开发日志并注意到了这一点:
[32mCommand[0m :: identify -format %wx%h '/var/folders/ky/r5gsdhbn6yggbglsg727cc900000gn/T/stream20120302-60051-eh17n7.png[0]'
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError:
/var/folders/ky/r5gsdhbn6yggbglsg727cc900000gn/T/stream20120302-60051-eh17n7.png is not recognized by the 'identify' command.>
Run Code Online (Sandbox Code Playgroud)
在一些谷歌搜索之后,我认为将默认路径设置为环境变量可能是个问题
Paperclip.options[:command_path] = "/usr/local/bin/"
Run Code Online (Sandbox Code Playgroud)
但我检查了这是正确的使用
which identify
Run Code Online (Sandbox Code Playgroud)
它回归了这条道路
/usr/local/bin/identify
Run Code Online (Sandbox Code Playgroud)
正如所料
然后我尝试从命令行运行识别作为测试并得到此错误
dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/identify
Reason: Incompatible library version: identify requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
Trace/BPT trap: 5 …Run Code Online (Sandbox Code Playgroud) 如何将CVPixelBufferRef转换为NSImage或CGImageRef?我需要能够在核心动画层中显示像素缓冲区的内容.
我在使用MAMP在Mac OSX上构建/安装XDebug时遇到问题.
到目前为止,我在网上进行了广泛的搜索,目前我被困在XDebug"安装向导"的一部分,它告诉我在我下载的源代码上"运行:phpize".
当我运行时,phpize我收到以下消息:
new-host-2:xdebug-2.2.0 Dima$ phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
Run Code Online (Sandbox Code Playgroud)
如果我做了which phpize我得到:
new-host-2:xdebug-2.2.0 Dima$ which phpize
/usr/bin/phpize
Run Code Online (Sandbox Code Playgroud)
这不是我想要使用的版本,我想使用phpize我假设的MAMP安装版本,因为我想在MAMP版本的PHP上安装XDebug.这很令人费解,因为我已将MAMP特定的PHP bin路径添加到我的.bash_profile中$PATH.
如果我跑echo $PATH我得到:
new-host-2:xdebug-2.2.0 …Run Code Online (Sandbox Code Playgroud) 我试图通过自制软件在我的macbook pro上设置八度音程.我的自制程序已更新,我的XCode及其命令行工具也是如此.
这是我得到的错误:
Undefined symbols for architecture x86_64:
"_append_history", referenced from:
_octave_append_history in liboctave_la-oct-rl-hist.o
(maybe you meant: _octave_append_history)
"_history_list", referenced from:
_octave_history_list in liboctave_la-oct-rl-hist.o
(maybe you meant: _octave_history_list)
"_read_history_range", referenced from:
_octave_read_history_range in liboctave_la-oct-rl-hist.o
(maybe you meant: _octave_read_history_range)
"_rl_basic_quote_characters", referenced from:
_octave_rl_set_basic_quote_characters in liboctave_la-oct-rl-edit.o
"_rl_char_is_quoted_p", referenced from:
_octave_rl_set_char_is_quoted_function in liboctave_la-oct-rl-edit.o
"_rl_clear_screen", referenced from:
_octave_rl_clear_screen in liboctave_la-oct-rl-edit.o
(maybe you meant: _octave_rl_clear_screen)
"_rl_filename_dequoting_function", referenced from:
_octave_rl_set_dequoting_function in liboctave_la-oct-rl-edit.o
"_rl_filename_quote_characters", referenced from:
_octave_rl_set_filename_quote_characters in liboctave_la-oct-rl-edit.o
"_rl_filename_quoting_desired", referenced from:
_octave_rl_filename_quoting_desired in liboctave_la-oct-rl-edit.o
(maybe you …Run Code Online (Sandbox Code Playgroud)