ActiveState Community

All / Any

Perl's magic sort variables: $a and $b

OS: All / Any | Product: ActivePerl | tags: Perl sort variable
Question: 

When I call my variables $a or $b they don't do what I expect. What's up?

Answer: 

Here's an often-used, but little-remembered fact about Perl that has caused some confusion on more than one occasion: $a and $b are special.

They are (among other things) used in custom sort blocks, but unfortunately the Perl documentation uses them in many examples. I say that it is unfortunate because the use strict pragma seems to ignore these two variables. If you do the following:

use strict;

$a = "foo";
$b = "bar";
$c = "baz";
$d = "quux";

You will see that only $c and $d are flagged as errors.

My advice is to avoid using $a and $b except for custom sort blocks and other places that require their use.

What is the license for the code in the language cookbooks?

OS: All / Any | Product: ASPN | tags: ASPN cookbook license
Question: 

What is the license for the code in the language cookbooks? Can the code be used in commercial projects?

Answer: 

The recipes in the language cookbooks are licensed under the BSD license, without the attribution clause (a.k.a. the "New BSD license").

This means that the code can be used in commercial and open source projects, including projects licensed under the GNU GPL (General Public License).

Who can see the messages I post to the mailing lists on ASPN?

OS: All / Any | Product: ASPN | tags: ASPN mailing list subscribe
Question: 

Who can see the messages I post to the mailing lists on ASPN? Are they publically available? Are they archived elsewhere?

Answer: 

Anyone can see the messages you post to the mailing lists on ASPN. All of the mailing list archives are publically available. All of the mailing list archives are no doubt listed in search engines. Some of the lists are also archived on different sites around the net.

In short, messages are entirely publically available, and may be archived in multiple places around the net. So post carefully.

How do I subscribe to the mailing lists?

OS: All / Any | Product: ASPN | tags: ASPN mailing list subscribe
Question: 

How do I subscribe to the mailing lists? What mailing lists are available?

Answer: 

ASPN hosts many mailing lists, and provides archives for many more. For a list of the lists available to read or subscribe to, go to:

http://aspn.activestate.com/ASPN/Mail/

To subscribe to a mailing list, click "Subscription options" on the link above, or go to:

http://aspn.activestate.com/ASPN/Mail/my

Why doesn't ActivePython support SSL?

OS: All / Any | Product: ActivePython | tags: activepython crypto library ssl
Question: 

ActivePython does not include SSL support. Why is this, and how can I add it?

Answer: 

Here is an answer on python-list while discussing the differences between ActivePython and python.org's Python:

http://mail.python.org/pipermail/python-list/2005-December/315754.html

As Neil pointed out, ActivePython does not currently have SSL
bindings (the _ssl module) that python.org's Python builds do. We
are currently going through the legal hurdles so that we can
include those. I expect that by or before the Python 2.5
timeframe we'll have _ssl in ActivePython.

In the meantime just plopping in the _ssl.pyd or _ssl.so from either python.org's build or from your own build into ActivePython's lib-dynload directory will work to get ActivePython talking SSL.

Why doesn't ActivePython use GNU readline?

Question: 

Why doesn't ActivePython use GNU readline? Why doesn't my up-arrow key recall past commands?

Answer: 

If you've used a Python.org build of Python before starting to use ActivePython, you may have grown fond of the command history and editing provided by the use of libreadline. Where Python.org Python gives you the last line you entered when you hit up-arrow, ActivePython gives you ^[[A.

We are working on solutions to this, but in the meantime you can get a very friendly front-end to the Python shell via Komodo. If Komodo is overkill for what you need, consider Pyrepl, which gives you only a more pleasant front-end, rather than a whole IDE. Pyrepl is not an ActiveState product so we can't provide support for it, but it may be what you want if you want to keep it simple.

What compilers are used to compile ActivePython?

OS: All / Any | Product: ActivePython | tags: activepython compiler
Question: 

What compilers are used to compile ActivePython? Why?

Answer: 

By using the versions of Visual Studio that we do (VS6 for Python 2.3, VS7 for Python 2.4), we keep binary compatibility with extensions for the Python.org distribution of the language. Our choice of build environment will continue to follow the lead of the community to ensure this compatibility remains.

There was a thread on the Python-Dev mailing list about switching build environments to VS2005. After some back-and-forth, this message told at least part of the story why it's not going to happen right now.

I would imagine that we will keep following the lead of the Python.org community to make sure we are compatible, and that binary extensions will continue to be useful for everyone.

Why isn't BLT included in ActiveTcl?

OS: All / Any | Product: ActiveTcl | tags: blt library package
Question: 

Why isn't BLT included in ActiveTcl?

Answer: 

BLT is not provided with ActiveTcl, which is our free Tcl/Tk distrbution available for Windows, UNIX, and OS X. For more information on what is included with ActiveTcl, please see the documentation at:

http://aspn.activestate.com/ASPN/docs/ActiveTcl

We do not provide BLT at this time largely because it is an unmaintained extension with outstanding issues, and cannot be considered "stable".

Unattended installation for ActiveTcl

OS: All / Any | Product: ActiveTcl | tags: install installation
Question: 

How do I install ActiveTcl in such a way that a scripted, unattended installation will work?

Answer: 

Since 8.4.8, automated installation was included but not published or
documented. The following documentation comes straight out of the comments
in the installer code:

--directory DIR
The installer goes auto and installs the distribution
into the directory DIR. The directory for the demos
is derived from that, it is DIR/demos. This can be
overridden. See below. The runtime directory is DIR as
well. This can be overridden. See below.
--demo-directory DIR
Overrides the location of the demo directory. See above.
The option is ignored if the installer is not in auto-mode.
--runtime-directory DIR
Specify directory to patch in. Optional. Ignored if
automatic mode was not activated with --directory.
Ignored on Windows.
--user-mode
Windows only, ignored on Unix. Install for the current
user. Default is to install for all users, i.e. admin-mode.
The option is ignored if the installer is not in auto-mode.
--no-plugin
Deactivates the installation of the plugin and all related
stuff. Optional. Default for automatic mode is to install
the plugin. The option is ignored if the installer is not in auto-mode.

TclApp can't find a package

OS: All / Any | Product: Tcl Dev Kit | tags: library package tclapp
Question: 

I try to wrap my TclApp application and TclApp says it can't find a package that I know I have installed. It's in my package search list -- what do I do?

Answer: 

If you're trying to wrap a package in TclApp and it can't find a dependent package that ships with ActiveTcl you have specified, try the following:

  • locate the .tap file in the package's directory
  • open the .tap file and ensure that the capitalization in the TclApp definition matches that found in the Package directive of the .tap file

Though the package's filename or directory may not be capitalized, it is what is found in the .tap file that matters for TclApp.