问题列表 - 第48959页

使用prolog与emacs

GNU Emacs 23.2.1
Fedora xfce 14
Run Code Online (Sandbox Code Playgroud)

我开始进入Prolog,我想使用我的emacs作为IDE在Prolog中进行编程.

目前我使用emacs进行c/c ++.但不知道如何开始使用Prolog.我知道emacs有一个用于emacs编程的内置库.但是,我已经研究过,发现它的功能较少,即没有语法高亮,缩进等.

所以我已经下载了emacs prackage Prolog.el.我已经加载了这个库M-X Load-library.

但是,我不知道在那之后该怎么做.如何编译我的prolog文件?在emacs IDE的菜单中,Prolog没有任何内容.

我是否还需要为Prolog下载一些解释器或编译器?是否有用于编译的emacs命令?我通常在编译c代码时在emacs中使用make.

我做了一个yum搜索序言并得到了这些结果,所以我需要的所有这些选择?:

gprolog.x86_64 : GNU Prolog is a free Prolog compiler
pl.x86_64 : SWI-Prolog - Edinburgh compatible Prolog compiler
pl-static.x86_64 : Static library for SWI Prolog
ppl-gprolog.x86_64 : The GNU Prolog interface of the Parma Polyhedra Library
ppl-gprolog-static.x86_64 : The static archive for the GNU Prolog interface of the Parma Polyhedra Library
ppl-swiprolog.x86_64 : The SWI-Prolog interface of the Parma Polyhedra Library
ppl-swiprolog-static.x86_64 …
Run Code Online (Sandbox Code Playgroud)

emacs prolog emacs23

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

Rails 3将参数传递给新方法

好吧,我正在努力让它发挥作用.我想将所需的信息传递给新操作,但它无法正常工作.我在视图中并使用link_to和路径来创建新记录:

<%= link_to "New", new_libation_path(:xid=> 123) %>
Run Code Online (Sandbox Code Playgroud)

我的路由表有: 资源:libations

在libation_controller中我有我的新动作......

def new
  puts params[:xid]    #This is nil!
  ...
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?也许我应该谷歌如何在铁轨中使用参数..

ruby-on-rails-3

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

如何以编程方式获取linux中设备/分区的uuid?

我是Linux编程的新手.

我的问题是:

  • 有没有办法以编程方式在Linux中读取设备或分区的UUID?
  • 是否有用于用户空间应用程序的C/C++ API?

我找到了一些命令sudo vol_id --uuid /dev/sda1,sudo blkid并且ls -l /dev/disk/by-uuid/.但所有这些都是需要在终端中运行的命令.但我需要从C/C++程序中实现这一点.

有人可以帮我解决这个问题.(仅供参考:我需要读取已安装Linux的根文件系统("/")的UUID.)

先感谢您.

c c++ linux uuid

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

如何清除ostringstream

    ostringstream s;

    s << "123";
    cout << s.str().c_str() << endl;

    // how to clear ostringstream here?
    s << "456";
    cout << s.str().c_str() << endl;

输出是:

123
123456

我需要:

123
456

如何重置ostringstream以获得所需的输出?

c++ stream

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

哪里可以找到旧版QT(例如QT 4.6)?

我在互联网上搜索但无济于事.任何人都可以帮我找到QT的旧版本吗?

qt

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

使用iostream和指针获取Seg Fault

我想读取数据文件(迷宫),其中我似乎已经编写自己一个赛格错,我承认我是病了我的有关动态分配的大学讲座,并搜查了我的问题throughly,无济于事.这是我的代码片段:

void MazeClass::ReadMaze(ifstream& mazedata) {
    mazedata >> row >> column;  // Pulls the size from the file
    GetExit(mazedata);          // Does the same for above, just for the Exit (Required in Class) 
    GetEntrance(mazedata);      // Does the same, just for the entrance (Required in Class)
    maze = new char*[row];      // First array of pointers for 2d array
    for (unsigned i; i<row;i++)
    {                           // Creates the second set of arrays 
        maze[i]=new char[column];
    }
    for (int y=0;y<column;y++)
    {                           // Keeping the maze inside boundries …
Run Code Online (Sandbox Code Playgroud)

c++

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

使用OpenSSL进行Base64编码和解码

我一直在试图找出base64解码和编码的openssl文档.我在下面找到了一些代码片段

#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <openssl/evp.h>
#include <openssl/bio.h>
#include <openssl/buffer.h>

char *base64(const unsigned char *input, int length)
{
  BIO *bmem, *b64;
  BUF_MEM *bptr;

  b64 = BIO_new(BIO_f_base64());
  bmem = BIO_new(BIO_s_mem());
  b64 = BIO_push(b64, bmem);
  BIO_write(b64, input, length);
  BIO_flush(b64);
  BIO_get_mem_ptr(b64, &bptr);

  char *buff = (char *)malloc(bptr->length);
  memcpy(buff, bptr->data, bptr->length-1);
  buff[bptr->length-1] = 0;

  BIO_free_all(b64);

  return buff;
}

char *decode64(unsigned char *input, int length)
{
  BIO *b64, *bmem;

  char *buffer = (char *)malloc(length);
  memset(buffer, 0, length);

  b64 = BIO_new(BIO_f_base64());
  bmem = BIO_new_mem_buf(input, length); …
Run Code Online (Sandbox Code Playgroud)

c++ base64 openssl

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

代码块注释掉整个块

我正在使用Codeblocks IDE for C++,我尝试使用Google搜索,但找不到答案.

如何在Codeblocks中注释掉一段代码?例如在Eclipse中它的ctrl + 7.

c++ comments codeblocks

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

TinyMCE-获取纯文本

在tinyMCE中,有没有办法获得纯文本而不是HTML文本?

tinymce

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

如何使用异步API在java中发送电子邮件

我试图使用简单的方法发送电子邮件,而且速度非常慢.有些人告诉我通过异步API发送电子邮件.

这是我的旧问题电子邮件代码使java spring MVC中的代码变慢

任何人都可以指导这是什么以及如何更快地发送电子邮件

java email asynchronous spring-mvc

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