小编use*_*650的帖子

麻烦使用PHP的DOTNET.

我一直试图从PHP到com调用.net程序集(使用DOTNET()).似乎php正在寻找DLL并正确初始化,但由于某种原因我无法看到/使用这些方法.有谁知道我怎么能解决这个问题?

这是我用来调用.net类的php代码.当我调用它时,输出是"hello1 hello2".当我尝试通过执行$ csclass-> ModelBuilder("","")直接调用该函数时,我收到500服务器错误,指出它无法找到该函数.

<?php
echo "hello1";
try{
$csclass = new DOTNET("ModelBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1208136d23b48dc5",
                      "ModelBuilder.ModelBuilder2");

$class_methods = get_class_methods($csclass);

foreach ($class_methods as $method_name) {
    echo "$method_name\n";
}

} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}
echo "hello2";
?>
Run Code Online (Sandbox Code Playgroud)

这是我试图调用的程序集中的类(使用.net 3.5构建,使用强名称签名,并使用gacutil注册):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using OfficeOpenXml;
using System.Runtime.InteropServices;

namespace ModelBuilder
{    
    [ClassInterface(ClassInterfaceType.AutoDual)]
    [ComVisible(true)]
    public class ModelBuilder2
    {
        [ComVisible(true)]
        public Boolean BuildModel(String outputFileLoc,String excelTemplateFile)
        {
            try
            {
                //do stuff
            return …
Run Code Online (Sandbox Code Playgroud)

.net php iis-7 windows-server-2008

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

将XLSM转换为XLSX

我正在使用EPPLUS库从Excel读取数据以创建另一个文件.不幸的是,它不支持.XLSM扩展文件.有没有一种很好的方法将.XLSM文件转换为.XLSX文件,以便用EPPLUS读取文件?

(使用EPPLUS进行阅读会很好,因为我的所有代码都是用它编写的:))

c# openxml xlsx xlsm epplus

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

SQL for-each循环替代

我有两个表(让我们称之为TradingWindows和VolumeData).每一行TradingWindows都有一个startBin和endBin用于每个不同的股票.在VolumeData中,有stock stock,binIndex,volume.

我想通过执行以下操作来组合这些信息:for-TradingWindows表中的每一行我想要总结所有的卷binIndex> startBin和<endBin.(想法是获得开始和结束之间的总量).

现在,来自程序编程背景,这很容易(只需编写for-each循环).我知道这在SQL中是可行的,但我是新的,并且想知道是否有更有效的方法来做到这一点.

谢谢!

sql

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

使用 d3 SVG Scale 无需翻译

我正在尝试在 SVG 和 d3 中使用 scale() 转换。我知道它通过增加坐标比例来工作,但它似乎也在翻译我的对象。当我有一个位于 (100,100) 的矩形并执行 scale(2) 时,矩形的大小加倍并移动到 (0,0)。如何让它在缩放时停止从 (100,100) 移动到 (0,0)。以下是我的代码:

    var mysvg = d3.select("#viz")
        .append("svg")
        .attr("width", 500)
        .attr("height", 500)
        .attr("class","mylist");  

    var node = mysvg.selectAll("g.node")
        .data(mydata)
        .enter().append("g")
        .attr("class","node")
        .attr("transform", function(d) { return "translate(" + d.xpos + "," + d.ypos + ")"; });         

    node.append("rect")
        .attr("width",tileWidth)
        .attr("height",tileWidth)
        .attr("fill","orange")
        .attr("rx",10)
        .attr("ry",10);

    node.append("text")
        .attr("transform",function(d) { return "translate(" + tileWidth/2 + "," + tileWidth/2 +")" })
        .attr("text-anchor", "middle")
        .attr("dy", ".3em")
        .attr("font-family","serif")
        .text(function(d) { return d.symbol; });

    node.on("mouseover",function(){ d3.select(this).transition().attr("transform","scale(1.2)") });
    node.on("mouseout",function(){ d3.select(this).transition().attr("transform","scale(1)") …
Run Code Online (Sandbox Code Playgroud)

javascript svg scale d3.js

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

如何使用D3.js方法重绘路径?

我似乎无法获得.enter()和.exit以使路径正常工作.对于下面的代码,每当我尝试重绘路径时,它都会保留旧路径.

我冒昧地猜测.attr("d",stepline(csProg))的错误.我认为它应该更像.attr("d",function(d){stepline(d);})或类似的东西,但我无法让它工作.有什么建议?

function drawCloseChart(mysvg,mydata,cx1,cx2,cy1,cy2,oq)
{

var x = d3.scale.linear().domain([360*60, 390*60]).range([cx1, cx2]), 
    y = d3.scale.linear().domain([0,oq]).range([cy1,cy2]),
    z = d3.scale.category10();


var targetg = mysvg.append("svg:g");

    //code to draw x-axis
    //code to draw y-axis

var stepline = d3.svg.line()
    .x(function(d) { return x(d.time); })
    .y(function(d) { return y(d.val); })
    .interpolate("step-after");

var chartData = [];
chartData.redraw = function()
{


    var cpg = cprog.selectAll("path").data(csProg);
    cpg.enter()
        .append("path")
        .attr("d",stepline(csProg))
        .attr("fill","none")
        .attr("stroke-width","2")
        .attr("stroke","black");

    cpg.exit().remove();        

}
chartData.redraw();
return chartData;
}
Run Code Online (Sandbox Code Playgroud)

后来在代码中我会调用(或者这个效果):

setInterval(function(){updateDate(); chartData.redraw();},1000)

但是,旧路径不会被删除.

编辑:这是一个JSFiddle与我看到的问题.http://jsfiddle.net/namit101/k8kUZ/26/

javascript svg d3.js

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

d3.js嵌套选择

我正在尝试创建<g>foreach数据点的<text>元素,<g>并根据当前数据点为每个元素添加几个不同的元素.我尝试过类似的东西:

var g = vis.selectAll("g").data(dd,function(d){ return d.data.name+d.x+d.y+d.s; });

    var gs = g.enter().append("g");         
        g.exit().remove();

    var t = gs.selectAll("text").data(function(d) { console.log(d); return d; });
    t.enter().append("text").attr("x",function(d){ return d.x+d.s/2; })
        .attr("y",function(d){ return d.y+d.s/4; })
        .attr("font-family","Verdana")
        .attr("font-size","9")          
        .attr("text-anchor","middle")
        .text(function(d){ return d.data.name; });      

    t.attr("x",function(d){ return d.x+d.s/2; })
        .attr("y",function(d){ return d.y+d.s/4; })
        .attr("font-family","Verdana")
        .attr("font-size","9")          
        .attr("text-anchor","middle")
        .text(function(d){ return d.data.name; });      

    t.exit().remove();
Run Code Online (Sandbox Code Playgroud)

但我得到的只是一组空<g>元素.我做错了什么吗?

d3.js

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

标签 统计

d3.js ×3

javascript ×2

svg ×2

.net ×1

c# ×1

epplus ×1

iis-7 ×1

openxml ×1

php ×1

scale ×1

sql ×1

windows-server-2008 ×1

xlsm ×1

xlsx ×1