Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| from scrapy.spider import BaseSpider | |
| from scrapy.http import FormRequest, Request | |
| from scrapy.selector import HtmlXPathSelector | |
| class DjangoSpider(BaseSpider): | |
| domain_name = "django.local" | |
| start_urls = ["http://localhost:8000/admin/"] | |
| extra_domain_names = ["localhost"] | |
| def parse(self, response): |
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| ######################### | |
| # .gitignore file for Xcode4 / OS X Source projects | |
| # | |
| # Version 2.0 | |
| # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
| # | |
| # 2013 updates: | |
| # - fixed the broken "save personal Schemes" | |
| # | |
| # NB: if you are storing "built" products, this WILL NOT WORK, |
Not for everyone. Each programmer has their own appreciation of what is good coding music.
(From most influential to least)
| If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example: | |
| - Use create in the index API (assuming you can). | |
| - Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval). | |
| - Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap. | |
| - Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000). | |
| - Increase the memory allocated to elasticsearch node. By default its 1g. | |
| - Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine. | |
| - Increase the number of machines you have so |
| import java.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |
| -Xmx10g | |
| m2.xlarge (4 virtual cores) | |
| Both Jetty and Netty execute the same code--generate 8k of random bits and compute a sha1, returning it over the wire. | |
| INTERNAL (Benchmark tool runs on same machine) | |
| -------- | |
| Jetty: |