Skip to content

Instantly share code, notes, and snippets.

@przhu
przhu / lilydjwg_swapview.hs
Last active December 30, 2015 22:18
for lilydjwg , try it. It uses show as a simple repl. of filesize ( I do not have that). It is still quite slow (I believe) (currenly I do not have a linux machine to test it..)
{-# LANGUAGE BangPatterns, OverloadedStrings, ScopedTypeVariables #-}
import Control.Applicative ((<$>))
import Control.Exception (catch, SomeException)
import Control.Monad (mapM)
import Data.Char (isDigit)
import Data.List (sortBy)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Format as T
import Data.Text.Lazy(toStrict)
@przhu
przhu / vm_mach_shm.c
Last active February 27, 2023 23:59
attachment of post: 2012-08-26-sharing-memory-using-mach-part-of-os-x.md
/*
Sample Code, (C) PrZhu 2012
Redistribution this sample code and/or modified version is permitted provided that
this notice is preserved.
*/
/*
mach_make_memory_entry, vm_map
can be used to set up shared memory, which is shared virtual memory
the memory_entry is represented in mach_port_t, you know.
diff -r -u calligra-2.4.3.orig/filters/karbon/wpg/CMakeLists.txt calligra-2.4.3/filters/karbon/wpg/CMakeLists.txt
--- calligra-2.4.3.orig/filters/karbon/wpg/CMakeLists.txt 2012-06-26 12:18:00.000000000 +0800
+++ calligra-2.4.3/filters/karbon/wpg/CMakeLists.txt 2012-07-16 18:51:31.000000000 +0800
@@ -5,7 +5,7 @@
kde4_add_plugin(wpgimport ${wpgimport_PART_SRCS})
-target_link_libraries(wpgimport komain ${LIBWPG_LIBRARIES} ${LIBWPG_STREAM_LIBRARIES} ${WPD_LIBRARIES})
+target_link_libraries(wpgimport komain ${LIBWPG_LIBRARIES} ${LIBWPG_STREAM_LIBRARY} ${WPD_LIBRARIES})