Posts

data structures - Spatial Index/R Tree Support in Perl -

anyone got hints working rtree in perl? either pure rtree implementation performant or hijack gis project? or easier use sqlite's spatial index support? cheers did try tree::r ? there doesn't seem activity on module, may not enough, again, might you're looking for. play few.

f# - using Array.Parallel.map for decreasing running time -

hello everyone i have converted project in c# f# paints mandelbrot set. unfortunately take around 1 minute render full screen try find ways speed up. it 1 call take of time: array.map (fun x -> this.colorarray.[calcz x]) xyarray xyarray (double * double) [] => (array of tuple of double) colorarray array of int32 length = 255 calcz defined as: let calcz (coord:double * double) = let maxiterations = 255 let rec calczhelper (xcoord:double) (ycoord:double) // line break inserted (x:double) (y:double) iters = let newx = x * x + xcoord - y * y let newy = 2.0 * x * y + ycoord match newx, newy, iters | _ when math.abs newx > 2.0 -> iters | _ when math.abs newy > 2.0 -> iters | _ when iters = maxiterations -> iters | _ -> calczhelper xcoord ycoord newx newy (iters + 1) calczhelper (fst coord) (snd coord) (fst coord) (snd coord) 0 as use around half of processor capa...

c++ - Help me understand this usage of boost::bind -

please have @ example posted johannes schaub sort vector of pairs: how sort vector of pairs based on second element of pair? std::sort(a.begin(), a.end(), boost::bind(&std::pair<int, int>::second, _1) < boost::bind(&std::pair<int, int>::second, _2)); i thought understand boost::bind, have trouble one. question 1: the sort algorithm expecting predicate function third parameter. see here, boolean expression. missing?: boost::bind(&std::pair<int, int>::second, _1) < boost::bind(&std::pair<int, int>::second, _2) does boost::bind library overload operator< 2 binds, , returning kind of function pointer (like lambda)? question 2: gets me confused: boost::bind(&std::pair<int, int>::second, _1) usually there kind of function pointer first parameter of bind call, here address of class member? result of particular bind? thanks time & help boost::bind overloads operator ! , relat...

visual c++ - Is this a BUG of VC++ 2010? About declaring a constant object in a header -

several lines of code worth thousand words: i have 3 simple files: header.h, main.cpp, other.cpp ==== code begin ==== // header.h #pragma once const void* p = 0; // main.cpp #include "header.h" int main() { return 0; } // other.cpp #include "header.h" ==== code end ==== when compiling simplest project, vc++ 2010 complains follows: clcompile: other.cpp main.cpp generating code... other.obj : error lnk2005: "void const * const p" (?p@@3pbxb) defined in main.obj d:\test\debug\bug.exe : fatal error lnk1169: 1 or more multiply defined symbols found build failed. time elapsed 00:00:00.29 ========== build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== i sure bug of vc++ 2010, because of following 2 references: the c++ standard says: (at page 140 of n3126) "objects declared const , not explicitly declared extern have internal linkage." the msdn says : "in c, constant values de...

html - What is wrong with this frameset code? -

i using webmin on server. reason it's decided stop displaying on root page, it's blank. it's still returning code, shown below. individual pages in frames work frameset doesn't want display, in browser, reason. i have stripped right down this, running on local server still doesn't show anything: <!doctype html public "-//w3c//dtd html 3.2 final//en"> <html> <head> <title>title</title> </head> <body> <frameset cols="230,*"> <frame name="left" src="test1.html" scrolling="auto"> <frame name="right" src="test2.html" noresize> </frameset> </body> </html> i've tried removing , changing various attributes no luck. the <frameset> element replaces <body> element. can't use both in same document. you should write: <!doctype html public "-//w3c//dtd html 3.2 final//en...

jQuery ajax - blank response returned -

i trying use jquery ajax values database , return them in array. i have used same code several times before time, no response being returned. although post values correct values expect. here javascript code using: $.ajax({ url: '/blogarchive.asmx/changepost' , type: 'post' , contenttype: 'application/json; charset=utf-8' , data: '{filename:"' + filename + '"}' , datatype: 'json' , success: function (data) { var arraylist = data.d; var blogposttitle = $(".blogposttitle")[0]; var blogpostdate = $(".blogpostdate")[0]; var blogpostcontent = $(".blogpostcontent")[0]; $(blogposttitle).html(arraylist[0]); $(blogpostdate).html(arraylist[...

php - SMTP error with PHPMailer -

i getting "smtp error: not connect smtp host." error while trying send mails using gmail smtp , phpmailer.. the code working in local environment getting error in live (bluehost) server.. please help bluehost wont allow gmail smtp connections . quoting article: according bluehost, cannot send emails through smtp connections web applications hosted on bluehost. allow sending through own smtp servers. the work around setup email account in bluehost same email use in google apps. modified code in magento send out using bluehost’s smtp servers: for example: outgoing mail server: (ssl) boxnumber.bluehost.com (server requires authentication) supported incoming mail protocols: * pop3: port 110 * pop3s (ssl/tls): port 995 * imap: port 143 * imaps (ssl/tls): port 993 supported outgoing mail protocols: * smtp: port 26 * smtps (ssl/tls): port 465 and works, sends email out customers right email address sent bluehost’s local smtp servers, when customer...