问题列表 - 第30957页

javascript在部分分割字符串

可能重复:
javascript中的格式数字

我有一个字符串代表一个数字:"3507654"我需要将它拆分为3,例如"3 507 654"

数字可以是任何值,但始终是数字.

javascript string

1
推荐指数
1
解决办法
1863
查看次数

void(U ::*)(void)是什么意思?

我正在研究is_classBoost中模板的实现,并遇到了一些我无法轻易解读的语法.

    template <class U> static ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
    template <class U> static ::boost::type_traits::no_type is_class_tester(...);
Run Code Online (Sandbox Code Playgroud)

我如何解释void(U::*)(void)上述?我熟悉C,所以看起来有些类似void(*)(void),但我不明白如何U::修改指针.有人可以帮忙吗?

谢谢

c++ templates

6
推荐指数
1
解决办法
440
查看次数

hibernate - spring/bean 映射集

我几乎是 spring-hibernate 的新手,我一直在努力让它发挥作用。

我有一个这样的数据模型:

patient                prescription
----------             --------------
patient_id*            prescription_id*
first_name             patient_id*
last_name              date
...
Run Code Online (Sandbox Code Playgroud)

我正在使用带有 hibernate 模板的 spring bean 来定义我的 session/hibernatetemplate 和 dao,如下所示:

    <bean id="mySessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="myDataSource" />
    <property name="mappingResources">
        <list>
            <value>./org/example/smartgwt/shared/model/prescription.hbm.xml</value>
            <value>./org/example/smartgwt/shared/model/patient.hbm.xml</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <value>hibernate.dialect=org.hibernate.dialect.HSQLDialect</value>
    </property>
</bean>

<!-- Wrapper for low-level data accessing and manipulation -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
    <property name="sessionFactory">
        <ref bean="mySessionFactory" />
    </property>
</bean>

<!--  -->

<bean id="patientDao" class="org.example.smartgwt.server.data.PatientDao">
    <property name="hibernateTemplate">
        <ref bean="hibernateTemplate" />
    </property>
</bean>

<bean id="prescriptionDao" class="org.example.smartgwt.server.data.PrescriptionDao">
    <property name="hibernateTemplate">
        <ref …
Run Code Online (Sandbox Code Playgroud)

java mapping spring hibernate

1
推荐指数
1
解决办法
5757
查看次数

本地jar不包含在类路径中(`<scope> system </ scope>`)

我正在尝试使用maven和eclipse构建我的应用程序.我依赖于我本地机器上的第三方罐子.这是我的pom.xml

<dependency>
    <groupId>sourceforge.net</groupId>
   <artifactId>zipdiff</artifactId>
   <version>0.4</version>
   <scope>system</scope>
   <systemPath>C:/gelcap/lib/zipdiff-0.4.jar</systemPath>
</dependency>

<dependency>
    <groupId>log4j</groupId>
   <artifactId>log4j</artifactId>
   <version>1.2.11</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

当我运行mvn:install时会为我的项目创建war文件.但问题是它不包括zipdiff.jar文件到web-inf/lib文件夹,它只包含下载的文件.我需要包括从我的本地系统复制文件,但maven忽略它们.我没有想到为什么maven没有包含系统范围的文件到我的war文件.请告诉我如何解决这个问题.提前致谢

java maven-2

5
推荐指数
2
解决办法
6876
查看次数

Firefox中的JQuery不兼容问题(可能).在Chrome中工作

<tr onmouseover="$('#actions').show();" onmouseout="$('#actions').hide();" >
    <td>
        <a onclick="showContacts();">Group Name</a>
    </td>
    <td>
        <span id="actions" style="display:none;">
            <img src="../images/Delete-icon.png" onclick="del();"/>
            <img src="../images/add-16.png" onclick="loadpage('contacts.php');" />
            <img src="../images/mail.png" onclick="send();" />
        </span>
    </td>
</tr>
Run Code Online (Sandbox Code Playgroud)

这是我的代码.我正试图在徘徊<td>时显示第二张图像<tr>.图像显示在将文本悬停在第一个文本中,<td>但在鼠标离开文本时消失.这只发生在我的FF(v3.6)中,但在IE和Chrome中运行良好.有人可以帮我解决这个问题吗?

firefox jquery incompatibility

0
推荐指数
1
解决办法
126
查看次数

UITableView tableFooterView奇怪的调整大小

我想在UITableView的页脚中显示一个UIButton(对于标题应该完全相同).

这段代码在我的TableViewController的viewDidLoad中:

UIButton *footerShareButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[footerShareButton setFrame:CGRectMake(10, 0, 70, 50)];
NSLog(@"%f", footerShareButton.frame.size.width);

[self.tableView setTableFooterView:footerShareButton];

NSLog(@"%f", footerShareButton.frame.size.width);
NSLog(@"%f", self.tableView.tableFooterView.frame.size.width);
Run Code Online (Sandbox Code Playgroud)

但是,此代码不起作用.Button的宽度太大,它是320.(虽然高度正确.)第一个NSLog输出70,第二个和第三个输出320.所以看起来setTableFooterView方法奇怪地调整了按钮的大小.

我已经将UIButton放在另一个UIView中,然后将其设置为表格页脚,从而解决了这个问题:

 UIButton *footerShareButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
 [footerShareButton setFrame:CGRectMake(10, 0, 70, 50)];

 UIView *aView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, 70, 50)];
 [aView addSubview:footerShareButton];

 [self.tableView setTableFooterView:aView];
 [aView release];
Run Code Online (Sandbox Code Playgroud)

这样做,按钮具有正确的宽度.

但是,我不明白为什么第一个代码示例不起作用.谁能解释一下?

iphone header footer uitableview

5
推荐指数
1
解决办法
9496
查看次数

Type.InvokeMember和引用类型

我正在尝试将Type.InvokeMember(String,BindingFlags,Binder,Object,array [])与默认绑定器一起使用.

对象数组中目标方法的一个参数是设置为null的引用类型.我想要我正在调用的方法来实例化引用类型,以便我可以继续使用它.例如:

using System;

namespace ConsoleApplication6
{
    class A
    {
        public void GetReferenceType(object o)
        {
            o = new object();
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            object o = null;
            A a = new A();
            Type t = typeof(A);
            t.InvokeMember("GetReferenceType", System.Reflection.BindingFlags.InvokeMethod, null, a, new object[] { o });

            if (o == null)
            {
                throw new NullReferenceException();
            }
            else
            {
                //do something with o;
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

解决方法是提供A一个属性并通过它访问o.

还有其他方法可以不改变A吗?

.net c# reflection

2
推荐指数
1
解决办法
3744
查看次数

是否存在全球股票市场实时报价应用程序编程接口(API)?

我正在寻找一个应用程序编程接口,它允许我至少为以下证券交易所访问有关多个公司符号的报价和其他数据:

American Stock Exchange (AMEX)
Australian Stock Exchange (ASX)
Bank of Canada
Bombay Stock Exchange (BOM) 
Canadian Venture Exchange (CVE) 
Euronext: Amsterdam (AMS)
Euronext: Brussels (EBR)
Euronext: Lisbon (ELI)  
Euronext: Paris (EPA)  
Frankfurt Stock Exchange
Hong Kong Stock Exchange (HKG)
London Stock Exchange (LON)
NASDAQ Stock Exchange (NASDAQ)
National Stock Exchange of India
New York Stock Exchange (NYSE)
New Zealand Stock Exchange (NZE)
Nikkei Indices
Shanghai Stock Exchange (SHA)
Shenzhen Stock Exchange (SHE)
Taiwan Stock Exchange (TPE)
Tokyo Stock Exchange …
Run Code Online (Sandbox Code Playgroud)

api finance interface

21
推荐指数
2
解决办法
2万
查看次数

php中的float和double之间的区别?

我有这个代码

$vad = 1.1;

print gettype($vad);

var_dump($vad);
Run Code Online (Sandbox Code Playgroud)

这将输出:

double
float(1.1) 
Run Code Online (Sandbox Code Playgroud)

所以它是双重或浮动在PHP?

php

112
推荐指数
4
解决办法
8万
查看次数

自定义警报对话框未在Android上垂直居中

我在游戏结束时显示了一个自定义警告对话框,以便玩家可以输入其名称进行保存.问题是当我打电话show()给对话框时,它不是垂直居中的!它比它应该低一点,无论我在xml中设置什么属性或使用时setGravity().

我认为这与此处提到的问题相同,但没有人给出正确答案.

谢谢你的帮助.

有关详细信息,请参阅以下代码:

    AlertDialog.Builder builder;

    LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.newrecord,(ViewGroup)findViewById(R.layout.shoot));

    builder = new AlertDialog.Builder(this);
    builder.setView(layout);

    newRecDialog = builder.create();
Run Code Online (Sandbox Code Playgroud)

以下是XML布局的第一个元素的代码newrecord.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:gravity="center"
 android:padding="10dp"
android:baselineAligned="true">
Run Code Online (Sandbox Code Playgroud)

以下是输出屏幕截图: alt text http://the.niox.free.fr/divers/dialog_offset.png

alert android dialog

12
推荐指数
1
解决办法
2万
查看次数