#import "VTM_AViPodReaderViewController.h"
#import <AudioToolbox/AudioToolbox.h> // for the core audio constants
#define EXPORT_NAME @"exported.caf"
@implementation VTM_AViPodReaderViewController
@synthesize songLabel;
@synthesize artistLabel;
@synthesize sizeLabel;
@synthesize coverArtView;
@synthesize conversionProgress;
#pragma mark init/dealloc
- (void)dealloc {
[super dealloc];
}
#pragma mark vc lifecycle
-(void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
#pragma mark event handlers
-(IBAction) convertTapped: (id) sender {
// set up an AVAssetReader to read from the iPod Library
NSURL *assetURL = [song valueForProperty:MPMediaItemPropertyAssetURL];
AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL:assetURL options:nil];
NSError *assetError = nil;
AVAssetReader …Run Code Online (Sandbox Code Playgroud) 我在 Windows 下有一个批处理脚本。当有人点击该脚本时,我希望命令窗口变成全屏,就像我们通过键盘快捷键所做的那样[Alt+Enter]。
可以使用批处理文件中的任何命令自动完成吗?
例如,如果我想评论这个:
(defun noop ()
nil)
Run Code Online (Sandbox Code Playgroud)
每次我尝试在"defun"之前放一个分号,defun就会跑到下一行.那么应该怎么做?
GNU Emacs 23.1.1
编辑:通过"逃跑"我的意思是当我在"(defun"之前插入分号,在分号后自动插入换行符和"defun"再次在新行开始时.
我的继续按钮有一个悬停事件,告诉你为什么它被禁用.唯一的问题是我启用按钮时无法删除悬停事件....
这很有效
function disable_continue_button(){
$('#frame_2 > .next')
.addClass('faded tt')
.hover(function(){
$hovered = $(this);
//tooltip?
tip = $('.tip.notification.information');
tip.find('div').html($hovered.attr('tt'));
tip.fadeIn(150);
},
function() {
tip.hide();
})
.mousemove(function(e) {
var mousex = e.pageX +40; //Get X coodrinates
var mousey = e.pageY -20; //Get Y coordinates
tip.css({top: mousey, left: mousex });
});
}
Run Code Online (Sandbox Code Playgroud)
这不起作用
function enable_continue_button(){
$('#frame_2 > .next')
.unbind('mouseenter mouseleave mousemove')
.removeClass('faded tt');
}
Run Code Online (Sandbox Code Playgroud)
这些类被删除了,但是没有删除悬停工具提示......
我有一个房子数据库.在房屋内,mssql数据库记录是一个名为areaID的字段.房子可以在多个区域,因此数据库中的条目可以如下:
+---------+----------------------+-----------+-------------+-------+
| HouseID | AreaID | HouseType | Description | Title |
+---------+----------------------+-----------+-------------+-------+
| 21 | 17, 32, 53 | B | data | data |
+---------+----------------------+-----------+-------------+-------+
| 23 | 23, 73 | B | data | data |
+---------+----------------------+-----------+-------------+-------+
| 24 | 53, 12, 153, 72, 153 | B | data | data |
+---------+----------------------+-----------+-------------+-------+
| 23 | 23, 53 | B | data | data |
+---------+----------------------+-----------+-------------+-------+
Run Code Online (Sandbox Code Playgroud)
如果我打开一个仅在区域53中呼叫房屋的页面,我将如何搜索它.我知道在MySQL中你可以使用find_in_SET但我使用的是Microsoft SQL Server 2005.
这段代码效果很好
@property (nonatomic, retain) NSTimer *timer;
self.timer = [[NSTimer timerWithTimeInterval:kAdsAppearTimeInterval target:self selector:@selector(timerFired:) userInfo:nil repeats:NO] retain];
Run Code Online (Sandbox Code Playgroud)
这段代码得到CFRelease.但为什么?我使用保留财产
self.timer = [NSTimer timerWithTimeInterval:kAdsAppearTimeInterval target:self selector:@selector(timerFired:) userInfo:nil repeats:NO];
Run Code Online (Sandbox Code Playgroud) 我正在尝试重构一个超级脂肪模型,该模型有很多与状态和转换相关的ActsAsStateMachine代码,我希望将它重构为模块调用CallStates.
#in lib/CallStates.rb
module CallStates
module ClassMethods
aasm_column :status
aasm_state :state1
aasm_state :state2
aasm_state :state3
end
def self.included(base)
base.send(:include, AASM)
base.extend(ClassMethods)
end
end
Run Code Online (Sandbox Code Playgroud)
然后在模型中
include CallStates
Run Code Online (Sandbox Code Playgroud)
我的问题涉及如何将模块行为包含到模块中,以便单个模块可以包含在模型中.我已经尝试过class_eval也无济于事.感谢您对此事的任何深刻见解.
我正在使用OpenGL编写我的第一个Android应用程序.我正在写我的欲望,所以我的屏幕坐标在横向模式下应该是0到799,479.我试图让OpenGL在世界坐标中使用这个范围.
该应用程序,如它,到目前为止工作正常,但我不得不调整数字以显示屏幕上显示的内容,我对我无法理解投影矩阵与渲染之间的关系感到沮丧在这方面的纹理.
设置投影矩阵:
gl.glViewport(0, 0, width, height);
float ratio = (float) width / height;
float size = .01f * (float) Math.tan(Math.toRadians(45.0) / 2);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glFrustumf(-size, size, -size / ratio, size / ratio, 0.01f, 100.0f);
// GLU.gluOrtho2D(gl, 0,width, 0, height);
Run Code Online (Sandbox Code Playgroud)
我想在这里理解0.01f和100.0f.我用什么来描述一个0,0 - > 799,479的二维世界,其中z值为零?
另外,我不确定什么是"最好的" - 使用glFrustumF或GLU.gluOrtho2D后者有更简单的参数 - 只是视口的尺寸 - 但我没有任何地方.(有些网站的高度和0相反,但没有区别.)但这不应该是2D使用OpenGL的自然选择吗?我是否必须在某个地方设置一些内容来对OpenGL说"我在2D中这样做 - 请为了速度而无视任何地方的第三个维度"?
绘制我的纹理:
我正在使用2个纹理三角形绘制东西.我的init的相关部分(如果我需要更详细地编辑我的问题,请告诉我)是:
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatex(nXpos, nYpos, nZoomin);
gl.glRotatef(nRotZ, 0, 0, 1);
gl.glScalef((float)nScaleup,(float)nScaleup, 0.0f);
...
...
gl.glVertexPointer(2, GL10.GL_FIXED, 0, mVertexBuffer);
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTextureBuffer);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
mVertexBuffer …Run Code Online (Sandbox Code Playgroud) Scott Meyers在"Effective C++"中指出了在编译器中执行例如矩阵运算的能力,这是在模板类/函数中实现某些算法的一个原因.但是这些函数不能对运行时确定的参数进行操作,显然 - 它们仅适用于写入程序的数字,或者最好作为编译器的参数.程序编译完成后,每次运行时都会使用相同的输出值.在这种情况下,为什么不只是用常规(非模板化)程序计算该值,并在必要时将其写入原始程序?计算例如1000磅并不快.编译器中的fft肯定比常规程序要好.
我能想到的最好的方法是,如果您需要为不同的客户端编译不同版本的程序,那么TMP可能会为您节省一些时间.但这是否真的需要每一个?
我有一些旧的Microsoft Word文件(可能是Word 97),并注意到标准的Unix文件实用程序将这些文件识别为"CDF".它实际上更精确,倾倒详细的元数据,例如:
CDF V2 Document,
Little Endian,
Os: Windows,
Version 4.0,
Code page: 1252,
Title: ...,
Author: ...,
Template: Normal.dot,
Last Saved By: ...,
Revision Number: 1,
Name of Creating Application: Microsoft Word 8.0,
Create Time/Date: ...,
Last Saved Time/Date: ...,
Number of Pages: 1,
Number of Words: 95,
Number of Characters: 542,
Security: 0
Run Code Online (Sandbox Code Playgroud)
CDF代表什么?这是一种通用的容器格式,如媒体文件的RIFF?我在网上找不到任何有用的东西."通道定义格式"和"复合文档格式"显然不是意思,因为那些Microsoft Word文件是完全二进制的.对于通用数据格式,我找不到连接.我试图在文件util的源代码中找到一些东西(在FreeBSD附带的版本中),但我只能发现它有一个专用的readcdf.c处理这种格式.
iphone ×2
2d ×1
android ×1
batch-file ×1
c++ ×1
comments ×1
core-audio ×1
emacs ×1
events ×1
javascript ×1
jquery ×1
lisp ×1
memory ×1
ms-word ×1
nstimer ×1
objective-c ×1
opengl-es ×1
refactoring ×1
retain ×1
ruby ×1
sql ×1
sql-server ×1
t-sql ×1
templates ×1
unbind ×1
windows ×1
xcode ×1