Search Results

Search found 9366 results on 375 pages for 'common lisp'.

Page 94/375 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • Language in a Sandbox in Rails

    - by Jon Romero
    I've found that there WAS a sandbox gem (created by the guys that made try ruby in your browser but it was compatible only with Ruby 1.8. Another problem is that I cannot find it anymore (it seems they stop serving the gem from the servers...). So, is there any secure way of running ruby in a sandbox (so you can run it from your browser)? Or an easy way to run (for example lua/python) in a sandbox (no filesystem access, no creation of objects etc) and be called from Ruby (Rails 2.2)? I want to make an application like try_ruby even without having a ruby underneath. But it has to be an easy language (I saw there was a prolog in ruby, even a lisp but I don't think they are easy to learn languages...). So, do you have any suggestions or tips? Or should I just start creating my own DSL in Ruby (if there is a solution in creating a somewhat safe system)? Thx

    Read the article

  • emacs23 pops up debugger way too frequently

    - by werner r.
    Since I've upgraded to Ubuntu lucid and emacs23, Emacs pops up the debugger in situations, where emacs22 does not. For example, when hitting C-c C-c in org-mode, emacs22 simply states can do nothing useful at this location, whereas in emacs23 the debugger shows up. Debugger entered--Lisp error: (error "C-c C-c can do nothing useful at this location") signal(error ("C-c C-c can do nothing useful at this location")) error("C-c C-c can do nothing useful at this location") org-ctrl-c-ctrl-c(nil) call-interactively(org-ctrl-c-ctrl-c nil nil) That only illustrates the pattern -- the behavior is not limited to org-mode. Occurring every 3 minutes, it really annoys me. How can I prevent it? I've already tried to stop this using debug-on-error and stack-trace-on-error: it didn't work.

    Read the article

  • emacs auctex: can one auto-fill section labels?

    - by Mica
    Hi all, I am currently using emacs and auctex to author my latex documents. This is, of course, fantastic. However, I would like to have emacs and/or auctex auto-fill the section label when using C-c C-e to make a new header. It should end up looking like this: \section{This is a section title} \label{sec:this-is-a-section-title} with the label for the header the same as the title, but with no spaces. I don't know lisp or elisp, and I'd have no idea where to start. If anyone could help that would be great!

    Read the article

  • Programming challenge: can you code a hello world program as a Palindrome?

    - by Assaf Lavie
    So the puzzle is to write a hello world program in your language of choice, where the program's source file as a string has to be a palindrome. To be clear, the output has to be exactly "Hello, World". Edit: Well, with comments it seems trivial (not that I thought of it myself of course [sigh].. hat tip to cobbal). So new rule: no comments. Edit: I feel kind of bad editing someone else's question to say this, but it will eliminate a lot of non-palindromes that keep popping up, and I'm tired of seeing the same simple mistake over and over. The following is NOT a palindrome: ()() The following IS a palindrome: ())( Brackets, parenthesis, and anything else that must match are a major barrier to palindrome-ing, yes, but that doesn't mean you can ignore them and post non-palindrome answers. Languages represented thus far: C, C++, Bash, elisp, C#, Perl, sh, Windows shell, Java, Common Lisp, Awk, Ruby, Brainfuck, Funge, Python, Machine Language, HQ9+, Assembly, TCL, J, php, Haskell, io, TeX, APL, Javascript, mIRC Script, Basic, Orc, Fortran, Unlambda, Pseudo-code, Befunge, CFML, Lua, INTERCAL, VBScript, HTML, sed, PostScript, GolfScript, REBOL, SQL

    Read the article

  • What programming language best bridges the gap between pseudocode and code?

    - by Kai
    As I write code from now on, I plan to first lay out everything in beautiful, readable pseudocode and then implement the program around that structure. If I rank the languages that I currently know from easiest to most difficult to translate, I'd say: Lisp, Python, Lua, C++, Java, C I know that each language has its strength and weaknesses but I'm focusing specifically on pseudocode. What language do you use that is best suited for pseudocode-to-code? I always enjoy picking up new languages. Also, if you currently use this technique, I'd love to hear any tips you have about structuring practical pseudocode. Note: I feel this is subjective but has a clear answer per individual preference. I'm asking this here because the SO community has a very wide audience and is likely to suggest languages and techniques that I would otherwise not encounter.

    Read the article

  • how to match a regulas expresion like (%i1) in python pexpect

    - by mike
    I want to use maxima from python using pexpect, whenever maxima starts it will print a bunch of stuff of this form: $ maxima Maxima 5.27.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.57-1.fc17 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) i would like to start up pexpect like so: import pexpect cmd = 'maxima' child = pexpect.spawn(cmd) child.expect (' match all that stuff up to and including (%i1)') child.sendline ('integrate(sin(x),x)') chil.expect( match (%o1 ) ) print child.before how do i match the starting banner up to the prompt (%i1)? and so on, also maxima increments the (%i1)'s by one as the session goes along, so the next expect would be: child.expect ('match (%i2)') child.sendline ('integrate(sin(x),x)') chil.expect( match (%o2 ) ) print child.before how do i match the (incrementing) integers?

    Read the article

  • (fluxus) learning curve

    - by Inaimathi
    I'm trying to have some fun with fluxus, but its manual and online docs all seem to assume that the reader is already an expert network programmer who's never heard of Scheme before. Consequently, you get passages that try to explain the very basics of prefix notation, but assume that you know how to pipe sound-card data into the program, or setup and connect to an OSC process. Is there any tutorial out there that goes the opposite way? IE, assumes that you already have a handle on the Lisp/Scheme thing, but need some pointers before you can properly set up sound sources or an OSC server? Barring that, does anyone know how to get (for example) the system microphone to connect to (fluxus), or how to get it to play a sound file from disk?

    Read the article

  • Is there a good extension for working with SVN in Emacs?

    - by allyourcode
    I've tried psvn.el, but the command to diff the file you're currently looking at is just hideous: M-x svn-file-show-svn-diff. I tried installing vc-svn.el, but couldn't get that working on my version of Emacs: GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600) of 2004-03-10 on NYAUMO. I've tried putting a copy of vc-snv.el in my site-lisp dir, but when I try to run the command "M-x vc-diff" it says my file "is not under version control". The emacs wiki page, which mainly focuses on vc-svn.el, seems to be horribly out of date, as many of the links do not work.

    Read the article

  • Create My own language with "Functional Programming Language"

    - by esehara
    I prefer Haskell. I already know How to create my own language with Procedural Language (for example: C, Java, Python, etc). But, I know How to create my own language with Functional Language (for example Haskell, Clojure and Scala). I've already read: Internet Resources Write Yourself a Scheme in 48 Hours Real World Haskell - Chapter 16.Using Persec Writing A Lisp Interpreter In Haskell Parsec, a fast combinator parser Implementing functional languages: a tutorial Books Introduction Functional Programming Using Haskell 2nd Edition -- Haskell StackOverflow (but with procedural language) Learning to write a compiler create my own programming language Source Libraries and tools/HJS -- Haskell Are there any other good sources? I wants to get more links,or sources.

    Read the article

  • In SICP exercise 2.26 using DrScheme, why does cons return a list, instead of a pair of lists?

    - by limist
    In SICP exercise 2.26, this Scheme code is given: (define x (list 1 2 3)) (define y (list 4 5 6)) Then this cons call is given: (cons x y) I expected a pair of lists would result, ((1 2 3) (4 5 6)) but the interpreter gives, ((1 2 3) 4 5 6) ...a list with 4 elements, the first being a list. Why is y treated differently? I've tried looking up other SICP answers for an explanation, but couldn't find something satisfactory. So could any Scheme/Lisp experts please shed some light on this aspect of cons? Thanks in advance for any insight.

    Read the article

  • What are the programming religious wars of the generations before our current generation?

    - by Christopher Altman
    Being 32 years old, I did not follow debates in programming, language design, and platforms in the 1960s, 1970s, 1980s, and most of the 1990s. I sometimes hear glimpse of what the major debates were and how they turned the course of history. It makes me wonder what I take for granted. I am curious, what were the debates. The ones I know are: Procedural vs. Object Orientated Programming Lisp vs. C Software vs. Chips with Embedded Code

    Read the article

  • emacsclient -eval "(insert \"something\")" is not working for me

    - by manu
    I recently upgraded to Ubuntu 10.04 which comes with Emacs 23. I need Jabref to push citations to Emacs. However, despite I installed the Jabref plugin to push citations through emacsclient, it's not working. I did my testing, and read some of the Emacs Lisp Intro. Some commands do work, for instance if I type (in the console): emacsclient --eval "(switch-to-buffer \"*sratch*\")" the emacs windows switches to that buffer. However if I issue an insert command: emacsclient --eval "(insert \"do you see me?\")" no text is inserted in the current buffer. Does Emacs 23 changed something about insert?

    Read the article

  • How to replace "(" with "\(" in the regexp, Emacs/elisp flavor?

    - by polyglot
    Question as title. More specifically, I'm rather tired of having to type \(, etc. every time I want a parenthesis in Emacs's (interactive) regexp functions (not to mention the \\( in code). So I wrote something like (defadvice query-replace-regexp (before my-query-replace-regexp activate) (ad-set-arg 0 (replace-regexp-in-string "(" "\\\\(" (ad-get-arg 0))) (ad-set-arg 0 (replace-regexp-in-string ")" "\\\\)" (ad-get-arg 0))))) in hope that I can conveniently forget about emacs's idiosyncrasy in regexp during "interaction mode". Except I cannot get the regexp right... (replace-regexp-in-string "(" "\\\\(" "(abc") gives \\(abc instead of the wanted \(abc. Other variations on the number of slashes just gives errors. Thoughts? Since I started questioning, might as well ask another one: since lisp code is not supposed to use interactive functions, advicing query-replace-regexp should be okay, am I correct?

    Read the article

  • Learning Algorithms and Data Structures Fundamentals

    - by valya
    Can you recommend me a book or (better!) a site with many hard problems and exercises about data structures? I'm already answering project Euler questions, but these questions are about interesting, but uncommon algorithms. I hardly used even a simple tree. Maybe there is a site with exercises like: hey, you need to calculate this: ... . Do it using a tree. Now do it using a zipper. Upload your C (Haskell, Lisp, even Pascal or Fortress go) solution. Oh, your solution is so slow! Self-education is very hard then you trying to learn very common, fundamental things. How can I help myself with them without attending to courses or whatever?

    Read the article

  • implementing feature structures: what data type to use?

    - by Dervin Thunk
    Hello. In simplistic terms, a feature structure is an unordered list of attribute-value pairs. [number:sg, person:3 | _ ], which can be embedded: [cat:np, agr:[number:sg, person:3 | _ ] | _ ], can subindex stuff and share the value [number:[1], person:3 | _ ], where [1] is another feature structure (that is, it allows reentrancy). My question is: what data structure would people think this should be implemented with for later access to values, to perform unification between 2 fts, to "type" them, etc. There is a full book on this, but it's in lisp, which simplifies list handling. So, my choices are: a hash of lists, a list of lists, or a trie. What do people think about this?

    Read the article

  • Python/C "defs" file - what is it?

    - by detly
    In the nautilus-python bindings, there is a file "nautilus.defs". It contains stanzas like (define-interface MenuProvider (in-module "Nautilus") (c-name "NautilusMenuProvider") (gtype-id "NAUTILUS_TYPE_MENU_PROVIDER") ) or (define-method get_mime_type (of-object "NautilusFileInfo") (c-name "nautilus_file_info_get_mime_type") (return-type "char*") ) Now I can see what most of these do (eg. that last one means that I can call the method "get_mime_type" on a "FileInfo" object). But I'd like to know: what is this file, exactly (ie. what do I search the web for to find out more info)? Is it a common thing to find in Python/C bindings? What is the format, and where is it documented? What program actually processes it? (So far, I've managed to glean that it gets transformed into a C source file, and it looks a bit like lisp to me.)

    Read the article

  • Passing an array for setting variable

    - by mathk
    Hi, I often see this idiom when reading php code: public function __construct($config) { if (array_key_exists('options', $config)) { ... } if (array_key_exists('driver_options', $config)) { ... } } Here I am concern with the way the parameter is used. If I were in lisp I would do: (defun ct (&key options driver_options) (do-something-with-option-and-driver_option)) But since I am in PHP I would rather have a constructor that take a list of parameter and let them be null if there a not require. So what do you guys think about having an array as parameter in other to do some initialization-or-whatever? In other to answer you have to take in account the point of view of the user of the function and the designer of the API. Also have you ever heard this has a code-smell? thanks

    Read the article

  • Are there any programming languages targeting PHP, besides haXe?

    - by stesch
    PHP doesn't get much love but is still a winner at easy deployment (for cheap hosting). Are there any programming languages (besides haXe) that target PHP? Writing applications in this language and then translating it into PHP, like some languages target C as an intermediate language? The Scheme implementation Chicken compiles into C. XOTcl converts Java code into Tcl code LINJ was(?) a tool to convert Lisp into nice looking Java code … + a lot of ways to produce JavaScript without touching JavaScript.

    Read the article

  • How do you move the pointer up or down multiple lines with Emacs?

    - by Peter
    I can move my pointer up and down one line with my arrow key just fine in Emacs, so I'd like to redefine C-n and C-p to move up and down 5 lines at a time. I'm just beginning to learn how to use Emacs, and elisp is very alien to me. I tried using the GNU Emacs lisp reference, but I couldn't find how to bind a keystroke to multiple commands. Here's what I have so far (concentrating on the moving up definition): (global-set-key "\C-p" '(loop for i in '(1 2 3 4 5) do ('previous-line))) But, this brings up an error message when I hit C-p, "Wrong type argument." Any suggestions? Thanks!

    Read the article

  • How to write a technical blog?

    - by Gutzofter
    I have a blog that I would like to increase traffic on. I've read lots of technical blogs, but it's a lot different writing a blog versus reading a blog. There seems to be several ways to write a post. General article: I like this tool. This is how I do it. Specific technical issue: Programming solutions. I do get some traffic, but they don't leave any comments. Should I use HN and Reddit. What are some of the other places I can promote my blog? How to respond to negative comments (trolls)? Another thing is you might want to have some link-thrus. comment on other peoples blog posts. BTW my blog is: (defun ugly-lisp-code () ()) New Blog ugly web development

    Read the article

  • Is there a good reason Uni courses still use "academic" languages like modula2?

    - by Cheeso
    This question prompts me to ask - why do universities still teach in languages like Modula2, when improved modern languages are available for free? Are there uni's that still teach Pascal, for example? I mean, it was good 30 years ago, but... now? Why? Why not Java, C#, Haskell? Related: Is it backwards to still teach LISP? Is this a duplicate question? If not, I think it ought to be a community wiki topic.

    Read the article

  • Recalling import in module

    - by Isaiah
    I'm still learning python and after playing around with pygame I noticed I'm re-importing things in modules I'm importing that I've already imported. import pygame For instance I have some classes in a separate file, but I must also import pygame into that file too for them to work. Does it actually import the code twice? Will it slow down my program? Or does it just pull the same import from before, but if it does that, why would I need to import it? Is there anything like (load) in lisp that just pulls in the code like it is part of the main file? Thank You

    Read the article

  • Implementing Transparent Persistence

    - by Jules
    Transparent persistence allows you to use regular objects instead of a database. The objects are automatically read from and written to disk. Examples of such systems are Gemstone and Rucksack (for common lisp). Simplified version of what they do: if you access foo.bar and bar is not in memory, it gets loaded from disk. If you do foo.bar = baz then the foo object gets updated on disk. Most systems also have some form of transactions, and they may have support for sharing objects across programs and even across a network. My question is what are the different techniques for implementing these kind of systems and what are the trade offs between these implementation approaches?

    Read the article

  • How do I bind a key to "the function represented by the following key sequence"?

    - by katrielalex
    I'm just starting to learn emacs (woohoo!) and I've been mucking around in my .emacs quite happily. Unfortunately, I don't know Lisp yet, so I'm having issues with the basics. I've already remapped a few keys until I fix my muscle memory: (global-set-key (kbd "<f9>") 'recompile) That's fine. But how can I tell a key to 'simulate pressing several keys'? For instance, I don't know, make <f1> do the same as C-u 2 C-x } (widen buffer by two chars). One way is to look up that C-x } calls shrink-window-horizontally, and do some sort of lambda thing. This is of course the neat and elegant way (how do you do this?). But surely there's a way to define <f1> to send the keystrokes C-u 2 C-x }?

    Read the article

  • Removing whitespace in Java string?

    - by waitinforatrain
    Hi guys, I'm writing a parser for some LISP files. I'm trying to get rid of leading whitespace in a string. The string contents are along the lines of: :FUNCTION (LAMBDA (DELTA PLASMA-IN-0) (IF (OR (>= #61=(+ (* 1 DELTA) PLASMA-IN-0) 100) (<= #61# 0)) PLASMA-IN-0 #61#)) The tabs are all printed as 4 spaces in the file, so I want to get rid of these leading tabs. I tried to do this: string.replaceAll("\\s{4}", " ") - but it had no effect at all on the string. Does anyone know what I'm doing wrong? Is it because it is a multi-line string? Thanks

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >