我有一个Yamaha MIDI吉他,当我播放使用XG MIDI标准编码的MIDI文件时,会导致吉他上的某些灯打开和关闭.我正在尝试确定导致这种情况的MIDI事件,以便我可以在不使用MIDI文件的情况下以编程方式发送相同的事件(我可以发送Note On(144)或Note Off(128)命令).
然而,虽然我能够找到MIDI协议的副本,但我找不到XG MIDI协议.有没有办法,除了尝试将所有可能的命令发送到设备,直到我找到适当的命令,以确定导致灯改变状态的MIDI事件是什么?或者有什么地方可以获得XG MIDI协议的副本?
我正在使用iTextSharp生成一些PDF文件.我有两个有内容的表,我想在两个表之间放一些空格,比如相当于1行文本(使用与空格周围的表相同的字体).
下面是我用来添加两个表的代码.我无法弄清楚的是如何在两个表之间放置一个垂直空间.
Table upperTable = new Table(1);
upperTable.Border = Rectangle.NO_BORDER;
upperTable.DefaultCell.Border = Rectangle.NO_BORDER;
upperTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
upperTable.AddCell(new Phrase("some text", font3));
d.Add(upperTable);
Table lowerTable= new Table(1);
lowerTable.Border = Rectangle.NO_BORDER;
lowerTable.DefaultCell.Border = Rectangle.NO_BORDER;
lowerTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
lowerTable.AddCell(new Phrase("some other text", font3));
d.Add(lowerTable);
Run Code Online (Sandbox Code Playgroud)
有人能告诉我如何在两个表之间添加垂直空间吗?
谢谢!
我有一个包含几种形式的页面.我想添加一个提交按钮,允许同时保存所有表单,如下图所示:
<form id="form1" name="form1" action="someAction" method="post">
....form fields
</form>
<form id="form2" name="form2" action="someOtherAction" method="post">
....form fields
</form>
<form id="form2" name="form2" action="anotherAction" method="post">
....form fields
</form>
<a href="somewhere.html" onclick="submitAll();">Submit All Forms</a>
<script>
function submitAll() {
document.form1.submit();
document.form2.submit();
document.form3.submit();
}
</script>
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是,一旦第一个表单被提交,它就会将页面重定向到该表单的目标 - 我想拦截该重定向,以便我可以处理下一个表单.
我知道这可以通过AJAX完成,它可以以某种方式让我捕获返回的页面(如果我这样选择就忽略它),但我无法弄清楚如何在不映射表单中的每个字段的情况下执行此操作手动.
有人可以帮忙吗?
有没有办法以不可反向工作的格式部署Java程序?
我知道如何将我的应用程序转换为可执行的JAR文件,但我想确保代码不能进行逆向工程,或者至少不容易.
源代码的混淆不计算......它使得理解代码变得更加困难,但不会隐藏它.
一个相关的问题是如何锁定已编译的Java类以防止反编译?
一旦我完成了程序,我仍然可以访问原始源代码,因此维护应用程序不会成为问题.如果应用程序是分发的,我不希望任何用户能够反编译它.混淆不能实现这一点,因为用户仍然可以对其进行反编译,虽然他们很难跟踪操作流程,但他们将能够看到代码,并可能从中获取信息.
我关心的是代码中是否有与远程访问相关的信息.应用程序使用用户提供的用户标识和密码连接主机.有没有办法从用户隐藏主机的地址,如果该地址位于源代码内?
我需要在我的hibernate映射上设置fetch模式在某些情况下是急切的,在其他情况下是懒惰的.我的默认值(通过hbm文件设置)为lazy ="true".如何在代码中覆盖此设置?MyClass有一个MyClass2类型的集合,我想将FetchMode设置为EAGER.
目前,我有类似的东西:
Session s = HibernateUtil.getSessionFactory().openSession();
MyClass c = (MyClass)session.get(MyClass.class, myClassID);
Run Code Online (Sandbox Code Playgroud) 我有一个hibernate映射如下:
<hibernate-mapping>
<class name="kochman.elie.data.types.InvoiceTVO" table="INVOICE">
<id name="id" column="ID">
<generator class="increment"/>
</id>
<property name="date" column="INVOICE_DATE"/>
<property name="customerId" column="CUSTOMER_ID"/>
<property name="schoolId" column="SCHOOL_ID"/>
<property name="bookFee" column="BOOK_FEE"/>
<property name="adminFee" column="ADMIN_FEE"/>
<property name="totalFee" column="TOTAL_FEE"/>
</class>
</hibernate-mapping>
Run Code Online (Sandbox Code Playgroud)
其中InvoiceTVO的变量定义为:
private int id;
private Date date;
private int customerId;
private int schoolId;
private float bookFee;
private float adminFee;
private float totalFee;
Run Code Online (Sandbox Code Playgroud)
当我在此表上插入时,出现以下错误:
Hibernate: insert into INVOICE (INVOICE_DATE, CUSTOMER_ID, SCHOOL_ID, BOOK_FEE, ADMIN_FEE, TOTAL_FEE, ID) values (?, ?, ?, ?, ?, ?, ?)
50156 [AWT-EventQueue-0] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: …Run Code Online (Sandbox Code Playgroud) 我有一个具有以下结构的菜单(为了说明目的而简化):
Menu Bar
|--File
| |--Save
| |--Exit
|--Tools
| |--Tool Category 1
| |--Tool Category 2
| |--Tool Category 3
|--Help
|--About
Run Code Online (Sandbox Code Playgroud)
我想将其重建如下:
Menu Bar
|--File
| |--Save
| |--Exit
|--Tool Category 1
|--Tool Category 2
|--Tool Category 3
|--Help
|--About
Run Code Online (Sandbox Code Playgroud)
但是,在 Visual Studio 2008 Pro 中,除了在它们所在的特定菜单组中重新组织它们之外,它不会让我拖动这些菜单项。有没有办法在不完全重建菜单栏的情况下移动它们?请注意,实际上菜单项比我展示的要多得多。
我的spring-context文件如下所示.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="cfaBeanFactory" class="org.springframework.context.support.ClassPathXmlApplicationContext">
<constructor-arg value="classpath:cfa-spring-core.xml" />
</bean>
</beans>
Run Code Online (Sandbox Code Playgroud)
当我尝试运行我的应用程序时,我收到以下错误:
Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:cfa-spring-context.xml], factory key [cfaBeanFactory]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Line 16 in XML document from URL [file:/C:/.../cfa-spring-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389)
... 56 more …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Visual C#2008 Express Edition连接到远程MySQL数据库.有没有办法使用编辑器进行连接,还是必须手动编写连接代码?编辑器有一个清晰易懂的向导,用于连接Microsoft SQL Server和Access数据库,但我没有看到添加远程MySQL数据源的简单方法.我尝试搜索帮助,但找不到任何有用的东西.
有没有人使用编辑器完成此操作?或者可以指出我有用的方向?
使用列表框,我有以下代码来提取所选项:
private void inventoryList_SelectedIndexChanged(object sender, EventArgs e)
{
String s = inventoryList.SelectedItem.ToString();
s = s.Substring(0, s.IndexOf(':'));
bookDetailTable.Rows.Clear();
...
more code
...
}
Run Code Online (Sandbox Code Playgroud)
我想为DataGridView做类似的事情,也就是说,当选择更改时,检索所选行中第一个单元格的内容.问题是,我不知道如何访问该数据元素.
任何帮助是极大的赞赏.
我正在尝试按照以下方式创建一个表单(我知道这不是有效的HTML,但它希望说明我尝试这样做的原因和原因):
<form method="post" action="test.php">
<input type="text" name="teamName">
<br />Players:
<grouping name="players[]">
<input type="text" name="firstName"><br />
<input type="text" name="lastName"><br />
</grouping>
<input type="submit" value="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
通过javascript,我会根据需要多次添加分组元素.提交表单后,我可以访问分组元素中的项目,如下所示:
foreach ($players as $player) {
$fName = $player->firstName;
$lName = $player->lastName;
}
Run Code Online (Sandbox Code Playgroud)
也就是说,在我开始之前,我不知道球队中有多少球员,但我知道球员的样子.我希望将这一切保留在一个屏幕上,以便用户可以在一个页面上将玩家添加到他们的团队,我希望能够将这些字段分组添加为一个组.但是,我还希望将分组存储为数组,而不是执行以下操作:
<form method="post" action="test.php">
<input type="text" name="teamName">
<br />Players:
<input type="text" name="firstName[]"><br />
<input type="text" name="lastName[]"><br />
<input type="submit" value="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
这意味着我可以遍历分组中的各个元素,但不能通过整个分组.
我有什么想法可以做到这一点?
c# ×4
hibernate ×3
java ×3
forms ×2
.net ×1
ajax ×1
compilation ×1
datagridview ×1
form-submit ×1
html ×1
itextsharp ×1
jar ×1
jquery ×1
midi ×1
mysql ×1
spring ×1
types ×1
winforms ×1