小编Bo.*_*Bo.的帖子

将任意flash对象wmode更改为透明

我需要将wmode任意flash对象从外部js文件更改为透明,以确保它们不使用Jquery或类似的lib来隐藏菜单.

在FF我使用getElementsByTagName("embed")和设置属性.它似乎运作良好.

具体来说我在IE7 中遇到了objectswfObject库设置的问题.

swfObject 在iE7中创建以下代码:

<OBJECT id=mymovie height=400 width=134 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>
        <PARAM NAME="_cx" VALUE="3545">
        <PARAM NAME="_cy" VALUE="10583">
        <PARAM NAME="FlashVars" VALUE="">
        <PARAM NAME="Movie" VALUE="imgs/site/tower.swf">
        <PARAM NAME="Src" VALUE="imgs/site/tower.swf">
        <PARAM NAME="WMode" VALUE="Window">
        <PARAM NAME="Play" VALUE="0">
        <PARAM NAME="Loop" VALUE="-1">
        <PARAM NAME="Quality" VALUE="High">
        <PARAM NAME="SAlign" VALUE="">
        <PARAM NAME="Menu" VALUE="-1">
        <PARAM NAME="Base" VALUE="">
        <PARAM NAME="AllowScriptAccess" VALUE="">
        <PARAM NAME="Scale" VALUE="ShowAll">
        <PARAM NAME="DeviceFont" VALUE="0">
        <PARAM NAME="EmbedMovie" VALUE="0">
        <PARAM NAME="BGColor" VALUE="FFFFFF">
        <PARAM NAME="SWRemote" VALUE="">
        <PARAM NAME="MovieData" VALUE="">
        <PARAM NAME="SeamlessTabbing" VALUE="1">
        <PARAM …
Run Code Online (Sandbox Code Playgroud)

javascript flash swfobject object wmode

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

在python字典中插入或更新键

我有一个dict1包含超过20,000个键的python字典,我希望update用另一个字典dict2.字典看起来像这样:

dict1
  key11=>[value11]
  key12=>[value12]
  ...
  ...
  keyxyz=>[value1x]      //common key
  ...... so on

dict2
  key21=>[value21]
  key22=>[value22]
  ...
  ...
  keyxyz=>[value2x]      // common key
  ........ so on
Run Code Online (Sandbox Code Playgroud)

如果我使用

dict1.update(dict2)
Run Code Online (Sandbox Code Playgroud)

然后其键dict1与键的类似dict2将使其值被值覆盖dict2.我想要的是如果一个键已经存在于dict1中,那么dict2中该键的值应该附加到dict1的值.所以

dict1.conditionalUpdate(dict2)
Run Code Online (Sandbox Code Playgroud)

应该导致

dict1
  key11=>[value11]
  key12=>[value12]
  key21=>[value21]
  key22=>[value22]
  ...
  ...
  keyxyz=>[value1x,value2x]
Run Code Online (Sandbox Code Playgroud)

一种天真的方法是迭代dict2每个键的键dict1并插入或更新键.有更好的方法吗?python是否支持支持这种功能的内置数据结构?

python algorithm dictionary

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

Highcharts:如何在图表区域内添加HTML

是否可以在图表区域内添加自定义HTML(例如div)(在边框内部; Highcharts Renderer似乎不提供此选项)?如果是的话怎么会这样做呢?

任何帮助表示赞赏.

javascript jquery charts graph highcharts

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

C#只有一个线程执行

我有一个多线程的应用程序.我希望只有一个线程执行我的函数,而其他线程在执行函数时传递它.我怎样才能做到这一点?

我的方法是这样的:

    public void setOutput(int value)
    {
        try
        {
            GPOs gpos = reader.Config.GPO;
            gpos[1].PortState = GPOs.GPO_PORT_STATE.TRUE;
            gpos[2].PortState = GPOs.GPO_PORT_STATE.TRUE;
            Thread.Sleep(WAIT);
            gpos[1].PortState = GPOs.GPO_PORT_STATE.FALSE;
            gpos[2].PortState = GPOs.GPO_PORT_STATE.FALSE;
        }
        catch (Exception ex)
        {
            logger.Error("An Exception occure while setting GPO to " + value + " " + ex.Message);
        }
    }
Run Code Online (Sandbox Code Playgroud)

c# multithreading

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

使用Ember.js构建搜索框搜索

我想在我的Notes.Application中构建一个简单的搜索框来搜索我的笔记.我正在寻找这个网站,Ember表格和谷歌,并没有那么多的解决方案.我发现只有两个,他们不适合我的应用程序皱眉.问题是我不知道如何做到这一点.

这是我的应用程序:

<script type="text/x-handlebars" data-template-name="index">  
    <div class="wrap">
      <div class="bar">
      {{input type="text" class="search" placeholder="Where is my bookmark??" value=search action="query"}}

        <div class="bar-buttons">
          <button {{action "addNote"}}> NEW </button>
          <button> HOME </button>
        </div>
      </div>
      <aside>
        <h4 class="all-notes">All Notes {{length}}</h4>
          {{#each item in model}}
            <li>
              {{#link-to 'note' item}} {{item.title}} {{/link-to}}
            </li>
          {{/each}}
      </aside>
      {{outlet}}
    </div> 
</script>
Run Code Online (Sandbox Code Playgroud)

控制器:

Notes.IndexController = Ember.ArrayController.extend ({
search: '',

actions:{
    query: function() {
      // the current value of the text field
      var query = this.get('search');
    },

    addNote: function () {
        this.transitionToRoute('main'); …
Run Code Online (Sandbox Code Playgroud)

javascript ember.js ember-data

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

在C中转换为unsigned char

我面临以下问题:当尝试强制转换为unsigned char时,我得到了意外的值.我正在使用的代码:

unsigned char MyVal1  = ((0xF1E3 && 0xff00) >> 8);
unsigned char MyVal2 = (unsigned char)((0xF1E3 && 0xff00) >> 8);
unsigned char MyVal3 = (unsigned char)((0xF1E3 && 0xff));
Run Code Online (Sandbox Code Playgroud)

我将所有三个变量存储在一个数组中.

我得到的输出(查看数组中的值;数组是unsigned char数组):

0x00 
0x00
0x01
Run Code Online (Sandbox Code Playgroud)

虽然我在期待:

0xF1 
0xF1
0xE3
Run Code Online (Sandbox Code Playgroud)

有人可以帮我解决我做错了什么吗?

c c++ casting

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

iPhone:UITextView在编辑时不会扩展

我在滚动视图上使用UITextView ...我希望它在我写东西时自动扩展......但我无法做到......

textViewBusiness = [[UITextView alloc] initWithFrame:CGRectMake(25,332,268,60)];
textViewBusiness.text=strMyBusiness;
textViewBusiness.editable=NO;
textViewBusiness.font = [UIFont fontWithName:@"Arial" size: 17.0];
textViewBusiness.layer.borderWidth = 2.0f;
textViewBusiness.layer.borderColor = [[UIColor grayColor] CGColor];
textViewBusiness.backgroundColor = [UIColor clearColor];
[textViewBusiness setTextColor:[UIColor blackColor]];
[self.scrollView addSubview: textViewBusiness];

CGRect frame = textViewBusiness.frame;
frame.size.height = textViewBusiness.contentSize.height;
textViewBusiness.frame = frame;
Run Code Online (Sandbox Code Playgroud)

这段代码对我不起作用......

谢谢

uitextview ios xcode4

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

if语句中带有等号"="而不是"=="的语句

我在代码中发现了一个错误(if语句应该有"=="instad"=")并且我几乎没有问题.

示例代码:

int i = 5;
if (i = MyFunction())  // MyFunction() returns an int; this is where bug was made
{
  // call A()
}
else
{
  // call B()
}
Run Code Online (Sandbox Code Playgroud)

从我收集它应该总是调用A().
1.我的假设是否正确()?
2.这种情况适用于所有/大多数编译器(任何例外)吗?

c

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