像往常一样,我在为Quartz作业设置Cron计时器表达式时遇到了麻烦.如果我想每天2245时开始工作,那么表达式应该是:
0 45 22**?
我有一个有多个工作的调度程序.我希望能够显示调度程序中的所有活动作业,我的意思是我想在每个作业被触发时显示.这是我的代码:
sched.start();
JobDetail job = newJob(Jobs.class)
.withIdentity(job_name_, "default")
.usingJobData("job_type", job_type_)
.build();
Trigger trigger = newTrigger()
.withIdentity(job_name_, "default")
.startNow()
.withSchedule(cronSchedule(date_time_))
.build();
sched.scheduleJob(job, trigger);
Run Code Online (Sandbox Code Playgroud)
如何才能做到这一点?如何从作业的触发器中获取cron表达式?还有一种方法可以将cron表达式视为日期或表达本身更详细的东西吗?
任何帮助将被批准,
提前致谢.
我打算在objective-c/cocoa中制作一个简单的OSX绘图/绘画应用程序,并认为最好的方法是(简而言之)在NSView子类中使用quartz.
问题:我应该考虑使用OPEN GL还是Quartz会这样做?使用OPEN GL意味着一个巨大的性能优势吗?
该应用程序将是非常基本的,应该(例如)能够:
-paint in color -paint with bitmap textures -use gradient fills -programmatic paint brush
BackGround :
I am using Quartz scheduler with Spring to schedule a cronjob.
Question:
我正在我的applicationconfig文件中配置调度程序选项.相反,我想在我的java类中以编程方式指定这些选项.关于如何实现这一点的任何想法?我的代码如下,
ApplicationConfig
<!-- Cron Trigger -->
<bean id="SimpleTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="TaskJobDetail" />
<property name="cronExpression" value="0 19 14 * * ?" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="TaskJobDetail" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="SimpleTrigger" />
</list>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
我想在我的java类中以编程方式设置cronExpression.有什么想法吗?
这个问题令我感到困惑,它影响了单个用户(据我所知)并且没有被我们复制......
用户正在接收MissingMethodException,我们的跟踪文件表明它是在我们创建组件的新实例之后发生的,当我们调用Initialize/Setup方法准备让它工作时(示例中的InitializeWorkerByArgument)
由错误指定的方法是一个接口方法,基类实现,从基类派生的类可以根据需要覆盖
用户拥有我们应用程序的最新版本
所有提供的代码都在一个程序集中提供
这是组件的非常精炼版本:
class Widget : UserControl
{
public void DoSomething(string argument)
{
InitializeWorkerByArgument(argument);
this.Worker.DoWork();
}
private void InitializeWorkerByArgument(string argument)
{
switch (argument)
{
case "SomeArgument":
this.Worker = new SomeWidgetWorker();
break;
}
// The issue I'm tracking down would have occured during "new SomeWidgetWorker()"
// and would have resulted in a missing method exception stating that
// method "DoWork" could not be found.
this.Worker.DoWorkComplete += new EventHandler(Worker_DoWorkComplete);
}
private IWidgetWorker Worker
{
get;
set;
}
void Worker_DoWorkComplete(object …Run Code Online (Sandbox Code Playgroud) 我正在用Quartz制作一个游戏,我正在用线条,椭圆和椭圆来绘制我的播放器.
然后我有diamong.png,我在屏幕左上角的0,0渲染.
问题是......
它呈现颠倒!
我怎么旋转180度?
这是我的一些代码:
CGImageRef diamondImage = CGImageRetain([UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"Diamond.png" ofType:nil]].CGImage);
CGContextDrawImage(context, CGRectMake(0, 0, 32, 24), diamondImage);
Run Code Online (Sandbox Code Playgroud)
如果它有任何帮助,我正在使用横向模式,右侧有主页按钮.它在我的.plist和我的ViewController中定义
-shouldAutorotateToInterfaceOrientation:interfaceOrientation:
我该如何旋转/转换它?
我正在尝试从Apple实现ViewTransitions代码示例,但是将所有逻辑放在我的viewController而不是我的applicationDelegate类中.
当我尝试编译时,我遇到了一个奇怪的错误.
_kCATransitionFade", referenced from:
_kCATransitionFade$non_lazy_ptr in ViewTransitionsAsViewControllerViewController.o
(maybe you meant: _kCATransitionFade$non_lazy_ptr)
Run Code Online (Sandbox Code Playgroud)
有人有主意吗?
回答第一条评论,这是我的整个viewController实现.与Apple ViewTranstions代码唯一真正的区别在于我将逻辑从'applicationDidFinishLaunching'方法移动到我的'viewDidLoad'方法.
#import "ViewTransitionsAsViewControllerViewController.h"
#import <QuartzCore/QuartzCore.h>
@implementation ViewTransitionsAsViewControllerViewController
@synthesize containerView, doTransitionButton;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
UIImage *image1 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image1.jpg" ofType:nil]];
view1 = [[UIImageView alloc] initWithImage:image1];
UIImage *image2 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image2.jpg" ofType:nil]];
view2 = [[UIImageView alloc] initWithImage:image2];
view2.hidden = YES;
[containerView addSubview:view1];
[containerView addSubview:view2];
transitioning = NO;
[super viewDidLoad]; …Run Code Online (Sandbox Code Playgroud) 我正在使用石英和nhibernate并遇到了问题.通常情况下,我的所有nhibernate会话都在Web请求结束时关闭,但是我有一个调度程序在应用程序启动时启动,我需要传入一个我认为永远不应该关闭的nhibernate会话.
我不确定该怎么做.
Ninject
public class NhibernateSessionFactoryProvider : Provider<ISessionFactory>
{
protected override ISessionFactory CreateInstance(IContext context)
{
var sessionFactory = new NhibernateSessionFactory();
return sessionFactory.GetSessionFactory();
}
}
public class NhibernateModule : NinjectModule
{
public override void Load()
{
Bind<ISessionFactory>().ToProvider<NhibernateSessionFactoryProvider>().InSingletonScope();
Bind<ISession>().ToMethod(context => context.Kernel.Get<ISessionFactory>().OpenSession()).InRequestScope();
}
}
Run Code Online (Sandbox Code Playgroud)
Global.aspx
protected void Application_Start()
{
// Hook our DI stuff when application starts
IKernel kernel = SetupDependencyInjection();
// get the reminder service HERE IS WHERE THE PROBLEMS START
IScheduledRemindersService scheduledRemindersService = kernel.Get<IScheduledRemindersService>();
scheduledRemindersService.StartTaskRemindersSchedule();
RegisterMaps.Register();
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
public …Run Code Online (Sandbox Code Playgroud) 我有一个UIView类,我用它来拥有一个CALayer.该图层将用于根据触摸绘制线条.
这是类的定义方式:
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self == nil) {
return nil;
}
self.layer.backgroundColor = [UIColor redColor].CGColor;
self.userInteractionEnabled = YES;
path = CGPathCreateMutable();
return self;
}
Run Code Online (Sandbox Code Playgroud)
那么我在touchesBegan,TouchesMoved和touchesEnded上有以下几行......
**touchesBegan**
CGPathMoveToPoint(path, NULL, currentPoint.x, currentPoint.y);
[self.layer setNeedsDisplay];
**touchesMoved**
CGPathAddLineToPoint(path, NULL, currentPoint.x, currentPoint.y);
[self.layer setNeedsDisplay];
**touchesEnded**
CGPathAddLineToPoint(path, NULL, currentPoint.x, currentPoint.y);
[self.layer setNeedsDisplay];
Run Code Online (Sandbox Code Playgroud)
那我有这个
-(void)drawInContext:(CGContextRef)context {
CGContextSetStrokeColorWithColor(context, [[UIColor greenColor] CGColor]);
CGContextSetLineWidth(context, 3.0);
CGContextBeginPath(context);
CGContextAddPath(context, path);
CGContextStrokePath(context);
}
Run Code Online (Sandbox Code Playgroud)
调用touchesBegan/Moved/Ended方法,但永远不会调用此drawInContext方法...
我错过了什么?
谢谢.
PHP的Serializer产生一个字节数组,可通过将其显示为单行字符串var_dump()。此字符串的格式很难读取,尤其是对于诸如数据库中存储的对象之类的方案。
为了读取这些值,是否可以将它们转换为缩进格式的可读字符串?还是在PHP中检索它们的唯一选择,unserialize()然后再执行诸如此类的操作var_dump()?
iphone ×3
objective-c ×3
.net ×1
asp.net-mvc ×1
calayer ×1
cocoa ×1
cron ×1
crontrigger ×1
debugging ×1
exception ×1
formatting ×1
image ×1
macos ×1
nhibernate ×1
opengl ×1
php ×1
pretty-print ×1
quartz.net ×1
readability ×1
rotation ×1
scheduler ×1
spring ×1