问题列表 - 第42384页

ssh命令没有运行perl脚本

我有以下perl脚本

#!/usr/bin/perl
$userinput =  <STDIN>;
chomp ($userinput);
while ( $userinput ne "DONE")
{
        print STDOUT "User typed ----->  $userinput\n";
        $userinput =  <STDIN>;
        chomp ($userinput);
}
Run Code Online (Sandbox Code Playgroud)

我在unix框上复制了这个,本地工作正常但是当我尝试使用ssh从另一个框远程运行这个perl脚本时,它不起作用.

我正在使用以下命令运行此脚本.

ssh username@hostname /tmp/testremote.pl
Run Code Online (Sandbox Code Playgroud)

它只挂在STDIN上,不会返回任何内容.

知道为什么这不起作用吗?

unix ssh perl

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

将Serializable对象写入外部存储时java.io.NotSerializableException?

朋友们,

我正在使用以下代码将Serializable对象写入外部存储.

它抛出我的错误java.io.NotSerializableException甚至我的对象是可序列化的任何人指导我我在做什么错?

public class MyClass implements Serializable 
{

// other veriable stuff here...
    public String title;
    public String startTime;
    public String endTime;
    public boolean classEnabled;
    public Context myContext;

 public MyClass(Context context,String title, String startTime, boolean enable){
            this.title = title;
            this.startTime = startTime;
            this.classEnabled = enable;
            this.myContext = context;

}

 public boolean saveObject(MyClass obj) {

        final File suspend_f=new File(cacheDir, "test");

            FileOutputStream   fos  = null;
            ObjectOutputStream oos  = null;
            boolean            keep = true;

            try {
                fos = new FileOutputStream(suspend_f);
                oos = …
Run Code Online (Sandbox Code Playgroud)

serialization android

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

即使具有此ID的标记不存在,$("#id")也会重新调整非空值

我在做

var tag = $("#foo");
if(tag != null) {
 // do something
}
Run Code Online (Sandbox Code Playgroud)

问题是,即使首次执行脚本时标记不存在,标记变量的值也是非空的,因此它会破坏代码.

为什么会这样?

jquery

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

如何在选择器中使用jQuery变量

我正在尝试突出显示在行中的表格单元格.

var $tr = $('tr:eq(' + row + ')');
$($tr:nth-child(col)).addClass('highlight');
Run Code Online (Sandbox Code Playgroud)

jquery

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

.Net与GraphicsPath.Widen()相反

我需要与GraphicsPath.Widen().Net 中的方法相反:

public GraphicsPath Widen()
Run Code Online (Sandbox Code Playgroud)

Widen()方法不接受否定参数,因此我需要等效的Inset方法:

public GraphicsPath Inset()
Run Code Online (Sandbox Code Playgroud)

您可以在开源Inkscape应用程序(www.Inkscape.org)中执行此操作,方法是转到菜单并选择"Path/Inset"(插入量存储在Inkscape属性对话框中).由于Inkscape是开源的,所以应该可以在C#.Net中执行此操作,但我不能在生命中使用Inkscape C++源代码(我只需要这个函数,所以我不能证明学习C++是正确的完成这个).

基本上,我需要一个带有此签名的GraphicsPath扩展方法:

public static GraphicsPath Inset(this GraphicsPath original, float amount)
{
   //implementation
}
Run Code Online (Sandbox Code Playgroud)

正如签名所述,它将采用一个GraphicsPath对象和.Inset()路径传递的数量......就像今天的Inkscape一样.如果它简化了任何问题,那么所讨论的GraphicsPath都是从该.PolyBezier方法创建的(并且没有其他内容),因此除非您想要完整性,否则不需要考虑rects,省略号或任何其他形状.

不幸的是,我没有使用C++代码的经验,所以我几乎不可能遵循Inkscape中包含的C++逻辑.

.

[编辑:]根据要求,这里是"MakeOffset"Inkscape代码.对于Inset,第二个参数(double dec)将为负,并且该参数的绝对值是引入形状的量.

我知道这里有很多依赖项.如果您需要查看更多的Inkscape源文件,请访问:http://sourceforge.net/projects/inkscape/files/inkscape/0.48/

int
Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_profile, double cx, double cy, double radius, Geom::Matrix *i2doc)
{
  Reset (0, 0);
  MakeBackData(a->_has_back_data);

    bool done_something = false;

  if (dec == 0)
  {
    _pts …
Run Code Online (Sandbox Code Playgroud)

c# open-source graphicspath

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

如何确定C#中是否存在子目录?

在C#中,如何确定子目录是否存在?

打电话时这是必要的CreateSubDirectory吗?

.net c# filesystems subdirectory

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

如何在Android中读取套接字输入流

     can anybody tell me how to read socket input stream. Here is my code.

if (!serverIpAddress.equals(""))
        {
            try
            {
                InetAddress serverAddr = InetAddress.getByName(serverIpAddress);
                Log.i("ClientActivity", "Connecting...");
                Socket socket = new Socket(serverAddr, 5777);

                try {
                    Log.i("ClientActivity", "Sending command.");
                    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket
                            .getOutputStream())), true);
                    // where you issue the commands
                    out.println("<maplist />");
                    Log.i("ClientActivity", "Sent.");

                    input = new BufferedReader(new InputStreamReader(socket.getInputStream()));                     
                    buffer = new StringBuilder();

                    new Thread(new Runnable() {

                        @Override
                        public void run() {

                            try 
                            {
                                buffer.append(input.readLine());
                            } catch (IOException e) …
Run Code Online (Sandbox Code Playgroud)

sockets multithreading android inputstream

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

将BufferedImage复制到剪贴板

如何将BufferedImage存储到系统剪贴板中?

java

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

在Facebook上发送消息给朋友收件箱

如何在Facebook中向朋友收件箱发帖子.我知道Facebook不允许您向用户的收件箱发送消息.因此,有一个read_messages权限,但有些应用程序提供了邀请朋友的功能,这个邀请发送到朋友收件箱和通知邮件也发送到朋友的电子邮件ID,所以有可能在Facebook的朋友收件箱中发送邮件.

谢谢

api facebook

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

如何在iphone设备中本地保存图像和数据

我从.net web服务器获取图像和一些细节.

我需要将这些细节存储在iphone设备内存中(而不是sdcard),因为我只需连接一次Web服务,即安装我的应用程序.

从下一次开始,我需要从设备获取数据.

我在java中有一些知识,在java中我使用文件存储图像和哈希表来存储细节.

我发现这是存储图像

它显示了路径

/Users/appleuser/Library/Application Support/iPhone Simulator/4.0.1/Applications/14ED40D5-321E-4519-BDEA-77757589F8F7/Documents
Run Code Online (Sandbox Code Playgroud)

但它是在设备中保存还是仅在笔记本中保存.

我怎么能在iPhone上做到这一点.

任何人都可以帮助我.

提前谢谢你.

iphone

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