问题列表 - 第43835页

Struts2 + <s:select /> tag +"headerValue"属性

如果我使用国际化,是否有可能从资源包中的"select"标签中获取"headerValue"属性的值?

还有其他可能的选择吗?

BR SC

struts2

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

在当前的li之后附加li

在我目前的选择之后,我想在一个ul中添加一个li.

我将点击事件绑定到li,当点击它时,必须在当前之后添加另一个li.

我现在拥有的是:

$(this).parent().append('<li>test</li>');
Run Code Online (Sandbox Code Playgroud)

但这只是将li添加到ul中,而不是在当前的li之后.

有没有办法做到这一点?

提前致谢

javascript jquery

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

浏览器中的HTML5文件上传功能检测

我正在尝试使用HTML5功能上传文件.根据调查我发现有3种不同的上传文件的方式,

  1. 通过将文件编码为多部分:仅在支持文件读取器时才会执行此操作.
  2. 使用XMLHTTP2(AJAX)规范方法发送二进制数据:新方法send(Blob/File)能够通过线路发送二进制数据.
  3. FormData对象:使用XMLHTTP(AJAX)发送(FormData)方法.

现在,对于跨浏览器问题和功能检测,下面的代码段很简单,

if(typeof FileReader == "undefined")
Run Code Online (Sandbox Code Playgroud)

但是我不知道如何找出当前浏览器中的AJAX的send()方法是支持send(FormData)还是send(Blob/File)方法实现.怎么找到它?这里有Object.property技巧吗?或者不同的东西?

谢谢,

javascript ajax html5

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

preg_replace错误

我有一个实体数组,需要在一个大的sting中替换,但只有第一次出现(这就是为什么我使用preg_replace而不是str_replace),例如:

$entities = array();
$entities[0] = 'string1';
$entities[1] = 'string2';
$entities[2] = 'string2';
$entities[3] = 'Error String ('; ## this is the one that errors because of the bracket
$entities[4] = 'string4';
$entities[5] = 'string5';

foreach ($entities as $entity) {
    $new_article = preg_replace('/' . $entity . '/', '##' . $key, $new_article, 1);
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Warning (2): preg_replace() [function.preg-replace]: Compilation failed: missing ) at offset XX
Run Code Online (Sandbox Code Playgroud)

使括号转义的最佳方法是什么,并且还可以转义可能在正则表达式中使用的任何其他字符.

谢谢

php regex preg-replace

0
推荐指数
2
解决办法
2421
查看次数

这个代码在objective-c中意味着什么?

[CATransaction withAnimationSpeed:1.0 :^ {
            if(newMultiplier > 100)
                fillLayer.backgroundColor = ColRGBA(1, 1, 0, 0.2);
            else
                fillLayer.backgroundColor = ColRGBA(0, 0, 0, 0);
        }];
Run Code Online (Sandbox Code Playgroud)

^ {}是什么意思?为什么要用这个符号.

iphone objective-c caanimation

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

在Scala中,什么是"早期初始化程序"?

在Martin Odersky 最近发表的关于 Scala 程序员能力水平的文章中,在专家库设计师部分,他包含了术语"早期初始化者".

在Scala编程中没有提到这些.这些是什么?

scala

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

为什么保留计数如此之高?内存管理

我一直在通过我的应用程序试图处理所有的内存问题和阅读内存管理.我开始使用[object retainCount]来跟踪我的内存分配.这是否值得信任,因为我一直觉得这些计数真的很奇怪?

有人可以解释以下内容:

请记住,这个app委托和一个空的mainViewController没有任何区别.initWithRootViewController导致计数上升,但我没有看到添加一个的另一种方法....

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {      


/* Create the View Controllers */  
UIViewController *mainViewControl = [[[MainViewController alloc] init] autorelease];


/* Create the Navigation Controller */
UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:mainViewControl] autorelease];


NSLog(@"retain count: %i",[mainViewControl retainCount]);

/* Set the toolbar to purple */
navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
navigationController.navigationBar.tintColor = [UIColor colorWithRed:.6 green:.1 blue:.4 alpha:0.4];
navigationController.navigationBar.translucent = YES;

NSLog(@"retain count: %i",[mainViewControl retainCount]);
navigationController.toolbar.barStyle = UIBarStyleBlackTranslucent;
navigationController.toolbar.tintColor = [UIColor colorWithRed:.6 green:.1 blue:.4 alpha:0.4];
navigationController.toolbar.translucent = YES;

[navigationController setNavigationBarHidden:YES animated:NO]; …
Run Code Online (Sandbox Code Playgroud)

iphone memory-management uinavigationcontroller retaincount

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

过滤Linux命令输出

我需要根据列值获取一行,就像查询数据库一样.我有这样的命令输出,

名称ID Mem VCPU State
Time(s)

域-0 0 15485 16 r ----- 1779042.1

prime95-01 512 1
-b ---- 61.9

在这里,我只需列出状态为"r"的那些行.像这样的东西,

域-0 0 15485 16
r ----- 1779042.1

我尝试过使用"grep"和"awk",但我仍然无法成功.

请帮我解决这个问题.

此致,Raaj

linux

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

任何人都知道一般的交易地图| 设置| 名单

我能找到的唯一真正可用的库是Apache Commons Transaction Library.

Apache Commons Transctions的问题

  • 最新发布2008(3年)
  • 不通用
  • 依赖于日志记录f/w - 我们需要一个Map的记录器!?!
  • 我看到了某个地方(doco),它不是XA.

功能id喜欢

  • 可用的集合应该是通用的
  • 应该对更改进行批处理,直到回滚(忘记所有更改)或提交为止.
  • 脏读等也应该是一个功能.
  • 线程独立,不同的线程应该能够参与不同的txs.
  • 视图也应该是事务 - 例如Map.entrySet()
  • XA会很好,因此集合实例可以参与两阶段提交.

java collections transactions

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

为什么Windows服务中的打印屏幕返回黑色图像?

protected override void OnStart(string[] args)
{
    base.OnStart(args);
    CaptureScreen();

}

protected override void OnStop()
{
    base.OnStop();

}

private void CaptureScreen()
{

    Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

    Graphics graphics = Graphics.FromImage(printscreen as Image);

    graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);

    printscreen.Save(@"L:\" + Counter++ + ".jpg", ImageFormat.Jpeg);
}
Run Code Online (Sandbox Code Playgroud)
  • 我检查过与桌面交互
  • 尝试了localService帐户和用户

.net c# windows-services printscreen c#-4.0

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