问题列表 - 第25947页

eval-after-load与模式挂钩

设置使用eval-after-load和使用模式挂钩的模式之间有区别吗?

我已经看到一些代码在define-key主模式钩子中使用,而其他一些代码define-keyeval-after-load形式中使用.


更新:

为了更好地理解,下面是使用带有org-mode的eval-after-load和mode钩子的示例.该代码可以运行之前 (load "org")(require 'org)(package-initialize).

;; The following two lines of code set some org-mode options.
;; Usually, these can be outside (eval-after-load ...) and work.
;; In cases that doesn't work, try using setq-default or set-variable
;; and putting them in (eval-after-load ...), if the
;; doc for the variables don't say what to do.
;; Or use Customize interface.
(setq org-hide-leading-stars t) …
Run Code Online (Sandbox Code Playgroud)

emacs elisp

67
推荐指数
1
解决办法
1万
查看次数

来自类的DataAnnotations验证

我在一个纯C#应用程序的项目中使用DataAnnotations,根据DataAnnotations属性验证模型/文档的最佳方法是什么?

c# data-annotations

4
推荐指数
2
解决办法
3445
查看次数

如何从Spring获取Hibernate Configuration对象?

我试图在我的非Spring代码中获取Spring定义的Hibernate配置和SessionFactory对象.以下是我的applicationContext.xml文件中的定义:

码:

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
   <property name="hibernateProperties">
    <props>
      <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
      <prop key="hibernate.show_sql">true</prop>
      <prop key="hibernate.hbm2ddl.auto">update</prop>
      <prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
      <prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
    </props>
   </property>
   <property name="dataSource">
    <ref bean="dataSource"/>
   </property>
    </bean>
Run Code Online (Sandbox Code Playgroud)

如果我现在调用getBean("sessionFactory"),我返回一个$ Proxy0对象,它似乎是Hibernate SessionFactory对象的代理.但这不是我想要的 - 我需要LocalSessionFactoryBean本身,因为我需要访问Configuration以及SessionFactory.

我需要Configuration对象的原因是我们的框架能够使用Hibernate的动态模型在运行时自动插入映射; 这要求我们更改配置并重建SessionFactory.实际上,我们所要做的就是获取Spring中已经存在的Hibernate配置,以便那些已经在Spring中拥有该信息的客户不需要将它复制到hibernate.cfg.xml文件中使用我们的Hibernate功能.

spring hibernate

25
推荐指数
1
解决办法
1万
查看次数

锁定RAD Studio内部浏览器安全性

我使用Firefox作为我的Web浏览器,主要用于访问加载项,如Flashblock和No-script.我昨天注意到用于欢迎页面等的RAD Studio内部浏览器启用了脚本和Active X等.有没有办法禁用脚本,或者更好的是,阻止内置浏览器中对非本地源的所有访问?

browser delphi security delphi-2009

2
推荐指数
1
解决办法
277
查看次数

在概念数据模型上表示外键是否正确?

在概念数据模型上表示外键是否正确,还是应该只在进行关系模型时引入外键?

database-design

1
推荐指数
1
解决办法
7288
查看次数

更改列表中嵌套元素的字体大小

我有一个ul元素的嵌套列表.我希望每个级别的字体大小减少几个像素.

因此,例如,第一个li元素的字体大小为18px,然后嵌套元素的字体大小为16px,其中任何嵌套元素的字体大小为14px等.但是一旦字体大小达到一定大小,例如8px,我会喜欢停止让它们变小.

这些列表是动态生成的,所以我无法知道它们有多深,所以不能只是将css硬编码到某个级别.在css或JQuery中有没有办法可以应用这种类型的格式?

css html-lists

5
推荐指数
2
解决办法
8920
查看次数

你能解释输出吗?

以下代码的输出应该是什么?为什么?我有点困惑.

int a =10;
printf("%d %d %d",a,a=a+10,a);
Run Code Online (Sandbox Code Playgroud)

c c++

5
推荐指数
3
解决办法
359
查看次数

Python,独立地向目录字符串,os添加尾部斜杠

如果尾部斜杠不存在,如何向目录字符串添加尾部斜杠(/对于*nix,\对于win32)?谢谢!

python string

103
推荐指数
3
解决办法
5万
查看次数

使用VisualSVN Server和Cruisecontrol.net检查内容集成中的修改失败

我正在使用CruiseControl.net进行持续集成.我使用VisualSvn服务器为我的项目创建了一个存储库(使用Windows身份验证).两台服务器都托管在同一系统中(Os-Microsoft Windows Server 2003 sp2).

当我使用CruiseControl.net强制构建项目时," 失败的任务:Svn:CheckForModifications "显示为消息.当我检查构建报告时,它说如下:

BUILD EXCEPTION 
Error Message: ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: OPTIONS of 'https://system:8443/svn/folder/Source': **Server certificate verification failed: issuer is not trusted** (https://system:8443). Process command: C:\Program Files\VisualSVN Server\bin\svn.exe log **sameUrlAbove** -r "{2010-04-29T08:35:26Z}:{2010-04-29T09:04:02Z}" --verbose --xml --username ccnetadmin --password cruise --non-interactive --no-auth-cache
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Svn.GetModifications (IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request) 
Run Code Online (Sandbox Code Playgroud)

ccnet.config中的我的SourceControl节点如下所示:

<sourcecontrol type="svn">
  <executable>C:\Program Files\VisualSVN Server\bin\svn.exe</executable>
  <trunkUrl>
    check out …
Run Code Online (Sandbox Code Playgroud)

svn cruisecontrol.net visualsvn-server

5
推荐指数
2
解决办法
3813
查看次数

当有人移除我的主题页脚的电源时,如何发出通知提醒

我的页脚上的示例链接

$powered = 'Powered by <a href="htp://stackoverflow.com">Stackoverflow</a>';
Run Code Online (Sandbox Code Playgroud)

主题文件

<?php echo $powered; ?>
Run Code Online (Sandbox Code Playgroud)

如果$powered从我的页脚中删除并错误/提醒通知它如何制作.

die('Do not remove the powered link')

php

0
推荐指数
1
解决办法
122
查看次数