Search Results

Search found 12 results on 1 pages for 'kinopiko'.

Page 1/1 | 1 

  • Is there a way to avoid putting the Perl version number into the "use lib" line for Perl modules in

    - by Kinopiko
    I am trying to install some Perl modules into a non-standard location, let's call it /non/standard/location. In the script which uses the module, it seems to be necessary to specify a long directory path including the version of Perl, like so: #!/usr/local/bin/perl use lib '/non/standard/location/lib/perl5/site_perl/5.8.9/'; use A::B; Is there any use lib or other statement which I can use which is not so long and verbose, and which does not include the actual version of Perl, in order that I don't have to go back and edit this out of the program if the version of Perl is upgraded?

    Read the article

  • Gnu Emacs indenting of my typedef

    - by Kinopiko
    Gnu Emacs is insisting on indenting my typedef as follows: typedef enum { horizontal, vertical, } shapes; I want it to indent as follows: typedef enum { horizontal, vertical, } shapes; What switch can I use to get that?

    Read the article

  • How can I de-install a Perl module installed via `cpan`?

    - by Kinopiko
    I am using Perl running in user space (not installed via root) and installing modules via the command-line cpan. I would like to know if there is a simple way to remove a module without having to do a lot of work deleting individual files. I searched for this question on the internet and found some answers, but the answers I've found seem to either discuss using the Perl package manager (specific for Microsoft Windows), otherwise operating-system specific (BSDpan), suggesting using cpanplus (which I've had several bad experiences with), or ended by pointing to a dead link as follows: http://www.cpan.org/misc/cpan-faq.html#How_delete_Perl_modules. My question is specifically whether there is a clean way to remove a module installed via cpan.

    Read the article

  • Is there a way to generate a gitignore from a makefile?

    - by Kinopiko
    I have a lot of files such as JavaScript, HTML, and even C and C header (.h) files which are automatically generated, so they appear in the makefile like myfile.js: myfile.js.tmpl etc. I want all of these target files to be ignored by the version control system. I am using git but this question is not git-specific. Is there a utility or a trick which exists to make the ignore file (like .gitignore) from a makefile? (If there isn't such a facility, I can make a script to create one, but before I do that I am just checking I haven't missed some obvious tool or method.)

    Read the article

  • Algorithm for disordered sequences of strings

    - by Kinopiko
    The Levenshtein distance gives us a way to calculate the distance between two similar strings in terms of disordered individual characters: quick brown fox quikc brown fax The Levenshtein distance = 3. What is a similar algorithm for the distance between two strings with similar subsequences? For example, in quickbrownfox brownquickfox the Levenshtein distance is 10, but this takes no account of the fact that the strings have two similar subsequences, which makes them more "similar" than completely disordered words like quickbrownfox qburiocwknfox and yet the completely disordered version has a Levenshtein distance of eight. What distance measures exist which take the length of subsequences into account, without assuming that the subsequences can be easily broken into distinct words?

    Read the article

  • Algorithm for measuring distance between disordered sequences

    - by Kinopiko
    The Levenshtein distance gives us a way to calculate the distance between two similar strings in terms of disordered individual characters: quick brown fox quikc brown fax The Levenshtein distance = 3. What is a similar algorithm for the distance between two strings with similar subsequences? For example, in quickbrownfox brownquickfox the Levenshtein distance is 10, but this takes no account of the fact that the strings have two similar subsequences, which makes them more "similar" than completely disordered words like quickbrownfox qburiocwknfox and yet this completely disordered version has a Levenshtein distance of eight. What distance measures exist which take the length of subsequences into account, without assuming that the subsequences can be easily broken into distinct words?

    Read the article

  • Emacs comment-region in C mode

    - by Kinopiko
    In GNU Emacs, is there a good way to change the comment-region command in C mode from /* This is a comment which extends */ /* over more than one line in C. */ to /* This is a comment which extends over more than one line in C. */ ? I have tried (setq comment-multi-line t) but this does not help. There is a section on multi-line comments in the Emacs manual, but it does not mention anything.

    Read the article

  • How do I use a dependency on a Perl module installed in a non-standard location?

    - by Kinopiko
    I need to install two Perl modules on a web host. Let's call them A::B and X::Y. X::Y depends on A::B (needs A::B to run). Both of them use Module::Install. I have successfully installed A::B into a non-system location using perl Makefile.PL PREFIX=/non/system/location make; make test; make install Now I want to install X::Y, so I try the same thing perl Makefile.PL PREFIX=/non/system/location The output is $ perl Makefile.PL PREFIX=/non/system/location/ Cannot determine perl version info from lib/X/Y.pm *** Module::AutoInstall version 1.03 *** Checking for Perl dependencies... [Core Features] - Test::More ...loaded. (0.94) - ExtUtils::MakeMaker ...loaded. (6.54 >= 6.11) - File::ShareDir ...loaded. (1.00) - A::B ...missing. ==> Auto-install the 1 mandatory module(s) from CPAN? [y] It can't seem to find A::B in the system, although it is installed, and when it tries to auto-install the module from CPAN, it tries to write it into the system directory (ignoring PREFIX). I have tried using variables like PERL_LIB and LIB on the command line, after PREFIX=..., but nothing I have done seems to work. I can do make and make install successfully, but I can't do make test because of this problem. Any suggestions? I found some advice at http://servers.digitaldaze.com/extensions/perl/modules.html to use an environment variable PERL5LIB, but this also doesn't seem to work: export PERL5LIB=/non/system/location/lib/perl5/ didn't solve the problem.

    Read the article

  • Algorithm for measuring distance between disordered sequences of strings

    - by Kinopiko
    The Levenshtein distance gives us a way to calculate the distance between two similar strings in terms of disordered individual characters: quick brown fox quikc brown fax The Levenshtein distance = 3. What is a similar algorithm for the distance between two strings with similar subsequences? For example, in quickbrownfox brownquickfox the Levenshtein distance is 10, but this takes no account of the fact that the strings have two similar subsequences, which makes them more "similar" than completely disordered words like quickbrownfox qburiocwknfox and yet this completely disordered version has a Levenshtein distance of eight. What distance measures exist which take the length of subsequences into account, without assuming that the subsequences can be easily broken into distinct words?

    Read the article

  • die $template->error() produces no line number

    - by Kinopiko
    In the following short program: use Template; my $template = Template->new (INCLUDE_PATH => "."); $template->process ("non-existent-file") or die $template->error (); why does "die" not produce a line number and newline? Output looks like this: $ perl template.pl file error - non-existent-file: not found ~ 503 $

    Read the article

  • Is it possible for a called routine to force its caller to return?

    - by Kinopiko
    If I have Perl module like package X; and an object like my $x = X->new (); Inside X.pm, I write an error handler for $x called handle_error, and I call it sub check_size { if ($x->{size} > 1000) { $x->handle_error (); return; } } is there any way to make handle_error force the return from its caller routine? In other words, in this example, can I make handle_error do return in check_size without actually writing return there?

    Read the article

  • Is it possible for a Perl subroutine to force its caller to return?

    - by Kinopiko
    If I have Perl module like package X; and an object like my $x = X->new (); Inside X.pm, I write an error handler for $x called handle_error, and I call it sub check_size { if ($x->{size} > 1000) { $x->handle_error (); return; } } Is there any way to make handle_error force the return from its caller routine? In other words, in this example, can I make handle_error do return in check_size without actually writing return there?

    Read the article

1