| PERLSOLARIS(1) | Perl Programmers Reference Guide | PERLSOLARIS(1) |
For the most part, everything should just work.
Starting with Solaris 8, perl5.00503 (or higher) is supplied with the operating system, so you might not even need to build a newer version of perl at all. The Sun-supplied version is installed in /usr/perl5 with /usr/bin/perl pointing to /usr/perl5/bin/perl. Do not disturb that installation unless you really know what you are doing. If you remove the perl supplied with the OS, you will render some bits of your system inoperable. If you wish to install a newer version of perl, install it under a different prefix from /usr/perl5. Common prefixes to use are /usr/local and /opt/perl.
You may wish to put your version of perl in the PATH of all users by changing the link /usr/bin/perl. This is probably OK, as most perl scripts shipped with Solaris use an explicit path. (There are a few exceptions, such as /usr/bin/rpm2cpio and /etc/rcm/scripts/README, but these are also sufficiently generic that the actual version of perl probably doesn't matter too much.)
Solaris ships with a range of Solaris-specific modules. If you choose to install your own version of perl you will find the source of many of these modules is available on CPAN under the Sun::Solaris:: namespace.
Solaris may include two versions of perl, e.g. Solaris 9 includes both 5.005_03 and 5.6.1. This is to provide stability across Solaris releases, in cases where a later perl version has incompatibilities with the version included in the preceding Solaris release. The default perl version will always be the most recent, and in general the old version will only be retained for one Solaris release. Note also that the default perl will NOT be configured to search for modules in the older version, again due to compatibility/stability concerns. As a consequence if you upgrade Solaris, you will have to rebuild/reinstall any additional CPAN modules that you installed for the previous Solaris version. See the CPAN manpage under 'autobundle' for a quick way of doing this.
As an interim measure, you may either change the #! line of your scripts to specifically refer to the old perl version, e.g. on Solaris 9 use #!/usr/perl5/5.00503/bin/perl to use the perl version that was the default for Solaris 8, or if you have a large number of scripts it may be more convenient to make the old version of perl the default on your system. You can do this by changing the appropriate symlinks under /usr/perl5 as follows (example for Solaris 9):
# cd /usr/perl5 # rm bin man pod # ln -s ./5.00503/bin # ln -s ./5.00503/man # ln -s ./5.00503/lib/pod # rm /usr/bin/perl # ln -s ../perl5/5.00503/bin/perl /usr/bin/perl
In both cases this should only be considered to be a temporary measure - you should upgrade to the later version of perl as soon as is practicable.
Note also that the perl command-line utilities (e.g. perldoc) and any that are added by modules that you install will be under /usr/perl5/bin, so that directory should be added to your PATH.
Sun: perl's Configure: uname uname -r Name osname osvers SunOS 4.1.3 Solaris 1.1 sunos 4.1.3 SunOS 5.6 Solaris 2.6 solaris 2.6 SunOS 5.8 Solaris 8 solaris 2.8 SunOS 5.9 Solaris 9 solaris 2.9 SunOS 5.10 Solaris 10 solaris 2.10
The complete table can be found in the Sun Managers' FAQ <ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq> under "9.1) Which Sun models run which versions of SunOS?".
The Sun Managers' FAQ is available at <ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq>
Include /usr/ccs/bin/ in your PATH.
Several tools needed to build perl are located in /usr/ccs/bin/: ar, as, ld, and make. Make sure that /usr/ccs/bin/ is in your PATH.
On all the released versions of Solaris (8, 9 and 10) you need to make sure the following packages are installed (this info is extracted from the Solaris FAQ):
for tools (sccs, lex, yacc, make, nm, truss, ld, as): SUNWbtool, SUNWsprot, SUNWtoo
for libraries & headers: SUNWhea, SUNWarc, SUNWlibm, SUNWlibms, SUNWdfbh, SUNWcg6h, SUNWxwinc
Additionally, on Solaris 8 and 9 you also need:
for 64 bit development: SUNWarcx, SUNWbtoox, SUNWdplx, SUNWscpux, SUNWsprox, SUNWtoox, SUNWlmsx, SUNWlmx, SUNWlibCx
And only on Solaris 8 you also need:
for libraries & headers: SUNWolinc
If you are in doubt which package contains a file you are missing, try to find an installation that has that file. Then do a
$ grep /my/missing/file /var/sadm/install/contents
This will display a line like this:
/usr/include/sys/errno.h f none 0644 root bin 7471 37605 956241356 SUNWhea
The last item listed (SUNWhea in this example) is the package you need.
Avoid /usr/ucb/cc.
You don't need to have /usr/ucb/ in your PATH to build perl. If you want /usr/ucb/ in your PATH anyway, make sure that /usr/ucb/ is NOT in your PATH before the directory containing the right C compiler.
Sun's C Compiler
If you use Sun's C compiler, make sure the correct directory (usually /opt/SUNWspro/bin/) is in your PATH (before /usr/ucb/).
GCC
If you use gcc, make sure your installation is recent and complete. perl versions since 5.6.0 build fine with gcc > 2.8.1 on Solaris >= 2.6.
You must Configure perl with
$ sh Configure -Dcc=gcc
If you don't, you may experience strange build errors.
If you have updated your Solaris version, you may also have to update your gcc. For example, if you are running Solaris 2.6 and your gcc is installed under /usr/local, check in /usr/local/lib/gcc-lib and make sure you have the appropriate directory, sparc-sun-solaris2.6/ or i386-pc-solaris2.6/. If gcc's directory is for a different version of Solaris than you are running, then you will need to rebuild gcc for your new version of Solaris.
You can get a precompiled version of gcc from <http://www.sunfreeware.com/> or <http://www.blastwave.org/>. Make sure you pick up the package for your Solaris release.
If you wish to use gcc to build add-on modules for use with the perl shipped with Solaris, you should use the Solaris::PerlGcc module which is available from CPAN. The perl shipped with Solaris is configured and built with the Sun compilers, and the compiler configuration information stored in Config.pm is therefore only relevant to the Sun compilers. The Solaris:PerlGcc module contains a replacement Config.pm that is correct for gcc - see the module for details.
GNU as and GNU ld
The following information applies to gcc version 2. Volunteers to update it as appropriately for gcc version 3 would be appreciated.
The versions of as and ld supplied with Solaris work fine for building perl. There is normally no need to install the GNU versions to compile perl.
If you decide to ignore this advice and use the GNU versions anyway, then be sure that they are relatively recent. Versions newer than 2.7 are apparently new enough. Older versions may have trouble with dynamic loading.
If you wish to use GNU ld, then you need to pass it the -Wl,-E flag. The hints/solaris_2.sh file tries to do this automatically by setting the following Configure variables:
ccdlflags="$ccdlflags -Wl,-E" lddlflags="$lddlflags -Wl,-E -G"
However, over the years, changes in gcc, GNU ld, and Solaris ld have made it difficult to automatically detect which ld ultimately gets called. You may have to manually edit config.sh and add the -Wl,-E flags yourself, or else run Configure interactively and add the flags at the appropriate prompts.
If your gcc is configured to use GNU as and ld but you want to use the Solaris ones instead to build perl, then you'll need to add -B/usr/ccs/bin/ to the gcc command line. One convenient way to do that is with
$ sh Configure -Dcc='gcc -B/usr/ccs/bin/'
Note that the trailing slash is required. This will result in some harmless warnings as Configure is run:
gcc: file path prefix `/usr/ccs/bin/' never used
These messages may safely be ignored. (Note that for a SunOS4 system, you must use -B/bin/ instead.)
Alternatively, you can use the GCC_EXEC_PREFIX environment variable to ensure that Sun's as and ld are used. Consult your gcc documentation for further information on the -B option and the GCC_EXEC_PREFIX variable.
Sun and GNU make
The make under /usr/ccs/bin works fine for building perl. If you have the Sun C compilers, you will also have a parallel version of make (dmake). This works fine to build perl, but can sometimes cause problems when running 'make test' due to underspecified dependencies between the different test harness files. The same problem can also affect the building of some add-on modules, so in those cases either specify '-m serial' on the dmake command line, or use /usr/ccs/bin/make instead. If you wish to use GNU make, be sure that the set-group-id bit is not set. If it is, then arrange your PATH so that /usr/ccs/bin/make is before GNU make or else have the system administrator disable the set-group-id bit on GNU make.
Avoid libucb.
Solaris provides some BSD-compatibility functions in /usr/ucblib/libucb.a. Perl will not build and run correctly if linked against -lucb since it contains routines that are incompatible with the standard Solaris libc. Normally this is not a problem since the solaris hints file prevents Configure from even looking in /usr/ucblib for libraries, and also explicitly omits -lucb.
Make sure your PATH includes the compiler (/opt/SUNWspro/bin/ if you're using Sun's compiler) as well as /usr/ccs/bin/ to pick up the other development tools (such as make, ar, as, and ld). Make sure your path either doesn't include /usr/ucb or that it includes it after the compiler and compiler tools and other standard Solaris directories. You definitely don't want /usr/ucb/cc.
LD_LIBRARY_PATH
If you have the LD_LIBRARY_PATH environment variable set, be sure that it does NOT include /lib or /usr/lib. If you will be building extensions that call third-party shared libraries (e.g. Berkeley DB) then make sure that your LD_LIBRARY_PATH environment variable includes the directory with that library (e.g. /usr/local/lib).
If you get an error message
dlopen: stub interception failed
it is probably because your LD_LIBRARY_PATH environment variable includes a directory which is a symlink to /usr/lib (such as /lib). The reason this causes a problem is quite subtle. The file libdl.so.1.0 actually *only* contains functions which generate 'stub interception failed' errors! The runtime linker intercepts links to "/usr/lib/libdl.so.1.0" and links in internal implementations of those functions instead. [Thanks to Tim Bunce for this explanation.]
By default, perl-5.6.0 (or later) is compiled as a 32-bit application with largefile and long-long support.
General 32-bit vs. 64-bit issues.
Solaris 7 and above will run in either 32 bit or 64 bit mode on SPARC CPUs, via a reboot. You can build 64 bit apps whilst running 32 bit mode and vice-versa. 32 bit apps will run under Solaris running in either 32 or 64 bit mode. 64 bit apps require Solaris to be running 64 bit mode.
Existing 32 bit apps are properly known as LP32, i.e. Longs and Pointers are 32 bit. 64-bit apps are more properly known as LP64. The discriminating feature of a LP64 bit app is its ability to utilise a 64-bit address space. It is perfectly possible to have a LP32 bit app that supports both 64-bit integers (long long) and largefiles (> 2GB), and this is the default for perl-5.6.0.
For a more complete explanation of 64-bit issues, see the "Solaris 64-bit Developer's Guide" at <http://docs.sun.com/>
You can detect the OS mode using "isainfo -v", e.g.
$ isainfo -v # Ultra 30 in 64 bit mode 64-bit sparcv9 applications 32-bit sparc applications
By default, perl will be compiled as a 32-bit application. Unless you want to allocate more than ~ 4GB of memory inside perl, or unless you need more than 255 open file descriptors, you probably don't need perl to be a 64-bit app.
Large File Support
For Solaris 2.6 and onwards, there are two different ways for 32-bit applications to manipulate large files (files whose size is > 2GByte). (A 64-bit application automatically has largefile support built in by default.)
First is the "transitional compilation environment", described in lfcompile64(5). According to the man page,
The transitional compilation environment exports all the explicit 64-bit functions (xxx64()) and types in addition to all the regular functions (xxx()) and types. Both xxx() and xxx64() functions are available to the program source. A 32-bit application must use the xxx64() functions in order to access large files. See the lf64(5) manual page for a complete listing of the 64-bit transitional interfaces.
The transitional compilation environment is obtained with the following compiler and linker flags:
getconf LFS64_CFLAGS -D_LARGEFILE64_SOURCE getconf LFS64_LDFLAG # nothing special needed getconf LFS64_LIBS # nothing special needed
Second is the "large file compilation environment", described in lfcompile(5). According to the man page,
Each interface named xxx() that needs to access 64-bit entities to access large files maps to a xxx64() call in the resulting binary. All relevant data types are defined to be of correct size (for example, off_t has a typedef definition for a 64-bit entity). An application compiled in this environment is able to use the xxx() source interfaces to access both large and small files, rather than having to explicitly utilize the transitional xxx64() interface calls to access large files.
Two exceptions are fseek() and ftell(). 32-bit applications should use fseeko(3C) and ftello(3C). These will get automatically mapped to fseeko64() and ftello64().
The large file compilation environment is obtained with
getconf LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 getconf LFS_LDFLAGS # nothing special needed getconf LFS_LIBS # nothing special needed
By default, perl uses the large file compilation environment and relies on Solaris to do the underlying mapping of interfaces.
Building an LP64 perl
To compile a 64-bit application on an UltraSparc with a recent Sun Compiler, you need to use the flag "-xarch=v9". getconf(1) will tell you this, e.g.
$ getconf -a | grep v9 XBS5_LP64_OFF64_CFLAGS: -xarch=v9 XBS5_LP64_OFF64_LDFLAGS: -xarch=v9 XBS5_LP64_OFF64_LINTFLAGS: -xarch=v9 XBS5_LPBIG_OFFBIG_CFLAGS: -xarch=v9 XBS5_LPBIG_OFFBIG_LDFLAGS: -xarch=v9 XBS5_LPBIG_OFFBIG_LINTFLAGS: -xarch=v9 _XBS5_LP64_OFF64_CFLAGS: -xarch=v9 _XBS5_LP64_OFF64_LDFLAGS: -xarch=v9 _XBS5_LP64_OFF64_LINTFLAGS: -xarch=v9 _XBS5_LPBIG_OFFBIG_CFLAGS: -xarch=v9 _XBS5_LPBIG_OFFBIG_LDFLAGS: -xarch=v9 _XBS5_LPBIG_OFFBIG_LINTFLAGS: -xarch=v9
This flag is supported in Sun WorkShop Compilers 5.0 and onwards (now marketed under the name Forte) when used on Solaris 7 or later on UltraSparc systems.
If you are using gcc, you would need to use -mcpu=v9 -m64 instead. This option is not yet supported as of gcc 2.95.2; from install/SPECIFIC in that release:
GCC version 2.95 is not able to compile code correctly for sparc64 targets. Users of the Linux kernel, at least, can use the sparc32 program to start up a new shell invocation with an environment that causes configure to recognize (via uname -a) the system as sparc-*-* instead.
All this should be handled automatically by the hints file, if requested.
Long Doubles.
As of 5.8.1, long doubles are working if you use the Sun compilers (needed for additional math routines not included in libm).
If you for some reason (such as binary backward compatibility) really need to use perl's malloc, you can rebuild perl from the sources and Configure the build with
$ sh Configure -Dusemymalloc
You should not use perl's malloc if you are building with gcc. There are reports of core dumps, especially in the PDL module. The problem appears to go away under -DDEBUGGING, so it has been difficult to track down. Sun's compiler appears to be okay with or without perl's malloc. [XXX further investigation is needed here.]
sh ./Configure -des -Dusecrosscompile \ -Dcc=i386-pc-solaris2.11-gcc \ -Dsysroot=$SYSROOT \ -Alddlflags=" -Wl,-z,notext" \ -Dtargethost=... # The usual cross-compilation options
The lddlflags addition is the only abnormal bit.
The problem is that various structures visible via procfs use off_t, and if you compile with largefile support these change from 32 bits to 64 bits. Thus what you get back from procfs doesn't match up with the structures in perl, resulting in garbage. See proc(4) for further discussion.
A fix for Proc::ProcessTable is to edit Makefile to explicitly remove the largefile flags from the ones MakeMaker picks up from Config.pm. This will result in Proc::ProcessTable being built under the correct environment. Everything should then be OK as long as Proc::ProcessTable doesn't try to share off_t's with the rest of perl, or if it does they should be explicitly specified as off64_t.
It may be possible to use the Entropy Gathering Daemon (written in Perl!), available from <http://www.lothar.com/tech/crypto/>.
... relocation truncated to fit: BASE13 ...
and dies. Therefore the SunOS 4.1 hints file explicitly sets the ld to be /usr/bin/ld.
As of Perl 5.8.1 the dynamic loading of libraries (DynaLoader, XSLoader) also seems to have become broken in in SunOS 4.x. Therefore the default is to build Perl statically.
Running the test suite in SunOS 4.1 is a bit tricky since the dist/Tie-File/t/09_gen_rs.t test hangs (subtest #51, FWIW) for some unknown reason. Just stop the test and kill that particular Perl process.
There are various other failures, that as of SunOS 4.1.4 and gcc 3.2.2 look a lot like gcc bugs. Many of the failures happen in the Encode tests, where for example when the test expects "0" you get "0" which should after a little squinting look very odd indeed. Another example is earlier in t/run/fresh_perl where chr(0xff) is expected but the test fails because the result is chr(0xff). Exactly.
This is the "make test" result from the said combination:
Failed 27 test scripts out of 745, 96.38% okay.
Running the "harness" is painful because of the many failing Unicode-related tests will output megabytes of failure messages, but if one patiently waits, one gets these results:
Failed Test Stat Wstat Total Fail Failed List of Failed ----------------------------------------------------------------------------- ... ../ext/Encode/t/at-cn.t 4 1024 29 4 13.79% 14-17 ../ext/Encode/t/at-tw.t 10 2560 17 10 58.82% 2 4 6 8 10 12 14-17 ../ext/Encode/t/enc_data.t 29 7424 ?? ?? % ?? ../ext/Encode/t/enc_eucjp.t 29 7424 ?? ?? % ?? ../ext/Encode/t/enc_module.t 29 7424 ?? ?? % ?? ../ext/Encode/t/encoding.t 29 7424 ?? ?? % ?? ../ext/Encode/t/grow.t 12 3072 24 12 50.00% 2 4 6 8 10 12 14 16 18 20 22 24 Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------ ../ext/Encode/t/guess.t 255 65280 29 40 137.93% 10-29 ../ext/Encode/t/jperl.t 29 7424 15 30 200.00% 1-15 ../ext/Encode/t/mime-header.t 2 512 10 2 20.00% 2-3 ../ext/Encode/t/perlio.t 22 5632 38 22 57.89% 1-4 9-16 19-20 23-24 27-32 ../ext/List/Util/t/shuffle.t 0 139 ?? ?? % ?? ../ext/PerlIO/t/encoding.t 14 1 7.14% 11 ../ext/PerlIO/t/fallback.t 9 2 22.22% 3 5 ../ext/Socket/t/socketpair.t 0 2 45 70 155.56% 11-45 ../lib/CPAN/t/vcmp.t 30 1 3.33% 25 ../lib/Tie/File/t/09_gen_rs.t 0 15 ?? ?? % ?? ../lib/Unicode/Collate/t/test.t 199 30 15.08% 7 26-27 71-75 81-88 95 101 103-104 106 108- 109 122 124 161 169-172 ../lib/sort.t 0 139 119 26 21.85% 107-119 op/alarm.t 4 1 25.00% 4 op/utfhash.t 97 1 1.03% 31 run/fresh_perl.t 91 1 1.10% 32 uni/tr_7jis.t ?? ?? % ?? uni/tr_eucjp.t 29 7424 6 12 200.00% 1-6 uni/tr_sjis.t 29 7424 6 12 200.00% 1-6 56 tests and 467 subtests skipped. Failed 27/811 test scripts, 96.67% okay. 1383/75399 subtests failed, 98.17% okay.
The alarm() test failure is caused by system() apparently blocking alarm(). That is probably a libc bug, and given that SunOS 4.x has been end-of-lifed years ago, don't hold your breath for a fix. In addition to that, don't try anything too Unicode-y, especially with Encode, and you should be fine in SunOS 4.x.
Please report any errors, updates, or suggestions to <https://github.com/Perl/perl5/issues>.
| 2020-02-11 | perl v5.30.3 |


Everyday thousands of people are diagnosed with mental disorders and often our society defines those people by their illness alone. More than a label strives to show that people are more than their disease. A mental illness is a noun, not an adjective, and does not specifically represent a person.  People are labeled for many reasons, but you get to decide your own label. So what will yours say?


Form control: input
The form below contains two input elements; one of type text and one of type password:
Select Image
Submit


Work starts on repair of historic Telford dam wall more than 12 months after it was destroyed by tree
by Mat GrowcottWork has now started to repair an historic dam wall which was broken when a tree fell through it more than a year ago.
Campaigners around Horsehay Pool had been planning to protest the eyesore wall, but work has now started on repairing it.
Telford & Wrekin Council said its contractors began the work on Monday, and that it was expected to take about four weeks to complete.
Russell Griffin, a spokesman for Telford & Wrekin Council, said: "A large tree fell into Horsehay Pool in October 2018 after high winds and damaged part of the Reservoir dam wall.
"Works started to permanently repair the damage on Monday, November 18 and these are expected to be completed in four weeks.
"Balfour Beatty is the principal contractor for the works and specialist local sub-contractors are being used to install scaffolding and rebuild the wall using locally sourced materials."
Ruins
The dam wall was left in ruins after a tree smashed through it during Storm Callum in October 2018.
The tree that crashed through the wall was cut down and the area was secured, but the beauty spot was then left untouched.
The council said that work had been going on behind the scenes on the difficult project, which was delayed in part by a suspended BT duct.
It said it was not a simple quick job because it involved the historic dam wall, the open water of Horsehay pool and nearby buried services.
The pool was created when Abraham Darby II build a blast furnace in the area.
It is believed to be the original pool from which water was drawn to operate the blast furnace. Many large scale projects were created in Horsehay, including the Shifnal railway bridge.
Many of the homes next to the pool were built for workers at the furnace.


Name
lua-oocairo-fontopt - options controlling text rendering
Introduction
A font options object contains options that tell Cairo how to render
text on surfaces. They can be created with the font_options_create
function in the main oocairo module (see lua-oocairo(3)), and
retrieved from scaled fonts or context objects with get_font_options
methods.
Font options objects can be compared with the ==
operator. Two different
objects with the same options set will be considered equal.
Methods
The following methods are available on font options objects:
- opt:copy ()
Returns a new font options object, with identical options to opt. The two objects will be completely independent, so you can set them to have different options.
- opt:get_antialias ()
Get the current antialiasing mode, which will be one of the strings accepted by the
opt:set_antialias()
method.- opt:get_hint_metrics ()
Returns the current hint metrics option, which will be one of the same strings accepted by the
opt:set_hint_metrics()
method.- opt:get_hint_style ()
Get the kind of font hinting done when rendering text. Returns one of the strings accepted by the
opt:set_hint_style()
method.- opt:get_subpixel_order ()
Returns the current ordering of colour components in pixels used for subpixel rendering, which will be one of the same strings accepted by the
opt:set_subpixel_order()
method.- opt:hash ()
Return a number which can be used as a hash key identifying the particular options in opt. That is, if you wanted to cache fonts according to the options set on them, you could store them in a table with this hash value as the key. Two font options objects with the same options will have the same hash value.
- opt:merge (srcopt)
Add any options which are set to a non-default value in srcopt to opt if that still has the default value from them. The options in srcopt will be unchanged. Nothing is returned.
- opt:set_antialias (antialiastype)
Set the antialiasing mode used for drawing. The argument must be a string or boolean value accepted by the
set_antialias
method on context objects (see lua-oocairo-context(3)).- opt:set_hint_metrics (hintmetrics)
Set the kind of hinting to be applied to the metrics, as opposed to outlines, of the glyphs in a font. The hintmetrics value must be one of the following strings:
- opt:set_hint_style (hintstyle)
Set the kind of font hinting done when rendering text. The hintstyle value must be one of the following strings:
- opt:set_subpixel_order (order)
Used to inform Cairo of the arrangement of colour components in the pixels of a display device like a monitor. Only applies if subpixel antialiasing is used. The order value must be one of the following strings:
The last two options refer to vertical arrangements of colours.


Line Clear Express & Logistics Sdn Bhd (Line Clear) were formed in 2015, a wholly-owned subsidiary of MMAG Holdings Berhad, a publicly-traded company on the ACE Market of Bursa Malaysia. Today, they see a fully integrated supply chain management specialist led by innovation. A company that were not only reinventing the express delivery business model but redefining the purpose of the business itself. Line Clear are undergoing a business transformation driven by new business methodology, creativity, technology and infrastructure that connect all the dots seamlessly.
Line Clear have 66 hubs and branches in Malaysia, including Sabah and
Sarawak. Their massive warehouses in Subang UEP (Selangor), Gelang Patah
(Johor), Tambun (Penang) and other strategic locations have a total capacity
of 1 million square feet. These warehouses are fully equipped with racks,
forklifts, a conveyor belt system. A systematic sorting arrangement and
pick-and-pack solutions that operate 18 hours a day.
The decentralization methodology allows goods and parcels to be sorted
out at hubs and depots at the regional level. This speeds up the handling
time and allows goods to be sent and received on the same day in the Klang
Valley, Johor Bahru, Penang, Ipoh, Melaka, Seremban and Kuantan.
Their fleet of over 800 vehicles includes trucks, vans, line haul vehicles,
prime movers and motorcycles. With the current setup, Line Clear have the
capacity to manage 100,000 air waybills (AWB) per day. Their services include
courier services, freight services, transit insurance, transit clearance,
customised and special handling services, warehousing, fulfilment, 3rd
and 4th party logistics.
Line Clear’s Scan2Deliver smart technology empowers customers to make
end-to-end delivery using the web or app. Information will be at the customer’s
fingertips and authentication of customers will be via QR code, an innovation
that is transforming the speed and scale of business in an economy disrupted
by the Covid-19 pandemic.
Line Clear aim to move not just things but to mobilise people, business
and the economy in these challenging times and beyond.


|
libcoap
4.2.1
|
#include "coap_internal.h"
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
Go to the source code of this file.
Data Structures | |
| struct | cnt_str |
Macros | |
| #define | ISEQUAL_CI(a, b) ((a) == (b) || (islower(b) && ((a) == ((b) - 0x20)))) |
| #define | hexchar_to_dec(c) |
Calculates decimal value from hexadecimal ASCII character given in c . More... | |
| #define | min(a, b) ((a) < (b) ? (a) : (b)) |
| #define | URI_DATA(uriobj) ((unsigned char *)(uriobj) + sizeof(coap_uri_t)) |
Typedefs | |
| typedef void(* | segment_handler_t) (const uint8_t *, size_t, void *) |
Functions | |
| COAP_STATIC_INLINE const uint8_t * | strnchr (const uint8_t *s, size_t len, unsigned char c) |
| A length-safe version of strchr(). More... | |
| int | coap_split_uri (const uint8_t *str_var, size_t len, coap_uri_t *uri) |
| Parses a given string into URI components. More... | |
| static void | decode_segment (const uint8_t *seg, size_t length, unsigned char *buf) |
Decodes percent-encoded characters while copying the string seg of size length to buf . More... | |
| static int | check_segment (const uint8_t *s, size_t length, size_t *segment_size) |
| Runs through the given path (or query) segment and checks if percent-encodings are correct. More... | |
| static int | make_decoded_option (const uint8_t *s, size_t length, unsigned char *buf, size_t buflen, size_t *optionsize) |
Writes a coap option from given string s to buf . More... | |
| COAP_STATIC_INLINE int | dots (const uint8_t *s, size_t len) |
Checks if path segment s consists of one or two dots. More... | |
| static size_t | coap_split_path_impl (const uint8_t *s, size_t length, segment_handler_t h, void *data) |
| Splits the given string into segments. More... | |
| static void | write_option (const uint8_t *s, size_t len, void *data) |
| int | coap_split_path (const uint8_t *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI path into segments. More... | |
| int | coap_split_query (const uint8_t *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI query into segments. More... | |
| coap_uri_t * | coap_new_uri (const uint8_t *uri, unsigned int length) |
| Creates a new coap_uri_t object from the specified URI. More... | |
| coap_uri_t * | coap_clone_uri (const coap_uri_t *uri) |
| Clones the specified coap_uri_t object. More... | |
| COAP_STATIC_INLINE int | is_unescaped_in_path (const uint8_t c) |
| COAP_STATIC_INLINE int | is_unescaped_in_query (const uint8_t c) |
| coap_string_t * | coap_get_query (const coap_pdu_t *request) |
| coap_string_t * | coap_get_uri_path (const coap_pdu_t *request) |
| #define hexchar_to_dec | ( | c | ) |
| #define ISEQUAL_CI | ( | a, | |
| b | |||
| ) | ((a) == (b) || (islower(b) && ((a) == ((b) - 0x20)))) |
| #define URI_DATA | ( | uriobj | ) | ((unsigned char *)(uriobj) + sizeof(coap_uri_t)) |
| typedef void(* segment_handler_t) (const uint8_t *, size_t, void *) |
|
static |
| coap_uri_t* coap_clone_uri | ( | const coap_uri_t * | uri | ) |
Clones the specified coap_uri_t object.
Thie function allocates sufficient memory to hold the coap_uri_t structure and its contents. The object must be released with coap_free().
Definition at line 447 of file uri.c.
| coap_string_t* coap_get_query | ( | const coap_pdu_t * | request | ) |
| coap_string_t* coap_get_uri_path | ( | const coap_pdu_t * | request | ) |
| coap_uri_t* coap_new_uri | ( | const uint8_t * | uri, |
| unsigned int | length | ||
| ) |
Creates a new coap_uri_t object from the specified URI.
Returns the new object or NULL on error. The memory allocated by the new coap_uri_t must be released using coap_free().
| uri | The URI path to copy. |
| length | The length of uri. |
Definition at line 428 of file uri.c.
|
static |
Splits the given string into segments.
You should call one of the macros coap_split_path() or coap_split_query() instead.
| s | The URI string to be tokenized. |
| length | The length of s . |
| h | A handler that is called with every token. |
| data | Opaque data that is passed to h when called. |
s
. Definition at line 341 of file uri.c.
|
static |
Decodes percent-encoded characters while copying the string seg
of size length
to buf
.
The caller of this function must ensure that the percent-encodings are correct (i.e. the character '' is always followed by two hex digits. and that buf
provides sufficient space to hold the result. This function is supposed to be called by make_decoded_option() only.
| seg | The segment to decode and copy. |
| length | Length of seg . |
| buf | The result buffer. |
Definition at line 213 of file uri.c.
| COAP_STATIC_INLINE int dots | ( | const uint8_t * | s, |
| size_t | len | ||
| ) |
| COAP_STATIC_INLINE int is_unescaped_in_path | ( | const uint8_t | c | ) |
| COAP_STATIC_INLINE int is_unescaped_in_query | ( | const uint8_t | c | ) |
|
static |
Writes a coap option from given string s
to buf
.
s
should point to a (percent-encoded) path or query segment of a coap_uri_t object. The created option will have type 0
, and the length parameter will be set according to the size of the decoded string. On success, this function returns 0
and sets optionsize
to the option's size. On error the function returns a value less than zero. This function must be called from coap_split_path_impl() only.
| s | The string to decode. |
| length | The size of the percent-encoded string s . |
| buf | The buffer to store the new coap option. |
| buflen | The maximum size of buf . |
| optionsize | The option's size. |
0
on success and -1
on error.Definition at line 276 of file uri.c.
| COAP_STATIC_INLINE const uint8_t* strnchr | ( | const uint8_t * | s, |
| size_t | len, | ||
| unsigned char | c | ||
| ) |
A length-safe version of strchr().
This function returns a pointer to the first occurrence of c
in s
, or NULL
if not found.
| s | The string to search for c . |
| len | The length of s . |
| c | The character to search. |
c
, or NULL
if not found. Definition at line 32 of file uri.c.


The Title should be an accurate and concise description of a page's content, and is critical to both a user experience and search engine optimisation.
More Information: Title Tag (Moz.com)
Meta Descriptions are commonly used in search engine result pages, and are extremely important in gaining user click-through.
Make sure to let users know whether the page contains the information they're looking for.
More Information: Meta Description (Moz.com)
{{ model.value.description || 'My Nice Description of this Page' | ellipsisLimit:serpDescriptionLength }}
Meta Keywords are used by SOME search engines for determine the category of content and if the content is relevant to user's search.
Make sure that keywords you entered here can be found in your content. If no, the search engine will think that you are cheating them.
More Information: What are Keywords? (Moz.com)
This is the URL segment that will be used on the site. It is okay to leave this blank (Umbraco will create a URL based off the page name).
Be careful when setting/changing this. It is generally bad practice to change this once a page has been published, unless you've got the Url Tracker installed.
If unsure, leave as-is and speak to {{ developerName }} for advice.
{{ doNotIndexExplanation }}
If unsure, leave as-is and speak to {{ developerName }} for advice.


UK ticket-holder claims £105m EuroMillions jackpot
A claim has been staked for the £105 million EuroMilliions jackpot won on Tuesday.
It is not known whether the UK ticket-holder is an individual or a syndicate.
National Lottery operator Camelot said the prize will be paid out at a ticket validation appointment before the winner decides whether to go public.
The big prize on the 25th anniversary of the first National Lottery draw was the sixth EuroMillions jackpot banked in the UK this year.
Sorry, this content isn't available on your device.
Andy Carter, senior winners’ adviser at the National Lottery, said: “What a way to celebrate 25 years of the National Lottery.
“This is the sixth massive EuroMillions jackpot win in 2019 and follows the nation’s biggest ever win of £170 million just last month.
“We now focus on supporting the ticket-holder as they start to enjoy their newfound wealth.
“There is another chance to win big tonight with a £25 million must-be-won Lotto jackpot up for grabs. Make sure you have a ticket to be in with a chance to win big.”
A UK ticket-holder won the £170 million EuroMillions jackpot in October, making them the UK’s biggest winner.
The previous biggest UK winners were Colin and Chris Weir, from Largs in North Ayrshire, who won £161 million in July 2011.
A £123 million jackpot was won by a UK ticket-holder in June and a UK winner scooped £38 million on the EuroMillions in April.
Ade Goodchild, from Hereford, bagged £71 million on March 15 and Patrick and Frances Connolly, from Northern Ireland, won £114.9 million on New Year’s Day.


Online Prescriptions
Profile:
[Profile Information]
Prescription
Medical History
[Prescription Information]
[Medical History]


“Then next, take canal life as a form of ‘university’ education.  Much the better you are for all that, when you get home again, aren't you?”
John Ruskin, Fors Clavigera, Letter LXXV “Star Law” (1877)


UBIQ & adidas Consortium's Crazy BYW 2.0 X Celebrates US-Via-Korea's "Sister Cities"
Featuring a full-body 3M underlay, extra 3M paneling, and Korean typography throughout.
by Eric BrainUBIQ is the latest stalwart sneaker store to be enlisted by adidas Consortium, this time around delivering a collaborative take on the Crazy BYW 2.0 X, dubbed “Sister Cities.”
The story of “Sister Cities” dates back to 1947 and was created as a way to bring communities together following World War II. Inspired by UBIQ’s hometowns of Philadelphia and Georgetown and their Sister Cities of Incheon and Seoul, the futuristic sneaker sports a combination of both nods to Korea and the store’s roots in its unique design.
adidas’ mid-top basketball silhouette has been treated to an engineered sandwich mesh upper with a reflective underlay, meaning that the white upper shines bright at night all over. Added 3M detailing can be seen on the toe box, lace stays, mid-panels, tongue and heel loops, and on the speckled bright green laces.
The full-length BOOST midsole is encaged in a sculpted, two-tone EVA unit, and finishing off the sneaker’s fabrication is a technical neoprene bootie lining the inside. UBIQ celebrates its “Sister Cities” with the inclusion of Korean typography printed all over the tongue, as well as insoles featuring a yin yang-style print adopting the blue and red hues of the traditional Korean Obangsaek color spectrum.
UBIQ and adidas Consortium’s Crazy BYW 2.0 x “Sister Cities” will release on Black Friday — November 29 — at 10 a.m. EST exclusively via the UBIQlife.com website for $170 USD.
In case you missed it, check out the Sneakersnstuff x adidas Originals Stadt “Södermalm.”
UBIQ x adidas Consortium Crazy BYW X 2.0 “Sister Cities”
Release Date
November 29, 2019 - 10:00 am EST (TBC)
Price
170 USD


Preparation time
1-2 hours
Cooking time
less than 10 mins
Serves
Serves 4
Mix together the chilli oil, paprika, chilli powder, sugar and the lime juice and zest. Cut each chicken breast lengthways into six strips. Add to the chilli paste, cover and leave to marinate for 1-2 hours.
Meanwhile make the tomato and avocado salsa. Place all the ingredients into a large bowl and stir gently to combine. Season with salt and pepper and place in a serving bowl.
Heat a barbecue or a ridged griddle pan.
Thread three pieces of chicken onto each skewer, place on the barbecue or griddle pan and cook for 3-4 minutes on each side until the chicken is cooked through.
Place the chicken skewers on a serving plate and hand around the tomato and avocado salsa, warmed tortillas, lettuce and soured cream and allow each person to assemble the fajitas themselves.


Your browser does not support the audio element.
nyaco logs
> specimens
> info
github
|
twitter
|
discord


| Package | Description |
|---|---|
| teetime.stage |
Contains a set of pre-defined stages, which are ready-to-go and can be used for analysis configuration.
|
| teetime.stage.basic | |
| teetime.stage.io | |
| teetime.stage.string | |
| teetime.stage.xml |
| Modifier and Type | Class and Description |
|---|---|
class |
ByteArray2String |
class |
Cache<T> |
class |
CipherStage |
class |
Counter<T> |
class |
ElementDelayMeasuringStage<T> |
class |
ElementsToList<I> |
class |
ElementThroughputMeasuringStage<T> |
class |
EveryXthStage<T> |
class |
InputPortSizePrinter<T> |
class |
InstanceCounter<T,C extends T> |
class |
MappingCounter<T>
This counts how many of different elements are sent to this stage.
|
class |
MD5Stage |
class |
NoopFilter<T> |
class |
Ramp
Sends a sequence of numbers starting from 0 to the value 'n' (not included) received by the input port, i.e., (0,1,2,..,n-1).
|
class |
Relay<T> |
class |
StartTimestampFilter |
class |
StopTimestampFilter |
class |
ZipByteArray
A stage to compress and decompress byte arrays
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractFilter<E> |
| Modifier and Type | Class and Description |
|---|---|
class |
Directory2FilesFilter |
class |
File2ByteArray |
class |
File2Lines |
class |
File2SeqOfWords |
class |
File2TextLinesFilter |
| Modifier and Type | Class and Description |
|---|---|
class |
Tokenizer |
class |
ToLowerCase
Receives a string and passes it on to the next stage only with lower case letters.
|
class |
WordcharacterFilter
Receives a string and passes it with removed punctuation and similar characters on to the next stage.
|
| Modifier and Type | Class and Description |
|---|---|
class |
ApplyXSLTToDocumentStage
Represents a transformation stage.
|
class |
LoadXMLToDocumentStage
Represents a transformation stage.
|
Copyright © 2015–2019. All rights reserved.


{% load staticfiles %} {% load extra_tags %}
You are about to DELETE this record, this procedure is irreversible.
Do you want to proceed?


Mumbai Health Project
About us
support us
What Do We Do
What Are We
Contact us
Our Operational Structure


---
title: ŁW's thoughts on software
description:
---
Another blog!
Yes, another blog about programming in general. I will try to put here some of the
things that I am working on, my reflections and notes. Maybe someone will use them
during their own work/fun :).


Callout can be used to provide helpful feedback during data entry.
Please enter your name:
Please enter your height (in inches):


Hertz 87,9
CampusRadio für Bielefeld
Infusio.net - defunct
"[...] free webradio playing quality dub and deep techno and downtempo from netlabels, which distribute music under Creative Commons License."
IRŠ TLIS
Nice music
Jenny FM
Trance, Techno, House, Progressive from Dortmund
KAMP Student Radio
The University of Arizona's first college radio station
KCPW
"On air at library square"
Kohina
old school game and demo music
KPFA
"Much of our programming is local, original and eclectic, with a well produced mix of news and in depth public affairs, an ongoing drama, literature and performance series, interviews, and reviews."
KRCL
Radio Free Utah
La Hora De La Bestia
The purpose of this show is to broadcast kickass bands to the rest of the world. This show plays real music, not a lot of talk. Only the pure energy of obscure or relatively unknown, underground bands.
LORA München
Das Freie Radio in München
Magic Radio
Eighties radio from France
Nectarine Demoscene Radio
"Demoscene music"
NRK Alltid Klassisk
Norwegian broadcasting corporation
NRK Alltid Nyheter
Norwegian broadcasting corporation
NRK mP3
Norwegian broadcasting corporation
NRK P1
Norwegian broadcasting corporation
NRK P2
Norwegian broadcasting corporation
NRK P3
Norwegian broadcasting corporation
NRK Stortinget
Norwegian broadcasting corporation
ocremix
Remixes of video game music.
Omroep Venray
Omroep Venray is een niet-commercieel publiek lokaal radiostation voor Venray en Noord-Limburg. Onze site bevat onder andere Venrays nieuws, radio nieuws, sport, muziek en informatie over Venray.
Ona Mallorca
From Mallorca
Plum'FM
Plum'FM est née en 1990 à l'IME Les Bruyères à Plumelec : les éducateurs lancèrent une activité radio pour les jeunes déficients mentaux de linstitut, afin de faciliter leur expression et en même temps leur participation à la vie locale.
Progrock.com
"The companion unobstrusive. Progressive rock on the Internet radio waves."
Radio 1190
Student station at the University of Colorado, USA. Independent music, many genres.
Radio Air Libre
Radio Air Libre est une radio socioculturelle reconnue par la Communauté française de Belgique. Elle est gérée et financée par ses membres, animatrices et animateurs.
Depuis sa création en 1980, Radio Air Libre existe pour celles et ceux qui trouvent trop souvent porte close dans les médias traditionnels.
Radio Akropolis
Streaming from Prague. Mostly in Czech, some other language programming (including English). They have an interesting setup, which has some live programmes. When the live programmes are off air, songs are selected from a playlist which listeners can edit!
Radio Bréniges
Pays de Brive
Radio Bro Gwened
Radio Bro Gwened propose à ses auditeurs des émissions en français et en langue bretonne et plus particulièrement en breton vannetais.
Radio Campus Lille
Radio Campus Lille une radio universitaire originale et indépendante depuis 1969 !
Rádio Devín
A station of the Slovak Broadcasting Corporation
Radio FMR
(Toulouse) La radio libre et associative
Radio Kanal Ratte
Free Radio from Schopfheim, Germany
Radio Kerne
Radio Kerne ur zo radio kevredigezhel brezhonek. E Ploneiz emañ, tre e-kichenn Kemper. Skignet en deus evit ar wech kentañ e 1998 ha bremañ gant e dav frekañs ez a da skigañ war ul lodenn vad eus departamant Penn ar Bed.
Radio Kreiz Breizh
Créée à Saint Nicodème (près de Callac) en 1983, Radio Kreiz Breizh émet sur l'Ouest des Côtes d'Armor, le Trégor Finistèrien et le Centre Finistère et le Nord-Ouest du Morbihan
Radio Libre Attitude
Radio Libre Attitude est une radio communautaire ne proposant que des contenus sous licence libre allant de la libre diffusion au libre complet.
Radio Mania
Rock music station, playing local and international tracks.
Radio Panik
Radio d'expression qui émet depuis plus de 20 ans sur les ondes de la FM bruxelloise.
Rádio Patria
A station of the Slovak Broadcasting Corporation
Rádio Regina Banská Bystrica
A station of the Slovak Broadcasting Corporation
Rádio Regina Bratislava
A station of the Slovak Broadcasting Corporation
Rádio Regina Košice
A station of the Slovak Broadcasting Corporation
radio six international
around the clock around the world
Rádio Slovensko
A station of the Slovak Broadcasting Corporation
Radio StHörfunk
Free Radio from Schwäbisch Hall, Germany
Radio ZuSa
das Radio für Heide, Elbmarsch und Wendland
Rádio_FM
A station of the Slovak Broadcasting Corporation
Radio-Canada.ca Espace Musique
From Montréal, Québec, Canada (in French)
Radio-Canada.ca Première Chaîne
From Montréal, Québec, Canada (in French)
RadioCitta’Fujiko
radiocitta’fujiko ha iniziato ufficialmente le sue trasmissioni sulla storica frequenza dei 103.100 Mhz in modulazione di frequenza nel mese di Ottobre 2004, in contemporanea con l'apertura di VAG61, il Media Center cittadino di via Paolo Fabbri 110.
Radius
Student radio
Rare FM
University College London Union
Resonance FM
"London's first radio art station"
Seattletech
'Years ago Mark got tired of carrying around CDs with him. He encoded them in Fran's MP3 format. He began using Icecast to stream the sounds. He no longer had to carry CDs with him.'
Shartnet Pop/Indie -
Ogg Vorbis
"Do you remember CB radio? Now we have SHART. Simple human audio recorded transmission. Use it just like your old CB radio. Only SHART is better, you can create a channel based on a topic of your choice. Any topic popular or obscure is ok. Anonymously transmit your SHART to the SHART stream, and you are instantly heard by fellow SHARTERS."
Shartnet Metal -
Ogg Vorbis
Sky Plus
Raadio Sky Plus
Star FM
An Estonian radio station playing chart music from the 80s and 90s.
Still Audio
Still Audio is the stream of the podcast featuring an eclectic mixture of calming electronica. Styles featured range from mainstream to experimental, and from the accessible to the avant-garde.
Surge
Southampton University Radio.
technobase.fm
Techno
TRD
Turkish World Radio
Türk Radyo Dünyasi, Turk Radyo Dunyasi, Turkish World Radio
Trent Radio
Run by students of Trent University, Peterborough, Ontario, Canada
Univalle Estéreo
Emisora Univalle Estéreo, estación de radio de la Universidad del Valle en Cali, Colombia transmitiendo en directo vía internet en Ogg Vorbis, real Audio y AAC
WCLV
Classical music in north east Ohio
WCPE
"Great classical music, 24 hours a day"
WCRT
'a radio station'
WDXU Durham
Duke University Union
Weasel Radio Network [ Retro Request Line ]
"Just the music I grew up listening to, songs that listeners have suggested, and many more. The Good Stuff."
WFMU
WFMU is an independent freeform radio station broadcasting at 91.1 fm in the New York City area, at 90.1 fm in the Hudson Valley, and live on the web.
Winsystem
No idea what this is
WKNC
"WKNC 88.1 FM is the only station on the Raleigh-Durham dial where you will find ""the next big thing"" in music as well as classic tunes that can not be heard on any other station."
WSIA Staten Island
WSIA 88.9 FM is dedicated to bringing the community the very best in music, news, and sports programming.
WTJU-FM
"WTJU-FM is a noncommercial educational radio station licensed by the Federal Communications Commission to the Rector and Board of Visitors of the University of Virginia.
WTJU presents original, rich, and diverse programming of music and other forms of expression free from the direct constraints of commercial interests, reflecting the broadest educational goals of the University."
WXYC
WXYC Chapel Hill 89.3 FM (student radio)


9.5 Description of Binary Search
Trees
Binary search
trees are
binary trees organized specifically for searching. To search
for a node in a binary search tree, we start at the root of
the tree and descend level by level until we find the node we
are looking for. When we encounter a node greater than the
desired node, we follow its left pointer. When we encounter a
node that is less, we follow its right pointer. For example,
to locate 15 in the tree of Figure
9.7, start at the root and move to the left since 15 is
less than 20, then to the right since 15 is greater than 09,
at which point we find 15. If we reach the end of a branch
before locating the desired node, it does not exist.
Of course, the process of searching a binary
tree depends on nodes having been inserted in a similar way.
Thus, to insert a node, we start at the root of the tree and
descend level by level, moving left or right as appropriate.
When we reach the end of a branch, we make the insertion. For
example, to insert 65 into the tree of Figure
9.7, we start at the root and move to the right since 65
is greater than 20, then to the right again since 65 is
greater than 53, and then to the left since 65 is less than
79. This point is the end of a branch, so we insert the key as
the left child of 79. Duplicate keys
are not allowed.
Binary search trees are efficient structures
for searching because in the worst case, we only end up
searching the data in one branch, instead of having to search
every piece of data. Thus, searching becomes an O (lg n) operation, where n is the number of nodes in the tree,
provided the tree is kept balanced. Recall that keeping a tree balanced
means that it will be as short as possible for a given number
of nodes. Keeping a binary search tree balanced is important
because it means that no branch we search will be
exceptionally long.
To understand further the importance of
keeping a binary search tree balanced, consider what happens
as a binary search tree becomes more and more unbalanced. As
this occurs, searching for a node approaches O (n),
which is no better than searching from one end of the data to
the next. For example, imagine a binary search tree containing
216 words from a dictionary inserted in alphabetical order
(see Figure
9.8). In this case, the tree consists of a single branch
to the right, and searching for a word could require
inspecting as many as 216 words. However, if we
insert the words in a random fashion, the tree should end up
at least somewhat balanced, and we can expect to traverse
closer to lg 216 = 16 words in the worst case.
Since normally the order in which nodes are inserted and
removed is not something we can control, we cannot rely on
this method to keep a tree balanced. Instead, we must take a
more proactive approach.
|


You must log into the database as Pat before proceeding with this page.
The 'credit_card' table is accessed by different users for different purpose. SECADM Pat wants to audit the employees, managers, and administrators for any activities on that table.
Auditing can be enabled on different objects like tables, roles, trusted context objects, authorities (SYSADM, DBADM, SECADM) and database.
Pat would like to audit the trusted context object. Based on this requirement, he performs the following:
All required audit policies are now set.


How can I help?
The best way for you to help is to submit questions for the questions database. You can submit questions via the form below (perfered method) or you can submit a question via email.
Thank you for your help. It is greatly appreciated. Would you like to submit another question?


Locality Sensitive Hashing (LSH) provides for a fast, efficient approximate nearest neighbor search. The algorithm scales well with respect to the number of data points as well as dimensions.
In this assignment, you will
Note to Amazon EC2 users: To conserve memory, make sure to stop all the other notebooks before running this notebook.
The following code block will check if you have the correct version of GraphLab Create. Any version later than 1.8.5 will do. To upgrade, read this page.
import numpy as np # dense matrices
import pandas as pd # see below for install instruction
import json
from scipy.sparse import csr_matrix # sparse matrices
from sklearn.metrics.pairwise import pairwise_distances # pairwise distances
from copy import copy # deep copies
import matplotlib.pyplot as plt # plotting
%matplotlib inline
'''compute norm of a sparse vector
Thanks to: Jaiyam Sharma'''
def norm(x):
sum_sq=x.dot(x.T)
norm=np.sqrt(sum_sq)
return(norm)
wiki = pd.read_csv('people_wiki.csv')
wiki.head(2)
wiki.shape
For this assignment, let us assign a unique ID to each document.
We first use GraphLab Create to compute a TF-IDF representation for each document.
def load_sparse_csr(filename):
loader = np.load(filename)
data = loader['data']
indices = loader['indices']
indptr = loader['indptr']
shape = loader['shape']
return csr_matrix( (data, indices, indptr), shape)
corpus = load_sparse_csr('people_wiki_tf_idf.npz')
with open('people_wiki_map_index_to_word.json') as people_wiki_map_index_to_word:
map_index_to_word = json.load(people_wiki_map_index_to_word)
print len(map_index_to_word)
print corpus.shape
For the remainder of the assignment, we will use sparse matrices. Sparse matrices are matrices that have a small number of nonzero entries. A good data structure for sparse matrices would only store the nonzero entries to save space and speed up computation. SciPy provides a highly-optimized library for sparse matrices. Many matrix operations available for NumPy arrays are also available for SciPy sparse matrices.
We first convert the TF-IDF column (in dictionary format) into the SciPy sparse matrix format.
The conversion should take a few minutes to complete.
Checkpoint: The following code block should return 'Check passed correctly', indicating that your matrix contains TF-IDF values for 59071 documents and 547979 unique words. Otherwise, it will return Error.
assert corpus.shape == (59071, 547979)
print 'Check passed correctly!'
LSH performs an efficient neighbor search by randomly partitioning all reference data points into different bins. Today we will build a popular variant of LSH known as random binary projection, which approximates cosine distance. There are other variants we could use for other choices of distance metrics.
The first step is to generate a collection of random vectors from the standard Gaussian distribution.
def generate_random_vectors(num_vector, dim):
return np.random.randn(dim, num_vector)
To visualize these Gaussian random vectors, let's look at an example in low-dimensions. Below, we generate 3 random vectors each of dimension 5.
# Generate 3 random vectors of dimension 5, arranged into a single 5 x 3 matrix.
np.random.seed(0) # set seed=0 for consistent results
print generate_random_vectors(num_vector=3, dim=5)
We now generate random vectors of the same dimensionality as our vocubulary size (547979). Each vector can be used to compute one bit in the bin encoding. We generate 16 vectors, leading to a 16-bit encoding of the bin index for each document.
# Generate 16 random vectors of dimension 547979
np.random.seed(0)
random_vectors = generate_random_vectors(num_vector=16, dim=547979)
print random_vectors.shape
Next, we partition data points into bins. Instead of using explicit loops, we'd like to utilize matrix operations for greater efficiency. Let's walk through the construction step by step.
We'd like to decide which bin document 0 should go. Since 16 random vectors were generated in the previous cell, we have 16 bits to represent the bin index. The first bit is given by the sign of the dot product between the first random vector and the document's TF-IDF vector.
doc = corpus[0, :] # vector of tf-idf values for document 0
print doc.dot(random_vectors[:, 0]) >= 0 # True if positive sign; False if negative sign
Similarly, the second bit is computed as the sign of the dot product between the second random vector and the document vector.
print doc.dot(random_vectors[:, 1]) >= 0 # True if positive sign; False if negative sign
We can compute all of the bin index bits at once as follows. Note the absence of the explicit for
loop over the 16 vectors. Matrix operations let us batch dot-product computation in a highly efficent manner, unlike the for
loop construction. Given the relative inefficiency of loops in Python, the advantage of matrix operations is even greater.
print doc.dot(random_vectors) >= 0 # should return an array of 16 True/False bits
print np.array(doc.dot(random_vectors) >= 0, dtype=int) # display index bits in 0/1's
All documents that obtain exactly this vector will be assigned to the same bin. We'd like to repeat the identical operation on all documents in the Wikipedia dataset and compute the corresponding bin indices. Again, we use matrix operations so that no explicit loop is needed.
print corpus[0:2].dot(random_vectors) >= 0 # compute bit indices of first two documents
print corpus.dot(random_vectors) >= 0 # compute bit indices of ALL documents
We're almost done! To make it convenient to refer to individual bins, we convert each binary bin index into a single integer:
Bin index integer
[0,0,0,0,0,0,0,0,0,0,0,0] => 0
[0,0,0,0,0,0,0,0,0,0,0,1] => 1
[0,0,0,0,0,0,0,0,0,0,1,0] => 2
[0,0,0,0,0,0,0,0,0,0,1,1] => 3
...
[1,1,1,1,1,1,1,1,1,1,0,0] => 65532
[1,1,1,1,1,1,1,1,1,1,0,1] => 65533
[1,1,1,1,1,1,1,1,1,1,1,0] => 65534
[1,1,1,1,1,1,1,1,1,1,1,1] => 65535 (= 2^16-1)
By the rules of binary number representation, we just need to compute the dot product between the document vector and the vector consisting of powers of 2:
doc = corpus[0, :] # first document
index_bits = (doc.dot(random_vectors) >= 0)
powers_of_two = (1 << np.arange(15, -1, -1))
print index_bits
print powers_of_two # [32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1]
print index_bits.dot(powers_of_two)
Since it's the dot product again, we batch it with a matrix operation:
index_bits = corpus.dot(random_vectors) >= 0
print index_bits.dot(powers_of_two)
print len(index_bits.dot(powers_of_two))
This array gives us the integer index of the bins for all documents.
Now we are ready to complete the following function. Given the integer bin indices for the documents, you should compile a list of document IDs that belong to each bin. Since a list is to be maintained for each unique bin index, a dictionary of lists is used.
def train_lsh(data, num_vector=16, seed=None):
dim = data.shape[1]
if seed is not None:
np.random.seed(seed)
random_vectors = generate_random_vectors(num_vector, dim)
powers_of_two = 1 << np.arange(num_vector-1, -1, -1)
table = {}
# Partition data points into bins
bin_index_bits = (data.dot(random_vectors) >= 0)
# Encode bin index bits into integers
bin_indices = bin_index_bits.dot(powers_of_two)
# Update `table` so that `table[i]` is the list of document ids with bin index equal to i.
for data_index, bin_index in enumerate(bin_indices):
if bin_index not in table:
# If no list yet exists for this bin, assign the bin an empty list.
table[bin_index] = [] # YOUR CODE HERE
# Fetch the list of document ids associated with the bin and add the document id to the end.
# YOUR CODE HERE
table[bin_index].append(data_index)
model = {'data': data,
'bin_index_bits': bin_index_bits,
'bin_indices': bin_indices,
'table': table,
'random_vectors': random_vectors,
'num_vector': num_vector}
return model
Checkpoint.
model = train_lsh(corpus, num_vector=16, seed=143)
table = model['table']
if 0 in table and table[0] == [39583] and \
143 in table and table[143] == [19693, 28277, 29776, 30399]:
print 'Passed!'
else:
print 'Check your code.'
Note. We will be using the model trained here in the following sections, unless otherwise indicated.
Let us look at some documents and see which bins they fall into.
print wiki[wiki['name'] == 'Barack Obama']
Quiz Question. What is the document id
of Barack Obama's article?
Quiz Question. Which bin contains Barack Obama's article? Enter its integer index.
"""
index_bits_obama = corpus[35817,:].dot(random_vectors) >= 0
print index_bits_obama.dot(powers_of_two)
print index_bits_obama % 2
"""
print np.array(model['bin_index_bits'][22745], dtype=int) # list of 0/1's
Recall from the previous assignment that Joe Biden was a close neighbor of Barack Obama.
print wiki[wiki['name'] == 'Joe Biden']
"""
index_bits_biden = corpus[24478,:].dot(random_vectors) >= 0
print index_bits_biden.dot(powers_of_two)
print index_bits_biden % 2
"""
print np.array(model['bin_index_bits'][24478], dtype=int) # list of 0/1's
"""
print (index_bits_obama.flatten() % 2 + index_bits_biden.flatten() % 2)
print (index_bits_obama.flatten() % 2 + index_bits_biden.flatten() % 2) % 2
print len(index_bits_obama.flatten()) - sum((index_bits_obama.flatten() % 2 + index_bits_biden.flatten() % 2) % 2)
"""
print (np.array(model['bin_index_bits'][35817] == model['bin_index_bits'][24478], dtype=int))
print np.sum(np.array(model['bin_index_bits'][35817] == model['bin_index_bits'][24478], dtype=int))
Quiz Question. Examine the bit representations of the bins containing Barack Obama and Joe Biden. In how many places do they agree?
Compare the result with a former British diplomat, whose bin representation agrees with Obama's in only 8 out of 16 places.
wiki[wiki['name']=='Wynn Normington Hugh-Jones']
print wiki[wiki['name']=='Wynn Normington Hugh-Jones']
print np.array(model['bin_index_bits'][22745], dtype=int) # list of 0/1's
print np.sum(np.array(model['bin_index_bits'][35817] == model['bin_index_bits'][22745]))
How about the documents in the same bin as Barack Obama? Are they necessarily more similar to Obama than Biden? Let's look at which documents are in the same bin as the Barack Obama article.
model['bin_indices'][35817]
print model['table'][model['bin_indices'][35817]]
There are four other documents that belong to the same bin. Which documents are they?
doc_ids = list(model['table'][model['bin_indices'][35817]])
doc_ids.remove(35817) # display documents other than Obama
wiki.loc[doc_ids] # filter by id column
#It turns out that Joe Biden is much closer to Barack Obama than any of the four documents, even though Biden's bin representation differs from Obama's by 2 bits.
It turns out that Joe Biden is much closer to Barack Obama than any of the four documents, even though Biden's bin representation differs from Obama's by 2 bits.
def cosine_distance(x, y):
xy = x.dot(y.T)
dist = xy/(norm(x)*norm(y))
return 1-dist[0,0]
obama_tf_idf = corpus[35817,:]
biden_tf_idf = corpus[24478,:]
print '================= Cosine distance from Barack Obama'
print 'Barack Obama - {0:24s}: {1:f}'.format('Joe Biden',
cosine_distance(obama_tf_idf, biden_tf_idf))
for doc_id in doc_ids:
doc_tf_idf = corpus[doc_id,:]
print 'Barack Obama - {0:24s}: {1:f}'.format(wiki.iloc[doc_id]['name'],
cosine_distance(obama_tf_idf, doc_tf_idf))
Moral of the story. Similar data points will in general tend to fall into nearby bins, but that's all we can say about LSH. In a high-dimensional space such as text features, we often get unlucky with our selection of only a few random vectors such that dissimilar data points go into the same bin while similar data points fall into different bins. Given a query document, we must consider all documents in the nearby bins and sort them according to their actual distances from the query.
Let us first implement the logic for searching nearby neighbors, which goes like this:
1. Let L be the bit representation of the bin that contains the query documents.
2. Consider all documents in bin L.
3. Consider documents in the bins whose bit representation differs from L by 1 bit.
4. Consider documents in the bins whose bit representation differs from L by 2 bits.
...
To obtain candidate bins that differ from the query bin by some number of bits, we use itertools.combinations
, which produces all possible subsets of a given list. See this documentation for details.
1. Decide on the search radius r. This will determine the number of different bits between the two vectors.
2. For each subset (n_1, n_2, ..., n_r) of the list [0, 1, 2, ..., num_vector-1], do the following:
* Flip the bits (n_1, n_2, ..., n_r) of the query bin to produce a new bit vector.
* Fetch the list of documents belonging to the bin indexed by the new bit vector.
* Add those documents to the candidate set.
Each line of output from the following cell is a 3-tuple indicating where the candidate bin would differ from the query bin. For instance,
(0, 1, 3)
indicates that the candiate bin differs from the query bin in first, second, and fourth bits.
from itertools import combinations
num_vector = 16
search_radius = 3
for diff in combinations(range(num_vector), search_radius):
print diff
With this output in mind, implement the logic for nearby bin search:
def search_nearby_bins(query_bin_bits, table, search_radius=2, initial_candidates=set()):
"""
For a given query vector and trained LSH model, return all candidate neighbors for
the query among all bins within the given search radius.
Example usage
-------------
>>> model = train_lsh(corpus, num_vector=16, seed=143)
>>> q = model['bin_index_bits'][0] # vector for the first document
>>> candidates = search_nearby_bins(q, model['table'])
"""
num_vector = len(query_bin_bits)
powers_of_two = 1 << np.arange(num_vector-1, -1, -1)
# Allow the user to provide an initial set of candidates.
candidate_set = copy(initial_candidates)
for different_bits in combinations(range(num_vector), search_radius):
# Flip the bits (n_1,n_2,...,n_r) of the query bin to produce a new bit vector.
## Hint: you can iterate over a tuple like a list
alternate_bits = copy(query_bin_bits)
for i in different_bits:
alternate_bits[i] = (alternate_bits[i] + 1) % 2 # YOUR CODE HERE
# Convert the new bit vector to an integer index
nearby_bin = alternate_bits.dot(powers_of_two)
# Fetch the list of documents belonging to the bin indexed by the new bit vector.
# Then add those documents to candidate_set
# Make sure that the bin exists in the table!
# Hint: update() method for sets lets you add an entire list to the set
if nearby_bin in table:
candidate_set |= set(table[nearby_bin])
# YOUR CODE HERE: Update candidate_set with the documents in this bin.
return candidate_set
Checkpoint. Running the function with search_radius=0
should yield the list of documents belonging to the same bin as the query.
obama_bin_index = model['bin_index_bits'][35817] # bin index of Barack Obama
candidate_set = search_nearby_bins(obama_bin_index, model['table'], search_radius=0)
if candidate_set == set([35817, 21426, 53937, 39426, 50261]):
print 'Passed test'
else:
print 'Check your code'
print 'List of documents in the same bin as Obama: 35817, 21426, 53937, 39426, 50261'
Checkpoint. Running the function with search_radius=1
adds more documents to the fore.
candidate_set = search_nearby_bins(obama_bin_index, model['table'], search_radius=1, initial_candidates=candidate_set)
if candidate_set == set([39426, 38155, 38412, 28444, 9757, 41631, 39207, 59050, 47773, 53937, 21426, 34547,
23229, 55615, 39877, 27404, 33996, 21715, 50261, 21975, 33243, 58723, 35817, 45676,
19699, 2804, 20347]):
print 'Passed test'
else:
print 'Check your code'
Note. Don't be surprised if few of the candidates look similar to Obama. This is why we add as many candidates as our computational budget allows and sort them by their distance to the query.
Now we have a function that can return all the candidates from neighboring bins. Next we write a function to collect all candidates and compute their true distance to the query.
def query(vec, model, k, max_search_radius):
data = model['data']
table = model['table']
random_vectors = model['random_vectors']
num_vector = random_vectors.shape[1]
# Compute bin index for the query vector, in bit representation.
bin_index_bits = (vec.dot(random_vectors) >= 0).flatten()
# Search nearby bins and collect candidates
candidate_set = set()
for search_radius in xrange(max_search_radius+1):
candidate_set = search_nearby_bins(bin_index_bits, table, search_radius, initial_candidates=candidate_set)
# Sort candidates by their true distances from the query
nearest_neighbors = pd.DataFrame(index=candidate_set)
candidates = data[np.array(list(candidate_set)),:]
nearest_neighbors['distance'] = pairwise_distances(candidates, vec, metric='cosine').flatten()
return nearest_neighbors.sort(['distance'], ascending=True)[:k], len(candidate_set)
Let's try it out with Obama:
print query(corpus[35817,:], model, k=10, max_search_radius=3)[0]
print query(corpus[35817,:], model, k=10, max_search_radius=3)
To identify the documents, it's helpful to join this table with the Wikipedia table:
wiki.head(2)
result, num_candidates_considered = query(corpus[35817,:], model, k=10, max_search_radius=3)
print result.join(wiki).sort('distance')[['distance', 'name']]
We have shown that we have a working LSH implementation!
In the following sections we have implemented a few experiments so that you can gain intuition for how your LSH implementation behaves in different situations. This will help you understand the effect of searching nearby bins and the performance of LSH versus computing nearest neighbors using a brute force search.
How does nearby bin search affect the outcome of LSH? There are three variables that are affected by the search radius:
Let us run LSH multiple times, each with different radii for nearby bin search. We will measure the three variables as discussed above.
wiki[wiki['name']=='Barack Obama']
import time
num_candidates_history = []
query_time_history = []
max_distance_from_query_history = []
min_distance_from_query_history = []
average_distance_from_query_history = []
for max_search_radius in xrange(17):
start=time.time()
# Perform LSH query using Barack Obama, with max_search_radius
result, num_candidates = query(corpus[35817,:], model, k=10,
max_search_radius=max_search_radius)
end=time.time()
query_time = end-start # Measure time
print 'Radius:', max_search_radius
# Display 10 nearest neighbors, along with document ID and name
print result.join(wiki).sort('distance')[['distance', 'name']]
# Collect statistics on 10 nearest neighbors
average_distance_from_query = result['distance'][1:].mean()
max_distance_from_query = result['distance'][1:].max()
min_distance_from_query = result['distance'][1:].min()
num_candidates_history.append(num_candidates)
query_time_history.append(query_time)
average_distance_from_query_history.append(average_distance_from_query)
max_distance_from_query_history.append(max_distance_from_query)
min_distance_from_query_history.append(min_distance_from_query)
Notice that the top 10 query results become more relevant as the search radius grows. Let's plot the three variables:
plt.figure(figsize=(7,4.5))
plt.plot(num_candidates_history, linewidth=4)
plt.xlabel('Search radius')
plt.ylabel('# of documents searched')
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(query_time_history, linewidth=4)
plt.xlabel('Search radius')
plt.ylabel('Query time (seconds)')
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(average_distance_from_query_history, linewidth=4, label='Average of 10 neighbors')
plt.plot(max_distance_from_query_history, linewidth=4, label='Farthest of 10 neighbors')
plt.plot(min_distance_from_query_history, linewidth=4, label='Closest of 10 neighbors')
plt.xlabel('Search radius')
plt.ylabel('Cosine distance of neighbors')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
Some observations:
Quiz Question. What was the smallest search radius that yielded the correct nearest neighbor, namely Joe Biden?
Quiz Question. Suppose our goal was to produce 10 approximate nearest neighbors whose average distance from the query document is within 0.01 of the average for the true 10 nearest neighbors. For Barack Obama, the true 10 nearest neighbors are on average about 0.77. What was the smallest search radius for Barack Obama that produced an average distance of 0.78 or better?
2
for i, v in enumerate(average_distance_from_query_history):
if average_distance_from_query_history[i] <= 0.78:
print i, v
break
The above analysis is limited by the fact that it was run with a single query, namely Barack Obama. We should repeat the analysis for the entirety of data. Iterating over all documents would take a long time, so let us randomly choose 10 documents for our analysis.
For each document, we first compute the true 25 nearest neighbors, and then run LSH multiple times. We look at two metrics:
Then we run LSH multiple times with different search radii.
def brute_force_query(vec, data, k):
num_data_points = data.shape[0]
# Compute distances for ALL data points in training set
nearest_neighbors = pd.DataFrame(index=range(num_data_points))
nearest_neighbors['distance'] = pairwise_distances(data, vec, metric='cosine').flatten()
return nearest_neighbors.sort(['distance'], ascending=True)[:k]
The following cell will run LSH with multiple search radii and compute the quality metrics for each run. Allow a few minutes to complete.
max_radius = 17
precision = {i:[] for i in xrange(max_radius)}
average_distance = {i:[] for i in xrange(max_radius)}
query_time = {i:[] for i in xrange(max_radius)}
np.random.seed(0)
num_queries = 10
for i, ix in enumerate(np.random.choice(corpus.shape[0], num_queries, replace=False)):
print('%s / %s' % (i, num_queries))
ground_truth = set(brute_force_query(corpus[ix,:], corpus, k=25).index.values)
# Get the set of 25 true nearest neighbors
for r in xrange(1,max_radius):
start = time.time()
result, num_candidates = query(corpus[ix,:], model, k=10, max_search_radius=r)
end = time.time()
query_time[r].append(end-start)
# precision = (# of neighbors both in result and ground_truth)/10.0
precision[r].append(len(set(result.index.values) & ground_truth)/10.0)
average_distance[r].append(result['distance'][1:].mean())
plt.figure(figsize=(7,4.5))
plt.plot(range(1,17), [np.mean(average_distance[i]) for i in xrange(1,17)], linewidth=4, label='Average over 10 neighbors')
plt.xlabel('Search radius')
plt.ylabel('Cosine distance')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(range(1,17), [np.mean(precision[i]) for i in xrange(1,17)], linewidth=4, label='Precison@10')
plt.xlabel('Search radius')
plt.ylabel('Precision')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(range(1,17), [np.mean(query_time[i]) for i in xrange(1,17)], linewidth=4, label='Query time')
plt.xlabel('Search radius')
plt.ylabel('Query time (seconds)')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
The observations for Barack Obama generalize to the entire dataset.
Let us now turn our focus to the remaining parameter: the number of random vectors. We run LSH with different number of random vectors, ranging from 5 to 20. We fix the search radius to 3.
Allow a few minutes for the following cell to complete.
precision = {i:[] for i in xrange(5,20)}
average_distance = {i:[] for i in xrange(5,20)}
query_time = {i:[] for i in xrange(5,20)}
num_candidates_history = {i:[] for i in xrange(5,20)}
ground_truth = {}
np.random.seed(0)
num_queries = 10
docs = np.random.choice(corpus.shape[0], num_queries, replace=False)
for i, ix in enumerate(docs):
ground_truth[ix] = set(brute_force_query(corpus[ix,:], corpus, k=25).index.values)
# Get the set of 25 true nearest neighbors
for num_vector in xrange(5,20):
print('num_vector = %s' % (num_vector))
model = train_lsh(corpus, num_vector, seed=143)
for i, ix in enumerate(docs):
start = time.time()
result, num_candidates = query(corpus[ix,:], model, k=10, max_search_radius=3)
end = time.time()
query_time[num_vector].append(end-start)
precision[num_vector].append(len(set(result.index.values) & ground_truth[ix])/10.0)
average_distance[num_vector].append(result['distance'][1:].mean())
num_candidates_history[num_vector].append(num_candidates)
plt.figure(figsize=(7,4.5))
plt.plot(range(5,20), [np.mean(average_distance[i]) for i in xrange(5,20)], linewidth=4, label='Average over 10 neighbors')
plt.xlabel('# of random vectors')
plt.ylabel('Cosine distance')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(range(5,20), [np.mean(precision[i]) for i in xrange(5,20)], linewidth=4, label='Precison@10')
plt.xlabel('# of random vectors')
plt.ylabel('Precision')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(range(5,20), [np.mean(query_time[i]) for i in xrange(5,20)], linewidth=4, label='Query time (seconds)')
plt.xlabel('# of random vectors')
plt.ylabel('Query time (seconds)')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
plt.figure(figsize=(7,4.5))
plt.plot(range(5,20), [np.mean(num_candidates_history[i]) for i in xrange(5,20)], linewidth=4,
label='# of documents searched')
plt.xlabel('# of random vectors')
plt.ylabel('# of documents searched')
plt.legend(loc='best', prop={'size':15})
plt.rcParams.update({'font.size':16})
plt.tight_layout()
We see a similar trade-off between quality and performance: as the number of random vectors increases, the query time goes down as each bin contains fewer documents on average, but on average the neighbors are likewise placed farther from the query. On the other hand, when using a small enough number of random vectors, LSH becomes very similar brute-force search: Many documents appear in a single bin, so searching the query bin alone covers a lot of the corpus; then, including neighboring bins might result in searching all documents, just as in the brute-force approach.


1. Launch VirtualBox
2. Click New
3. This opens New Virtual Machine Wizard. Click Next
4. Give your new virtual machine a name, choose the right OS and version. These are automatically selected if VirtualBox can determine it from the name you gave. Click Next
5. Set the amount of RAM you want to assign to Ubuntu. For running a Linux vm (virtual machine), 512 MB is enough. You can assign as much as you want to, maximum being about 512 MB less of your host computer's RAM. Keep in mind though that RAM used by a running vm is away from the RAM Windows can use; assigning more RAM can make your vm run faster and better but at the same time make your Windows crawl so slowly even the vm halts. My recommendation is always leave at least 2 GB for Windows, or if you have under 4 GB of RAM only give maximum of 1 GB to a vm. Click Next
6. VirtualBox asks now if you want to create a new vhd (virtual hard disk), or use existing vhd. Choose Create new and click Next
7. New Virtual Disk Wizard starts. Click Next
8. Click Next to accept Dynamically expanding storage
Dynamically expanding vhd means that although the guest consideres the HD being the size given (max value), host Windows only uses as much space on HD as is actually needed; a 20 GB dynamic vhd where only 4 GB is used is seen by Windows host as a 4 GB vhd file, not as a 20 GB file, but the guest OS sees the same vhd file as a 20 GB hard disk with 16 GB free. I recommend 8 to 12 GB for Ubuntu.
9. You can now accept the default location where VirtualBox offers to save the vhd, or change the location by clicking the small folder symbol. Default save folders are Your_Username\.VirtualBox (VirtualBox 3.2 and older) or Your_Username\VirtualBox VMs(from version 4 Beta). You can also change the original size of vhd here. Click Next
10. Click Finish to end New Virtual Disk Wizard
11. Click Finish to end New Virtual Machine Wizard
12. Now choose the virtual machine you just created and click Settings
13. Choose Storage from the left pane, CD/DVD from under the title IDE controller, and click the small CD symbol on the right
14. Now you need to tell VirtualBox which install media you want to use. You can assign any of the host system's CD/DVD drives to vm , or an ISO image to act as a CD/DVD drive. For now, you want to use the Ubuntu ISO you downloaded earlier. Browse to its location, choose it and click Open
15. Now choose Display from the left pane, assign the maximum 128 MB video RAM to virtual machine's emulated video card:
16. Next you need to setup network controller. Click Network on the left pane, choose Enable Network Adapter, choose Bridged Adapter, and choose your host computer's network adapter from drop down list:
Host-only only permits network operations with the Host OS.
NAT mode will mask all network activity as if it came from your Host OS, although the VM can access external resources.
Bridged mode replicates another node on the physical network and your VM will receive it's own IP address if DHCP is enabled in the network.
17. Click OK to save edited settings
© 2014 HaKTuts. All rights reserved.


Tone.Transport
Tone.Transport is the application-wide timekeeper. It uses an OscillatorNode
as it's clock source which enables sample-accurate scheduling as well as
tempo-curves and automation. This example uses Tone.Transport.setInterval
to invoke a callback every 16th note.


Chintamani Bakery is a ecommerce website for Chintamani bakery situated in Bathinda, Punjab.
This helped their customers browse and order items online.
This also helped Chintamani Bakery grow their business online and
gave them a better web presence.
SecureMT
For Secure Money Transfer.
Developed a website for securemoney transfer between registered user. One user can transfer to another user by using their mobile number registered with the website. It guarantees secure transfer with secure payment gateway. User can have all the details related to their account, balance amount and the transactions done by them along with its status.
.
RapidAVD
For downloading Audio/Video Files.
Developed a platform to download audio/video from any
supported multimedia URL. Audio from a Video URL can also be
extracted. Exposed REST API’s to getAudio and to getVideo. Valid
authorization token is required to access features through the APIs..


Purchase Your Fun Here!
A small pharagraph about ticket info can go here, but I need help with the copy. A small pharagraph about ticket info can go here, but I need help with the copy. A small pharagraph about ticket info can go here, but I need help with the copy. A small pharagraph about ticket info can go here, but I need help with the copy..
Ticket form can go here on down, within a container of it's own???


Toggle navigation
★ Akos
Level: 2
Ranking: 47
Exp: 500/1200
CREATE MEMORY
Take Picture
Description
Save
Back
×
You Created a new Memory
Do you want to share it on Facebook?