I hereby claim:
- I am fennb on github.
- I am fennb (https://keybase.io/fennb) on keybase.
- I have a public key ASBADiC1MkWSxXy2wM84ZISNtgCGa3ySBjnMLcqCbK2-DQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| $ ab -n 10000 -c 500 http://wp-demo.local/ | |
| Server Software: nginx/0.8.54 | |
| Server Hostname: wp-demo.local | |
| Server Port: 80 | |
| Document Path: / | |
| Document Length: 5728 bytes | |
| Concurrency Level: 500 |
| $ ab -n 200 -c 4 http://wp-demo.local:8080/ | |
| Server Software: Apache/2.2.17 | |
| Server Hostname: wp-demo.local | |
| Server Port: 8080 | |
| Document Path: / | |
| Document Length: 5726 bytes | |
| Concurrency Level: 4 |
| # Set cache dir | |
| proxy_cache_path /var/cache/nginx levels=1:2 | |
| keys_zone=microcache:5m max_size=1000m; | |
| # Virtualhost/server configuration | |
| server { | |
| listen 80; | |
| server_name yourhost.domain.com; | |
| # Define cached location (may not be whole site) |
| { | |
| "hypotheses": [ | |
| { | |
| "confidence": 0.88569070000000005, | |
| "utterance": "this is pretty cool" | |
| }, | |
| { | |
| "utterance": "thesis pretty cool" | |
| }, | |
| { |
| const int SpeechRecognizer::kAudioSampleRate = 16000; | |
| const int SpeechRecognizer::kAudioPacketIntervalMs = 100; | |
| const ChannelLayout SpeechRecognizer::kChannelLayout = CHANNEL_LAYOUT_MONO; | |
| const int SpeechRecognizer::kNumBitsPerAudioSample = 16; | |
| const int SpeechRecognizer::kNoSpeechTimeoutSec = 8; | |
| const int SpeechRecognizer::kEndpointerEstimationTimeMs = 300; | |
| // ... | |
| const char* const kContentTypeSpeex = "audio/x-speex-with-header-byte; rate="; | |
| const int kSpeexEncodingQuality = 8; | |
| const int kMaxSpeexFrameLength = 110; // (44kbps rate sampled at 32kHz). |
| #!/bin/bash | |
| # FLAC encoded example | |
| curl \ | |
| --data-binary @example.flac \ | |
| --header 'Content-type: audio/x-flac; rate=16000' \ | |
| 'https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&pfilter=2&lang=en-US&maxresults=6' | |
| # Speex encoded example | |
| curl \ |
| // Illustrative case | |
| for (var i = 0; i < recentBlogPostIds.length; i++) { | |
| var blogPostId = recentBlogPostIds[i]; | |
| var results = []; | |
| // Fetch from DB | |
| asynchronousDB.getBlogPostById(blogPostId, function(err, post) { | |
| htmlFragment = templating.render(post); | |
| results.push(htmlFragment); | |
| }); | |
| } |
| // asynchronous version | |
| asynchronousCache.get("id:3244", function(err, myThing) { | |
| if (myThing == null) { | |
| asynchronousDB.query("SELECT * from something WHERE id = 3244", function(err, myThing) { | |
| // We now have a thing from DB, do something with result | |
| // ... | |
| }); | |
| } else { | |
| // We have a thing from cache, do something with result |
| // synchronous version | |
| myThing = synchronousCache.get("id:3244"); | |
| if (myThing == null) { | |
| myThing = synchronousDB.query("SELECT * from something WHERE id = 3244"); | |
| } | |
| // Do various stuff with myThing here |