小编Sam*_*Sam的帖子

MVC CSV文件下载+项目真棒

我目前正在使用项目很棒来弹出一个要求提供帐号的表单.

我取数字并生成一个csv文件并将其发送到浏览器:

string billcsv = "account_ref,line1,line2,line3"

var VIRFile = File(new System.Text.UTF8Encoding().GetBytes(billcsv), "text/csv", "billfor" + accnumber+ ".csv")

return Json(VIRFile);
Run Code Online (Sandbox Code Playgroud)

我希望最终用户提示保存csv文件,但无法确定是谁.

我应该首先在磁盘上创建CSV文件,然后将url传递给文件到success函数并使用window.open(url),还是可以使用javascript从json结果重新创建文件?

Json结果:

{ "FileContents":[65,99,99,111,117,110,116,95,82,69,70,44,73,78,86,79,73,67,69,95,84,89,80,69,44,73, 78,86,79,73,67,69,95,82,69,70,44,81,84,89,95,79,82,68,69,82,44,83,69,82,86, 73,67,69,95,84,69,88,84,44,85,78,73,84,95,80,82,73,67,69,44,83,69,82,86,73, 67,69,95,65,77,79,85,78,84,13,10,114,114,114,44,73,110,118,111,105,99,101,44,86,73,82,49,48,50,44,49,44,83,116, 97,114,83,104,105,112,32,32,79,110,101,13,10,44,76,79,65,32,45,32,32,109,116,114,115,13,​​10,44,71,82,84,32,45,71,84, 44,48,44,48,44,48,13,10,114,114,114,44,73,110,118,111,105,99,101,44,86,73,82,49,48,50,44,50,44,66,111,97,116,32,84,114, 97,110,115,102,101,114,115,32,72,105,114,101,32,67,104,97,114,103,101,44,50,53,48,46,48,48,44,53,48,48,46,48,48,13,10,114,114,114,44,73,110,118,111,105,99,101, 44,86,73,82,49,48,50,44,51,44,66,101,114,116,104,105,110,103,32,32,82,70,65,32,47,32,77,111,68,44,51,53,48, 46,48,48,44,49,48,53,48,46,48,48,13,10] "的ContentType": "文本/ CSV", "FileDownloadName": "billfor123.csv"}

asp.net-mvc-3

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

如何在不使用表的情况下制作这个2列表?

http://jsfiddle.net/pkLMC/

左列应缩小以适合,右列应占据页面宽度的其余部分.它也需要与IE7一起使用

问题的形象

http://i.stack.imgur.com/4Q8aW.png

<style>
table
{
    width:100%;
    border:1px solid black;
}
td
{
    vertical-align:top;
    border:1px solid green;
    background-color:orange;
}
.left
{
    /* trim the column to the minimum necessary width required to avoid overflow */
    width:1px;
}
.long
{
    /* this layout works whether the content of the right column wraps or not */
    /* display:none; */
}
</style>

<table>
<tr><td class="left">ABC</td><td>Lorem ipsum dolor</td></tr>
<tr><td class="left">ABCDE</td><td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut …
Run Code Online (Sandbox Code Playgroud)

html css

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

GUI测试工具PyUseCase与Dogtail相比如何?

GUI测试工具PyUseCase如何重命名为StoryText.与Dogtail相比

我想听听那些希望同时使用这两者的人.

有兴趣:

  • 维护测试代码
  • 他们对真正的GUI有多好?

python testing user-interface automation compare

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

做漂亮的UIActivityIndi​​catorView

我曾经看过一个可以很UIActivityIndicatorView容易做到的图书馆,但我找不到它.有人知道或知道另一种做得好的方法UIActivityIndicatorView吗?类似的东西 http://hpics.li/64d7b07

iphone objective-c uiactivityindicatorview

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

二叉树插入的动画GIF

我试图生产使用简单二叉树插入GIF动画dotconvertUbuntu的公用事业.但它并不是我想要的完全正常工作.我在最后得到的动画gif没有显示完整的树,只显示了根节点.

要测试程序,只需输入一些随机整数并用-1停止输入部分.

#include<stdio.h>
#include<stdlib.h>

struct node{
    int value;
    struct node *left,*right;
};

typedef struct node node;

node *root;
FILE *out;

node *insert(node *,int);
node *new_node(int);

int main()
{
    root = NULL;

    int temp;
    int k = 0;

    while(1)
    {
        scanf("%d",&temp);
        if( temp == -1) break;

        root = insert(root,temp);

        take_snap(k++); // this function writes the dot file and create a jpg image for the current tree
    }

    animate();
    // this function use convert utility to combine all …
Run Code Online (Sandbox Code Playgroud)

c dot imagemagick-convert

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

在默认包中的JAR文件中导入类

我如何在这里使用Queue?

我无法让导入工作,因为Queue.class不在包中.

我已经尝试过这个宇宙中的一切,等等.

图片 http://i.stack.imgur.com/AFrrc.jpg

java eclipse import

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

Android LinearGradient和奇怪的相对定位

我有以下代码和LinearGradient,它与其他所有示例看起来非常相似.

public class CustomColourBar extends View
{

public CustomColourBar( Context context, AttributeSet attribs )
{
    super( context, attribs );
}    

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
    setMeasuredDimension(170, 40);
}

@Override
protected synchronized void onDraw( Canvas canvas )
{
    int height = this.getMeasuredHeight();
    int width = this.getMeasuredWidth();

    LinearGradient shader = new LinearGradient(
        0, 0, 0, height, 
        Color.RED, Color.YELLOW,
        Shader.TileMode.CLAMP );

    Paint paint = new Paint(); 
    paint.setShader(shader);
    RectF fgRect = new RectF( 0, 0, width, height);

    canvas.drawRoundRect(fgRect, 7f, 7f, paint); …
Run Code Online (Sandbox Code Playgroud)

layout android gradient

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

潜入python书中对kgp.py程序的具体怀疑

深入Python:XML处理 -

这里我指的是一部分kgp.py节目 -

def getDefaultSource(self):
  xrefs = {}
  for xref in self.grammar.getElementsByTagName("xref"):
    xrefs[xref.attributes["id"].value] = 1
  xrefs = xrefs.keys()
  standaloneXrefs = [e for e in self.refs.keys() if e not in xrefs]
  if not standaloneXrefs:
    raise NoSourceError, "can't guess source, and no source specified"
  return '<xref id="%s"/>' % random.choice(standaloneXrefs)
Run Code Online (Sandbox Code Playgroud)

self.grammar:解析XML表示(using xml.dom.minidom) -

<?xml version="1.0" ?>
<grammar>
<ref id="bit">
  <p>0</p>
  <p>1</p>
</ref>
<ref id="byte">
  <p><xref id="bit"/><xref id="bit"/><xref id="bit"/><xref id="bit"/>\
<xref id="bit"/><xref id="bit"/><xref id="bit"/><xref id="bit"/></p>
</ref> …
Run Code Online (Sandbox Code Playgroud)

python xml

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

链接错误 - 缺少文件符号中未找到的架构i386

我正在开发一个使用twitter API的应用程序.

当它连接到IOS设备时,应用程序运行正常,但是当我将架构从armv6更改为i386以使其在模拟器上运行时,我收到此错误:

  ld: warning: ignoring file       /Users/username/Desktop/tweetsAloud/tweets2/tweetsAloud/Src/NeoSpeech/lib-i iphoneos/libvt_eng_julie.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
  "_VT_LOADTTS_ENG", referenced from:
      -[TweetsViewController viewWillAppear:] in TweetsViewController.o
  "_VT_UNLOADTTS_ENG", referenced from:
      -[TweetsViewController viewWillDisappear:] in TweetsViewController.o
  "_VT_TextToFile_ENG", referenced from:
      -[TweetsViewController readyStringToPlay:] in TweetsViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

所以我已经阅读了很多建议,并尝试了大部分的运气.

我首先确保我拥有所有框架,然后我尝试编辑project.pbxproj,仍然无法正常工作.

我尝试过清理和更改构建设置.

任何人有任何想法,为什么我收到此错误消息?

c linker ld i386 armv6

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

水平滚动具有悬停和拖动支持

嗨,大家好,感谢您花时间阅读本文.

好吧,我在Jquery中是一个全新的,所以我会尝试解释这个想法:

我在div中以水平方式获得了25个图像,当网站加载时它只显示12或16个最大值,因此我需要一个让我使用鼠标水平滚动的解决方案(悬停).如果我将鼠标移到右侧,我可以看到其余的图像和示例:

图片 http://i.stack.imgur.com/z27yf.png

我希望你能帮我一个例子或者我完全愚蠢的东西:(谢谢!

jquery

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