Is there an existing library for an SMTP mail server? I would create an SMTP server using the library to process mail messages in a custom format. But I can't use an existing mail server program like postfix because every incoming mail needs to be processed by a seperate thread and based on the format of the received mail I need to do certain things. I searched all over but couldn't find a lightweight SMTP server library although I found a few SMTP server programs similar to postfix which is not what I need.submitted by desijays
[link] [9 comments]
Suppose that you were given a list of input/ouput pairs:f 0 = 0 f 1 = 2 f 2 = 1 f 3 = -1 f 4 = 0 f 5 = 0 f 6 = -76 f 7 = -3 f 8 = 3 f 9 = -1 f 10 = -1 f 11 = -6 f 12 = -1 f 13 = -1 f 14 = 4 f 15 = -2 f 16 = -10 f 17 = 0 f 18 = 0 f 19 = -1 f 20 = 2 f 21 = 3 f 22 = 0 f 23 = 4 f 24 = 2 f 25 = -1 f 26 = 0 f 27 = 0 f 28 = -4 f 29 = -2 f 30 = -14
Now suppose you were asked to find the definition of f. How would you do it? Spoil.submitted by SrPeixinho
[link] [18 comments]
Lately I've been familiarizing myself with low-level performance hackery. I also perused the Data.HashMap sources, and in particular it started to bug me that doing snoc/append/insert on primitive arrays is not very efficient in the current state of affairs.
The core of the problem is that we can't have uninitialized arrays lying around, because the GC would try to follow the junk data, believing them to be valid pointers. So we can allocate unboxed ByteArrays uninitialized, but not boxed Arrays, and thus we have to initialize fresh arrays only to overwrite them a moment later.
I did a little benchmark on snoccing. It emulates a primitive snoc in a horribly unsafe way: it uses thawArray to copy one more element than there actually is in the source array, and then writes the new element to the back. Of course, this is a bounds error and possibly a GC mess-up, but it works at least for demonstration purposes.
Here it is. The speedup seems to be significant (1,5x - 2,5x). Primitive insertion could be similarly faster (which, unlike snoc, I couldn't test with a hack). HashMap does lots and lots of array insertions so it might benefit considerably from this.
Is this a kind of thing that would be sensible to implement? I'm posting here instead of to GHC trac because at the moment I am entirely unfamiliar with the GHC codebase or development process.submitted by Puttamalac
[link] [14 comments]
More hakyll blog fixes:
Ugly things showing on planets
My posts were showing unwanted things on planet haskell - double heading, redundant date, tag links, and ugly disqus html. By comparing with Jasper Van der Jeugt’s blog, I found the problem: I was snapshotting content for the feed at the wrong time, after applying the post template:>>= return . fmap demoteHeaders >>= loadAndApplyTemplate "templates/post.html" (postCtx tags) >>= saveSnapshot "content" >>= loadAndApplyTemplate "templates/default.html" defaultContext
Better:>>= saveSnapshot "content" -- >>= return . fmap demoteHeaders >>= loadAndApplyTemplate "templates/post.html" (postCtx tags) >>= loadAndApplyTemplate "templates/default.html" defaultContext
Manual feed publishing
The main blog feed is now generated with a _ prefix, and I must manually rename it (with make feed) to make it live it on Planet Haskell. This will hopefully reduce snafus (and not create new ones)../site.hs 95 - create ["blog.xml"] $ do + create ["_blog.xml"] $ do ./Makefile 14 +feed: _site/blog.xml + +_site/blog.xml: _site/_blog.xml + cp _site/_blog.xml _site/blog.xml +
Better HTML titles
Changed the “Joyful Systems” prefix to a suffix in the HTML page titles, making search results and browser tab names more useful.
Today, a coalition of thousands of Internet users, companies and organizations launched a campaign for a day of action to “Reset The Net” on June 5th, 2014, the anniversary of the first NSA surveillance story revealed by whistleblower Edward Snowden. Tens of thousands of internet activists, companies and organizations committed to preserving free speech and basic rights on the Internet by taking steps to shutting off the government’s mass surveillance capabilities.
Watch the campaign video and see a full list of participants here: http://ResetTheNet.org More than 20 organizations and companies support the launch of the campaign including Fight For The Future (who initiated the campaign) along with reddit, CREDO Mobile, Imgur, Greenpeace, Libertarian Party, FireDogLake, Thunderclap, DuckDuckGo, Disconnect.Me, Demand Progress, Access, Free Press, Restore the Fourth, AIDS Policy Project, PolitiHacks, OpenMedia, Free Software Foundation, Bill of Rights Defense Committee, Code Pink, Popular Resistance, Participatory Politics Foundation, BoingBoing, Public Knowledge, Amicus, New America Foundation’s Open Technology Institute, Progressive Change Campaign Committee, Student Net Alliance, and the Center for Democracy and Technology. ... Internet users are invited to join in on the day of Reset The Net to install privacy and encryption tools and secure their personal digital footprint against intrusive surveillance.Technical information here and press release here.