Commits

Armin Rigo  committed 615acc2

misc tweaks

  • Participants
  • Parent commits 99fba7e

Comments (0)

Files changed (4)

File hack/misc/bash-4.3-histfile.diff

-Only in lib/readline/: bind.o
-Only in lib/readline/: callback.o
-Only in lib/readline/: colors.o
-Only in lib/readline/: compat.o
-Only in lib/readline/: complete.o
-Only in lib/readline/: display.o
-Common subdirectories: ../bash-4.3/lib/readline/doc and lib/readline/doc
-Common subdirectories: ../bash-4.3/lib/readline/examples and lib/readline/examples
-Only in lib/readline/: funmap.o
-Only in lib/readline/: histexpand.o
-Only in lib/readline/: histfile.o
 diff -u ../bash-4.3/lib/readline/history.c lib/readline/history.c
 --- ../bash-4.3/lib/readline/history.c	2013-07-08 16:40:32.000000000 +0200
 +++ lib/readline/history.c	2014-07-19 13:01:22.970475432 +0200
      }
  
    temp = alloc_history_entry (string, hist_inittime ());
-Only in lib/readline/: history.o
-Only in lib/readline/: histsearch.o
-Only in lib/readline/: input.o
-Only in lib/readline/: isearch.o
-Only in lib/readline/: keymaps.o
-Only in lib/readline/: kill.o
-Only in lib/readline/: libhistory.a
-Only in lib/readline/: libreadline.a
-Only in lib/readline/: macro.o
-Only in lib/readline/: Makefile
-Only in lib/readline/: mbutil.o
-Only in lib/readline/: misc.o
-Only in lib/readline/: nls.o
-Only in lib/readline/: parens.o
-Only in lib/readline/: parse-colors.o
-Only in lib/readline/: readline.o
-Only in lib/readline/: rltty.o
-Only in lib/readline/: savestring.o
-Only in lib/readline/: search.o
-Only in lib/readline/: shell.o
-Only in lib/readline/: signals.o
-Only in lib/readline/: terminal.o
-Only in lib/readline/: text.o
-Only in lib/readline/: tilde.o
-Only in lib/readline/: undo.o
-Only in lib/readline/: util.o
-Only in lib/readline/: vi_mode.o
-Only in lib/readline/: xfree.o
-Only in lib/readline/: xmalloc.o

File hack/misc/zipfilepart.py

         raise BadZipfile, \
               "Unsupported compression method %d for file %s" % (ct, fname)
     crc = binascii.crc32(bytes)
-    if crc != expectedcrc:
-        raise BadCRC, "Bad CRC-32 for file %s" % fname
+    if (crc - expectedcrc) & 0xffffffff:
+        raise BadCRC, "Bad CRC-32 for file %r (%r != %r)" % (
+            fname, crc, expectedcrc)
     return fname, bytes
 
 def enum_zip_file(file, follow=False):

File hack/puzzle/staticweb/puzzle.html

 //INIT = "p----/-001020-/-011121-/-021222-/-----";
 INIT = "5x5x3x3";
 IMAGE = "http://www.raph.com/3dartists/artgallery/jerry1p.jpg";
+FW = "";
 //IMAGE = "jerry1p.jpg";
 
 BORDER = 2;
+FULLBORDER = 24;
 OUTSIDECOLOR = {r: 213, g: 213, b: 192};
 PLAYERCOLOR = {r: 224, g: 0, b: 0};
 BACKCOLOR = {r: 200, g: 200, b: 200};
 
 function initialize()
 {
-    state.cw = Math.floor(myimage.width / state.iw);
-    state.ch = Math.floor(myimage.height / state.ih);
-    state.finished = false;
+    state.cw1 = Math.floor(myimage.width / state.iw);
+    state.ch1 = Math.floor(myimage.height / state.ih);
+    document.onkeydown = keyhandler;
+    window.onresize = resized;
+    resized();
+}
+
+function resized()
+{
+    state.cw = (window.innerWidth - FULLBORDER) / (state.bw + 0.5);
+    state.ch = (window.innerHeight - FULLBORDER) / state.bh;
+    var fraction = max(max(state.cw1 / state.cw, state.ch1 / state.ch), 1.0);
+    state.cw = Math.floor(state.cw1 / fraction);
+    state.ch = Math.floor(state.ch1 / fraction);
+
+    var width = BORDER + state.cw * state.bw + BORDER;
+    var height = BORDER + state.ch * state.bh + BORDER;
 
     var canvas = document.getElementById('cnv');
-    var width = BORDER + state.cw * state.bw + BORDER;
-    var height = BORDER + state.ch * state.bh + BORDER;
     canvas.width = width + state.cw / 2;
     canvas.height = height;
+
     ctx = canvas.getContext('2d');
-
     setcolor(OUTSIDECOLOR, "dark");
     ctx.fillRect(1, 0, width - BORDER - 1, BORDER);
     ctx.fillRect(0, 1, BORDER, height - BORDER - 1);
                  BORDER, height - BORDER - 1);
 
     redraw();
-    document.onkeydown = keyhandler;
 }
 
 function draw_arrow()
             }
             else if (c.length == 2) {
                 ctx.drawImage(myimage,
-                              (c.charCodeAt(0) - 48) * state.cw,
-                              (c.charCodeAt(1) - 48) * state.ch,
-                              state.cw,
-                              state.ch,
+                              (c.charCodeAt(0) - 48) * state.cw1,
+                              (c.charCodeAt(1) - 48) * state.ch1,
+                              state.cw1,
+                              state.ch1,
                               tx,
                               ty,
                               state.cw,
         redraw();
         if (param_fw)
             document.location.href = param_fw;
+        else
+            window.history.back();
         return;
     }
 
     state.history = [];
     state.board = [];
     state.doory = 0;
+    state.finished = false;
 
     if (init.indexOf("x") == -1)
         parse_state_explicit(init);
         myimage.src = query.img;
     else
         myimage.src = IMAGE;
-    param_fw = query.fw
+    if (query.fw)
+        param_fw = query.fw;
+    else
+        param_fw = FW;
 }
 
 </script>

File hack/pypy-hack/stm/stmpool.py

     try:
         with signals_enabled:
             for item in iterator:
+                hint_commit_soon()
                 with atomic:
                     result = function(item)
+                hint_commit_soon()
                 if interrupt:
                     break
                 resultsqueue.put((0, result))