问题列表 - 第45072页

IOS:UIDatePicker渲染效果不佳,背景为黑色

当我创建一个新的UIDatePicker,其Mode设置为CountDownTimer时,它呈现黑色背景很差.有人有任何见解吗? 在此输入图像描述

Normal Picker看起来像这样:

在此输入图像描述

代码:请注意,UIButton是拾取器后面的全屏按钮,用于关闭视图

intervalPicker = new UIDatePicker(new RectangleF(0, this.tvc.View.Bounds.Height - 135, this.tvc.View.Bounds.Width, 200));
intervalPicker.Mode = UIDatePickerMode.CountDownTimer;
intervalPicker.CountDownDuration = DeviceSession.CurrentBehavioralEvent.Duration*60;

intervalPicker.ValueChanged += new EventHandler(intervalPicker_EditingChanged);
UIButton b = UIButton.FromType(UIButtonType.Custom);
b.Opaque = false;
b.BackgroundColor = UIColor.Clear;
b.Frame = new RectangleF(0, 0, this.tvc.View.Bounds.Width, this.tvc.View.Bounds.Height);
b.TouchUpInside += (o, s) => {
    intervalPicker.RemoveFromSuperview();
        b.RemoveFromSuperview();
    };

this.tvc.NavigationController.View.AddSubview(b);
this.tvc.NavigationController.View.AddSubview(intervalPicker);
Run Code Online (Sandbox Code Playgroud)

rendering uidatepicker xamarin.ios ipad ios

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

cURL将文件上载到MS Windows上的远程服务器

当我使用linux并尝试使用此脚本将文件上传到远程服务器时,一切都很好.但如果我使用Windows,那么脚本无法正常工作.脚本:

$url="http://site.com/upload.php";
$post=array('image'=>'@'.getcwd().'images/image.jpg');
$this->ch=curl_init();
curl_setopt($this->ch, CURLOPT_URL, $url);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($this->ch, CURLOPT_TIMEOUT, 30);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($this->ch, CURLOPT_POST, 1);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $post);
$body = curl_exec($this->ch);
echo $body; // << on Windows empty result
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

PHP 5.3

Windows 7 - 不工作,Ubuntu Linux 10.10 - 工作

php linux windows upload curl

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

jquery body委托鼠标悬停和mouseout同时触发

我有一个代理人在鼠标悬停和mouseout上等待类缩略图元素

 $('body').delegate('.thumbnail', 'mouseover mouseout', function(e){
            if(e.type=='mouseover' && !isMousingOver ){
              enlarge_thumbnail(this);
              isMousingOver = true;
              console.log('enlarged')
            }else if(e.type=='mouseout'){
              reset_thumbnail(this);
              isMousingOver = false;
              console.log('resetting')
            }
        })
Run Code Online (Sandbox Code Playgroud)

但每当我在div.thumbnail元素的边界内移动鼠标时,我会在日志中放大重置放大重置放大重置放大重置...

其中enlarge_thumbnail和reset_thumbnail是:

function enlarge_thumbnail(element_to_set, how_much) {
    element_to_set = $(element_to_set); // jQueryize the element;
          how_much = parseInt(how_much);// Make sure it's an intger;
    if( element_to_set.length && !isNaN(how_much) ){
      element_to_set.css({width:how_much});
    }
  }

function reset_thumbnail(element_to_reset) {
    element_to_reset = $(element_to_reset); // jQueryize the element;
    element_to_reset.css({width:'200px'});
  }
Run Code Online (Sandbox Code Playgroud)

如果我不移动鼠标,并且鼠标在div.thumbnail元素的边界内是静止的,那么它就可以实现我想要的:放大缩略图而不是重置它.

可能是什么问题?

jquery delegates

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

sqlbulkcopy,我想覆盖数据库中的当前行

在我的程序中,我填充数据表,然后将其批量复制到我的数据库中.

但是,如果行中的3列匹配,我希望它覆盖数据库中的一行.

例如,如果我有5列

membernum dateregistered name address city state

因此,如果membernum,dateregistered和name匹配,我想覆盖该行.使用批量插入的数据.在我的程序中,没有填充整个数据库表,我认为它可以加载它.

Using bcp As SqlBulkCopy = New SqlBulkCopy(SqlDataSource2.ConnectionString)

    bcp.DestinationTableName = "dbo.dashboardtasks"

    bcp.WriteToServer(table)
Run Code Online (Sandbox Code Playgroud)

如果最好的方法是使用我的数据库表创建数据表,我将如何比较行,然后覆盖特定3列中匹配的表.然后仅使用已更改的行或新行来更新数据库

INSERT INTO [dashboardtasks] ([tour], [taskname], [deptdate], [tasktype], [desc], [duedate], [compdate], [comments], [agent], [compby], [graceperiod], [id])
Run Code Online (Sandbox Code Playgroud)

sql vb.net sql-server-2005

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

随机 15px 边距?

我得到随机的 15px 顶部和底部边距,但我不知道它们来自哪里。

这种情况在 IE 中不会发生,只有 FF 和 Chrome 才会发生。

在以下示例中,每个“Here is content”段落上方和下方的间距是意外的。

#pageContent {
    background-color: #fff;
    padding: 10px;
}

#contentHead {
    height: 33px;
    width: 882px;
    color: black;
    font-size: 14px;
    font-weight: bold;
    line-height: 34px;
    padding-left: 48px;
    text-transform: uppercase;
}

#contentBody{
    background-color: #d4d3d1;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    -moz-border-radius: 0 0 10px 10px;
    border: 1px solid #8b8b8b;
}

#contentNoSidebar{
    background-color: #000;
    color: white;
}
Run Code Online (Sandbox Code Playgroud)
<div id="pageContent">
  <div id="contentHead">Sample Page</div>
  <div id="contentBody">
    <div id="contentNoSidebar">
      <p>Here is content</p>
      ...
      <p>Here is content</p>
    </div>
  </div> …
Run Code Online (Sandbox Code Playgroud)

html css margin

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

外键与部分键及其ER表示

我无法理解部分键/弱实体和外键之间的区别.我觉得自己不能理解这些东西是个白痴.

据我了解:

Weak Entity: An entity that is dependent on another entity.
Partial Key: Specifies a key that that is only partially unique.  Used for weak entities.

vs

Foreign Key: A key that is used to establish and enforce a relation between data in different tables.
Run Code Online (Sandbox Code Playgroud)

这些似乎不是一样的东西,但是我无法区分它们的用途.

以[非常]简单的例子为例:

We have employees specified by an empid.  We also have children specified by name.  A
child is uniquely specified by name when the parent (employee) is known.
Run Code Online (Sandbox Code Playgroud)

子实体是否是一个弱的身份,其中部分密钥是名称(部分唯一)?或者我应该使用外键,因为我正在努力建立和加强员工与孩子之间的关系?我觉得我可以为两者辩护,但我也觉得我在这里缺少一些东西.任何见解都值得赞赏,我为这些愚蠢的问题道歉.

entity-relationship relational-database

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

制作半透明的Theme.Wallpaper

我正试图建立一个孩子Theme.Wallpaper.NoTitleBar,但我希望它只是半透明的.我目前的风格是这样写的:

<resources>
    <style name="CustomClear" parent="@android:style/Theme.Wallpaper.NoTitleBar">
        <item name="android:color">#F0000000</item>
    </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

最终目标是仍然能够在背景中看到壁纸,但是使它变暗以便文本更容易阅读.我在这里至少走在正确的轨道上吗?

android

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

Websockets 中的 \x00 和 \xff 是什么意思?

为什么通过 websocket 的消息总是以 开头\x00和结尾\xff,如下所示\x00Your message\xff

formatting message websocket

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

如何让EFProf和EFProviderWrapper在Entity Framework Connection上一起工作

有没有人找到一种方法让Kowalski的EFProviderWrapper框架Rhino的EFProf(Entity Framework Profiler)一起在同一个Entity Framework上下文/连接中运行?目前,如果我尝试在使用EFProviderWrapper包装的EntitytConnection时注册EFProf Profiler,则在尝试创建新连接时,在运行时会收到以下错误:

无法将"HibernatingRhinos.Profiler.Appender.ProfiledDataAccess.ProfiledConnection"类型的对象转换为"EFProviderWrapperToolkit.DbConnectionWrapper"类型.

从我可以看出,似乎是因为EFProf最后注册,而EFProviderWrapperToolkit期望是最后注册的.我猜这需要更改EFProviderWrapperToolkit可能创建一个新的DbConnectionWrapper类型,允许非EFProviderWrapper类型?如果有人对多个DBConnection提供程序框架有任何经验,那么我很高兴.

dbconnection entity-framework-4

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

为什么这段代码使用*char作为缓冲区指针?

在寻找循环缓冲区代码以供重用时,我遇到了使用char的问题让我感到困惑

typedef struct CircularBuffer
{
    void *buffer;     // data buffer
    void *buffer_end; // end of data buffer
    size_t capacity;  // maximum number of items in the buffer
    size_t count;     // number of items in the buffer
    size_t sz;        // size of each item in the buffer
    void *head;       // pointer to head
    void *tail;       // pointer to tail
} CircularBuffer;

void cb_push_back(CircularBuffer *cb, const void *item)
{
    if(cb->count == cb->capacity)
        // handle error
        memcpy(cb->head, item, cb->sz);

    ////////////// here's the part …
Run Code Online (Sandbox Code Playgroud)

c pointers char

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