问题背景: 我们正在构建一个需要用户登录的在线Web应用程序.我们将添加"让我在此计算机上登录x周"的功能.
题:
您应该允许用户保持登录状态的正常标准是什么?*2周?*4周?*永远?
为什么?是否有理由不允许我们的用户永远保持登录状态?
我有一个名为mysql的数据库表POST.
其中一个字段是时间戳,在创建记录时设置为默认为mysql服务器上的当前时间戳.
我需要一个SQL查询来提取在特定月份内具有时间戳的所有行.也就是说,三月的所有记录,或十一月的所有记录等.
我有一些Windows Phone 7代码,使用SoundEffect.FromStream开始播放声音.我正在使用它而不是普通的媒体对象,因为我需要在一个页面上有多个音频剪辑.
但是,根据某些外部事件,我想停止特定的声音播放.由于通过开放流播放的声音是"玩和忘记"我无法弄清楚如何引用这种播放声音并停止它.
public void PlaySoundCircus(object sender, RoutedEventArgs e)
{
if (audioPlaying == false)
{
using (var stream = TitleContainer.OpenStream("circus.wav"))
{
var effect = SoundEffect.FromStream(stream);
FrameworkDispatcher.Update();
effect.Play();
}
audioPlaying = true;
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个使用Bing Map控件的WP Phone应用程序.我有一个对象数组,每个对象都有一个位置.我迭代数组以将引脚放在地图上(见下文).我有一个绑定到每个引脚的触摸事件,允许用户点击引脚开始动作.
现在 - 我希望,在点击时,显示与该引脚相关的对象的信息,以便在文本框中显示.如何从与点击/单击的图钉对应的数组中检索对象?
foreach (wikiResult result in arrayResults)
{
double lat = double.Parse(result.Latitude, CultureInfo.InvariantCulture);
double lng = double.Parse(result.Longitude, CultureInfo.InvariantCulture);
statusTextBlock.Text = result.Latitude + " " + result.Longitude + " " + lat + " " + lng;
GeoCoordinate d = new GeoCoordinate(lat, lng);
Pushpin pin;
pin = new Pushpin();
pin.Location = d;
pin.Content = result.Name;
pin.MouseLeftButtonUp += new MouseButtonEventHandler(pin1_MouseLeftButtonUp);
myMap.Children.Add(pin);
}
void pin1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
//display the content from the object in a text box …Run Code Online (Sandbox Code Playgroud) 我正在发送一个SQL UPDATE查询,而mySQL数据库表现得很奇怪.它返回一个成功的响应,但会影响0行.代码是:
UPDATE place
SET city='Qatar' AND country='Qatar'
WHERE placeid='25'
Run Code Online (Sandbox Code Playgroud)
Response: Successful 0 row(s) affected. ( Query took 0.0003 sec )
有肯定与数据库placeid = '25'的记录.如果我做一个SELECT*FROM place WHERE placeid ='25'我得到了返回的记录.
有任何想法吗?谢谢!
编辑:
Table structure:
SQL query: describe place;
Rows: 9
Field Type Null Key Default Extra
title text NO NULL
description text NO NULL
latitude float NO NULL
longitude float NO NULL
image text NO NULL
placeid int(11) NO PRI NULL
country text YES NULL
city text YES NULL
address …Run Code Online (Sandbox Code Playgroud) 我想创建一个包含我正在处理的所有Pushpin对象的数组.在尝试填充Array时,我收到NullReferenceException抛出未处理的错误.我已经阅读了尽可能多的文档,但无法解决发生的事情.
我至少尝试了以下方法:
Pushpin[] arrayPushpins;
int i = 0;
foreach (Result result in arrayResults)
{
Pushpin pin;
pin = new Pushpin();
pin.Location = d;
myMap.Children.Add(pin);
arrayPushpins[i] = new Pushpin();
arrayPushpins.SetValue(pin, i);;
i++;
}
Run Code Online (Sandbox Code Playgroud)
和...
Pushpin[] arrayPushpins;
int i = 0;
foreach (Result result in arrayResults)
{
Pushpin pin;
pin = new Pushpin();
pin.Location = d;
myMap.Children.Add(pin);
arrayPushpins[i] = new Pushpin();
arrayPushpins[i] = pin;
i++;
}
Run Code Online (Sandbox Code Playgroud)
似乎没有任何工作......我每次都会得到NullReference错误.有任何想法吗?非常感谢!将.
我有一个4x LineSeries的图表.我定义了两种不同的样式来表示线条,我希望能够动态地更改应用于特定LineSeries的样式(例如,基于用户点击按钮等).
我似乎无法弄清楚如何从c#更新样式.任何帮助赞赏!
我试过了:
lineChartMood.PolylineStyle = this.Resources.PolylineStyle2 as Style;
Run Code Online (Sandbox Code Playgroud)
但是这会返回Null异常.
这是页面的XAML,包括样式定义:
<phone:PhoneApplicationPage
x:Class="Bhutaan.ChartingTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:local="clr-namespace:Bhutaan"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<Style x:Key="PolylineStyle" TargetType="Polyline">
<Setter Property="StrokeThickness" Value="5"/>
</Style>
<Style x:Key="PolylineStyle2" TargetType="Polyline">
<Setter Property="StrokeThickness" Value="1"/>
</Style>
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel …Run Code Online (Sandbox Code Playgroud) 事实证明我毕竟需要高中代数...而且我很愚蠢; 我忘记了如何做基本代数.
我有这个等式:
p = nc + s(n-1)
Run Code Online (Sandbox Code Playgroud)
因此,例如:
c = (p - s(n-1)) / n
Run Code Online (Sandbox Code Playgroud)
如何解决方程式以解决s?即,s = ??
谢谢!
(我是Java的新手,请原谅我的无知).
我有一个非常简单的课程:
public class Bill {
private String Total;
private int Tip;
private int People;
Bill() {
Total = "0";
Tip=0;
People=0;
}
Bill (String total, int people, int tip) {
Total = total;
Tip = tip;
People = people;
}
//the problem is here somewhere.
private Double Split = (Double.parseDouble(Total) * ((double)Tip / 100)) / (double)People;
public String getTotal() {
return Total;
}
public double getSplit() {
return Split;
}
public double getTip() {
return Tip;
}
}
Run Code Online (Sandbox Code Playgroud)
当我调用'getSplit()'方法时,运行时崩溃并出现NullPointer异常: …