小编Cap*_*ous的帖子

Emacs根据窗口宽度和填充列动态更改字体大小

我在小型上网本上使用Emacs来编写代码,并且我设置了字体大小,使得大约填充列(79)字符填充单个"最大化"窗口的宽度(即相当大的字体大小).但是,如果我并排打开两个窗口,我希望这些窗口中的字体大小自动缩小,以便每个窗口的宽度至少容纳79个字符.

在我开始深入研究这个问题之前(我不擅长Lisp),是否可以在每个调整大小上获取窗口宽度,将其除以填充列,并根据该结果选择等宽字体大小?

size emacs fonts

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

如何关闭Eclipse自动扩展我的项目文件夹?

我正在开发Android(不确定是否重要)关于工作中的可持续项目.我有一个非常大的项目,每个文件夹中有太多文件.每次我在源代码编辑器中单击打开的文件选项卡时,Eclipse都会自动打开文件所在的文件夹.我该怎么办呢?

eclipse directory expand project

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

使用在Windows XP上运行的VS 2012编译MFC程序

我在Windows 7上安装了VS 2012.我想构建一个可以在Windows XP上运行的MFC程序.但是,当我将exe文件移动到Windows XP时,我收到以下错误:"它不是一个有效的win32应用程序".

在互联网上探索之后,我发现我应该安装Visual Studio 2012 Update 1并将平台工具集从"Visual Studio 2012(v110)"更改为"Visual Studio 2012 - Windows XP(v110_xp)".我还将目标机器更改为"MachineX86(/ MACHINE:X86)".这次我在Windows XP上运行exe文件时收到另一个错误:"程序入口点initializecriticalsection无法位于动态库KERNEL32.dll中".

现在我不知道该怎么做:(.我很感激,如果有人可以帮助我:).

请注意,我尝试了一个简单的对话框MFC程序,但没有添加任何代码.

c++ mfc windows-xp

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

如果WebAppContext无法启动,如何取消启动或关闭jetty

我正在使用Maven Jetty插件,有没有办法防止服务器启动或关闭(例如使用maven-jetty-plugin)如果任何bean失败?

这是一个例子:

2013-04-22 11:43:59.327:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.JettyWebAppContext@9a681a{/,file:/opt/bamboo/bamboo-home/xml-data/build-dir/APA-BC-JETTYAPA/src/main/webapp/,STARTING}{file:/opt/bamboo/bamboo-home/xml-data/build-dir/APA-BC-JETTYAPA/src/main/webapp/}
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/classes/applicationContext.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'staticDataService' for bean class [com.etermax.common.service.StaticDataService] conflicts with existing, non-compatible bean definition of same name and class [com.etermax.bingo.api.service.BingoStaticDataService]
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:778)
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:425)
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:770)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:275) …
Run Code Online (Sandbox Code Playgroud)

java spring jetty maven-jetty-plugin

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

阻止SQL Server Management工作室打破我的观点

我有一个完全正常的视图,看起来大致如下:

 WITH xxx AS ( ... ),
      yyy AS ( SELECT ... FROM xxx )

 SELECT ... FROM yyy
Run Code Online (Sandbox Code Playgroud)

很简单,它一直很好用.然而,出现了一种情况,我需要做一个很小的改变xxx.我进入视图编辑器,对xxx进行小的更改,但是当我保存/执行时,服务器管理工​​作室的自动格式突然接管并决定将我的视图更改为:

 WITH yyy AS ( SELECT ... FROM xxx),
      xxx AS ( ... )

 SELECT ... FROM yyy
Run Code Online (Sandbox Code Playgroud)

基本上它没有明显的原因切换我的WITH语句的第一和第二部分!我已经尝试将视图编写脚本到一个新的查询,在那里进行更改并重新创建它,它也做同样的事情.

有没有办法关闭自动格式化??任何其他建议!?

sql format ssms view

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

CSS从高度自动过渡到高度75%

我做了一个css过渡,从高度自动到高度:75%.

CSS-过渡:

-webkit-transition: height 0.5s ease-in-out;
-moz-transition: height 0.5s ease-in-out;
-o-transition: height 0.5s ease-in-out;
transition: height 0.5s ease-in-out;
Run Code Online (Sandbox Code Playgroud)

但它不适用于IE和Firefox.我在谷歌上发现了一些帖子,但无法找到解决方案.

谢谢你的帮助.

css height transition

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

div 中的自动溢出在 ie 中不起作用

这是我的代码http://jsfiddle.net/FbC86/。如果您使用 Chrome 或 Firefox 打开此页面,则单元格内的文本会通过垂直滚动条正确溢出。如果你用 Internet Explorer 打开它,它就不能正常工作。

我需要您的建议,因为我是 Web 开发的新手,我找不到任何解决此问题的方法。提前致谢!部分代码:

CSS

div.main
{
    width:100%;
    height:100%;
    display:block;
    position:relative;
    overflow:auto;
}
div.transparent{
    padding:3em;
    background-color: rgba(255,255,255,0.7);
    display:block;
}
Run Code Online (Sandbox Code Playgroud)

HTML

...
<td colspan="7" valign="top"  style="height:0;" >
    <div class="main">
    <div class="transparent">
Here goes a long text
</div</div></td>
...
Run Code Online (Sandbox Code Playgroud)

html css overflow

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

列宽="自动"时WPF GridSplitter奇怪的行为

我有非常简单的布局,看起来:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" MinWidth="200"></ColumnDefinition>
        <ColumnDefinition Width="5"></ColumnDefinition>
        <ColumnDefinition Width="Auto" MinWidth="50"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <Border Grid.Column="0"
            BorderBrush="Red"
            BorderThickness="2">
        <!-- Any picture-->
        <Image Source="/Resources/PreviewTest.png"></Image>
    </Border>
    <GridSplitter Grid.Column="1" 
                    Width="5"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Stretch"
                    ResizeBehavior="PreviousAndNext"></GridSplitter>
    <Expander Grid.Column="2"
                ExpandDirection="Left"
                BorderBrush="RoyalBlue"
                BorderThickness="2">
        <!-- Any picture-->
        <Image Source="/Resources/PreviewTest.png"></Image>    
    </Expander>
</Grid>
Run Code Online (Sandbox Code Playgroud)

问题是:当我GridSplitter向左拖动时,右栏从窗口边框出来,如动画所示.我发现当第三列的宽度设置为"Auto"(Width="Auto")时会发生这种情况.如果我设置Width="*" GridSplitter工作正常,第三个Column不从窗口边框出去.那么为什么Width="Auto"会发生呢?

示范

wpf column-width gridsplitter

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

Bullet 中的凹面碰撞检测

我是 Bullet 新手,如果我的问题对您来说很琐碎,我提前道歉。

我需要从 .stl 文件加载一组凹三角形网格并执行碰撞检测。用户可以移动对象。从用户手册中,我读到:“凹三角形网格:对于静态世界环境,表示静态三角形网格的一种非常有效的方法是使用 btBvhTriangleMeshShape。”

因此,我的问题是: - Bullet 可以检测使用 BvhTriangleMeshShape 建模的凹面网格对象之间的碰撞吗?- contactTest 和 CollisionWorld::PerformDiscreteCollisionDetection() 之间的真正区别是什么 - 我是否需要为凹面碰撞检测指定不同的碰撞算法?

我正在使用BulletSharp维护的 Bullet C# 包装器。我所做的是设置我的子弹环境:

CollisionConfiguration bt_collision_configuration;
CollisionDispatcher bt_dispatcher;
BroadphaseInterface bt_broadphase;
CollisionWorld bt_collision_world;

double scene_size = 500;
uint max_objects = 16000;

bt_collision_configuration = new DefaultCollisionConfiguration();
bt_dispatcher = new CollisionDispatcher(bt_collision_configuration);

float sscene_size = (float)scene_size;
Vector3 worldAabbMin = new Vector3(-sscene_size, -sscene_size, -sscene_size);
Vector3 worldAabbMax = new Vector3(sscene_size, sscene_size, sscene_size);
bt_broadphase = new AxisSweep3_32Bit(worldAabbMin, worldAabbMax, max_objects);
bt_collision_world = new CollisionWorld(bt_dispatcher, bt_broadphase, bt_collision_configuration);    [/code] …
Run Code Online (Sandbox Code Playgroud)

c# concave collision-detection bulletphysics

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

我可以将IntelliJ设置为自动缩进代码体吗?

问题1:IntelliJ可以设置为在创建新行时自动缩进代码体吗?

这是我的意思的一个例子:

我有这个方法:

    public static void main(String[] args)
        {
            System.out.println("Hi there.");
        }
Run Code Online (Sandbox Code Playgroud)

在键入表达式后按下返回键,我得到:

    public static void main(String[] args)
        {
            System.out.println("Hi there.");
        // the new line aligns itself with the braces.
        }
Run Code Online (Sandbox Code Playgroud)

我希望它能做到这一点:

    public static void main(String[] args)
        {
            System.out.println("Hi there.");
            // the new line aligns itself with the preceding line
        }
Run Code Online (Sandbox Code Playgroud)

我无法在"设置"下的任何位置找到可以使其成为默认行为的选项.它存在吗?我错过了它还是我在找一只独角兽?

问题2:是否有选项可以默认缩进代码体?如果是这样,它在哪里可以找到?

例:

使用"重新格式化代码..."命令后,我得到:

    public static void main(String[] args)
        {
        System.out.println("Hi there.");
        // the code body is realigned with the braces
        }
Run Code Online (Sandbox Code Playgroud)

是否可以设置IntelliJ来执行此操作,如果可以,我在哪里可以找到该选项?:

    public static void main(String[] args)
        { …
Run Code Online (Sandbox Code Playgroud)

java ide indentation intellij-idea

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