我需要在WPF控件层次结构中搜索与给定名称或类型匹配的控件。我该怎么做呢?

如果我从脚本中运行这些命令:

#my.sh
PWD=bla
sed 's/xxx/'$PWD'/'
...
$ ./my.sh
xxx
bla

这很好。

但是,如果我运行:

#my.sh
sed 's/xxx/'$PWD'/'
...
$ ./my.sh
$ sed: -e expression #1, char 8: Unknown option to `s' 

我在教程中读到,要从shell中替换环境变量,你需要停止,并“引用”$varname部分,这样它就不会直接被替换,这就是我所做的,并且只有在变量刚刚定义之前才有效。

我如何才能让sed识别$var作为一个环境变量,因为它是在shell中定义的?

我用的是Windows 10, Node 5.6.0和npm 3.6.0。我试图安装角材料和mdi到我的工作文件夹。NPM安装角材质mdi错误:

+-- angular@1.5.0

+-- UNMET PEER DEPENDENCY angular-animate@^1.5.0

+-- UNMET PEER DEPENDENCY angular-aria@^1.5.0

+-- angular-material@1.0.6

+-- UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57

npm WARN enoent ENOENT: no such file or directory, open
'C:\Users\xxxxx\Desktop\ngClassifieds\package.json' 

npm WARN angular-material@1.0.6 requires a peer of
angular-animate@^1.5.0 but none was installed. 

npm WARN angular-material@1.0.6 requires a peer of angular-aria@^1.5.0
but none was installed. 

npm WARN angular-material@1.0.6 requires a peer of
angular-messages@^1.5.0 but none was installed.

如何解决这个问题来安装AngularJS材质和MDI ?

我想按两列对数据帧进行分组,然后在这些组中对聚合的结果进行排序。

In [167]: df

Out[167]:
   count     job source
0      2   sales      A
1      4   sales      B
2      6   sales      C
3      3   sales      D
4      7   sales      E
5      5  market      A
6      3  market      B
7      2  market      C
8      4  market      D
9      1  market      E


In [168]: df.groupby(['job','source']).agg({'count':sum})

Out[168]:
               count
job    source       
market A           5
       B           3
       C           2
       D           4
       E           1
sales  A           2
       B           4
       C           6
       D           3
       E           7

我现在想在每个组中按降序对“count”列排序,然后只取前三行。得到类似这样的东西:

                count
job     source
market  A           5
        D           4
        B           3
sales   E           7
        C           6
        B           4

I am trying to determine whether there is an entry in a Pandas column that has a particular value. I tried to do this with if x in df['id']. I thought this was working, except when I fed it a value that I knew was not in the column 43 in df['id'] it still returned True. When I subset to a data frame only containing entries matching the missing id df[df['id'] == 43] there are, obviously, no entries in it. How to I determine if a column in a Pandas data frame contains a particular value and why doesn't my current method work? (FYI, I have the same problem when I use the implementation in this answer to a similar question).

我刚刚发现ASP中的每个请求。网络web应用程序在请求开始时获得一个会话锁,然后在请求结束时释放它!

如果你不明白这其中的含义,就像我一开始一样,这基本上意味着:

Any time an ASP.Net webpage is taking a long time to load (maybe due to a slow database call or whatever), and the user decides they want to navigate to a different page because they are tired of waiting, they can't! The ASP.Net session lock forces the new page request to wait until the original request has finished its painfully slow load. Arrrgh. Anytime an UpdatePanel is loading slowly, and the user decides to navigate to a different page before the UpdatePanel has finished updating... they can't! The ASP.Net session lock forces the new page request to wait until the original request has finished its painfully slow load. Double Arrrgh!

那么有什么选择呢?到目前为止,我想出了:

Implement a Custom SessionStateDataStore, which ASP.Net supports. I haven't found too many out there to copy, and it seems kind of high risk and easy to mess up. Keep track of all requests in progress, and if a request comes in from the same user, cancel the original request. Seems kind of extreme, but it would work (I think). Don't use Session! When I need some kind of state for the user, I could just use Cache instead, and key items on the authenticated username, or some such thing. Again seems kind of extreme.

我真不敢相信ASP。Net微软团队在4.0版本的框架中留下了如此巨大的性能瓶颈!我是不是遗漏了什么明显的东西?为会话使用ThreadSafe集合有多难?

在SortedList<TKey,TValue>和SortedDictionary<TKey,TValue>之间有任何真正的实际区别吗?在某些情况下,你会特别使用其中一种而不是另一种吗?

我试图读取一个大的csv文件(aprox。6 GB)在熊猫和我得到一个内存错误:

MemoryError                               Traceback (most recent call last)
<ipython-input-58-67a72687871b> in <module>()
----> 1 data=pd.read_csv('aphro.csv',sep=';')

...

MemoryError: 

有什么帮助吗?

我有3个CSV文件。每个数据框架的第一列都是人的(字符串)名,而每个数据框架中的所有其他列都是人的属性。

我如何将所有三个CSV文档“联接”在一起,以创建一个单一的CSV,其中每行都具有人的字符串名称的每个唯一值的所有属性?

pandas中的join()函数指定我需要一个多索引,但我对分层索引方案与基于单个索引进行连接有什么关系感到困惑。

有一个API谷歌保持?我想为谷歌Keep做一个windows 8的应用程序,这样它就可以与你的手机同步。

我查看了Drive SDK,因为谷歌Keep是谷歌Drive的扩展,但我找不到它。