小编Gre*_*ngs的帖子

获取Amazon Product Advertising API的所有优惠列表

我需要能够使用amazon API获取产品的所有报价列表.这是我发送的请求:

http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemLookup&SubscriptionId=&AssociateTag=&Version=2011-08-01&ItemId=B007IJQDQQ&IdType=ASIN&ResponseGroup=Offers&Condition=All&MerchantId=All
Run Code Online (Sandbox Code Playgroud)

这将返回以下优惠:

<Offers>
<TotalOffers>1</TotalOffers>
<TotalOfferPages>1</TotalOfferPages>
<MoreOffersUrl>
http://www.amazon.com/gp/offer-listing/B007IJQDQQ%3FSubscriptionId%3DAKIAJTZ6VROOTPJAPPWQ%26tag%3Damazoautom-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3DB007IJQDQQ
</MoreOffersUrl>
<Offer>
<OfferAttributes>
<Condition>New</Condition>
</OfferAttributes>
<OfferListing>
<OfferListingId>
TR5sygI0VR7cwy3Hg0DBHwgCWFnkqXLyCR70jjMhy1h8gWlEisKYt5cqDbS2Fu1SEqDtfBILdxYDziJdFzfsqMpPJkBqcYV3DFovHx1nXWRy9wHS6CFZXknBvsCo1bxYS%2BsxAeYrZHrS6g6aakEJQA%3D%3D
</OfferListingId>
<Price>
<Amount>375</Amount>
<CurrencyCode>USD</CurrencyCode>
<FormattedPrice>$3.75</FormattedPrice>
</Price>
<AmountSaved>
<PercentageSaved>56</PercentageSaved>
<Availability>Usually ships in 1-2 business days</Availability>
<AvailabilityAttributes>
<IsEligibleForSuperSaverShipping>0</IsEligibleForSuperSaverShipping>
</OfferListing>
</Offer>
</Offers>
Run Code Online (Sandbox Code Playgroud)

正如你所看到的,它只返回1个报价,即使它说有3个新报价.有没有人知道如何获得所有优惠而不仅仅是最低价?商家ID ='ALL'不会执行此操作,也不会执行任何其他响应组,例如offerFull,offerSummary或​​offer.

amazon amazon-web-services amazon-product-api

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

C#asp.net:Chrome Chrome中的截止日期

我在使用Chrome时在C#中的Cookie的截止日期有问题.

这是我正在使用的代码:

public static void createCookie(Users u, DateTime expirationDate)
{
    HttpCookie loginCookie = new HttpCookie("cookie");
    loginCookie.Value = "somevalue";
    loginCookie.Expires = DateTime.UtcNow.AddDays(1d);
    HttpContext.Current.Response.Cookies.Add(loginCookie);
}
Run Code Online (Sandbox Code Playgroud)

我通过Fiddler运行此代码,它确实返回了正确的到期日期.在Firefox和IE9中,cookie的到期日期也是正确的但是,当我在chrome中运行时,到期日总是设置为:Sun,19 Dec 1969 03:28:36 GMT

总是在格林威治标准时间3:28:36它永远不会改变.任何关于为什么会发生这种情况的想法将不胜感激.谢谢!

我还尝试使用:DateTime.Now.AddDays(1d)设置过期日期,结果相同.

c# cookies google-chrome date

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

设置为“重定向”时,NodeJS VM2 访问控制台的正确方法

我正在使用VM2包来运行用户代码。我正在尝试拦截控制台输出并将 NodeVM 对象的控制台属性设置为“重定向”:

    // Create a new sandbox VM for this request
    const vm = new NodeVM( {
        console: 'redirect',
        timeout: 30000,
        sandbox: { request, state, response },
        require: {
            external: true
        }
    });
Run Code Online (Sandbox Code Playgroud)

根据将控制台输出重定向到“事件”的文档。我是 NodeJS 的新手,如何连接到这些事件以捕获在沙箱内执行的 console.log 消息?

node.js node-vm2

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

Java AWT线程

我使用netbeans Swing GUI遇到Threads问题.这是我第一次真正尝试使用Java的文件系统通知程序为备份程序开发GUI.我有两个文件SyncUI.javaSync.java.

几乎我想要发生的是你在jTextField1文本字段中输入一个目录路径,它创建一个同步线程,创建一个新的同步对象,然后调用processEvents该对象.当更改该目录中的文件时,我想将有关更改的文本添加到列表中.

在当前状态下,UI不再没有响应,但是processEvents没有在我的列表中添加任何内容.知道问题是什么吗?此外,由于我刚开始使用java,任何建设性的批评都受到欢迎.

SyncUI.java:

package sync;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.SwingUtilities;

public class SyncUI extends javax.swing.JFrame {

    public SyncUI() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {
        jButton1 = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        list1 = new java.awt.List();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton1.setText("Start");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        }); …
Run Code Online (Sandbox Code Playgroud)

java swing multithreading awt jlist

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

CleanFabric之后的Azure Service Fabric先前安装

我正在尝试在群集中的某个节点上(可能不正确地)运行clean后重新安装Azure Service Fabric.

我运行CleanFabric.ps1并得到以下结果:

FabricInstallerSvc is already removed.
FabricSetup.exe is no longer in FabricCodePath. Uninstall may have already run.
Run Code Online (Sandbox Code Playgroud)

当我为单机节点运行TestConfiguration.ps1时,我得到以下结果:

    Microsoft.Azure.ServiceFabric.WindowsServer.5.3.301.9590> .\TestConfiguration.ps1 -Clust
    erConfigFilePath .\ClusterConfig.Unsecure.DevCluster.json
    Trace folder already exists. Traces will be written to existing trace folder: Microsoft.Azu
    re.ServiceFabric.WindowsServer.5.3.301.9590\DeploymentTraces

    Previous Fabric installation detected on machine localhost. Please clean the machine.
    Run Test-ServiceFabricConfiguration or TestConfiguration.ps1 to validate configuration & environment state. Best Practic
    es Analyzer hit validation error(s).


    LocalAdminPrivilege        : True
    IsJsonValid                : True
    IsCabValid                 : True
    RequiredPortsOpen          : True
    RemoteRegistryAvailable …
Run Code Online (Sandbox Code Playgroud)

azure azure-service-fabric

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