我在Linux上使用节点5.10.0。运行我的脚本时出现一些问题,如下所示
[davea@mydevbox mydir]$ node SkyNet.js 
Validation Complete
/home/davea/node_modules/selenium-webdriver/chrome.js:185
      throw Error(
      ^
Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and   ensure it can be found on your PATH.
    at Error (native)
    at new ServiceBuilder (/home/davea/node_modules/selenium-webdriver/chrome.js:185:13)
    at getDefaultService (/home/davea/node_modules/selenium-webdriver/chrome.js:362:22)
    at Driver (/home/davea/node_modules/selenium-webdriver/chrome.js:771:34)
    at Builder.build (/home/davea/node_modules/selenium-webdriver/builder.js:464:16)
    at Object.<anonymous> (/home/davea/mydir/js/Optimus.js:14:4)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
Run Code Online (Sandbox Code Playgroud)
就是说chromedriver不在我的路上,但我只是从这里下载了合适的版本-http://chromedriver.storage.googleapis.com/index.html?path=2.9 /,如您所见,它是在我的道路上
[davea@mydevbox mydir]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/davea/bin:/home/davea/bin:/usr/lib/chromedriver …Run Code Online (Sandbox Code Playgroud) 我正在使用Rails 5.我当前正在使用Rails内存缓存来缓存数据库查询结果,例如,这是在我的state.rb模型中...
  def self.cached_find_by_iso_and_country_id(iso, country_id)
    if iso
      Rails.cache.fetch("#{iso.strip.upcase} #{country_id}") do
        find_by_iso_and_country_id(iso.strip.upcase, country_id)
      end
    end
  end
Run Code Online (Sandbox Code Playgroud)
我的问题是,如何创建第二个内存中的Rails缓存(我需要一个用于存储我从Internet下载的文件),这不会干扰我上面的查询缓存?我不希望文件缓存中的条目导致我的查询缓存中的条目被逐出.
我正在使用带有ActionCable的Ruby on Rails 5.1.我想使用minitest测试一个特定的方法,并模拟"ActionCable.server.broadcast"调用以验证我发送的数据是否正确
module MyModule
  class Scanner
    def trasmit
    ...
        ActionCable.server.broadcast "my_channel", data: msg_data
Run Code Online (Sandbox Code Playgroud)
但我不知道在我的minitest类中我如何验证ActionCable如何广播正确的消息数据.
我正在使用Maven 3.0.3和JUnit 4.8.1.在我的JUnit测试中,如何读取我的Maven pom.xml文件中定义的project.artifactId?在我的pom中,我有
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myco.pplus2</groupId>
<artifactId>pplus2</artifactId>
Run Code Online (Sandbox Code Playgroud)
但是这在我的JUnit测试中不起作用来设置工件ID ...
@Before
public void setUp() { 
    ...        
    System.out.println( "artifactId:" + System.getProperty("project.build.sourceEncoding") ); 
}   // setUp
Run Code Online (Sandbox Code Playgroud)
以上输出"artifactId:null".无论如何,感谢任何帮助, - 戴夫
我无法弄清楚为什么我从SVN收到这条消息.SVN告诉我某个文件存在冲突.所以我更新了文件......
Daves-MacBook-Pro:didoclient davea$ svn up src/test/java/org/myco/myproject/dao/AccessCodeDAOTest.javaUpdating 'src/test/java/org/myco/myproject/dao/AccessCodeDAOTest.java':
At revision 27.
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试并立即提交后,我收到的消息是该文件仍然存在冲突...
Daves-MacBook-Pro:didoclient davea$ svn commit -m "… my message ..."
svn: E155015: Commit failed (details follow):
svn: E155015: Aborting commit: '/Users/davea/Dropbox/workspace/didoclient/src/test/java/org/myco/myproject/dao/AccessCodeDAOTest.java' remains in conflict
Run Code Online (Sandbox Code Playgroud)
这是怎么回事?我如何提交我的文件? - 戴夫
我在Mac 10.9.5上使用Eclipse Kepler.我使用m2e Eclipse插件导入了许多Maven项目.所有这些项目都是父母的孩子.当我查看各个子pom.xml文件中的"Overview"时,我看到如下内容:
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:write-project-properties (execution: default, phase: process-resources)
Run Code Online (Sandbox Code Playgroud)
我希望Eclipse在适当的时候执行这些生命周期阶段,但我不知道如何做到这一点.当我选择Eclipse的建议时......
Permanently mark goal write-project-properties in pom.xml as ignore
Run Code Online (Sandbox Code Playgroud)
我在提示"选择要放置忽略的位置"时选择了父pom.xml文件,但是,当我在Eclipse编辑器中查看子pom.xml文件时,错误不会消失.如何映射m2e未涵盖的生命周期阶段?
编辑:
根据答案,我去了Eclipse - > Preferences - > Maven - > Lifecycle Mappings,点击了"Open Workspace Lifecycle Mappings Metadata",并根据建议编辑了文件......
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <versionRange>2.3.3</versionRange>
                <goals>
                    <goal>xmlbeans</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <ignore />
            </action>
        </pluginExecution>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <versionRange>[1.0-alpha-2,)</versionRange>
                <goals>
                    <goal>write-project-properties</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <execute />
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>
Run Code Online (Sandbox Code Playgroud)
即使在重新启动Eclipse之后,当我打开子pom.xml文件时,"生命周期配置未涵盖的插件执行"错误仍然像以前一样.
我正在使用Hibernate 5.1.0.Final和ehcache以及Spring 3.2.11.RELEASE.我@Cacheable在其中一个中设置了以下注释DAO:
@Override
@Cacheable(value = "main")
public Item findItemById(String id)
{
    return entityManager.find(Item.class, id);
}
Run Code Online (Sandbox Code Playgroud)
返回的项目有许多关联,其中一些是懒惰的.例如,它(最终)引用该字段:
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "product_category", joinColumns = { @JoinColumn(name = "PRODUCT_ID") }, inverseJoinColumns = { @JoinColumn(name = "CATEGORY_ID") })
private List<Category> categories;
Run Code Online (Sandbox Code Playgroud)
我注意到在我标记的一个方法中@Transactional,当从二级缓存中检索到上述方法时,我在尝试迭代categories字段时得到以下异常:
@Transactional(readOnly=true)
public UserContentDto getContent(String itemId, String pageNumber) throws IOException
{
    Item Item = contentDao.findItemById(ItemId);
   …
   // Below line causes a “LazyInitializationException” exception
   for (Category category : item.getParent().getProduct().getCategories())
    {
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪是:
16:29:42,557 INFO  [org.directwebremoting.log.accessLog] (ajp-/127.0.0.1:8009-18) …Run Code Online (Sandbox Code Playgroud) 我想创建一个居中的表单.
HTML:
<div id="profileContainer”>…</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#profileContainer {
  border-radius: 25px;
  background: #ffffff;
  padding: 10px;
  width: 100%;
  max-width: 760px;
  display: inline-block;
  position: fixed;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}
Run Code Online (Sandbox Code Playgroud)
问题是当屏幕垂直缩短时,表单的一部分会被隐藏,并且没有滚动条可以使其可访问:JSFiddle.
我怎么出现滚动条时,单独的垂直空间不足,但请保留我的div水平居中和垂直方向时,有是足够的空间?
我正在使用jQuery 1.12.我有一个带LI元素的UL风格.当DIV具有焦点时,我使用以下代码使用键盘上的向上或向下箭头选择这些元素...
 $(".select").bind('keydown', function(event) {
    var currentElement = $(this).find(".select-options li.selected");
    if (currentElement.length == 0) {
        currentElement = $(this).find(".select-options li")[0];
      $(currentElement).addClass("selected");
      return;
    }       // if
    var nextElement;
    switch(event.keyCode){
    // case up
    case 38:
        nextElement = $(this).find(".select-options li")[($(this).find(".select-options li").index(currentElement) - 1) % $(this).find(".select-options li").length];
        break;
    case 40:
        nextElement = $(this).find(".select-options li")[($(this).find(".select-options li").index(currentElement) + 1) % $(this).find(".select-options li").length];
      break;
    }
    $(this).find(".select-options li").removeClass("selected");
    if(nextElement !== null) {
        $(nextElement).addClass("selected");
    }
 });
Run Code Online (Sandbox Code Playgroud)
问题是,如果你不断点击向下键(例如),最终你将无法看到所选项目.如何调整内容以使所选项始终可见?说明问题的小提琴在这里 - http://jsfiddle.net/sge8g5qu/1/.
如何在生产Rails 5.0.1环境中关闭SQL的日志记录?我加了这个
  config.after_initialize do
    ActiveRecord::Base.logger = Rails.logger.clone
    ActiveRecord::Base.logger.level = Logger::INFO
  end
Run Code Online (Sandbox Code Playgroud)
到我的config/environments/production.rb环境,但我仍然看到我的log/production.log文件中记录了SQL.这是我完整的production.rb文件
Rails.application.configure do
  # Settings specified here will take precedence over those in config/application.rb.
  # Code is not reloaded between requests.
  config.cache_classes = true
  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both threaded web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = …Run Code Online (Sandbox Code Playgroud) css ×2
html ×2
maven ×2
actioncable ×1
caching ×1
center ×1
css3 ×1
eclipse ×1
ehcache ×1
hibernate ×1
html-lists ×1
in-memory ×1
java ×1
jquery ×1
junit ×1
lifecycle ×1
linux ×1
logging ×1
m2e ×1
m2eclipse ×1
minitest ×1
mocking ×1
node.js ×1
path ×1
production ×1
scroll ×1
scrollbars ×1
spring ×1
sql ×1
svn ×1