问题列表 - 第38827页

changing colors with jquery with a color picker?

i have this jquery script that changes the color of the background instantly by entering a color code into the textbox, the working example is in jsfiddle link below.

http://jsfiddle.net/7jg4e/

but instead of the input field i wanted to use a color picker custom skin, becuase i dont want user to deal with hex code(just like twitter). the jquery plugin im trying to use is found at

http://www.eyecon.ro/colorpicker/

at the buttom of the page it has the neat color picker …

html javascript css jquery colors

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

Apache HttpClient and PEM certificate files

I'd like to programmatically access a site that requires Client certificates, which I have in PEM files. In this application I don't want to add them to my keystore, use keytool, or openssl if I can avoid doing so. I need to deal with them directly in code.

    HttpClient httpclient = new DefaultHttpClient();
    HttpGet httpget = new HttpGet("https://my.secure.site.com/url");

    // TODO: Specify ca.pem and client.pem here?

    HttpResponse response = httpclient.execute(httpget);
    HttpEntity entity = response.getEntity();

    if (entity != null) {
        entity.consumeContent();
    } …
Run Code Online (Sandbox Code Playgroud)

java pem apache-httpclient-4.x

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

Algorithm to generate all unique permutations of fixed-length integer partitions?

I'm searching for an algorithm that generates all permutations of fixed-length partitions of an integer. Order does not matter.

For example, for n=4 and length L=3:

[(0, 2, 2), (2, 0, 2), (2, 2, 0),
 (2, 1, 1), (1, 2, 1), (1, 1, 2),
 (0, 1, 3), (0, 3, 1), (3, 0, 1), (3, 1, 0), (1, 3, 0), (1, 0, 3),
 (0, 0, 4), (4, 0, 0), (0, 4, 0)]
Run Code Online (Sandbox Code Playgroud)

I bumbled about with integer partitions + permutations for …

algorithm integer data-partitioning

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

从模型中删除的行仍在视图中,我做错了什么?

我有 QTableView,由 QSqlRelationalTableModel 填充。应该在点击按钮时提交或恢复更改。当我编辑某行时,它会在编辑完成时更改视图中的状态,并在调用 submitAll() 时成功提交对数据库的更改。但是当我尝试删除行时,它仍然在视图中。这是插槽,连接到删除按钮:

def _removeSelectedStatuses(self):
    '''
    ??????? ????????? ?????? ?? ???????

    pre[self]: self._model is not None
    '''
    model = self.ConservationStatusesTableView.selectionModel()
    l = model.selectedRows()
    if not len(l): return

    rows = set([i.row() for i in l])
    rows = list(rows)
    rows.sort()
    first = rows[0]
    count = len(rows)
    self._model.removeRows(first, count)
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

qt pyqt qtableview

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

PowerShell中的自定义排序

我是动力贝壳的新手.

我的问题是我有以下格式的文件名:

[ignore-prefix]-[important-middle]-[ignore-suffix]-[name-with-digits]
Run Code Online (Sandbox Code Playgroud)

我需要按照以下规则排序:首先按中间部分,然后按名称按自然顺序排序(即foobar10> foobar2).我不知道前缀值,但我知道分隔符(破折号).

所以我的第一次尝试,自然:

 filelist | Sort-Object -property @{Expression=`
       {$_.FullName.SubString($_.FullName.IndexOf("-")+1)}}
Run Code Online (Sandbox Code Playgroud)

这有一个问题,后缀影响顺序(ignore-aaa-1ignore-wname)在ignore-aaa-2ignore-aname之前排序,所以:

 $filelist | Sort-Object -property @{Expression=`
       {$_.FullName.SubString($_.FullName.IndexOf("-")+1,`
        $_.FullName.SubString($_.FullName.IndexOf("-")+1).IndexOf("-"))}}
Run Code Online (Sandbox Code Playgroud)

好吧,那个在中间排序,但已经不合时宜了.如果我要添加更糟糕的自然类型.这样做更优雅的方式是什么?

powershell

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

反应堆根的Maven变量

在多模块maven项目中,是否有一个指向根项目文件夹的变量?

  • ${project.basedir} 指向当前项目的目录,
  • ${project.parent.basedir} 指向父项目的目录,

但是有一个变量总是指向根目录(执行maven命令的目录),无论反应堆内的哪个项目?


我意识到我想要解决的问题几乎无法解决.我想要一个指向project.basedir,project.parent.basedir,project.parent.parent.basedir等的变量,以较高者为准.但是由于项目的父pom不一定是文件系统中的父项,我的整个方法都无济于事.所以我接受Pascal的答案,因为它回答了我的问题(即使我的问题没有解决我的问题).

maven-2

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

WPF多线程:使用Dispatcher但UI仍然挂起?

即使我使用Dispatcher,我的UI悬挂也有点问题,在我进一步研究之前,我想知道这是否是我处理数据检索的方式.

现在我有我的主窗口创建一个View和ViewModel.然后,在新的Thread内部(使用Dispatcher),它设置View.DataContext = ViewModel.一个非常大的ObservableCollection在绑定踢的时候被懒惰地创建,这导致了减速.但是,似乎在减速之前应该显示的其他一些UI项目实际上并没有显示出来.

   private void ButtonClick(Object sender, RoutedEventArgs e)
   {
        MyView view = new MyView();
        MyViewModel vm = new MyViewModel();

        TabItem tabItem = new TabItem();
        tabItem.Header = "MyView";
        tabItem.Content = view;

        MyTabCollection.Items.Add(tabItem);

        Window working = new Working();
        working.Show();

        ThreadStart thread = delegate()
        {
            DispatcherOperation operation = Dispatcher.BeginInvoke(
                DispatcherPriority.Normal,
                new Action(delegate()
                {
                    view.DataContext = vm;
                    ((FrameworkElement)view.Parent).Focus();
                    working.Close();
                }
                )
            );
        };

        Thread theThread = new Thread(thread);
        theThread.Start();
    }
Run Code Online (Sandbox Code Playgroud)

这基本上说它应该创建一个视图和一个视图模型,然后将视图添加到我拥有的标签集合中(这意味着它应该至少显示新标签).而且,它还应该显示一个"工作......"窗口.之后,一个单独的线程应该将ViewModel链接到视图,关注该选项卡并关闭工作窗口.问题是第一部分直到一切都完成后才显示; 直到新线程实际完成后才显示选项卡并且不显示工作窗口(这会导致工作窗口立即显示/关闭).我猜它可能与我检索数据的方式有关,但我不确定.这是它的方式:

  1. 创建视图
  2. 创建ViewModel
  3. 创建TabItem,将Content设置为View,并将TabItem添加到TabCollection.
  4. 创建/显示"工作..."窗口
  5. Dispatcher:设置View.DataContext = ViewModel.此事件会引发DataBindings,而DataBindings又会获取ObservableCollection.由于OC是Lazily创建的,现在正在创建(这是瓶颈).< - 这会弄乱我单独的线程/调度员吗?
  6. Dispatcher:将Focus设置为选项卡 …

data-binding wpf multithreading dispatcher mvvm

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

关闭时销毁PHP会话

我创建了一个基于会话的简单登录页面.

session_start();
Run Code Online (Sandbox Code Playgroud)

并添加了一个包含此内容的注销页面

session_destroy();
Run Code Online (Sandbox Code Playgroud)

现在,当我关闭浏览器/页面并重新打开它时,会话的值仍然存在.

我想知道如何完全破坏页面/浏览器关闭的会话.

php session

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

如何使用XSL检查XML文件中是否存在属性

在运行时,我可以有两种格式的XML文件:

  1. <root>
        <diagram> 
            <graph color= "#ff00ff">    
                <xaxis>1 2 3 12 312 3123 1231 23 </xaxis>
                <yaxis>1 2 3 12 312 3123 1231 23 </yaxis>
            </graph>  
        </diagram> 
    </root>
    
    Run Code Online (Sandbox Code Playgroud)
  2. <root>
        <diagram> 
            <graph>    
                <xaxis>1 2 3 12 312 3123 1231 23 </xaxis>
                <yaxis>1 2 3 12 312 3123 1231 23 </yaxis>
            </graph>  
        </diagram> 
    </root>
    
    Run Code Online (Sandbox Code Playgroud)

根据颜色属性的存在,我必须处理xaxis和yaxis的值.

我需要使用XSL来做到这一点.任何人都可以帮我暗示我可以检查这些条件的片段.

我试过用

<xsl: when test="graph[1]/@color">
     //some processing here using graph[1]/@color values
</xsl:when>
Run Code Online (Sandbox Code Playgroud)

我收到了一个错误......

xml xslt xpath

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

如何从R生成文档(.rtf,.doc,.odt)

什么是生成字处理器文件的最佳方法(理想情况下,尽可能与平台无关,但本机Word格式可以),其中带有图像,来自统计语言R?

document openoffice.org r ms-word ms-office

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