我在ubuntu 14.04下使用virtualenv,virtualenvwrapper运行python 2.7.6.现在我从源代码安装了python 2.7.9.新的python解释器现在位于下面,/usr/local/bin
但似乎旧的解释器也位于下面/usr/bin
.
如果我运行python shell它会显示python2.7.9.但如果我使用mkvirtualenv venv
我收到以下消息.
在venv/bin/python中新的python可执行文件
安装setuptools,pip ...完成.
Blockquote/usr/local/bin/python:没有名为virtualenvwrapper的模块
old .bashrc
(使用python 2.7.6解释器的工作配置)
# virtualenv-wrappper path
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
Run Code Online (Sandbox Code Playgroud)
新的.bashrc
(有失败配置)
# virtualenv-wrappper path
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
Run Code Online (Sandbox Code Playgroud)
使用新的.baschrc
I键入source .bashrc
并获得以下输出.
/ usr/local/bin/python:没有名为virtualenvwrapper virtualenvwrapper.sh的模块:运行初始化挂钩时出现问题.
如果Python无法导入virtualenvwrapper.hook_loader模块,请检查是否已为VIRTUALENVWRAPPER_PYTHON =/usr/local/bin/python安装了virtualenvwrapper,并且正确设置了PATH.
我也尝试过which -a python
:
输出:
/usr/local/bin/python
/usr/bin/python
Run Code Online (Sandbox Code Playgroud)
我想在virtualenv和virtualenvwrapper中使用python 2.7.9.所以我要做的就是让它运转起来?
我在我的Web应用程序中有两个Gridview.我需要在单击(ExcelExpot)按钮时将值导出到Excel中相应的Sheet1和Sheet2.
protected void ExportToExcel()
{
this.GridView1.EditIndex = -1;
Response.Clear();
Response.Buffer = true;
string connectionString = (string)ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection sqlconnection = new SqlConnection(connectionString);
String sqlSelect = "select * from login";
sqlconnection.Open();
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(sqlSelect, connectionString);
//DataTable dt1
DataTable dt1 =new DataTable();
mySqlDataAdapter.Fill(dt1);
//LinQ Query for dt2
var query = (from c in dt.AsEnumerable()
select new {id= c.Field<string>("id"),name=c.Field<string>("name"),city=c.Field<string>("city")}) ;
DataTable dt2 = new DataTable();
d2=query.CopyToDatatable();
DataSet ds=new DataSet();
ds.Tabls.Add(dt1);
ds.Tabls.Add(dt2);
Excel.Application excelHandle1 = PrepareForExport(ds);
excelHandle1.Visible = true;
}
// code for …
Run Code Online (Sandbox Code Playgroud) 我有像下面的TextBox.
<asp:TextBox runat="server" ID="Name" value="aaaa" text="bbbb"/>
Run Code Online (Sandbox Code Playgroud)
在代码背后.
Dim str As String = Name.Text.Trim() ' value as bbbb
Run Code Online (Sandbox Code Playgroud)
如果我删除了text属性.
<asp:TextBox runat="server" ID="Name" value="aaaa" /> <%--text="bbbb"--%>
Dim str As String = Name.Text.Trim() ' value as aaaa
Run Code Online (Sandbox Code Playgroud)
每当我保留文本属性时,我都无法访问Value字段.如何在text属性存在时获取值字段?
您好,
最近几天我遇到了以下教义问题 - 由于我不允许粘贴任何源代码,我将尝试简要描述:
我正在使用学说 orm,我需要向 DB 中的现有表添加一个新列 - DB 和实体之间的映射是通过 xml 映射文件完成的 - 以下是我进行的步骤:
当我然后运行应用程序时,我仍然收到此错误:
[Semantical Error] Error: Class Entity.php has no field or association named newColumn
Run Code Online (Sandbox Code Playgroud)
因此,如果我正确理解这一点,那就是说 Entity.php 中的字段 newColumn 应该是新的 DB 列映射到的字段。
但事实并非如此,因为这是我所做的第一步。
我已经试过了:
我仍然总是遇到同样的错误。
任何想法我可能会错过什么?谢谢!
是否可以HttpRuntime.Cache
从其他应用程序检索?
我有两个申请,
例如App-A,App-B
在App-A我正在插入缓存的值
HttpRuntime.Cache.Insert(sCacheKey, sCacheValue, Nothing, Now.AddHours(CInt(System.Configuration.ConfigurationManager.AppSettings("CacheExpirationHours"))), TimeSpan.Zero)
Run Code Online (Sandbox Code Playgroud)
我无法检索App-B中的值
Dim strList As String
strList = HttpRuntime.Cache.Get(sCacheKey)
Run Code Online (Sandbox Code Playgroud)
它只是简单地返回.我做错了什么?
我正在提出一个关于protected
vs 的问题(protected internal
因为我仍然不确定,并且无法控制它们).
任何帮助深表感谢.
// DLL 1
namespace Assembly1
{
class class1 : class2
{
static void Main()
{
new class1().Test();
}
private void Test()
{
Console.WriteLine(this.sample);
}
}
}
Run Code Online (Sandbox Code Playgroud)
// DLL 2
namespace Assembly2
{
public class class2
{
// protected string sample = "Test";
protected internal string sample = "Test";
//Same behavior when using protected and protected internal. Why ?
}
}
Run Code Online (Sandbox Code Playgroud)
我对这两行都有相同的行为.
// protected string sample = "Test";
protected internal string sample = …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在画布内移动一个动态绘制的矩形.我能够在画布中动态绘制矩形,同时尝试在画布内移动矩形我遇到问题
XAML:
<Grid x:Name="Gridimage1" Margin="0,0,411,100">
<Image Name="image1" HorizontalAlignment="Left" Stretch="Fill" VerticalAlignment="Top"></Image>
<Canvas x:Name="BackPanel" Margin="20,67,0,0" Height="317" Width="331">
<Rectangle x:Name="selectionRectangle" Stroke="LightBlue" Fill="#220000FF"/>
</Canvas>
</Grid>
Run Code Online (Sandbox Code Playgroud)
C# :
动态绘制矩形后,我正在添加以下鼠标事件.
selectionRectangle.MouseLeftButtonDown += new MouseButtonEventHandler(Rect1_MouseDown);
selectionRectangle.MouseMove += new MouseEventHandler(Rectangle_MouseMove_1);
selectionRectangle.MouseUp += new MouseButtonEventHandler(Rect1_MouseUp);
# region "rectangle move"
private bool drag = false;
private Point startPt;
private int wid;
private int hei;
private Point lastLoc;
private double CanvasLeft, CanvasTop;
private void Rect1_MouseDown(object sender, MouseButtonEventArgs e)
{
drag = true;
Cursor = Cursors.Hand;
startPt = e.GetPosition(BackPanel);
wid = (int)selectionRectangle.Width; …
Run Code Online (Sandbox Code Playgroud) 有一个我有一个java字符串的问题:
String aString="name==p==?header=hello?aname=?????lname=lastname";
Run Code Online (Sandbox Code Playgroud)
我需要在问号上分开,然后是等号.
结果应该是键/值对:
name = "=p=="
header = "hello"
aname = "????"
lname = "lastname"
Run Code Online (Sandbox Code Playgroud)
问题是aname和lname成为:
name = ""
lname = "????lname=lastname"
Run Code Online (Sandbox Code Playgroud)
我的代码简单地通过执行分割aString.split("\\?",2)
将返回2个字符串.一个包含键/值对,第二个字符串包含字符串的其余部分.如果我在字符串中找到一个问号,我会对第二个字符串进行递归以进一步分解.
private String split(String aString)
{
System.out.println("Split: " + aString);
String[] vals = aString.split("\\?",2);
System.out.println(" - Found: " + vals.length);
for ( int c = 0;c<vals.length;c++ )
{
System.out.println(" - "+ c + "| String: [" + vals[c] + "]" );
if(vals[c].indexOf("?") > 0 )
{
split(vals[c]);
}
}
return ""; // For now …
Run Code Online (Sandbox Code Playgroud) 当我的笔记本电脑电池突然没电时,我正在使用 PHPStorm。
回家给它充电后,我大吃一惊:我所有搁置的更改现在都消失了!
有什么办法可以恢复它们吗?
另外,当我启动 PHPStorm 时,它说"workspace.xml"
要重新制作一些东西。
我有大量的代码搁置。请帮我 :)