Whenever I try to create an application based on the Haskell cartridge, it results in the a variant of the following error:The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 55c67c940c1e6694ac000017 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c5,c753' /bin/sh -c \"gear postreceive --init >> /tmp/initial-build.log 2>&1\""' returned an error. rc=137 .Last 10 kB of build output: The server is not running, nothing to stop. Repairing links for 1 deployments Building git ref 'master', commit 6b8beb4 Downloading the latest package list from hackage.haskell.org
This happens for predefined cartridges in the Openshift hub, such as Snap, Yesod, Scotty, and for the cartridges defined in the wiki (https://wiki.haskell.org/Web/Cloud).
I'm requesting help because he application never gets created thus I can't check the logs, and I can't make much from the error message. I tried other cartridge types than Haskell, and they get created just fine.submitted by Skyeam
[link] [7 comments]
So here's a little brain-teaser for you guys. I managed to write the following Applicative instance and to my astonishment it actually compiles. :) I'm still struggling to get a less roundabout intuition into it, though. So if anyone dares to write a clearer version of it, please do.-- | -- A thing that executes an effectful handler. newtype Executor m a = Executor (forall z. (a -> m z) -> m z) instance Functor (Executor m) where fmap aToB (Executor a'') = Executor $ \b' -> a'' (b' . aToB) instance Applicative (Executor m) where pure a = Executor $ \a' -> a' a (<*>) (Executor aToB'') (Executor a'') = Executor $ \b' -> ($ id) $ flip (premap . premap) aToB'' $ \aToB -> ($ id) $ flip (premap . premap) a'' $ \a -> b' $ aToB a where premap = flip (.) submitted by nikita-volkov
[link] [20 comments]
Earlier articles: Introduction
(At left is page 1 of the Cosmic Call message. For an enlarged version of the image, click it.)
First, some notes about the general format of each page. The Cosmic Call message was structured as 23 pages, each a 127×127 bitmap. The entire message was therefore 127×127×23 bits, and this would hopefully be suggestive to the aliens: they could try decoding it as 127 pages of 127×23-bit images, which would produce garbage, or as 23 pages of 127×127-bit images, which is correct. Or they might try decoding it as a single 127×2921-bit image, which would also work. But the choices are quite limited and it shouldn't take long to figure out which one makes sense.
To assist in the framing, each page of the message is surrounded by a border of black pixels and then a second smaller border of white pixels. If the recipient misinterpreted the framing of the bit sequence, say by supposing that the message was made of lines of 23 pixels, it would be immediately apparent that something was wrong, as at right. At the very least the regular appearance of the black border pixels every 127 positions, and the fact that the message began with 128 black pixels, would suggest that there was something significant about that number. If the aliens fourier-transform the message, there should be a nice big spike at the 127 mark.
Most of the message is encoded as a series of 5×7-pixel glyphs. The glyphs were generated at random and then subject to later filtering: candidate glyphs were discarded if they don't differ from previous glyphs in enough bit positions. This is to help the recipients reconstruct the glyphs if some of the bits are corrupted in transmission, as is likely.
The experimenters then eyeballed the glyphs and tried to match glyphs with their meanings in a way that would be easy for humans to remember, to aid in proofreading. For example, the glyph they chose to represent the digit 7 was .
People frequently ask why the message uses strange glyphs instead of standard hindu-arabic numerals. This is explained by the need to have the glyphs be as different as possible. Communication with other stars is very lossy. Imagine trying to see a tiny flickering light against the background of a star at a disatnce of several light years. In between you and the flickering light arevariable dist and gas clouds. Many of the pixels are likely to be corrupted in transmission. The message needs to survive this corruption. So glyphs are 35 bits each. Each one differs from the other glyphs in many positions, whereas a change of only a few pixels could change a standard 6 into an 8 or vice versa. A glyph is spread across multiple lines of the image, which makes it more resistant to burst errors: even if an entire line of pixels is destroyed in transit, no entire glyph will be lost.
At the top left and top right of each page are page numbers. For example, page number 1: The page numbers are written in binary, most significant bit first, with representing a 1 bit and representing a 0 bit. These bit shapes were chosen to be resistant to data corruption; you can change any 4 of the 9 pixels in either shape and the recipient can still recover the entire bit unambiguously. There is an ambiguity about whether the numerals are written right to left or left to right—is the number 1 or the number 16?—but the aliens should be able to figure it out by comparing page numbers on consecutive pages; this in turn will help them when time comes for them to figure out the digit symbols.
Every page has a topic header, in this case , which roughly means “mathematics”. The topics of the following pages are something like:
- 1–5 Mathematics
- 6–11,21 Physics
- 12–14,19–20 The Earth
- 15–18 Human anatomy and biochemistry
- 22 Cosmology
- 23 Questions
In the next article I'll explain the contents of page 1. Each following article will appear two or three days later and will explain another page.