我emacs23
在Ubuntu 10.04台式机上安装了GNU Emacs 23(软件包),并emacs23-nox
在Ubuntu 10.04无头服务器上安装了软件包(没有安装X).两个安装都具有相同的~/.emacs
文件.我-nw
在两台计算机上运行Emacs .我没有python-mode
在任何一台机器上安装,因为我的理解是它包含在Emacs 23中.
在桌面计算机上,Python中的注释(以...开头#
)以红色突出显示.在服务器上,注释以纯白文本显示,就像所有其他非突出显示的文本一样.有关为什么注释没有在server(nox
)安装上正确突出显示的任何建议?
更新:这似乎是与终端相关的问题.我通过屏幕更换ssh
进入服务器机器.如果我在服务器上运行emacs ,则会突出显示注释,但所有其他颜色看起来都很奇怪. terminator
byobu
TERM="xterm-256color" emacs
更新:添加`export TERM ="xterm-256color""解决了这个问题.现在语法高亮显示有非常奇怪的颜色:紫色紫色和浅棕色.我的绿色当前线高亮条现在是淡淡的黄色/绿色.评论以红色突出显示:)
更新:解决了.设置TERM="xterm-color"
会产生"正确"的颜色,包括突出显示注释.服务器默认为"screen-bce"值,TERM
但没有突出显示注释.
更新:未解决. byobu
为各种功能键提供键绑定,以轻松创建新的屏幕会话并在它们之间切换.当TERM
设置为xterm-color
,这些功能键不再工作.所以我想我只需要对Emacs中Python代码中没有突出显示的注释感到满意.
真的只是一个理论问题.
说我的网站包含一个使用PHP邮件功能发送电子邮件的表单.我有500个用户同时点击提交.现在,必须从PHP发送500个不同会话中的500封电子邮件.
它会同时进行吗?涉及多少线程?每个人会阻止其他人一个接一个地做吗?
假设我有一个customers
包含以下字段和记录的表:
id first_name last_name email phone
------------------------------------------------------------------------
1 Michael Turley mturley@whatever.com 555-123-4567
2 John Dohe jdoe@whatever.com
3 Jack Smith jsmith@whatever.com 555-555-5555
4 Johnathan Doe 123-456-7890
Run Code Online (Sandbox Code Playgroud)
还有其他一些表,如orders
,rewards
,receipts
其中有外键customer_id
有关此表的customers.id
.
正如您所看到的,我的用户以他们无限的智慧为John Doe创建了重复记录,并且拼写和数据丢失都不一致.管理员注意到这一点,选择客户2和4,然后单击"合并".然后提示他们为每个字段选择哪个值是正确的等等,我的PHP确定合并的记录应如下所示:
id first_name last_name email phone
------------------------------------------------------------------------
? John Doe jdoe@whatever.com 123-456-7890
Run Code Online (Sandbox Code Playgroud)
让我们假设Doe已经下了几个订单,获得了奖励,生成了收据..但是其中一些已经与id 2相关联,有些已经与id 4相关联.合并的行需要匹配其他所有外键与原始行匹配的表.
这是我不知道该怎么做的地方.我的直觉是这样做:
DELETE FROM customers WHERE id = 4;
UPDATE customers
SET first_name = 'John',
last_name = 'Doe',
email = 'jdoe@whatever.com',
phone = '123-456-7890'
WHERE id = …
Run Code Online (Sandbox Code Playgroud) 当一个Entity映射到另一个在其子类上有直接实现的Entity时,我遇到了问题.请参阅以下示例映射:
@Entity
class Location {
@OneToOne
@JoinColumn(...)
private Person person;
}
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="person_type",discriminatorType=DiscriminatorType.STRING)
abstract class Person {
}
@Entity
@DiscriminatorValue("M")
class Man extends Person {
...
}
@Entity
@DiscriminatorValue("W")
class Woman extends Person {
...
}
Run Code Online (Sandbox Code Playgroud)
现在,这就是我在数据库表上的内容:
location-table:id = 1,person_id = 1 person-table:id = 1,person_type ="M"
当我使用实体管理器检索位置时,hibernate会抛出一个异常,说我无法实例化抽象类或接口.
Location location = entityManager.find(Location.class, 1L);
Run Code Online (Sandbox Code Playgroud)
Hibernate抛出此错误:
javax.persistence.PersistenceException: org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: Person
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:195)
at ......
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) …
Run Code Online (Sandbox Code Playgroud) 你觉得这段代码有什么不对吗?如果不能正常工作,它会返回一个NaN.
public class Method2 extends GUIct1
{
double x=0,y=0;
void settype1 (double conv1)
{
x = conv1;
}
void settype2 (double conv2)
{
y = conv2;
}
double conversion ( double amount)
{
double converted = (amount*y)/x;
return converted;
}
}
Run Code Online (Sandbox Code Playgroud)
使用方式我已经改变了设定部分
Method2 convert = new Method2(); \\ method is called
Run Code Online (Sandbox Code Playgroud)
.....
convert.settype1(j);
Run Code Online (Sandbox Code Playgroud)
.....
convert.settype2(k);
Run Code Online (Sandbox Code Playgroud)
.....
double x = convert.conversion(i);
System.out.println(x);
Run Code Online (Sandbox Code Playgroud) 我之前使用wsimport生成了一个Metro客户端,但在这种情况下,WSDL是通过https访问的.我的命运看起来像这样:
wsimport https://service.net/services/Service?wsdl -d C:\ClientProject\src\main\java -keep
Run Code Online (Sandbox Code Playgroud)
一切都很好.现在我正在尝试生成一个客户端,但是,我只有一个WSDL文件的本地副本.我的项目目录设置如下(在c:\ Devel中):
ClientProject
|- src
|- main
|- java
|- resources
|- META-INF
|- service.wsdl
|- wsimport.bat
Run Code Online (Sandbox Code Playgroud)
wsimport.bat文件如下所示:
wsimport -keep -d ../src/main/java -wsdlLocation ../src/resources/META-INF/service.wsdl
Run Code Online (Sandbox Code Playgroud)
它基于Metro Guide示例,但没有-p选项(http://metro.java.net/guide/Developing_client_application_with_locally_packaged_WSDL.html).但是,当我运行bat文件时,我得到一个无限循环的命令被打印到控制台.例如
C:\Devel\ClientProject>wsimport -keep -d ../src/main/java -wsdlLocation ../src/resources/META-INF/service.wsdl
Run Code Online (Sandbox Code Playgroud)
有人可以指出我做错了什么吗?
UPDATE
我尝试使用绝对路径(并重新排列参数顺序无济于事.我仍然得到无尽的命令控制台打印:
wsimport C:\Devel\ClientProject\src\resources\META-INF\service.wsdl -d C:\Devel\ClientProject\src\main\java -keep
Run Code Online (Sandbox Code Playgroud) 我试图在POSIX系统中发送带管道的整数,但write()
函数正在发送字符串或字符数据.有没有办法用管道发送整数?
问候
我修改了Visual C++应用程序中的现有类,使其成为泛型类.该类由另外两个模块使用.当我单独编译这些模块时,一切正常.但是,当我执行Build All时,我会收到以下链接器错误:
1>Linking...
1> Creating library C:\ccmdb\prep\g3_v5.3\g3_tools\fc_tools\ZFRTool\ZStackMTI\Debug\ZStackMTI.lib and object C:\ccmdb\prep\g3_v5.3\g3_tools\fc_tools\ZFRTool\ZStackMTI\Debug\ZStackMTI.exp
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::CRingBuffer<unsigned char>(unsigned long)" (??0?$CRingBuffer@E@@QAE@K@Z) referenced in function "public: __thiscall CSerialPort::CSerialPort(void)" (??0CSerialPort@@QAE@XZ)
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::CRingBuffer<unsigned char>(unsigned long)" (??0?$CRingBuffer@E@@QAE@K@Z)
1>SerialPort.obj : error LNK2019: unresolved external symbol "public: __thiscall CRingBuffer<unsigned char>::~CRingBuffer<unsigned char>(void)" (??1?$CRingBuffer@E@@QAE@XZ) referenced in function "public: void * __thiscall CRingBuffer<unsigned char>::`scalar deleting destructor'(unsigned int)" (??_G?$CRingBuffer@E@@QAEPAXI@Z)
1>ZStackMTI.obj : error LNK2001: unresolved external symbol "public: …
Run Code Online (Sandbox Code Playgroud) 我有AVPlayer问题.
1.如何控制它的音量?
2.如何知道AVPlayer是否因为连接错误而重新加载音乐,我是否有一些它的消息?
我有一个整数数组int[] a = new int [5]
.
在我的代码中,我只在索引0和1处存储了2个值.
a[0]=100
和 a[1]=101
现在我需要将数组大小/长度设置为2.
我该做什么?