小编Gan*_*alf的帖子

如何编写嵌套的多维json对象

我正在研究json,我想知道这是否是编写嵌套的多维json对象的正确方法.我写道:

var foo = {
    "logged_in":true,
    "town":"Dublin",
    "state":"Ohio",
    "country":"USA",
    "products":2,
    "0":{
        "pic_id":"1500",
        "description":"Picture of a computer",
        "localion":"img.cloudimages.us/2012/06/02/computer.jpg",
        "type":"jpg",
        "childrenimages":2

        "0":{
        "pic_id":"15011",
        "description":"Picture of a cpu",
        "localion":"img.cloudimages.us/2012/06/02/mycpu.png",
        "type":"png"
          }
        "1":{
        "pic_id":"15012",
        "description":"Picture of a cpu two",
        "localion":"img.cloudimages.us/2012/06/02/thiscpu.png",
        "type":"png"
          }
    },
    "1":{
        "pic_id":"1501",
        "description":"Picture of a cpu",
        "localion":"img.cloudimages.us/2012/06/02/cpu.png",
        "type":"png"
    }
};
Run Code Online (Sandbox Code Playgroud)

如果我的对象变得太嵌套了,我应该遵循这个约定吗?

jquery json

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

在Qt中获取Windows上的MAC地址

我试图使用以下代码在Windows XP上获取mac地址:

QString getMacAddress()
{
QString macaddress="??:??:??:??:??:??";
#ifdef Q_WS_WIN
PIP_ADAPTER_INFO pinfo=NULL;

unsigned long len=0;
unsigned long nError;

if (pinfo!=NULL)
delete (pinfo);

nError  =   GetAdaptersInfo(pinfo,&len);    //Have to do it 2 times?

if(nError != 0)
{
pinfo= (PIP_ADAPTER_INFO)malloc(len);
nError  =   GetAdaptersInfo(pinfo,&len);
}

if(nError == 0)
macaddress.sprintf("%02X:%02X:%02X:%02X:%02X:%02X",pinfo->Address[0],pinfo->Address[1],pinfo->Address[2],pinfo->Address[3],pinfo->Address[4],pinfo->Address[5]);
#endif
return macaddress;
}
Run Code Online (Sandbox Code Playgroud)

这里的代码建议如下:http://www.qtforum.org/post/42589/how-to-obtain-mac-address.html#post42589

我应该包含哪些库才能使其工作?

qt4 qtnetwork

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

如何从Bootstrap CSS的下拉列表中删除箭头?

我想删除Twitter Bootstrap框架下拉菜单中显示的箭头.有没有人想办法去除箭头?

twitter-bootstrap

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

在Wordpress主题中使用自定义类

我有一个PHP类,我想在我的主题选择的任何地方使用方法.
例如这个类:

<?php
class MyClass
{
    const constant = 'constant value';

    function showConstant() {
        echo  self::constant . "\n";
    }
}


$class = new MyClass();
$class->showConstant();

?>
Run Code Online (Sandbox Code Playgroud)

我如何在我的主题中包含这样的课程?

php wordpress

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

使用特定类在div内部建立样式链接

我想知道我如何能够在给定的div中为给定的类中的链接设置样式

.navigation-div : a:link,a:visited {
  color:red;
  }
Run Code Online (Sandbox Code Playgroud)

一些HTML

  <div class="navigation-div">
  <a href="home.php">Home</a>
  <a href="home.php">List</a>
  <a href="home.php">Download</a>
  <a href="home.php">Files Used</a>
  <a href="home.php">Documentation</a>
  </div>

  <div class="client-header">
  <h1><a href="home.php">CRUD Application</a></h1>
  </div>
Run Code Online (Sandbox Code Playgroud)

这种东西有选择器吗?

css

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

使用jquery将数据发布到self

我试图将一些表单数据发布到自己没有成功.我的代码如下

<html>
    <title>Post to self</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">

    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.x-button').live("click", function () {
                $.ajax({
                    type: "POST",
                    url: "self.php",
                    data: $(".aj").serialize(),
                    success: function (data) {
                        alert("Data Loaded:");
                    }
                });
            });
        });
    </script>
    </head>

    <body>

               <?php
              if(isset($_POST['submit']))
              {
             echo $_POST['firstname'];
              }
              ?>
            <form name="input" action="" class="aj" method="post">
                <article>
                    <label>Firstname</label>
                    <input type="text" name="firstname" value="Ed" class="x-input"
                    />
                </article>
                <article>
                    <label>Lastname</label>
                    <input type="text" name="lastname" value="Doe" class="x-input"
                    />
                </article>
                <article>
                    <label>City</label>
                    <input type="text" name="city" value="London" class="x-input"
                    />
                </article>
                <input type="submit" value="Update …
Run Code Online (Sandbox Code Playgroud)

php

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

delphi应用程序中的Javascript

是否有可能利用javascript制作Windows桌面应用程序.我使用borland delphi,我需要在我的网格中使用javascript.

javascript delphi

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

C++桌面应用程序框架

我不是c ++的新手,但是我还没有找到一个c ++桌面应用程序框架.我找到了一个并且看起来很复杂.那里有其他可用于c ++的框架吗?

c++

6
推荐指数
2
解决办法
6157
查看次数

部署MS Lightswitch应用程序

Microsoft LightSwitch桌面应用程序可以部署为单个可执行文件吗?

deployment visual-studio visual-studio-lightswitch

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

在Windows中使用命令行shell创建sqlite数据库

我有我的sqlite3.exe文件,C:\我想创建一个sqlite数据库.C:\db\sqlite我已经尝试了sqlite3 ex1,如文档http://www.sqlite.org/sqlite.html上建议但我收到错误错误附近"sqlite3 ".

从shell创建新数据库的正确方法是什么?

sqlite

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