我有一个我已经开发了一段时间的应用程序.最近通过双击启动应用程序会显示一个对话框,显示"您无法打开应用程序RepoWatch,因为它可能已损坏或不完整."
通过打开./RepoWatch.app启动应用程序让我"无法打开应用程序,因为它的可执行文件丢失了."
我通常通过./RepoWatch.app/Contents/MacOS/RepoWatch启动应用程序只是出于习惯(工作正常),所以我不确定这种情况发生了多长时间,或者事先发生了什么变化.最可能的变化是我放入cp Info.plist ./RepoWatch.app/Contents/我的make文件以便版本Info.plist而不对.app包中的所有内容进行版本控制.
我多次查看Info.plist并且找不到任何错误.该文件使用Property List Editor打开,没有任何错误.从属性列表编辑器保存不会使文件"工作"(如果首先要责备它).
据我所知,权限看起来也很健全:
$ ls -l
./RepoWatch.app/Contents/Info.plist
-rw-rw-r--@ 1 dgrace staff 789 Feb 1 23:20 ./RepoWatch.app/Contents/Info.plist
$ ls -l
/Applications/Adium.app/Contents/Info.plist
-rw-rw-r-- 1 dgrace staff 5750 Aug 21 15:41 /Applications/Adium.app/Contents/Info.plist
Run Code Online (Sandbox Code Playgroud)
我不知道下一步该尝试什么.
以下是Info.plist的内容(尽管在很长一段时间内没有真正改变):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>RepoWatch</string>
<key>CFBundleIdentifier</key>
<string>com.doomstick.RepoWatch</string>
<key>CFBundleName</key>
<string>RepoWatch</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>CFBundleVersion</key>
<string>Beta26</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud) 当我在服务器上启动putty时,我得到如下提示:
hpbl802!benjaminb:~ [22]>
Run Code Online (Sandbox Code Playgroud)
如何将此提示更改为
benjamin:~ [22]>
Run Code Online (Sandbox Code Playgroud) 我想这样的代码:
(define-struct thing (a b c))
(define th (make-thing 1 2 3))
Run Code Online (Sandbox Code Playgroud)
打印这样的东西:
(make-thing 1 2 3)
Run Code Online (Sandbox Code Playgroud)
当我在DrScheme或MzScheme repl中键入"th"时.我在DrScheme中使用"非常大"的语言,输出样式设置为"构造函数".这就是我在DrScheme中得到的:
(make-thing ...)
Run Code Online (Sandbox Code Playgroud)
(我真的得到三个点)
在MzScheme:
#<thing>
Run Code Online (Sandbox Code Playgroud) 我正在寻找一个django博客应用程序来运行我的博客.
我找到了以下选项:
你能分享一下你的推荐吗?
我的基本要求是: - 易于定制 - 具有基本的博客功能
在命名文件中读取最pythonic的方法是什么,剥离为空的行,仅包含空格,或者将#作为第一个字符,然后处理剩余的行?假设它很容易适合记忆.
注意:这样做并不难 - 我要问的是最蟒蛇的方式.我一直在写很多Ruby和Java,但我已经失去了感觉.
这是一个稻草人:
file_lines = [line.strip() for line in open(config_file, 'r').readlines() if len(line.strip()) > 0]
for line in file_lines:
if line[0] == '#':
continue
# Do whatever with line here.
Run Code Online (Sandbox Code Playgroud)
我对简洁感兴趣,但不是以难以阅读为代价.
我正在使用OpenPanel来获取文件路径URL.这有效:
[oPanel beginSheetModalForWindow:theWindow completionHandler:^(NSInteger returnCode)
{
NSURL *pathToFile = nil;
if (returnCode == NSOKButton)
pathToFile = [[oPanel URLs] objectAtIndex:0];
}];
Run Code Online (Sandbox Code Playgroud)
这不会导致"只读变量的赋值"错误:
NSURL *pathToFile = nil;
[oPanel beginSheetModalForWindow:theWindow completionHandler:^(NSInteger returnCode)
{
if (returnCode == NSOKButton)
pathToFile = [[oPanel URLs] objectAtIndex:0];
}];
return pathToFile;
Run Code Online (Sandbox Code Playgroud)
通常,任何从oPanel上下文中提取pathToFile的尝试都失败了.对于小情况来说,这不是什么大问题,但随着我的代码的增长,我不得不在不适当的区域内填充所有内容 - XML解析,核心数据等.我该怎么做才能提取pathToFile?
谢谢.
我需要改变格式
this.TextBox3.Text = DateTime.Now.ToShortDateString();
Run Code Online (Sandbox Code Playgroud)
所以它返回(例如)25.02.2012,但我需要02.25.2012
如何才能做到这一点?
我在C aptitude论文中发现了这个难题.
void change()
{
//write something in this function so that output of printf in main function
//should always give 5.you can't change the main function
}
int main()
{
int i = 5;
change();
i = 10;
printf("%d", i);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
任何解决方案.?
struct foo
{
int a;
int b;
};
void* p = (void*)malloc(sizeof(struct foo));
((foo*)p)->a;//do something.
free(p);//Is this safe?
Run Code Online (Sandbox Code Playgroud) 如何使自己的自定义类可序列化?我特别想把它写到iPhone上的文件中,只是plist而你的类只是一个简单的实例类,只是NSStrings而且可能是NSUrl.
c ×2
cocoa ×2
objective-c ×2
.net ×1
asynchronous ×1
blogs ×1
coding-style ×1
datetime ×1
django ×1
idioms ×1
iphone ×1
macos ×1
nsopenpanel ×1
prompt ×1
puzzle ×1
python ×1
racket ×1
scheme ×1
shell ×1
unix ×1