#haskell - Mon 19 Feb 2007 between 18:04 and 18:14

NY Lost Funds



matthew-_after ghc has compiled stuff, I often find that if I load the said compiled files into ghci then data constructors are missing
so I want ghci to ignore the compiled stuff and interpret the .hs directly
sorearfind . -name '*.o' -delete
matthew-_no, as compilation takes about 2 mins and I don't want to do endless make clean
sorear:set -fforce-recomp might also work
in GHC it says to ignore .o files, I've never tried in in ghci
matthew-_cool, that works
thanks
sorearnrb23: next won't leak memory from allocaBytes, but if pcap_next returns a pointer to malloced memory it might still leak
nrb23sorear: a good point.. I'm not sure
sorear: hmm, allright
sorear: my program seems to do different things depending on where I print the packet I'm getting back
CaleSyzygy-: that's a value-level implementation of Peano arithmetic
sorearnrb23: gak! maybe it's a static buffer and you'll need to read it inside next?
@ty Data.ByteString.copyCString -- nrb23
nrb23here's a C demo: http://www.tcpdump.org/pcap.htm
lambdabotForeign.C.String.CString -> IO Data.ByteString.Base.ByteString
Title: Programming with pcap
sorear@ty Data.ByteString.copyCString . Foreign.Ptr.castPtr -- nrb23
lambdabotforall a. GHC.Ptr.Ptr a -> IO Data.ByteString.Base.ByteString
sorear^^ that will turn a Ptr Word8 (nul-terminated) into a ByteString, copyingly
nrb23sorear: not null terminated ;-<
sorear@ty Data.ByteString.copyCStringLen
lambdabotForeign.C.String.CStringLen -> IO Data.ByteString.Base.ByteString
nrb23ok
sorearCStringLen === (Ptr CChar, CSizeT
type synonym
nrb23in the C examples, they never free the packet from that function.. which is weird
Syzygy-Cale: I'm still not convinced I even want that Peano arithmetic there: I'm very much uncertain as to what I want to do with the matrix question at all...
actionsorear checks the source
sorearchecks the source
gak! apt has 2 versions of libpcap
CaleSyzygy-: arrays will already keep track of their sizes at runtime.
sorearwhich are you using?
or are 0.7 and 0.8 compatible?
Caleand you can ensure that they're rectangular more easily.
Syzygy-Cale: That's a point...
nrb23sorear: I would assume they're compatible
sorearnrb23: wow, debian's libpcap0.8 is version 0.9.5 !
nrb23sorear: go debian :->
CaleI wonder if GAP has any sort of FFI.

Page: 1 8 15 22 29 36 43 50 57 64 71 78 85 

IrcArchive

NY Lost Funds