小编Ema*_*een的帖子

如何检测声音文件何时完成?

我在广播接收器活动中使用此代码播放声音文件:

notification.sound = Uri.parse("android.resource://emad.app/raw/seven_chimes");
Run Code Online (Sandbox Code Playgroud)

我想检测这个文件何时播放完毕.

我尝试了这样的循环,但我认为这对媒体播放器只有好处,因为即使我确定声音文件仍在播放,它总是=假:

/*
 * Stay here until the chime sound is finished.
 */
   while (manager.isMusicActive()){
   }
Run Code Online (Sandbox Code Playgroud)

你能告诉我应该用什么代替manager.isMusicActive()吗?

android while-loop

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

如何自动刷新SQL Server Management Studio智能感知缓存?

在SQL Server Management Studio中,如果用户创建新的表列,表等,则用户需要使用CTRL+ Shift+ 刷新IntelliSense缓存R.

是否有设置或某种方式来自动化它,以便它可以在插入新表后立即自动刷新等?

sql-server intellisense ssms refresh

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

如何刷新PreferenceActivity以显示设置中的更改?

根据以下代码,您能告诉我如何刷新PreferenceActivity窗口以立即显示设置中的更改吗?例如:用户点击主chime切换复选框为true(勾选),我希望用户立即看到其他设置,如ChimeOn15Past复选框也是true(勾选)

SharedPreferences.Editor prefEditor = clockSettings.edit(); // Allow the settings to be changed.

if (booleanMasterChimeToggle == true) {
    prefEditor.putBoolean("ChimeOnTheHour", true);
    prefEditor.putBoolean("ChimeOn15Past", true);
    prefEditor.putBoolean("ChimeOn30Past", true);
    prefEditor.putBoolean("ChimeOn45Past", true);

    strNotifyMessage = "Full chiming has now been set.";

} else {
    prefEditor.putBoolean("ChimeOnTheHour", false);
    prefEditor.putBoolean("ChimeOn15Past", false);
    prefEditor.putBoolean("ChimeOn30Past", false);
    prefEditor.putBoolean("ChimeOn45Past", false);

    strNotifyMessage = "Full chiming has now been disabled.";
}
Run Code Online (Sandbox Code Playgroud)

settings android refresh preferenceactivity

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

"Order By"使用列名称的参数

我们希望在使用Visual Studio DataSet Designer创建的查询或存储过程的"Order By"子句中使用参数.

例:

  FROM TableName
 WHERE (Forename LIKE '%' + @SearchValue + '%') OR
       (Surname LIKE '%' + @SearchValue + '%') OR
       (@SearchValue = 'ALL')
ORDER BY @OrderByColumn
Run Code Online (Sandbox Code Playgroud)

显示此错误:

Variables are only allowed when ordering by an expression referencing 
a column name.
Run Code Online (Sandbox Code Playgroud)

sql sql-server parameters sql-order-by visual-studio

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

ListPreference默认值未显示

我试图设置ListPreference的默认值,但没有显示任何内容.

你可以检查我的代码是否有任何错误?

谢谢.

真的,Emad

这是在settings.xml文件中:

<PreferenceCategory android:title="Media:">
    <CheckBoxPreference android:key="ChimeWhenMusicIsPlaying"
        android:title="@string/ChimeWhenMusicIsPlayingTitle" android:summary="@string/ChimeWhenMusicIsPlayingSummary"
        android:defaultValue="false" />

    <ListPreference android:title="Chime Volume"
        android:key="ChimeVolume" android:summary="Select volume for the chiming sound."
        android:entries="@array/chimeVolumeLabels" android:entryValues="@array/chimeVolumeValues"
        android:defaultValue="1" />

</PreferenceCategory>
Run Code Online (Sandbox Code Playgroud)

这是在数组文件中:

<resources>

    <string-array name="chimeVolumeLabels">
    <item>Default</item>
    <item>Soft</item>
    <item>Medium</item>
    <item>Loud</item>
    </string-array>

    <string-array name="chimeVolumeValues">
    <item>1</item>
    <item>2</item>
    <item>3</item>
    <item>4</item>
    </string-array>
</resources>
Run Code Online (Sandbox Code Playgroud)

settings android default-value listpreference

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

如何使用广播接收器检查音乐是否正在播放?

我想阻止我的一些代码在当前播放音乐或视频时执行.我如何使用广播接收器实现这一目标?

android background-music broadcastreceiver audio-player android-music-player

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

使用Gmail发送电子邮件会导致超时错误

我们正在测试一些代码,以便从表单中使用Gmail发送电子邮件,但会收到超时错误.

您能否告诉我们此代码中缺少什么来发送电子邮件?

    Try
        Dim SmtpServer As New SmtpClient()
        Dim mail As New MailMessage()

        SmtpServer.EnableSsl = True
        SmtpServer.Credentials = New Net.NetworkCredential("ouremail@gmail.com", "MyPasswordGoesHere")
        SmtpServer.Port = 465
        SmtpServer.Host = "smtp.gmail.com"

        mail.From = New MailAddress("ouremail@gmail.com")
        mail.To.Add("ouremail@gmail.com")
        mail.Subject = "Test Mail"
        mail.Body = "This is for testing SMTP mail from GMAIL"

        SmtpServer.Send(mail)

        MsgBox("mail sent")

    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
Run Code Online (Sandbox Code Playgroud)

更新:使用MailBee进行代码更改.这就是我们向所有客户发送电子邮件的方式:

    Dim strSqlStatement As String = "Select CustomerName, Email " & _
                               "From Customers " & _
                              "Where Email Is Not Null"
    If IsConnected() …
Run Code Online (Sandbox Code Playgroud)

vb.net email smtp timeoutexception

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

无法删除Visual Studio 2010创建的项目文件夹

我创建了一个我想要完全删除的Visual Studio 2010项目,其中包括所有项目文件夹.

我以管理员身份登录.

我试图删除文件资源管理器中的文件夹,但只收到一条消息,告诉我需要具有管理员权限才能删除它.

Visual Studio似乎已锁定管理员帐户无法访问的项目文件夹.

我知道我有权自行创建和删除文件夹,因为我创建了一个测试文件夹并将其删除而没有任何问题.

你知道解决这个问题吗?

directory access-denied visual-studio-2010

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

ModuleNotFoundError:使用 Visual Studio Code 在 Python 中没有名为“PySide6”的模块

*** 更新*** 这个问题已由whiteroom 在评论部分解决。问题是需要更改 Python 解释器设置以指向正确的设置。白室问题的回答也非常有帮助。

*** 原始问题 *** 我在我的 MacBook 上安装了 PySide6 并确认它已安装,如所附屏幕截图所示。我对 Python 和 Mac 终端应用程序也很陌生。

pip3 install PySide6
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我尝试从 Visual Studio Code 编辑器运行这个简单的应用程序。

from PySide6.QtWidgets import QApplication,QLabel
app   = QApplication([])
label = QLabel('hello world')
label.show()
app.exec()
Run Code Online (Sandbox Code Playgroud)

Python 响应此错误:

Traceback (most recent call last):
  File "/Users/emad-ud-deen/Development/Python/Practice/PySide6 Test.py", line 1, in <module>
    from PySide6.QtWidgets import QApplication,QLabel
ModuleNotFoundError: No module named 'PySide6'
Run Code Online (Sandbox Code Playgroud)

我能够运行使用 PySide6 编写的应用程序而不会出现该错误的唯一方法是从终端中的命令行。

你能告诉我如何让 Visual Studio Code 识别 PySide6 吗?

python installation pyside6

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

适用于带有SQL Server 2012 Business Intelligence的Visual Studio 2010的安装顺序

我有一个Windows 7 64位(Ultimate)虚拟机,并希望安装以下内容:

Visual Studio 2010 (Ultimate)
SQL Server 2012 Business Intelligence (with SSIS and SSRS)
Run Code Online (Sandbox Code Playgroud)

但我不确定是否有正确的顺序来安装这些项目,以免发生冲突.我很担心因为我知道VS2010安装了SQL Server 2008 express.如果我先做SQL Server 2012,我希望它不会过度使用2008版本编写我的SQL Server安装.

如果已安装较新版本,VS2010是否会跳过安装SQL Server 2008?

更新:

我按照Justin的说明安装了文件.
VS2010安装程序检测到SQL Server 2012的安装和安装没​​有任何问题.
当我运行VS2010时,它告诉我需要安装VS2010 SP1,因为已经安装了较新的SQL Server 2012文件.
我安装了SP1并再次运行VS2010,所有内容都已加载并运行良好.
我还加载了SQL Server Management Studio,并且仍然可以连接到SQL Server 2012而没有任何问题.

sql-server installation conflict virtual-machine visual-studio-2010

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