- We are using:
- Cordova v4.3.0
- jQuery Mobile v1.4.5
- We would like page transitions to be animated nicely
- Android 4.1 doesn't play ball
- We use the standard jQuery Mobile pages with fixed header, and we've disabled tap toggle
- We find that we get 2 problems
- White flashes, flickering, in between the page transitions
- Also the content of the page gets pushed underneath the fixed header, when we remove previously inserted pages (we do this to deal with memory / performance issues)
- And user is able to tap hold and prompt up the user selection options / widgets, i.e. copy and paste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to a proprer repositoy, TSWS is a real boy now! | |
https://github.com/dfletcher/tsws | |
PRs welcomed. |
Since this is on Hacker News and reddit...
- No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
- I apologize for the use of
_t
in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries". - Since people kept complaining, I've fixed the assignments of string literals to non-const
char *
s. - My use of
type * name
, however, is entirely intentional. - If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/gridfs.c b/src/gridfs.c | |
index f51b397..66f8d88 100644 | |
--- a/src/gridfs.c | |
+++ b/src/gridfs.c | |
@@ -43,7 +43,7 @@ int gridfs_init( mongo *client, const char *dbname, const char *prefix, | |
int options; | |
bson b; | |
- bson_bool_t success; | |
+ bson_bool_t success = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ngx_http_gridfs_module.c b/ngx_http_gridfs_module.c | |
index 77ef430..859dff1 100644 | |
--- a/ngx_http_gridfs_module.c | |
+++ b/ngx_http_gridfs_module.c | |
@@ -490,7 +490,7 @@ static ngx_int_t ngx_http_mongo_add_connection(ngx_cycle_t* cycle, ngx_http_grid | |
if ( gridfs_loc_conf->mongods->nelts == 1 ) { | |
ngx_cpystrn( host, mongods[0].host.data, mongods[0].host.len + 1 ); | |
- status = mongo_connect( &mongo_conn->conn, (const char*)host, mongods[0].port ); | |
+ status = mongo_connect( &mongo_conn->conn, (const char*)host, mongods[0].port, MONGO_SECONDARY_OK ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |