cat

NHibernate narrowing proxy warning

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are building an ASP.NET MVC application utilizing NH for data access. Using NH Profiler I see a lot of warnings like "WARN: Narrowing proxy to Domain.CaseTask - this operation breaks ==". I get these very often when executing queries for classes which are mapped in a table per subclass, for example, using the NH Linq provider: Query<ICaseTask>().Where(c => c.Assignee == Of || c.Operator == Of) where the class CaseTask inherits from Task, triggers the warning. Information about the warning in the internet is scarce and mostly hints that

MYSQL Group by column with 2 rows for each group

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need 2 id for each group. SELECT `id` , `category` . `cat_name` FROM `info` LEFT JOIN `category` ON `info` . `cat_id` = `category` . `cat_id` WHERE `category` . `cat_name` IS NOT NULL GROUP BY `category` . `cat_name` ORDER BY `category` . `cat_name` ASC How to do this? Sample Data: id cat_name 1 Cat - 1 2 Cat - 1 3 Cat - 2 4 Cat - 1 5 Cat - 2 6 Cat - 1 7 Cat - 2 Output Will be: id cat_name 6 Cat - 1 4 Cat - 1 7 Cat - 2 5 Cat - 2 回答1: If you need two arbitrary ids, then use min() and max() : SELECT c . `cat_name` , min ( id ), max

Reading entropy_avail file appears to consume entropy [closed]

匿名 (未验证) 提交于 2019-12-03 08:39:56
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The question have been asked in here http://www.gossamer-threads.com/lists/linux/kernel/1210167 but I don't see an answer. AFAIK /proc/sys/kernel/random/entropy_avail should return the size of available entropy but should not consume it. At least I don't see any reason for that. However, I have been noticing the same thing as OP for at least a year and now I executed in quick succession % cat /proc/sys/kernel/random/entropy_avail 3918 % cat /proc/sys/kernel/random/entropy_avail 3447 % cat /proc/sys/kernel/random/entropy_avail 2878 % cat

Making a stacked area plot using ggplot2

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using the following data structure to try and make a stacked area chart: df <- data . frame ( PopDen = c ( 0.002279892 , 0.002885407 , 0.004291351 , 0.002457731 , 0.006631572 , 0.007578882 , 0.004465446 , 0.007436628 , 0.009001456 , 0.006951703 , 0.003602076 , 0.005695585 , 0.005819783 , 0.007412274 , 0.004931548 , 0.006257411 , 0.008635908 , 0.005438558 , 0.002251421 , 0.006438558 ), DomArea = c ( 253500 , 135270 , 197180 , 131590 , 142210 , 166920 , 125640 , 184600 , 139940 , 126280 , 127760 , 190940 , 133440 , 143510 ,

How to change a string in a function when calling a function?

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm not sure if this is possible but is there a way to change a string that a function prints while calling it from another function? I want to do something like this: def string(): print ("This cat was scared.") def main(): for words in string(): str.replace("cat", "dog") # Print "The do was scared." main() 回答1: As a guess: You wanted string() to return a value the caller can use , instead of just printing something to the screen. So you need a return statement instead of a print call. You want to loop over all of the words in that returned

Group html table rows with HXT in Haskell

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to process a (very poorly defined) html, which has the information grouped in pairs of rows, like this: <html> <body> <table> <tr> <td> <font > <a href="a">ABC</a></font> </td> </tr> <tr> <td height="50"> <font>When:</font><font>19-1-2013</font> <b><font>  </font></b> <font>Where:</font><font>Here</font> <font>Who:</font><font>Me</font> </td> </tr> <tr> <td> <font > <a href="b">EFG</a> </font> </td> </tr> <tr> <td height="50"> <font>When:</font><font>19-2-2013</font> <b><font>  </font></b> <font>Where:</font><font>There</font> <font

Spring Data JPA Specification for a ManyToMany Unidirectional Relationship

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a setup where cats can be owned by many owners, and each owner can own several cats. Given this, I would like to write a specification to help me find all cats with a given owner name. Here is a simple class setup. @Entity public class Cat extends AbstractEntity { @Column private String name; } * No getters/setters for conciseness. Id field is in the superclass. @Entity public class Owner extends AbstractEntity { @Column private String name; @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "OWNER_2_CATS", joinColumns =

Explode in PySpark

匿名 (未验证) 提交于 2019-12-03 07:47:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to transform from a DataFrame that contains lists of words into a DataFrame with each word in its own row. How do I do explode on a column in a DataFrame? Here is an example with some of my attempts where you can uncomment each code line and get the error listed in the following comment. I use PySpark in Python 2.7 with Spark 1.6.1. from pyspark.sql.functions import split, explode DF = sqlContext.createDataFrame([('cat \n\n elephant rat \n rat cat', )], ['word']) print 'Dataset:' DF.show() print '\n\n Trying to do explode: \n'

Howto merge two avi files using ffmpeg?

心不动则不痛 提交于 2019-12-03 07:44:05
问题 I'm unable to merge two avi videos together. google is full of below examples: cat file1.avi file2.avi file3.avi > video_draft.avi after appending the data together using cat above, you need to re-index the draft movie like this: mencoder video_draft.avi -o video_final.avi -forceidx -ovc copy -oac copy Now you're video_final.avi file will be right to go. but it doesn't work for me, the first video is converted and that's it. 回答1: You should look into the concat demux and concat protocol that

.off转.ply(python)

白昼怎懂夜的黑 提交于 2019-12-03 07:18:21
1. 读取.off为N 3点云和M c网格面 def read_off(filename): points = [] faces = [] with open(filename, 'r') as f: first = f.readline() if (len(first) > 4): # Too handle error in .off like OFF492 312 0 n, m, c = first[3:].split(' ')[:] else: n, m, c = f.readline().rstrip().split(' ')[:] n = int(n) m = int(m) for i in range(n): value = f.readline().rstrip().split(' ') points.append([float(x) for x in value]) for i in range(m): value = f.readline().rstrip().split(' ') faces.append([int(x) for x in value]) points = np.array(points) faces = np.array(faces) return points, faces 2. N*3 点云写入ply文件 def export_ply(pc