小编mic*_*ele的帖子

按html按钮时显示网页的html代码

是否有可能在html/javascript中返回页面的html代码?

我有一个html页面,我想通过点击a input[type=button]打开页面的源代码.

html javascript debugging

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

PHP显示未读邮件计数

我正在使用php imap类.在我的盒子里,我有很多邮件,但是使用这个脚本,我只会检索未反复的邮件.我该怎么做?

if ($mbox=imap_open( "{" . $mailserver . ":" . $port . "}INBOX", $user, $pass )) 
{
  echo "Connected\n"; 
} else { exit ("Can't connect: " . imap_last_error() ."\n");  echo "FAIL!\n";  }; 

if ($hdr = imap_check($mbox)) {
  $msgCount = $hdr->Nmsgs;
  echo "Ci sono ".$msgCount." mail";
} else {
  echo "Failed to get mail";
}
Run Code Online (Sandbox Code Playgroud)

如果我做

$overview=imap_fetch_overview($mbox,"1:$msgCount",0);
Run Code Online (Sandbox Code Playgroud)

脚本加载到无限时间.

imap_search UNSEEN解决方案不好,因为pop3不使用此标志.那怎么办??????? 非常感谢.

php email pop3 imap

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

php访问json_decode数据

这是我的json对象

object(stdClass)#23 (2) { ["type"]=> string(4) "text" ["$t"]=> string(10) "cippalippa" } 
Run Code Online (Sandbox Code Playgroud)

我怎样才能访问"text" ["$t"]?

php json

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

php domdocument检查span类

如何迭代所有标签并检查类是 font18 还是 font17?

\n\n
 $html = new DOMDocument();\n    $html->load(\'file.html\');\n
Run Code Online (Sandbox Code Playgroud)\n\n

html:

\n\n
    <p><a name="bookmark7"></a><span class="font18" style="font-weight:bold;">Abilitazione</span></p>\n<p><span class="font17">I medici devono essere autorizzati dallo Stato a praticare la loro professione. I requisiti per ottenere questa autorizzazione variano a seconda delle diverse Nazioni. I laureati presso Facolt\xc3\xa0 mediche estere possono ottenere l\'autorizzazione a esercitare in Italia se rispondono ai requisiti statali per quanto riguarda il tirocinio e se superano l\'esame di Stato. Nell\'ambito della CEE si tratta tuttora di una questione da …
Run Code Online (Sandbox Code Playgroud)

html php dom domdocument

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

javascript facebook检查用户是否是页面的粉丝

这是我的代码:

    <div id="fb-root"></div>

<script>
  window.fbAsyncInit = function() {
    // init the FB JS SDK
    FB.init({
      appId      : '',                        // App ID from the app dashboard
      channelUrl : 'http://.php', // Channel file for x-domain comms
      status     : true,                                 // Check Facebook Login status
      xfbml      : true                                  // Look for social plugins on the page
    });

    // Additional initialization code such as adding Event Listeners goes here
    FB.api('me/likes/',function(response) {
        if( response.data ) {
            if( !isEmpty(response.data) )
                alert('You are a fan!');
            else
                alert('Not …
Run Code Online (Sandbox Code Playgroud)

javascript facebook-like facebook-graph-api

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

带有通配符和匹配条件的 Elasticsearch 查询

我有这个索引:

    {
            "mappings": {
                "records" : {
                    "properties" : {
                        "suggest" : {
                            "type" : "completion",
                            "contexts": [
                                { 
                                    "name": "year",
                                    "type": "category",
                                    "path": "year"
                                }
                            ]
                        }
                    }
                }
            }
}
Run Code Online (Sandbox Code Playgroud)

我贴了一些记录:

POST http://localhost:9200/example/records
{
            "suggest": {
                "input": "foo123" ,
                "contexts": {
                    "year": "1999"
                }
            }
}

POST http://localhost:9200/example/records
{
            "suggest": {
                "input": "some123" ,
                "contexts": {
                    "year": "1999"
                }
            }
}
POST http://localhost:9200/example/records
{
            "suggest": {
                "input": "thing123" ,
                "contexts": {
                    "year": "2000"
                }
            }
}
Run Code Online (Sandbox Code Playgroud)

现在我会执行这个查询(类似sql):

SELECT …
Run Code Online (Sandbox Code Playgroud)

regex elasticsearch elasticsearch-query

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

pyinstaller在exe文件中添加包含图像的文件夹

我有一个名为main.py的python脚本,该脚本在images文件夹中的同一路径中使用一些图像。

我想创建一个exe文件,其中也包含main.py脚本中使用的图像。

myprogram 
|-images_folder 
|-main.py
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

我正在发射:

pyinstaller --onefile --windowed main.py
Run Code Online (Sandbox Code Playgroud)

但是它会生成一个main.exe文件,该文件无法可视化图像,因为它们不包含在exe文件中。

python pyinstaller python-3.x

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

android nfc - mifare classic 1k增量操作tranceive失败

我想存储一个整数值,并使用API​​函数递增或递减它.

我用一个实用程序来刷卡,这是第5块的内容: 在此输入图像描述

似乎没有任何价值块.

这是我的代码:

    int sector = 5;
    this.mClassic.connect();
    boolean success = this.mClassic.authenticateSectorWithKeyA(sector, MifareClassic.KEY_DEFAULT );

        if(success){
            int firstBlock = mClassic.sectorToBlock(sector);
            Log.i("MIFARE CLASSIC", "first block of the given sector:" + firstBlock);


            //set the value = 0
            byte[] zeroValue = {0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,0,0,};
            //save this value 
                            mClassic.writeBlock(firstBlock, zeroValue);

            //increment the value and store it
            this.mClassic.increment(firstBlock, 1);
            this.mClassic.transfer(firstBlock);

            // read the incremented value by converting it in integer from bytearray
            b = readSector(firstBlock);
            data = b.toByteArray();
            value = 0;
            for (int …
Run Code Online (Sandbox Code Playgroud)

tags android nfc mifare android-beam

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

pageToOverride Chrome扩展程序 - 设置默认标签打开chrome

当用户打开新标签时,我正在使用chrome url overrides打开myPage.html.

问题是如果我打开chrome,它会加载默认选项卡而不是myPage.html.仅当我单击新选项卡按钮时才会打开myPage.html.

在我的清单中我有:

 "chrome_url_overrides" : {
    "pageToOverride": "myPage.html"
  },
Run Code Online (Sandbox Code Playgroud)

我需要改变什么?

非常感谢

google-chrome-extension google-chrome-devtools

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

Java 8 Date equal null safe

Which is the best way for checking if two Date() object are equals, with null safe feature? Date d1 Date d2

d1 = null, d2 = new Date() => equal false
d1 = null, d2 = null => equal true
d1 = SAME_INSTANT, d2 = SAME_INSTANT => equal true
d1 = new Date(), d2 = YESTERDAY => equal false
Run Code Online (Sandbox Code Playgroud)

java date java-8

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