小编Mar*_*num的帖子

循环图像

我知道这很多,但我无法让它工作:/

    <div class='container'>
        <img src="images/1.jpg" alt="">
        <img src="images/2.jpg" alt="">
    </div>
Run Code Online (Sandbox Code Playgroud)

所以我有 2 个图像,下面的 CSS 被固定为浏览器窗口的完整大小:

        <style type="text/css">
        .container {
            position:fixed; 
            top:-50%; 
            left:-50%; 
            width:200%; 
            height:200%;
        }
        .container img {
            position:absolute; 
            top:0; 
            left:0; 
            right:0; 
            bottom:0; 
            margin:auto; 
            min-width:50%;
            min-height:50%;
        }
    </style>
Run Code Online (Sandbox Code Playgroud)

目前,它仅显示以全尺寸显示的最后一张图像 (2)。但是,我想使用一些 jQuery 来显示第一个,然后在 X 秒后淡出数字 1 并在每个图像中循环淡出。我认为最好使用 setInterval,然后使用淡入淡出和淡入淡出图像,但无论我做什么都不起作用。

我试图沿着这条线走下去:

        <script type="text/javascript">
        $(document).ready(function() {

            $('.container').children('img').each(function(i) { 
                $(this).fadeOut();
            }); 

        });
    </script>
Run Code Online (Sandbox Code Playgroud)

html css jquery

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

HTML5表单模式/验证

我试图想出一个HTML5表单的有效模式.我想允许所有大写和小写字母,空格,数字和符号/\@#$%&.

我尝试了几种不同的格式,但我没有运气.

到目前为止,我有:

Address: <input type="text" name="Address" size="25"  pattern="[a-zA-Z0-9 ]{2,35}]" title="Title" required/>
Run Code Online (Sandbox Code Playgroud)

html validation html5 html5-validation

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

对象到字节的转换

当我试图将一个对象转换为字节数组时,我得到了一个奇怪的数组.这是代码:

        using (MemoryStream ms = new MemoryStream())
        {
            BinaryFormatter bf = new BinaryFormatter();
            bf.Serialize(ms, obj);
            Console.WriteLine(ByteArrayToString(ms.ToArray()));
        }
//int obj = 50;

//string ByteArrayToString(byte[] byteArr) the functionality of this method is pretty obvious
Run Code Online (Sandbox Code Playgroud)

结果是这样的:

"00 01 00 00 00 FF FF FF FF 01 00 00 00 00 00 00 04 01 00 00 00 0C 53 79 73 74 65 6D 2E 49 6E 74 33 32 01 00 00 00 07 6D 5F 76 61 6C 75 65 00 …

.net c# conventions

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

转换错误

有人可以告诉我为什么我得到以下错误,当我通过我的代码,我不确定它是否与我的SQL语句的问题,因为这似乎是好的,但我在下面添加它,以便我可以得到一个第二个意见

"从字符串转换日期/时间时转换失败"

public static int GetConveyorProductionCount(string machineNameV, string StartTimeV, string EndTimeV)
    {

        try
        {
            int count;

            SqlParameter param01 = new SqlParameter("@param01", SqlDbType.VarChar, 5);
            param01.Value = machineNameV;

            SqlParameter param02 = new SqlParameter("@param02", SqlDbType.VarChar, 5);
            param02.Value = StartTimeV;

            SqlParameter param03 = new SqlParameter("@param03", SqlDbType.VarChar, 5);
            param03.Value = EndTimeV;

            SqlCommand getConveyorProductionSC = new SqlCommand("SELECT cast([" + machineNameV + "] as int) FROM VWCONVEYORPRODUCTION WHERE([DA_TE] BETWEEN @param02 AND @param03)", myConnection);

            getConveyorProductionSC.Parameters.Add(param01);
            getConveyorProductionSC.Parameters.Add(param02);
            getConveyorProductionSC.Parameters.Add(param03);

            myConnection.Open();
            object result = getConveyorProductionSC.ExecuteScalar();
            myConnection.Close();

            if (result == DBNull.Value)
            { …
Run Code Online (Sandbox Code Playgroud)

c# sql parameters

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

按百分比绘制饼图

如何使用ImageMagick按百分比绘制饼图?

例如:如果以百分比形式给出45之类的值 - 如何使用Ruby或bash命令绘制仅有45%的饼图?

如果我使用ImageMagick的draw运算符,需要如何设置弧值?或者我如何从整数值计算acr值?

例如:

convert -size 100x100 xc:none -fill white -stroke black/
-draw "path 'M 30,40   A 1,1  0  0,0 70,20 ....  ??
Run Code Online (Sandbox Code Playgroud)

我试着阅读并理解这些例子,但弧形计算对我来说是一个谜.

imagemagick

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

hasNext不在javascript中处理集合

我在javascript中有以下代码,它检索两行:

 var raceCursor = RacesCollection.find({eventId: "e1"});
    var race;
    while(raceCursor.hasNext()){
    race = raceCursor.next();                   
    console.log(race.raceName);
    }
Run Code Online (Sandbox Code Playgroud)

似乎没有错,但它显示:

Uncaught TypeError: Object [object Object] has no method 'hasNext' 在JavaScript控制台中.

我在这里缺少什么?

MongoDB方法是否需要在javascript中进行特殊导入,以便在集合中使用?

该系列是:

RacesCollection  = new Meteor.Collection("RacesCollection");
RacesCollection.insert({raceId:"r1", eventId:"e1", raceName:"Moto race 1", status:"statusDetail"});
RacesCollection.insert({raceId:"r2", eventId:"e1", raceName:"Moto race 2", status:"statusDetail"});
Run Code Online (Sandbox Code Playgroud)

任何建议都会得到满足.谢谢..

javascript mongodb meteor

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

计算日期之间的天数差异

在我的代码中,日期之间的差异是错误的,因为它应该是38天而不是8天.我该怎么办?

package random04diferencadata;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Random04DiferencaData {

    /**
     * http://www.guj.com.br/java/9440-diferenca-entre-datas
     */
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("hh:mm dd/mm/yyyy");
        try {
            Date date1 = sdf.parse("00:00 02/11/2012");
            Date date2 = sdf.parse("10:23 10/12/2012");
            long differenceMilliSeconds = date2.getTime() - date1.getTime();
            System.out.println("diferenca em milisegundos: " + differenceMilliSeconds);
            System.out.println("diferenca em segundos: " + (differenceMilliSeconds / 1000));
            System.out.println("diferenca em minutos: " + (differenceMilliSeconds / 1000 / 60));
            System.out.println("diferenca em horas: " + (differenceMilliSeconds / 1000 / …
Run Code Online (Sandbox Code Playgroud)

java date

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

ListBoxItem的工具提示绑定到字符串列表时

当ListBox控件绑定到字符串列表时,我们如何显示ListBoxItem的工具提示.下面是我的ListBox的源代码,其中ConcernedConditions是List类型.

<ListBox ItemsSource="{Binding ConcernedConditions}" Style="{StaticResource CustomStyle}">
    <ListBox.ItemContainerStyle>
        <Style TargetType="{x:Type ListBoxItem}">
            <Setter Property="Template"> 
                <Setter.Value> 
                    <ControlTemplate TargetType="{x:Type ListBoxItem}"> 
                        <ContentPresenter /> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter>
        </Style>
    </ListBox.ItemContainerStyle>
</ListBox>
Run Code Online (Sandbox Code Playgroud)

wpf listbox tooltip mvvm

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

Ruby on Rails错误,推送到heroku,sqlite3

我将我的应用程序推送到heroku有问题.它说我必须安装sqlite3,但我已经安装了sqlite!我正在使用OSX Mountain Lion

>> sudo gem install sqlite3

Building native extensions.  This could take a while...
Successfully installed sqlite3-1.3.7
1 gem installed

>> git push heroku master
Counting objects: 115, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (99/99), done.
Writing objects: 100% (115/115), 33.62 KiB, done.
Total 115 (delta 12), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Fetching …
Run Code Online (Sandbox Code Playgroud)

sqlite ruby-on-rails heroku

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

创建自定义参数选择

我有一个方法,需要一个参数来区分几个不同的场景.我可以传递一个字符串,并希望我(或将来将使用该类的任何人)将使用其中一个已识别的命令.我宁愿有这样的结构:

方法声明:

myMethod(myOption opt){ ... }
Run Code Online (Sandbox Code Playgroud)

这个电话应该是这样的:

myMethod(myOption.option1);
Run Code Online (Sandbox Code Playgroud)

在方法中我应该能够这样做:

if (opt == myOption.option1){ ... }
Run Code Online (Sandbox Code Playgroud)

当我传递按钮或图标配置时,我相信这是Message Box的工作方式.

我经历了很多实验并经常搜索,但我没有找到任何东西.也许这是因为我没有找到正确的关键字组合来提供谷歌.

谢谢你的帮助!

c# parameters

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