首页 \ 问答 \ B2B hybris模块gen不起作用(B2B hybris module gen does not work)

B2B hybris模块gen不起作用(B2B hybris module gen does not work)

在使用b2b_acc配方后,我想要做模块生成。 喜欢:

ant modulegen -Dinput.module=accelerator -Dinput.name=qqq -Dinput.package=com.fffff.sampa -Dinput.template=develop

但它会给出错误

hybris "java.util.regex.PatternSyntaxException": Illegal repetition near index 0 ${YMODULE_TOKEN}(.*)

并没有关于如何为b2b做的信息。

我能做什么? 我需要开发一个B2B网站。 我应该使用extgen吗?

现在它给出了这个:

java.lang.IllegalArgumentException:由于重复属性'ConsignmentProcess.done(java.lang.Boolean):((fulfilmentprocess)):: YAttributeDescriptor [fulfilmentprocess-items.xml:无法将名称空间((fulfilmentprocess))合并到(() 18(AttributeTagListener)] [PROPERTY]'vs'ConsignmentProcess.done(java.lang.Boolean):((yacceleratorfulfilmentprocess)):: YAttributeDescriptor [yacceleratorfulfilmentprocess-items.xml:18(AttributeTagListener)] [PROPERTY]'


AFter using b2b_acc recipe, i want to do module gen. like:

ant modulegen -Dinput.module=accelerator -Dinput.name=qqq -Dinput.package=com.fffff.sampa -Dinput.template=develop

but it gives error of

hybris "java.util.regex.PatternSyntaxException": Illegal repetition near index 0 ${YMODULE_TOKEN}(.*)

And there is no information about how to do for b2b.

What can i do? I need to develop a b2b website. Should i use extgen?

Now it gives this:

java.lang.IllegalArgumentException: cannot merge namespace ((fulfilmentprocess)) into (()) due to duplicate attribute 'ConsignmentProcess.done(java.lang.Boolean):((fulfilmentprocess))::YAttributeDescriptor[fulfilmentprocess-items.xml:18(AttributeTagListener)][PROPERTY]' vs 'ConsignmentProcess.done(java.lang.Boolean):((yacceleratorfulfilmentprocess))::YAttributeDescriptor[yacceleratorfulfilmentprocess-items.xml:18(AttributeTagListener)][PROPERTY]'


原文:https://stackoverflow.com/questions/50233675
更新时间:2019-12-31 14:51

最满意答案

我同意Calumn:DFS是最简单的方法。 这是一个类似python的伪代码的简单解决方案。 它会将解决方案打印为“L”,“R”,“U”,“D”的序列,以指示向左,向右,向上或向下。

def flood(x,y,story):
  if (visited[x][y] or map[x][y]=='0'): return;
  visited[x][y]=True;
  if (map[x][y]=='3'): 
    print 'done. The path is: '+story
    return
  if (x<len(a[0])): flood(x+1,y,story+'R')
  if (y<len(a)): flood(x,y+1,story+'D')
  if (x>0): flood(x-1,y,story+'L')
  if (y>0): flood(x,y-1,story+'U')

def solve(map):
  visited = array_of_false_of_same_size_as(map)
  x,y = find_the_two(map)
  flood(x,y,'')

一旦找到解决方案就使其停止的优化作为练习留给读者(你可以使洪水返回一个布尔值来指示它是否找到了什么,或使用全局标志)。

(ps我做了这个回答社区维基,因为我只是澄清了Calumn的答案。我不能说太多的功劳)

广度优先搜索版本,也在Python中

对于它的价值而言,只是为了表明广度优先搜索并不复杂,Python中的实际可运行程序:

def find(grid, xstart=0, ystart=0):
  # Maps (xi,yi) to (x(i-1), y(i-1))
  prev = {(xstart, ystart):None}

  # Prepare for the breadth-first search
  queue = [(xstart, ystart)]
  qpos = 0
  # Possibly enqueue a trial coordinate
  def enqueue(prevxy, dx, dy):
    x = prevxy[0] + dx
    y = prevxy[1] + dy
    xy = (x, y)
    # Check that it hasn't been visited and the coordinates
    # are valid and the grid position is not a 0
    if (xy not in prev
        and x >= 0 and x < len(grid)
        and y >= 0 and y < len(grid[x])
        and grid[x][y] != 0):
      # Record the history (and the fact that we've been here)
      prev[xy] = prevxy
      # If we found the target, signal success
      if grid[x][y] == 3:
        return xy
      # Otherwise, queue the new coordinates
      else:
        queue.append(xy)
        return None

  # The actual breadth-first search
  while qpos < len(queue):
    xy = queue[qpos]
    qpos += 1
    found = (  enqueue(xy, 1, 0)
            or enqueue(xy, 0, 1)
            or enqueue(xy, -1, 0)
            or enqueue(xy, 0, -1))
    if found: break

  # Recover the path
  path = []
  while found:
    path.append(found)
    found = prev[found]
  path.reverse()
  return path

# Test run    
grid = [ [2,1,1,1,1,1,1,1,1,0,0,0,0,0]
       , [0,0,0,0,0,0,1,1,0,0,0,0,0,0]
       , [0,0,0,0,1,1,1,1,1,1,1,1,1,1]
       , [0,0,0,0,1,1,1,1,1,0,0,1,1,1]
       , [0,0,0,0,1,1,1,0,0,0,0,1,0,1]
       , [0,0,0,0,1,1,1,1,1,0,0,1,1,3]
       ]
for x, y in find(grid): grid[x][y]='*'
print '\n'.join(''.join(str(p) for p in line) for line in grid)

输出:

*******1100000
000000*1000000
000011******11
00001111100*11
00001110000*01
00001111100***

I agree with Calumn: DFS is the simplest approach here. Here is a simple solution in python-like pseudocode. It will print the solution as a sequence of 'L','R',U','D' to indicate left,right,up, or down.

def flood(x,y,story):
  if (visited[x][y] or map[x][y]=='0'): return;
  visited[x][y]=True;
  if (map[x][y]=='3'): 
    print 'done. The path is: '+story
    return
  if (x<len(a[0])): flood(x+1,y,story+'R')
  if (y<len(a)): flood(x,y+1,story+'D')
  if (x>0): flood(x-1,y,story+'L')
  if (y>0): flood(x,y-1,story+'U')

def solve(map):
  visited = array_of_false_of_same_size_as(map)
  x,y = find_the_two(map)
  flood(x,y,'')

The optimization of making it stop as soon as it finds a solution is left as an exercise to the reader (you could make flood return a boolean to indicate if it found something, or use a global flag).

(p.s. I made this answer community wiki since I'm just clarifying Calumn's answer. I can't claim much credit)

Breadth-First Search version, also in Python

For what it's worth, and just to show that breadth-first search is not that complicated, an actual runnable program in Python:

def find(grid, xstart=0, ystart=0):
  # Maps (xi,yi) to (x(i-1), y(i-1))
  prev = {(xstart, ystart):None}

  # Prepare for the breadth-first search
  queue = [(xstart, ystart)]
  qpos = 0
  # Possibly enqueue a trial coordinate
  def enqueue(prevxy, dx, dy):
    x = prevxy[0] + dx
    y = prevxy[1] + dy
    xy = (x, y)
    # Check that it hasn't been visited and the coordinates
    # are valid and the grid position is not a 0
    if (xy not in prev
        and x >= 0 and x < len(grid)
        and y >= 0 and y < len(grid[x])
        and grid[x][y] != 0):
      # Record the history (and the fact that we've been here)
      prev[xy] = prevxy
      # If we found the target, signal success
      if grid[x][y] == 3:
        return xy
      # Otherwise, queue the new coordinates
      else:
        queue.append(xy)
        return None

  # The actual breadth-first search
  while qpos < len(queue):
    xy = queue[qpos]
    qpos += 1
    found = (  enqueue(xy, 1, 0)
            or enqueue(xy, 0, 1)
            or enqueue(xy, -1, 0)
            or enqueue(xy, 0, -1))
    if found: break

  # Recover the path
  path = []
  while found:
    path.append(found)
    found = prev[found]
  path.reverse()
  return path

# Test run    
grid = [ [2,1,1,1,1,1,1,1,1,0,0,0,0,0]
       , [0,0,0,0,0,0,1,1,0,0,0,0,0,0]
       , [0,0,0,0,1,1,1,1,1,1,1,1,1,1]
       , [0,0,0,0,1,1,1,1,1,0,0,1,1,1]
       , [0,0,0,0,1,1,1,0,0,0,0,1,0,1]
       , [0,0,0,0,1,1,1,1,1,0,0,1,1,3]
       ]
for x, y in find(grid): grid[x][y]='*'
print '\n'.join(''.join(str(p) for p in line) for line in grid)

Output:

*******1100000
000000*1000000
000011******11
00001111100*11
00001110000*01
00001111100***

相关问答

更多
  • 可以通过检索用户的主目录 String userHomeDir = System.getProperty("user.home"); 请参阅系统属性 The user's home directory can be retrieved via String userHomeDir = System.getProperty("user.home"); See System Properties
  • 也许你不需要push position.push(_e.target); ,只需将光标放到最后,光标没有更多目标后,可以将光标初始化回第一个节点,不要忘记你访问的每个节点都必须设置为true maybe you don't need push position.push(_e.target); , just let the cursor in to the end , after the cursor hasn't more target , you can initial the cursor to ba ...
  • 我将从有向图开始,每个节点代表你的数字加上额外的自由度(由于约束)。 例如,您可以将此视为另一个数字添加到您的号码中,代表“数字最后更改”。 例如,您以1001[0]并且此节点连接到 1001[0] -> 2001[1] 1001[0] -> 0001[1] 1001[0] -> 1101[2] 1001[0] -> 1011[3] 1001[0] -> 1002[4] 1001[0] -> 0000[4] 或2001[1]至 2001[1] -> 2101[2] 2001[1] -> 2011[3] 2 ...
  • 也许我疯了,但每当我看到涉及断开的连续区域的问题时,我认为不相交的集合 。 不相交集是为非常有效的合并而设计的集合,如果你试图找到#的许多区域是否连接,那么合并就是你做的很多。 将地图上的每个位置放入其自己的不相交集中。 包含位置的任何集合最终都将包含您可以从中移动的所有位置。 怎么样? 我们在地图上走动,任何时候我们可以从一个地方移动到另一个地方,我们合并集合。 你应该采取什么顺序采取这些步骤? 从某个地方洪水填充整个地图 - 从每个位置进行洪水填充,再到您不是来自的任何邻居。 如果X与Y在同一设置中,则 ...
  • 听起来你只是想要一个线性变换。 喜欢 Xt = (((X'-X)/T)*t)+X, Yt = (((Y'-Y)/T)*t)+Y 或者在英语中,时间t处的图块的坐标是沿着其路径的t / total_frames长度。 如果你不想避开障碍,A *就是矫枉过正。 It sounds like you just want a linear transformation. Like Xt = (((X'-X)/T)*t)+X, Yt = (((Y'-Y)/T)*t)+Y Or in English the coo ...
  • 我同意Calumn:DFS是最简单的方法。 这是一个类似python的伪代码的简单解决方案。 它会将解决方案打印为“L”,“R”,“U”,“D”的序列,以指示向左,向右,向上或向下。 def flood(x,y,story): if (visited[x][y] or map[x][y]=='0'): return; visited[x][y]=True; if (map[x][y]=='3'): print 'done. The path is: '+story return ...
  • 这是一个粗略的方法: 让入口成为最初的起点。 选择一个尚未到达的目标。 执行广度优先(或深度优先)搜索以找到该目标的路径,并标记沿该路径遇到的任何其他目标。 如果已找到所有目标,则停止。 让所选目标所在的房间成为下一个起点。 转到(2)。 根据我的理解,加入所有细分市场所形成的道路将满足您的要求。 Here's a crude approach: Let the entrance be the initial starting point. Select one target not yet reached ...
  • 我会把音调分成10x10像素网格。 您的路由不必像系统的其他部分那样精细,它会使算法占用更少的内存。 正如克里斯所说,选择合适的启发式算法是让算法正常运行的关键。 I would break the pitch down into 10x10 pixel grid. Your routing does not have to be as finely grained as the rest of your system and it makes the algorithm take up far less ...
  • 当您检测到更改时,您可以设置目标并插入目标直到达到它,而不是立即跳到新的笔触宽度。 你的mStrokes需要是Float而不是Integer 。 private static final float STROKE_DELTA = 0.0001f; // for float comparison private static final float STROKE_INCREMENT = 0.01f; // amount to interpolate private float currentStroke = ...
  • 在你的问题中,在A *中,当你访问一个点(x,y线)时,你不会再次访问同一点。 原因是在您的问题中,状态是网格中的位置,并且每个门的状态(打开或关闭)。 所以在开始时,在您的示例中,初始状态为(3,1,{false})。 (错误表示门已关闭)。 当你到达'!' 位置,新状态将是(1,1,{true})所以现在当你到达门时,你将通过门。 In your problem, it is not true that in A* when you visit a point (x,y cord) you won't ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)