问题列表 - 第34351页

Java垃圾收集策略

我正在寻找一种技术来找出Java VM在给定时间点使用的垃圾收集(GC)策略(收集器).(稍后,我希望它能正确反映我选择的策略,比如说XX:+UseConcMarkSweepGC.)

verbose:gc(以其基本形式)没有帮助,因为它只是告诉我它对每一代所做的一切.是否有任何其他标志我可以设置它来吐出正在使用的GC策略?

JDK版本是1.6_21

java garbage-collection jdk1.6

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

为什么输入[type = text]在IE中不起作用

我有一些这样的风格:

<style type="text/css">
input[type=text]{
width:300px;
}
</style>
Run Code Online (Sandbox Code Playgroud)

上面的代码适用于chrome和firefox.为什么不在IE?我在Reports.aspx文件末尾的Reporting Services中使用此代码.

css input reporting-services

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

在控制台应用程序中的主线程上调用委托

在Windows应用程序中,当使用多个线程时,我知道有必要调用主线程来更新GUI组件.如何在控制台应用程序中完成?

例如,我有两个线程,一个主线程和一个辅助线程.辅助线程始终在侦听全局热键; 当它被按下时,辅助线程执行一个事件,该事件延伸到win32 api方法AnimateWindow.我收到一个错误,因为只允许主线程执行所述函数.

当"调用"不可用时,如何有效地告诉主线程执行该方法?


更新:如果有帮助,这是代码.要查看HotKeyManager内容(其他线程正在发挥作用),请查看此问题的答案

class Hud
{
    bool isHidden = false;
    int keyId;

    private static IntPtr windowHandle;

    public void Init(string[] args)
    {
        windowHandle = Process.GetCurrentProcess().MainWindowHandle;
        SetupHotkey();
        InitPowershell(args);
        Cleanup();
    }

    private void Cleanup()
    {
        HotKeyManager.UnregisterHotKey(keyId);
    }

    private void SetupHotkey()
    {

        keyId = HotKeyManager.RegisterHotKey(Keys.Oemtilde, KeyModifiers.Control);
        HotKeyManager.HotKeyPressed += new EventHandler<HotKeyEventArgs>(HotKeyManager_HotKeyPressed);
    }

    void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e)
    {
       ToggleWindow();
    }

    private void ToggleWindow()
    {
        //exception is thrown because a thread other than the one the console was created in …
Run Code Online (Sandbox Code Playgroud)

c# winapi multithreading console-application

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

Android中有一个状态栏图标的多个通知

我正在使用自定义通知...如何设置不显示通知?并列出这些通知?这是我的代码......

public void onReceive(Context context, Intent intent) {
        Toast.makeText(context, "coming", Toast.LENGTH_LONG).show();
        Bundle descBundle = intent.getExtras();
        CharSequence desc = descBundle.getString("description");
        int reminderId = descBundle.getInt("reminderId");
        NotificationManager mNotificationManager;
        mNotificationManager = (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
        PendingIntent contentIntent = PendingIntent.getActivity(context,
                reminderId, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);
        RemoteViews contentView = new RemoteViews(context.getPackageName(),
                R.layout.main);
        contentView.setImageViewResource(R.id.image, R.drawable.reminder_1);
        contentView.setTextViewText(R.id.text, desc);
        Notification notifyDetails = new Notification();
        notifyDetails.icon = R.drawable.reminder_1;
        notifyDetails.when = System.currentTimeMillis();
        notifyDetails.tickerText = desc;
        notifyDetails.iconLevel = 1;
        notifyDetails.number = reminderId;
        notifyDetails.contentView = contentView;
        notifyDetails.contentIntent = contentIntent;
        mNotificationManager.notify(0, notifyDetails);
    }
Run Code Online (Sandbox Code Playgroud)

我正在使用此代码显示通知...但它只显示一个通知内容...但图标显示没有通知...

notifications android

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

什么是PHP中使用的刻度?

我想知道为什么,如何以及何时在PHP中使用ticks:

declare(ticks=1);

// A function called on each tick event
function tick_handler()
{
    echo "tick_handler() called\n";
}

register_tick_function('tick_handler');

$a = 1;

if ($a > 0) {
    $a += 2;
    print($a);
}
Run Code Online (Sandbox Code Playgroud)

php

16
推荐指数
3
解决办法
4581
查看次数

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

构建泛型集合类

我正在构建以下类来管理字典.

    public class EnumDictionary<TKey, TValue>
    {
        private Dictionary<TKey, TValue> _Dict;

        public EnumDictionary(Dictionary<TKey, TValue> Dict)
        {
            this._Dict = Dict;
        }

        public TKey GetValue(TValue value)
        {
            foreach (KeyValuePair<TKey, TValue> kvp in _Dict)
            {
                if (kvp.Value == value)
                    return kvp.Key;
            }

            throw new Exception("Undefined data type: " + value);
        }              
    }
Run Code Online (Sandbox Code Playgroud)

但我得到一个错误"运算符'=='不能应用于'TValue'和'TValue'类型的操作数".

顺便说一句,我正在制作这个自定义集合是因为​​我的字典具有独特的价值,但我无法从字典中获取密钥.

任何帮助表示赞赏.谢谢.

c# generics collections dictionary

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

如何将图像和 QProgressBar 放入 QTableView?

我正在开发某种下载管理器并在 QTableView 中显示文件名、大小和剩余字节。现在我想用 QProgressBar 可视化进度并显示图像(以指示它是下载还是上传)。如何添加或显示QProgressBar和图像的QTableView中?

c++ qt

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

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

WSDL,DISCO和EVENT之间有什么区别?

所有这些都是网络服务,但有什么区别?

web-services

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