我正在使用Numpy生成Meshgrid,它占用了大量的内存和相当多的时间.
xi, yi = np.meshgrid(xi, yi)
Run Code Online (Sandbox Code Playgroud)
我生成一个与底层站点地图图像分辨率相同的网格网格,有时是3000像素尺寸.它有时使用几次内存,在将其写入页面文件时需要10-15秒或更长时间.
我的问题是; 我可以在不升级服务器的情况下加快速度吗?这是我的应用程序源代码的完整副本.
def generateContours(date_collected, substance_name, well_arr, site_id, sitemap_id, image, title_wildcard='', label_over_well=False, crop_contours=False, groundwater_contours=False, flow_lines=False, site_image_alpha=1, status_token=""):
#create empty arrays to fill up!
x_values = []
y_values = []
z_values = []
#iterate over wells and fill the arrays with well data
for well in well_arr:
x_values.append(well['xpos'])
y_values.append(well['ypos'])
z_values.append(well['value'])
#initialize numpy array as required for interpolation functions
x = np.array(x_values, dtype=np.float)
y = np.array(y_values, dtype=np.float)
z = np.array(z_values, dtype=np.float)
#create a list of x, …Run Code Online (Sandbox Code Playgroud) 我正在调试我的网站为可怕的IE6,但我正式难倒.
Firefox中的外观:http://dl-client.getdropbox.com/u/5822/firefox.tiff
在IE6中出现:http://dl-client.getdropbox.com/u/5822/ie6.tiff
直播网站:Motolistr.com
以下CSS在FF和Safari中运行良好,但在IE6中不行.
#search_sort{
background-image:url('../images/nav/bg-form.jpg');
padding:10px;
border:1px solid #d13a3b;
margin-top:5px;
}
Run Code Online (Sandbox Code Playgroud)
以下CSS在IE6中工作,看起来相同......(wtf)
#email_seller{
border:1px solid #d13a3b;
background-image:url('../images/nav/email-form-bg.jpg');
}
Run Code Online (Sandbox Code Playgroud)
此外,我的链接/跨度按钮也没有出现 - 我认为这是同一类型的问题.
a.button {
background: transparent url('../images/nav/button_bg_right4.gif') no-repeat scroll top right;
color: #000;
display: block;
float: left;
font: normal 18px arial, sans-serif;
height: 36px;
margin-right: 6px;
padding-right: 18px; /* sliding doors padding */
text-decoration: none;
}
a.button span {
background: transparent url('../images/nav/button_bg4.gif') no-repeat;
display: block;
line-height: 24px;
padding: 5px 0 7px 18px; …Run Code Online (Sandbox Code Playgroud) 我创建了一个脚本,需要选择一个开始年份,然后只显示从开始年份开始的年份 - > 2009年.它只是一个startYear to endYear Range选择器.
该脚本仅适用于Firefox.我正在学习javascript,所以我希望有人能指出我正确的方向.可以在http://motolistr.com找到实时脚本
<script type="text/javascript">
function display_year2(start_year) {
//alert(start_year);
if (start_year != "Any") {
var i;
for(i=document.form.year2.options.length-1;i>=0;i--)
{
document.form.year2.remove(i);
}
var x = 2009;
while (x >= start_year) {
var optn = document.createElement("OPTION");
optn.text = x;
optn.value = x;
document.form.year2.options.add(optn);
//alert(x);
x--;
}
}
else
{
var i;
for(i=document.form.year2.options.length-1;i>=0;i--)
{
document.form.year2.remove(i);
}
var optn = document.createElement("OPTION");
optn.text = "Any";
optn.value = "Any";
document.form.year2.options.add(optn);
} // end else
} // end function
</script>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗? …
这是我正在搜索的输入:
\u003cspan class=\"prs\">email_address@me.com\u003c\/span>
Run Code Online (Sandbox Code Playgroud)
试着返回email_address@me.com.
我的正则表达式在RegExp中class=\\"prs\\">(.*?)\\返回"class=\"prs\">email_address@me.com\",这是好的,我可以使用该结果.
但我不能让它在PHP中工作.
$regex = "/class=\\\"prs\\\">(.*?)\\/";
Run Code Online (Sandbox Code Playgroud)
给我一个错误"没有结束分隔符"
有人可以帮忙吗?