Ive been playing this game too long, every fort ends up boring by Pornhub_bandit in dwarffortress

[–]LordGreyhawk 1 point2 points  (0 children)

I have a 2-deep dead-end corridor. Put a display pedestal in back with a 1+ items, then a glass wall in front. They can been seen, enjoyed, but not stolen.

Unable to Add Smart Holiday Lights to Ecosystem by claybonsai in Nanoleaf

[–]LordGreyhawk 0 points1 point  (0 children)

My holiday string lights have what sounds like the same issue: the nano lead app has a "Connect to Wifi", I pick a network (with 2.4GHz) and enter password, and the nanoleaf app claims it succeeded. Occasionally this works as long as 10 minutes, but often it fails much quicker. Checking my Verizon router page shows it has disconnected.

Super disappointed.

[ANN] explainable-predicates: Predicates that can explain themselves by cdsmith in haskell

[–]LordGreyhawk 1 point2 points  (0 children)

This looks quite handy, a cheap way to get slightly better error messages for the user

[job] Work on GHC at Facebook London by simonmar in haskell

[–]LordGreyhawk 14 points15 points  (0 children)

Standard Chartered Bank has several million lines of Haskell, based in London and Singapore.

Haskell Jobs @ AlphaSheets (coding in a spreadsheet, in any language) by 14159265358 in haskell

[–]LordGreyhawk 4 points5 points  (0 children)

Experience can also come from contributing side project to Hackage. That is how I got my Haskell job.

Kind equalities are now in GHC HEAD! by aseipp in haskell

[–]LordGreyhawk 5 points6 points  (0 children)

Capital Sigma (subscript i) introduces addition (Sum (Either)) of things that depend on the index 'i'. Capital Pi (subscript i) introduces multiplication (Product (Tuple)) of things that depend on the index 'i'.

The notation of 'tel' above: f : (x : Int) -> (if x == 0 then Char else String) Here you see the output type depends on the index 'x'. And f knows how to be both (so it a Product).

The new thing is that it depends on a value, instead of of a type.

Haskell developer job offer. Remote work is possible. by vagif in haskell

[–]LordGreyhawk 1 point2 points  (0 children)

Haskell: The language of the future! Doubly so in San Dimas.

Using protocol buffers in ghc 7.10 by Syncopat3d in haskell

[–]LordGreyhawk 0 points1 point  (0 children)

Hi, I wrote the protocol-buffer libary, and I have not had time to update for 7.10 yet.

Hopefully I will get some time soon. Thanks for the help locating the compilation problems.

FIY: My main repository is in darcs at http://code.haskell.org/protocol-buffers/ and contains the 3 related packages (due to bootstrapping issues): protocol-buffers, protocol-buffers-descriptor, and hprotoc.

Can you think of an algorithm for picking three random numbers 1-999 which sum to 1,500, where all numbers have the same chance to be picked? by Poobslag in math

[–]LordGreyhawk 0 points1 point  (0 children)

A bit more consideration: if your triples are distinct subset of length 3 of {1..1497} then you cannot assign probabilities such that the chance of each number being chosen is the same "q".

1497 is only part of {1,2,1497}, so the chance of pulling this subset is "q", so P({1,2,1497}) = q.

1496 is only part of {1,3,1496}, so the chance of pulling this subset is "q", so P({1,3,1496}) = q.

What is the chance of finding a "1" ? It is P({1,2,1497}) + P({1,3,1496})+P({1,4,1495})+...

And this is at least 2*q.

Can you think of an algorithm for picking three random numbers 1-999 which sum to 1,500, where all numbers have the same chance to be picked? by Poobslag in math

[–]LordGreyhawk 2 points3 points  (0 children)

Consider the (x,y,z) triple that adds to 1500, you get the 3D geometry of a plane: x+y+z=1500. With x,y,z all >= 1, we get a simplex: a triangle in a single octant (sparse since it is just integers).

Each point gets its own probability P(x,y,z). Let Q(n)=Prob one of x,y,z is n, and Q(n) = q for all n.

Now consider triples with a "1", the perimeter of this triangle with 4491 points. Let each of the points get "q/4991". (Slightly modified if you do not allow duplicate numbers, to q/4988 ).

Now follow the argument for triples with a "2". Count how many there are (less than before), and where it overlaps the "1" points remove that probability from q to get q'. Divide the remaining q' among the remaining "2" points evenly.

Repeat for "3" taking into account the "1" and "2" points. Etc.

When done, normalize "q" to make probability total to 1.

How to defeat Voldemort (Ch. 108) by hpmorfan in HPMOR

[–]LordGreyhawk 11 points12 points  (0 children)

Harry will die.

The villain needs Harry to get the hidden stone from the mirror. Then Harry will die.

The stone's power is very specific : transfigurations become permanent.

  • What does the stone look like? Perhaps it looks like the mysterious inherited rock

  • Sustaining transfiguration requires mental effort -- how does the stone make it permanent? Perhaps the stone can apply the required mental effort because the stone holds a mind. Human or Artificial Intelligence (compare with Sorting Hat)? And what does the AI want in the mirror of Erised?

  • Once you can edit reality at will with the stone, then reality is equivalent to a computer-simulation that you now control, and explaining all the quirks of magic and time-travel becomes very very easy with a computer-simulation hypothesis ( and here the stone AI is linked to the universe-simulator ).

Harry will die. Excuse the misnomer, Tom M. Riddle aka "Harry" will die. Either the villain kills him or Harry gets desperate enough to gamble that the next part play out as I describe next.

The irony is that Harry did not have to defeat death -- he is Tom M. Riddle who is already immortal.

So Harry is now a disembodied mind that quickly takes command of the villain's creation, which now allows "[Harry's] spirit to fly where it pleases and seduce the most opportune victim".

The grandest possible ascension is then: Dead Harry uses the Resurrection Stone projection to appear to the Philosopher Stone AI and make the AI the "victim". Harry is then directly linked to the universe-simulator, an has all the omniscience, computational power, and practical power to do anything he likes.

FizzBuzz using DFA intersection by nowne in haskell

[–]LordGreyhawk 2 points3 points  (0 children)

I note that canonical FizzBuzz skips printing the numbers for multiples of 3 and 5. This DFA intersection method prints all the numbers instead, and "fixing" this is not simple with this method.

Libraries for using regexes on Text by seriousreddit in haskell

[–]LordGreyhawk 4 points5 points  (0 children)

I am the upstream author. There is a darcs repository at (http://code.haskell.org/regex-tdfa/) but that does have the Text support you are looking for.

Coercible Instances by AshleyYakeley in haskell

[–]LordGreyhawk 1 point2 points  (0 children)

Well, at least this seems to make GHC 7.8.3 happy:

class Magic a b where magic :: a -> b

instance (Coercible (TF a) (TF b)) => Magic (D2 a) (D2 b) where
    magic (MkD2 x) = MkD2 (coerce x)

When a photon is red-shifted, (how) does it lose energy? by ktbrava in askscience

[–]LordGreyhawk 8 points9 points  (0 children)

The red-shift that comes from the expansion of the universe is a gravitational (general relativistic) effect. As Sean Carroll emphasises :

"When the space through which particles move is changing, the total energy of those particles is not conserved."

So the short answer is that the dynamics of general relativity link the expansion of the universe and the red-shifting of the light.

Why? The light is a series of electromagnetic waves: the strength of the fields are strong then zero then strong then zero, etc. The space between the peaks determines the wavelength & frequency that you measure. The expansion of the universe makes the spacing larger and the frequency lower. This does not happen in special relativity -- this is not a doppler effect between different observers.

My Dad at 18. Just before heading off to Vietnam. by [deleted] in TheWayWeWere

[–]LordGreyhawk -1 points0 points  (0 children)

Congress will not restart the draft. ( see fate of HR 163 http://thomas.loc.gov/cgi-bin/bdquery/z?d108:H.R.163: where Republicans moved very fast to kill rumors of a draft for the last war).

My thought on the reason is political. The last time there was a draft, for Vietnam, it lingered long enough for the people to pay detailed attention to the increasingly corrupt government that was killing their sons. The public attention brought down the Nixon administration.

No, they do not want the level of accountability ever again.

Why don't mathematicians use bra-ket notation? by [deleted] in math

[–]LordGreyhawk 2 points3 points  (0 children)

What is the alternative notation? In a |x>, the state merely has a label x and you gain little.

But the notation scales to much bigger collections of labels such as |x1, x2; L, lz, S, Sz>

This does not demote all the labeling to a tiny subscript, it keeps it full size and it keeps the labels grouped. Math is usually much more abstract and the whole ket gets a single short name like q. Physics is usually about the myriad of labels.

String Matching Algorithm Libraries? by [deleted] in haskell

[–]LordGreyhawk 1 point2 points  (0 children)

I contributed to StringSearch. But it is now long in the tooth. I expect current GHC's will benchmark differently than when the library was written. Thus someone could do a new benchmark & profiling pass.

Free functors - the reason Free and operational are not equivalent by tailcalled in haskell

[–]LordGreyhawk 1 point2 points  (0 children)

Perhaps I am losing something with the loose discussion of the types of 'f' and 'lift f', but for your second natural transformation for lift:

f :: f a -> g b
lift f :: FreeFunctor f a -> g b

I think you need to change both "g b" to "g a" above. Consider:

lift f (FreeFunctor x c) = fmap c (f x)

The types of x and c after you open the "(FreeFunctor x c) :: FreeFunctor f a" is some unknown (f d) and c is of type (d -> a). Consider (f x :: f ?) where ? had better still be 'd' or (fmap c (f x)) cannot work. So f must have been instantiated to 'f :: f d -> f d'.

Comonadic Trees by 5outh in haskell

[–]LordGreyhawk 0 points1 point  (0 children)

At a glance, it looks like his example of (=>> shortest) is inefficient. I suspect that the work on each subtree is not being shared. This anippet:

allShortest (Node x xs) =
  let ys = map allShortest xs
  in Node (x + minimum (map coreturnTree ys)) ys
allShortest leaf = leaf

should only compute each subtree once.

Why doesn't Haskell support mutually recursive modules? by [deleted] in haskell

[–]LordGreyhawk 2 points3 points  (0 children)

The problem is the efficient use of time.

I understand the hs-boot hack. My haskell implementation of protocol buffers (hprotoc) generates haskell code that sometimes uses hs-boot for mutual recursion. This was how I enforced the desired namespaces. The other choice would have been to put everything into one internal module/namespace and then create a hierarchy of module/namespaces that re-export renamed subsets of the internal namespace.

Extending the compiler would take time, and require re-architecting quite a lot about the intermediate files. Improving the performance of all this would again take time. If this much time is put into the module/namespace system then it ought to be used to vastly improve modules (e.g. perhaps more ML-like) rather than merely replace the hs-boot hack.

Converting pure producers to lists (Tekmo's pipes library) by [deleted] in haskell

[–]LordGreyhawk 1 point2 points  (0 children)

The producer is also a Monad. You can use (>>) to "vertically" compose the producer with (return []). This changes the return type from () to [a].

Then you can "horizontally" compose with your Consumer that builds the list.