Ueditor高亮插件SyntaxHighlighter问题修正1、如果一行代码太长,就会造成代码块过宽,修改shCoreDefault.css,加上word-break:break-all:.syntaxhighlighter { width: 100% !important; margin: .3em 0 .3em 0 !important; position: relative !important; overflow: auto !important; background-color: #f5f5f5 !important; border: 1px solid #ccc !important; border-radius: 4px !important; border-collapse: separate !important; word-break: break-all; }2、双击以后文本框大小不对错位问题,修改shCore.js,为文本框增加高度:/** * Quick code mouse double click handler. */ function quickCodeHandler(e) { var target = e.target, highlighterDiv = findParentElement(target, '.syntaxhighlighter'), container = findParentElement(target, '.container'), textarea = document.createElement('textarea'), highlighter ; if (!container || !highlighterDiv || findElement(container, 'textarea')) return; highlighter = getHighlighterById(highlighterDiv.id); // add source class name addClass(highlighterDiv, 'source'); // Have to go over each line and grab it's text, can't just do it on the // container because Firefox loses all \n where as Webkit doesn't. var lines = container.childNodes, code = …
研究CNTK(七):Python还是BrainScript速度更快?
def create_reader(map_file, mean_file, train): if not os.path.exists(map_file) or not os.path.exists(mean_file): raise RuntimeError("File '%s' or '%s' does not exist. Please run install_cifar10.py from DataSets/CIFAR-10 to fetch them" % (map_file, mean_file)) #…