问题列表 - 第34671页

jsp中的oracle连接

我是jsp和oracle的新手.

我只想知道将oracle 10g数据库与jsp页面连接的步骤.

java oracle jsp database-connection jdbc

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

UIImagePickerController异常:"源类型必须是UIImagePickerControllerSourceTypeCamera"

这有什么问题?我真的不明白UIImagePickerController的一些重要部分....

这里是来源:

     UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;        
imagePickerController.delegate = self;
[self presentModalViewController:imagePickerController animated:YES];
[imagePickerController release];
Run Code Online (Sandbox Code Playgroud)

我不能打开照片库吗?任何帮助赞赏!

iphone uiimagepickercontroller

15
推荐指数
4
解决办法
9565
查看次数

Android NumberPicker没有保存EditText更改

我已将Android的NumberPicker小部件复制到我自己的应用程序中,但我遇到了一个问题......

当有人手动单击EditText并通过键盘更改它时,不会保存选择.是否有一些监听器可以实现检查并查看用户是否手动更改EditText以将其设置为当前?或者其他的东西?

android android-widget

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

__str__和__repr__的目的是什么?

我真的不明白的地方都__str____repr__Python中使用.我的意思是,我得到它__str__返回一个对象的字符串表示.但为什么我需要呢?在什么用例场景?另外,我读到了有关的用法__repr__

但我不明白的是,我会在哪里使用它们?

python

74
推荐指数
5
解决办法
8万
查看次数

Hibernate Criteria Projection

正如问题标题所说,我试图制作一个投影标准,只查询几个表属性.

所以我有一个Person Table /类,它有大约40个属性.我希望我的标准获得动态数量的属性,比如10,11或12(SQL术语select firstname, lastname from person),我这样做:

Transaction tx = session.beginTransaction();
Criteria crit = session.createCriteria(Person.class);
crit.setCacheable(true);
ProjectionList projList = Projections.projectionList();
projList.add(Projections.property("id"));
Criterias c = null;
 for (int i = 0; i < checked.size(); i++) {
        Attribute attr = checked.elementAt(i);
        switch (attr) {
            case LASTNAME:
                projList.add(Projections.property("lastName"));
                c = enumMap.get(attr);
                if (c.isChanged()) {
                    String tmp = (String) c.getAnswer();
                    tmp = tmp.replace('*', '%');
                    crit.add(Restrictions.like("lastName", tmp));
                    crit.addOrder(Order.asc("lastName"));
                }
            case ...THE REST .....
            }
    crit.setProjection(projList);
    retList = crit.list();
    tx.commit();
    return retList;
Run Code Online (Sandbox Code Playgroud)

并且它返回 …

java hibernate criteria restrictions hibernate-criteria

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

javascript中的对象

原始值以javascript形式存储在堆栈中,但对象存储在堆中.我理解为什么要在堆栈中存储基元但是对象存储在堆中的任何原因?

javascript

14
推荐指数
2
解决办法
2939
查看次数

如何获得当月的天数?用PHP

我想检查今天是否是这个月的最后一天,但我真的不知道如何.我想用PHP写它.

你能帮我吗?

谢谢,塞巴斯蒂安

php date

23
推荐指数
6
解决办法
7万
查看次数

StackOverflowError使用joda-time new Period(long)

首先,抱歉,这太久了.我可能不需要所有代码,但我想确定.

其次,我的实际问题是,我做错了什么,或者这是joda-time库中的错误?

我正在尝试使用joda-time(1.6.1)来计算,然后格式化持续时间.

我目前正在使用Period,这可能是错误的选择.如果是的话请告诉我.但是,即使这是错误的选择,我也很确定这不应该发生.

我正在初始化一个Period使用毫秒(通过将持续时间(以秒为单位)乘以1000).我正在使用,Period所以我可以格式化并打印它:

long durationLong = durationSec * 1000;
Period duration = new Period(durationLong);

PeriodFormatter daysHoursMinutes = new PeriodFormatterBuilder()
    .appendHours()
    .appendSeparator(":")
    .appendMinutes()
    .appendSeparator(":")
    .appendSeconds()
    .toFormatter();

String formattedString = daysHoursMinutes.print(callDuration.normalizedStandard());
Run Code Online (Sandbox Code Playgroud)

我在下面得到了Exception,并查看了源代码以确认循环.

Caused by: java.lang.StackOverflowError
    at java.util.Hashtable.get(Hashtable.java:274)
    at java.util.Properties.getProperty(Properties.java:177)
    at java.lang.System.getProperty(System.java:440)
    at java.lang.System.getProperty(System.java:412)
    at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:132)
    at org.joda.time.DateTimeZone.forID(DateTimeZone.java:190)
    at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:132)
    at org.joda.time.DateTimeZone.forID(DateTimeZone.java:190)

...snip (all the same)...

    at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:132)
    at org.joda.time.DateTimeZone.forID(DateTimeZone.java:190)
    at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:132)
    at org.joda.time.DateTimeZone.forID(Dat
Run Code Online (Sandbox Code Playgroud)

周期(长):

public Period(long duration) {
    super(duration, null, null);
}
Run Code Online (Sandbox Code Playgroud)

super(long,PeriodType,Chronology):

protected …
Run Code Online (Sandbox Code Playgroud)

java stack-overflow jodatime

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

喜欢在SQL中解决(性能问题)

我一直在阅读,发现使用LIKE导致查询大幅减速.

一位同事建议我们使用

Select Name
From mytable
a.Name IN (SELECT Name 
           FROM mytable
           WHERE Name LIKE '%' + ISNULL(@Name, N'') + '%' 
           GROUP BY Name)
Run Code Online (Sandbox Code Playgroud)

替代

Select Name
From mytable
a.Name LIKE '%' + ISNULL(@Name, N'') + '%'
Run Code Online (Sandbox Code Playgroud)

现在我不是SQL专家,我不太了解这些陈述的内部运作.这是一个更好的选择,值得为每个类似的声明键入一些额外的字符吗?是否有更好的(更容易打字)替代方案?

sql t-sql sql-server sql-like

6
推荐指数
2
解决办法
7635
查看次数

查找黄色文本的所有实例并将字体颜色更改为红色

我需要一个vba宏来搜索MS Word 2007文档中字体颜色为黄色的所有文本并将其更改为红色.打印输出中不会显示黄色.手动选择和更改将花费我几个小时.

vba ms-word word-vba

5
推荐指数
3
解决办法
3万
查看次数