Posts

Perl Module using %EXPORT_TAGS -

i'm having trouble using %export_tags in perl module. in solver.pl have: use matrixfunctions qw(:normal); then inside matrixfunctions.pm , have: package matrixfunctions; use strict; use exporter; use vars qw($version @isa @export @export_ok %export_tags); $version = 1.00; @isa = qw(exporter); @export = (); @export_ok = qw(&det &identitymatrix &matrixadd &matrixscalarmultiply &matrixmultiplication); %export_tags = ( det => [qw(&det)], normal => [qw(&det &identitymatrix &matrixadd &matrixscalarmultiply &matrixmultiplication)]); however works when have @export_ok including methods. if have @export_ok = (); i have error: "matrixscalarmultiply" not exported matrixfunctions module "det" not exported matrixfunctions module "matrixadd" not exported matrixfunctions module "matrixmultiplication" not exported matrixfunctions module "i...

mapreduce - pcap to Avro on Hadoop -

i need know if there way can convert pcap file avro , can write map reduce program on avro data using hadoop ? otherwise best practice when dealing pcap files on hadoop ? thanks a pcap file collection of records, each containing time stamp, packet length field, "amount of data packet captured , saved" length field, , unstructured blob of raw packet data. the avro documentation says: avro provides: rich data structures. .... "unstructured blob of raw packet data" , "rich data structures" don't go together; you'll have parse raw packet data, same way implementations of protocols in packet , same way tcpdump/wireshark/various other protocol analyzers do, turn structured data, can have data on can do processing. so, first, need figure out you're trying here. sort of analysis want do? packet data want process? packet time stamps? source , destination ip addresses? protocols within packet? in pa...

javascript - What is `_dereq_()` inside React? -

i'm searching through react-0.13.3.js , 1 thing can't work out. @ start of source there's bunch of dereq() calls. 'use strict'; var eventpluginutils = _dereq_(19); var reactchildren = _dereq_(32); var reactcomponent = _dereq_(34); var reactclass = _dereq_(33); but see implementation function. , how work? , importantly, declared? update i'm still waiting more comprehensive answer accept. main question what _dereq_ function , how work. this derequire combined browserify (or other bundler?) module ids. it's way rename require in output bundle avoid collisions. read here more information: https://github.com/calvinmetcalf/derequire/issues/25 the basic idea different module loaders handle require differently. "derequire" strategy binding requires context via different keyword.

sql - FD theory and normal forms -

if have new r1 = {a,b,c,d} , r3 = {c,d,e,h} which know not in either bcnf or 3nf because candidate key not in fd. now, how can decompose both of them bcnf if functional dependencies are. f = {a->b,a->c,e->f,e->g,ae->h} to convert relation r , set of functional dependencies( fd's ) 3nf can use bernstein's synthesis . apply bernstein's synthesis - first make sure given set of fd's minimal cover second take each fd , make own sub-schema. third try combine sub-schemas for example in case: r = {a,b,c,d,e,f,g,h,i} ( according comment above ) fd's = {a->b,a->c,e->f,e->g,ae->h} first check whether fd's minimal cover ( singleton right-hand side , no extraneous left-hand side attribute, no redundant fd ). in case given fd's minimal cover . second make each fd own sub-schema. have - ( the keys each relation in bold ) r 1 ={ a ,b} r 2 ={ a ,c} r 3 ={ e ,f} r 4 ={ e ,g} r 5 ={ a,e ,h}...

url - PHP: Get Domain (without subdomain) of any Address available as String -

recently question has been asked, how domain of url available string. unfortunately question has been closed, , far linked answers pointed solutions using regex (which fails special cases .co.uk ) , static solutions, considering exceptions (which ofc. might change on time). so, searching generic solution question, work @ time , found one. (at least couple of tests positive) if find domain attempted solution not work, feel free mention it, , i'll try imrpove snipped cover case well. to find domain of string given, three-step solution seems work best: first, actual hostname, using parse_url ( http://php.net/manual/en/function.parse-url.php ) second, query dns-server "top-most" a-record available. (i used checkdnsrr purpose: http://php.net/manual/en/function.checkdnsrr.php ) last not least: perform validations make sure not running "default response". i performed tests , seems result expected. method directly generates output, can modif...

Create type with two possible variants in Typescript -

is there way in typescript declare variable can int16array or uint16array , nothing more? typescript 1.4 has support type unions , notation is: var arr: int16array|uint16array; common methods both of these have available on arr . if use instanceof or typeof checks on arr in conditional/branched code, infer type of arr in branches. typescript 1.4. has support type aliases: type my16array = int16array | uint16array; you can use: var arr: my16array;

mapbox - Leaflet: Keep PopUp Open -

i'm trying create popup stays open until click x in top right corner close down. best way this? code below, thanks! //pop code //create custom icon var newicon = l.icon({ iconurl: 'logo.png', }) // creating marker var marker = l.marker(new l.latlng(41.77, -87.6), { icon: l.mapbox.marker.icon({ 'marker-color': 'ff8888' }), icon: newicon, draggable: true, }).addto(map); // bind popup marker marker.bindpopup("i text stay open until closed").openpopup(); use: var newpopup = l.popup({ closeonclick: false }).setcontent("i text stay open until closed"); marker.bindpopup(newpopup);