我一直在努力连接到erlang节点而没有运气.情况如下:
1)我已经"-detached"运行在本地主机上的erlang节点 -sname n1
2)
$ epmd -names
epmd: up and running on port 4369 with data:
name n1 at port 53653
Run Code Online (Sandbox Code Playgroud)
3)尝试连接
$ erl -sname test -remsh n1
...
ERROR: Shell process terminated! (^G to start new job)
$ erl -sname test -setcookie *COOKIE* -remsh n1
...
ERROR: Shell process terminated! (^G to start new job)
$ erl -sname test -setcookie *COOKIE* -remsh n1@localhost
...
ERROR: Shell process terminated! (^G to start new job)
Run Code Online (Sandbox Code Playgroud)
我还应该尝试什么?
UPD:
关注@Odobenus Rosmarus建议:
$ …Run Code Online (Sandbox Code Playgroud) 这是我的情况.
我有带数据表的页面和几个由bean支持的按钮.应该使用一些默认属性初始化Bean.可以根据操作更改属性.我从RequestScoped bean和@PostConstruct注释方法开始.但似乎datatable仅适用于View(Session)作用域.现在我的设置看起来像这样:
@ManagedBean
@ViewScoped
public class ProductsTableBean implements Serializable {
private LazyDataModel<Products> productsData;
@Inject
private ProductsFacade model;
public void onPageLoad() {
// here some defaults are set
// ...
System.err.println("onPageLoad called");
}
public void addRow() {
// andhere some defaults redefined
// ...
System.err.println("addRow called");
}
...
Run Code Online (Sandbox Code Playgroud)
和来自jsf页面的片段:
<p:commandButton action="#{productsTableBean.addRow()}"
title="save"
update="@form" process="@form" >
</p:commandButton>
...
<f:metadata>
<f:event type="preRenderView" listener="#{productsTableBean.onPageLoad}"/>
</f:metadata>
Run Code Online (Sandbox Code Playgroud)
以下是调用顺序中出现的主要问题,我有以下输出:
onPageLoad called
addRow called
onPageLoad called <-- :(
Run Code Online (Sandbox Code Playgroud)
但我希望addRow成为最后一个被调用的动作,如下所示:
onPageLoad called
addRow called
Run Code Online (Sandbox Code Playgroud)
这里有简单的解决方案
与这个班级:
public class Products implements Serializable {
private BigDecimal productId;
private float priority;
public float getPriority() {
return priority;
}
public void setPriority(float priority) {
this.priority = priority;
}
}
Run Code Online (Sandbox Code Playgroud)
在对此类JSON数据进行反序列化时:
{"productId":47552,"priority":78}
Run Code Online (Sandbox Code Playgroud)
得到此错误:
org.codehaus.jackson.map.JsonMappingException:
Can not deserialize instance of float out of FIELD_NAME token
at [Source: org.apache.catalina.connector.CoyoteInputStream@103cf49; line: 1, \
column: 290] (through reference chain: entity.Products["priority"])
Run Code Online (Sandbox Code Playgroud)
但是对于这个数据(优先值周围的报价)
{"productId":47552,"priority":"78"}
Run Code Online (Sandbox Code Playgroud)
效果很好,所以杰克逊(1.9.9)似乎不尊重数值?我怀疑这里出了点问题.
美好的一天.
这是简单的"猜数"片段,它包含单个错误,但编译器使得很难解决错误:
import System.Random
import Control.Monad
import Control.Monad.Cont
main = do
rn <- randomRIO (1,10) :: IO Int
runContT (callCC $ \k -> forever $ do
lift $ putStr "Your number:"
n <- lift (fmap read getLine)
when (n == rn) $ k
lift $ putStrLn $ if (n > rn)
then "Too much"
else "Too little") (return)
putStrLn $ "Good guess! " ++ (show rn)
Run Code Online (Sandbox Code Playgroud)
GHC给出错误:
> simple.hs:11:21:
> Couldn't match expected type `()' against inferred type `m b' …Run Code Online (Sandbox Code Playgroud) 美好的一天,问题是相当noobish,但我坚持下去.
我决定从普通字符串迁移在我的项目,以文字和面临的问题,在源中的所有字符串产生编译错误添加后{ - #语言OverloadedStrings# - },例如网页摘要:
dropWhile (~/= "<li>") tags
Run Code Online (Sandbox Code Playgroud)
现在导致
由于使用`〜=='
t' in the constraints:而产生的文字"<li>"' at ParserOx.hs:93:42-47TagRep t'的模糊类型变量Data.String.IsString t '
这可能有什么问题?
UPD:
是的,我的所有功能都有签名,例如:
getContainer :: [Tag Text] -> [Tag Text]
getContainer tags =
h
where
(h:t) = sections (~== "<div id=\"itemscontainer\">") tags
Run Code Online (Sandbox Code Playgroud) 我在这里发现了两个类似的问题,但是他们没有帮助我,我的代码是:
var grid = Ext.create('Ext.grid.Panel', {
autoScroll: true,
// if set this to any numeric value, then everything works just good, but
// i was hoping that `ExtJS` already can detect browser window height, am i wrong ?
height: '100%',
title: 'Products',
store: store,
itemId: 'product_grid',
columns: [.. columns skipped ...],
plugins: [ rowEditing ],
dockedItems: [ ..addRow button here..]
});
var panel = Ext.create('Ext.panel.Panel', {
autoScroll: true,
items: [
{
xtype: 'productGrid'
}
]
});
Ext.create('Ext.container.Viewport', {
layout: 'fit', …Run Code Online (Sandbox Code Playgroud) 我只是特别学习宏和clojure宏,我很好奇有可能做这样的事情:
(defmacro with-a=hello [f]
`(let [a "hello"] ~f))
(with-a=hello (println a))
Run Code Online (Sandbox Code Playgroud)
这对我不起作用并抛出错误: CompilerException java.lang.RuntimeException: Can't let qualified name: user/a, compiling:(NO_SOURCE_PATH:1)
正如我现在所说的那样,scheme的define-syntax允许做类似的事情,但是有没有这样的方法呢?
这个psql会话片段应该是不言自明的:
psql (9.1.7)
Type "help" for help.
=> CREATE TABLE languages(language VARCHAR NOT NULL);
CREATE TABLE
=> INSERT INTO languages VALUES ('english'),('french'),('turkish');
INSERT 0 3
=> SELECT language, to_tsvector('english', 'hello world') FROM languages;
language| to_tsvector
---------+---------------------
english | 'hello':1 'world':2
french | 'hello':1 'world':2
turkish | 'hello':1 'world':2
(3 rows)
=> SELECT language, to_tsvector(language, 'hello world') FROM languages;
ERROR: function to_tsvector(character varying, unknown) does not exist
LINE 1: select language, to_tsvector(language, 'hello world')...
^
HINT: No function matches the given …Run Code Online (Sandbox Code Playgroud) 我需要绘制一个大表,不是很大,大约400x400个单元格.但React渲染速度太慢,并且每次单击该单元格时,都应更新单元格,此更新需要相同的时间.有什么建议如何加快它?或者React不适合这样的任务?
这是一个示例(表的大小略有缩小):https: //jsfiddle.net/69z2wepo/15731/
var ROWSC = 400;
var COLSC = 100;
var Hello = React.createClass({
getInitialState: function () {
return {
t: { "1-1": 'c' }
};
},
clicked: function (k) {
var t = this.state.t;
t[k] = t[k] ? 0 : 'c';
this.setState({ t: t });
},
render: function() {
var items = [];
for (var r = 0; r < ROWSC; r++) {
var cols = [];
for (var c = 0; c < COLSC; c++) …Run Code Online (Sandbox Code Playgroud) 美好的一天,我有一个布尔列的网格:
var grid = Ext.create('Ext.grid.Panel', {
...
columns: [{
dataIndex: 'visibleForUser',
text: 'Visible',
editor: {
xtype: 'checkboxfield',
inputValue: 1 // <-- this option has no effect
}
},
...
Run Code Online (Sandbox Code Playgroud)
Grid的商店通过JSON代理远程存储.当我保存或更新行时,生成的JSON看起来像:
{... visibleForUser: false, ... }
Run Code Online (Sandbox Code Playgroud)
正如你看到的,ExtJS的序列化复选框值true或falseJSON条款.我需要自定义这个并序列化,比方说,1以及0任何建议如何实现这一目标?谢谢.