我正在使用堆栈构建静态链接二进制文件,我尝试向其添加调试符号(以下:https://downloads.haskell.org/~ghc/master/users-guide/debug-info.html).然而GDB报道:no debugging symbols found.
我错过了什么?
我已经加入到ghc-options了在.cabal文件:-g -rtsopts和到ld-options:-static.我使用以下命令构建堆栈:
stack install \
--install-ghc \
--split-objs \
--ghc-options="-fPIC -fllvm -pgmlo opt -pgmlc llc"
Run Code Online (Sandbox Code Playgroud)
GDB调用如下: gdb --args nodebug-exe +RTS -V0
GHC 8.2.1
整个源代码在这里:https://github.com/carbolymer/haskell-missing-debug-symbols
在我的WEB Api 2控制器中,我想从一个站点请求文件并从我的控制器返回该文件.这是代码
public HttpResponseMessage GetLecture()
{
HttpWebRequest request = WebRequest.CreateHttp("http://openmedia.yale.edu/cgi-bin/open_yale/media_downloader.cgi?file=/courses/spring11/phil181/mp3/phil181_01_011111.mp3");
request.Referer = @"http://oyc.yale.edu/courses/";
var receivedResponse = request.GetResponse();
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StreamContent(receivedResponse.GetResponseStream());
response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(receivedResponse.ContentType);
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
response.Content.Headers.ContentDisposition.FileName = "phil181_01_011111.mp3";
response.Content.Headers.ContentLength = receivedResponse.ContentLength;
return response;
}
Run Code Online (Sandbox Code Playgroud)
本地它工作正常,我可以下载文件,但当我部署到Azure时,我得到502错误.Web服务器在充当网关或代理服务器时收到无效响应.
记录显示它在返回响应后失败,因此在方法执行期间没有异常.
这是~50MB的文件.对于较小的文件代码工作正常.
如何使此代码在Azure上运行50 MB文件?
尝试运行时,抛出以下异常(ValueError)
ValueError: Shape () must have rank at least 2
Run Code Online (Sandbox Code Playgroud)
这是针对以下行抛出的:
states_series, current_state = tf.contrib.rnn.static_rnn(cell, inputs_series, init_state)
Run Code Online (Sandbox Code Playgroud)
这里cell定义的地方:
cell = tf.contrib.rnn.BasicLSTMCell(state_size, state_is_tuple=True)
Run Code Online (Sandbox Code Playgroud)
查看RNN和Tesor_shape的规则,我可以看到这是某种张量维度形状问题。据我所知,它没有被BasicLSTMCell视为一个秩为 2 的矩阵?
完整错误:
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/glennhealy/PycharmProjects/firstRNNTest/LSTM-RNN.py
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
Traceback (most recent call last):
File "/Users/glennhealy/PycharmProjects/firstRNNTest/LSTM-RNN.py", line 42, in <module>
states_series, current_state = tf.contrib.rnn.static_rnn(cell, inputs_series, init_state)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/rnn.py", line 1181, in static_rnn
input_shape = first_input.get_shape().with_rank_at_least(2)
File …Run Code Online (Sandbox Code Playgroud) python neural-network lstm tensorflow recurrent-neural-network
我在ubuntu 16.04 VM上进行开发工作
当我处理许多项目时,为了让我的生活更轻松,我使用*.dev域将VirtualDocumentRoot和hosts文件从我的主文件夹中用于服务器站点:
在000-default.conf我有:
<VirtualHost *:80>
VirtualDocumentRoot /home/steve/websites/%-2/%-2/public_html
ServerAlias *.dev
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
然后在主机中我有我正在研究的各种网站:
127.0.0.1 somesite.dev
127.0.0.1 another.dev
127.0.0.1 athirdone.dev
127.0.0.1 blog.athirdone.dev
Run Code Online (Sandbox Code Playgroud)
这样,当我添加一个新项目时,我只需要在网站目录中创建正确的文件夹结构并向主机添加一行,例如,如果我想处理一个新项目somecoolproject.dev,我只需添加一个文件夹:
/home/steve/websites/somecoolproject/somecoolproject/public_html
Run Code Online (Sandbox Code Playgroud)
和主机中的一行:
127.0.0.1 somecoolproject.dev
Run Code Online (Sandbox Code Playgroud)
我很高兴去.
无论如何,我现在工作的几乎所有内容都运行在https上,并且许多项目都有代码来强制执行此操作,无论是在源代码还是htaccess等,这使得处理开发副本变得很麻烦.
我想在我的开发机器上创建一个自签名证书,理想情况是我不需要为每个项目生成一个新的证书,所以某种通配符*.dev会很棒.
但即使我确实需要为每个项目创建一个新项目,我仍然无法解决如何使用我的设置安装它 - 我找到的所有内容都假设一个固定文档和硬编码的服务器名称.
我有一个带有 TimeIndexed 值的宽 Pandas 数据框,我想使用我制作的 Interval 对象进行选择:
inter = pd.Interval(pd.Timestamp('2017-12-05 16:36:17'),
pd.Timestamp('2017-12-05 22:00:00'), closed='left')
Run Code Online (Sandbox Code Playgroud)
我尝试了 loc 和 iloc 方法,但它们不接受 Interval 实例作为参数。
我可以这样测试时间戳是否在该间隔内:
pd.Timestamp('2017-12-05 22:00:00') in inter
Run Code Online (Sandbox Code Playgroud)
但我无法编写一行来选择数据帧的行。
是否可以使用同时维护多个列np.where?通常,一列是用 维护的np.where,所以我的编码如下所示:
df['col1'] = np.where(df[df.condition == 'yes'],'sth', '')
df['col2'] = np.where(df[df.condition == 'yes'], 50.00, 0.0)
Run Code Online (Sandbox Code Playgroud)
但由于我对相同的条件进行了两次测试,我想知道是否可以通过 2 列并在一次运行中填充它们。
我试过这个:
df['col1','col2'] = np.where(df[df.condition == 'yes'],['sth',50.00], ['',0.0])
Run Code Online (Sandbox Code Playgroud)
但这不起作用。有没有办法实现这一点?
我有几百万个表,在一些表中有数十亿行,有一列作为int现在我正在改为bigint.我尝试使用SSMS更改数据类型,并在事务日志已满几小时后失败.
我采用的另一种方法是创建一个新列并开始批量更新旧列到新列的值,通过将ROWCOUNT属性设置为100000,它可以工作,但速度非常慢,并且它声明了完整的服务器内存.使用这种方法,可能需要几天时间才能完成,而且在生产中是不可接受的.
更改数据类型的快速\最佳方法是什么?源列不是标识列和重复列,并且允许为null.该表有其他列的索引,禁用索引会加快进程吗?是否会添加Begin Tran和Commit帮助?
我一直在用fancybox搞砸.我在CakePHP框架中工作,并创建了一个管理面板.这个面板有几个选项,我通过AJAX加载到页面本身的Div.
现在,当我在这个div中放置一个图像并尝试使用Fancybox时,当我点击一个图像(放大它)时出现此错误:
Uncaught TypeError: Cannot call method 'hide' of undefined
N
I
b.fn.fancybox
f.event.dispatch
f.event.add.h.handle.i
Run Code Online (Sandbox Code Playgroud)
现在这是我的ajax加载器(functions.js)
$(".cmsPage").click(function() {
var url = $(this).attr("href");
$.ajax({
url: url,
success: function(data){
$("#admin_wrapper").fadeIn('slow');
$("#admin_content").fadeIn('slow');
$("#admin_close").fadeIn('slow');
$("#admin_content").html(data);
}
});
return false;
});
Run Code Online (Sandbox Code Playgroud)
admin_content是显示图像的位置:
#admin_content{
display:none;
position:absolute;
z-index:10;
background-color:#fff;
opacity:1;
width:1000px;
min-height:500px;
top:1%;
color:black;
padding:10px;
margin:10px;
border:solid black 1px;
border-radius:5px;
}
Run Code Online (Sandbox Code Playgroud)
但是,如果我去页面本身(不使用ajax)它完全正常.
有什么东西可以推翻fancybox吗?这个错误对我来说并不清楚.我在这里尝试了一切但是我没有使用wordpress.
我正在用libgdx开发一个小游戏,在我的屏幕上我希望有一个标签(包裹在一个表格中),其中有一个可点击的文本链接(带下划线或颜色不同),如下所示:
您可以在此处查看代码
编辑:
我试过的是:
HorizontalGroup monGroup = new HorizontalGroup();
Label howRotationRep = new Label("They have been based on the information provided on this ", new Label.LabelStyle(game.petiteFont, Color.WHITE));
howRotationRep.setWrap(true);
howRotationRep.setWidth(tailleCell);
Label test = new Label(" site", new Label.LabelStyle(game.petiteFont, Color.RED));
test.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
Gdx.net.openURI("http://tetrisconcept.net/wiki/SRS");
}
});
monGroup.addActor(howRotationRep);
monGroup.addActor(test);
table.add(monGroup).left().width(tailleCell);
Run Code Online (Sandbox Code Playgroud)
它给了我这个

不确定我得到这个,但我从 pyLint 得到一个验证错误说:
Redefining name 'a' from outer scope (line 443) (redefined-outer-name)
Redefining name 'b' from outer scope (line 444) (redefined-outer-name)
Run Code Online (Sandbox Code Playgroud)
代码是这样的:
a = 98 # line 443
b = 90 # line 444
def prodNr(a, b):
"""Definiera prodNr"""
return a * b
result = prodNr(a, b)
ANSWER = result
Run Code Online (Sandbox Code Playgroud)
谁能给我一个关于如何摆脱验证错误的线索?