-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.ios.js
45 lines (37 loc) · 15.3 KB
/
index.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* @flow */
import React, { Component, AppRegistry, Text, Navigator, ToolbarAndroid, BackAndroid } from 'react-native';
import { Provider } from 'react-redux/native';
import Index from './app/scenes/index';
import Comments from './app/scenes/comments';
import FormattedText from './app/components/FormattedText';
import store from './app/state/store';
var _navigator;
BackAndroid.addEventListener('hardwareBackPress', () => {
if (_navigator && _navigator.getCurrentRoutes().length > 1) {
_navigator.pop();
return true;
}
return false;
});
// navigationBar={<ToolbarAndroid />}
// var tmpStory = {"id":10257305,"title":"Introducing Brotli: a new compression algorithm for the internet","points":83,"user":"rey12rey","time":1442909660,"time_ago":"3 hours ago","type":"link","url":"http://google-opensource.blogspot.com/2015/09/introducing-brotli-new-compression.html?m=0","domain":"google-opensource.blogspot.com","comments":[{"id":10257766,"level":0,"user":"rottyguy","time":1442919034,"time_ago":"2 minutes ago","content":"<p>I'm curious about the viability of the following approach. Can a generic static dictionary be made to be held on the client side such that said compressor/decompressor can utilize efficiently? This would prevent the need to send along the dictionary with the compressed package every time. Even at an 80/20 - 90/10 success rate (of course we'd have a fall back to worse case), wouldn't this be a great advancement and reduce massive network load? With modern hd sizes, many could spare a few gigabites which could be dialed up/down as necessary depending on how optimized you'd want it. I would think we could identify particular binary patterns based on the users xfer habits (eg downloading text vs application vs audio vs video) and have different dictionaries optimized to their usage (eg roku would just store dictionaries maximized for video usage)","comments":[]},{"id":10257694,"level":0,"user":"tmd83","time":1442917461,"time_ago":"29 minutes ago","content":"<p>It's fantastic to see so much fascinating work in compression these days after a fair amount of stagnation. I know there had been a lot of specialized but codec work but the recent discoveries are very much for wide use.<p>You now have LZ4, Brotil, zstd, snappy, lzfse, lzma all pretty useful practical codec.<p>Brotil is interesting though. It can be an easy replacement for zlib at level 1 with fairly higher compression then zlib at similar speed.<p>On the other hand with with lzma it can handily beat lzma but with an even slower compression rate (from the levels that they published in the benchmark) but on the other hand with much higher decompression speed meaning its very good for distribution work. It would be interesting to see the compression ratio, time for levels between 1-9.<p>It's actually a much easier replacement for zlib then lzma for some. The benchmark shows only level 1,9 and 11. It seems that it can handily beat lzma but at the cost of compression speed (I wonder who use more memory). Then again its decompression speed is so much better making it a perfect choice for distribution.<p>What truly surprise me though is the work of 'Yann Collet'. A single person so handily beating google's snappy. Even his zstd work looks ground breaking. When I read couple of weeks ago that he was a part time hobby programmer I just didn't know how to be suitably impressed.<p>Am I reading right that apples lzfse is based of a mix of lz+zstd?","comments":[]},{"id":10257591,"level":0,"user":"simonlindholm","time":1442915222,"time_ago":"an hour ago","content":"<p>Currently being implemented in Firefox: <a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=366559\" rel=\"nofollow\">https://bugzilla.mozilla.org/show_bug.cgi?id=366559</a>","comments":[{"id":10257708,"level":1,"user":"gjm11","time":1442917691,"time_ago":"25 minutes ago","content":"<p>Note that this bug originally seems to have been called something like "Implement LZMA compression", and the early comments are about that; it's some way in that someone says "oh, and Google have this new Brotli thing which might be even better".","comments":[]}]},{"id":10257654,"level":0,"user":"fsiefken","time":1442916690,"time_ago":"41 minutes ago","content":"<p>"We hope that this format will be supported by major browsers" - if I'm not mistaken it should also be implemented by all major webservers. I'm hoping Opera open sources or sells their OMPD proxy platform. Someone made a chrome extension which interfaces with their network and the speed is amazing. OMPD is a tradeoff and breaks certain javascript and css and is different from Opera Turbo, I am not sure what compression Turbo uses currently. Does anyone know if Brotli gets implemented in the google server and proxy compression? <a href=\"http://browsingthenet.blogspot.nl/2014/09/chrome-data-compression-proxy-vs-mozilla-janus-vs-opera-turbo.html\" rel=\"nofollow\">http://browsingthenet.blogspot.nl/2014/09/chrome-data-compre...</a>","comments":[]},{"id":10257474,"level":0,"user":"estefan","time":1442912843,"time_ago":"2 hours ago","content":"<p>> Just like Zopfli, the new algorithm is named after Swiss bakery products. Brötli means ‘small bread’ in Swiss German.<p>Makes sense.","comments":[{"id":10257631,"level":1,"user":"TazeTSchnitzel","time":1442915977,"time_ago":"an hour ago","content":"<p>Disappointing they aren't dissolving the umlaut and instead stripping it. 'Broetil' would be equivalent to 'Brötil', yet they remove it (and thus change the sound) to create 'Brotil'.","comments":[{"id":10257772,"level":2,"user":"agumonkey","time":1442919105,"time_ago":"a minute ago","content":"<p>Keeping that long human linguistic tradition of information loss. Pretty on point for a compression scheme.","comments":[]},{"id":10257666,"level":2,"user":"m_mueller","time":1442916909,"time_ago":"38 minutes ago","content":"<p>First I thought you made a typo, but then it was consistent: Swiss German it is Bröt<i>li</i>.","comments":[]}]}]},{"id":10257588,"level":0,"user":"kccqzy","time":1442915096,"time_ago":"an hour ago","content":"<p>Really like how big and influential companies are working on foundational technologies like compression, which smaller companies would have no chance of popularising. Earlier this summer Apple introduced lzfse. But this brotli seems even more amazing as its compression ratio seems to match that of lzma. Wonderful.","comments":[]},{"id":10257670,"level":0,"user":"jacobolus","time":1442917012,"time_ago":"36 minutes ago","content":"<p>So how does it compare to Apple’s new proprietary LZFSE codec (<a href=\"http://forums.macrumors.com/attachments/lzfse_1-png.565004/\" rel=\"nofollow\">http://forums.macrumors.com/attachments/lzfse_1-png.565004/</a>), and what’s the Weissman score?","comments":[]},{"id":10257540,"level":0,"user":"dwb","time":1442914218,"time_ago":"an hour ago","content":"<p>So it should be "Broetli", then...?","comments":[{"id":10257755,"level":1,"user":"wodenokoto","time":1442918870,"time_ago":"5 minutes ago","content":"<p>Yes and no. It is very common to simply strip umlauts and dashes when converting to ASCII compatible writing.<p>I even do it with my name most of the times. A Chinese official that sees Ø in my passport won't understand why I write 'OE', and might even start questioning if it is the same name, but 'O' never fails.<p>Airlines can read the gibberish in the bottom of my passport and see that the transliteration is actually 'OE', but most places don't have a scanner for that.","comments":[]},{"id":10257677,"level":1,"user":"dot","time":1442917146,"time_ago":"34 minutes ago","content":"<p>Can't wait for Gipfeli","comments":[]}]},{"id":10257526,"level":0,"user":"cslmy","time":1442913873,"time_ago":"an hour ago","content":"<p>Pied Piper is that you?","comments":[{"id":10257572,"level":1,"user":"orblivion","time":1442914826,"time_ago":"an hour ago","content":"<p>No, it's Hooli beating them to the punch.","comments":[]},{"id":10257561,"level":1,"user":"anc84","time":1442914632,"time_ago":"an hour ago","content":"<p>What is that Pied Piper thing I constantly see referenced somewhere? Some SF or startup meme?","comments":[{"id":10257573,"level":2,"user":"wingerlang","time":1442914872,"time_ago":"an hour ago","content":"<p>It's from a TV series called Silicon Valley.<p><a href=\"https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)\" rel=\"nofollow\">https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)</a>","comments":[{"id":10257760,"level":3,"user":"wolfgke","time":1442918972,"time_ago":"3 minutes ago","content":"<p>Being German I thought you meant the Pied Piper of Hamelin (<a href=\"https://en.wikipedia.org/wiki/Pied_Piper_of_Hamelin\" rel=\"nofollow\">https://en.wikipedia.org/wiki/Pied_Piper_of_Hamelin</a>).","comments":[]},{"id":10257662,"level":3,"user":"acqq","time":1442916818,"time_ago":"39 minutes ago","content":"<p>What's the point of mentioning a fictional compression startup as a comment on the algorithm made by Google?<p>To tell the world that he also watched the series?","comments":[{"id":10257674,"level":4,"user":"valarauca1","time":1442917126,"time_ago":"34 minutes ago","content":"<p>>What's the point of mentioning a fictional compression startup as a comment on the algorithm made by Google?<p>A joke, or a pop culture reference. Stating a shared experience that others may also gleam some enjoyment out of, or to create the illusion of a shared community/experience to help maintain the illusion that we are not just meaningless souls adrift in an indifferent, eternal void, who's incomprehensible size only re-enforces the meaninglessness of our existence.<p>But like I said. A joke.","comments":[]},{"id":10257672,"level":4,"user":"wingerlang","time":1442917041,"time_ago":"36 minutes ago","content":"<p>One one hand I understand it, pop culture references has been a thing for ages and ages. On the other hand, I don't know because many take it to an extreme (see: reddit).","comments":[]},{"id":10257746,"level":4,"user":"teddyh","time":1442918590,"time_ago":"10 minutes ago","content":"<p>“<i>References to a shared culture are the universal language of camaraderie.</i>”<p><a href=\"http://tailsteak.com/archive.php?num=29\" rel=\"nofollow\">http://tailsteak.com/archive.php?num=29</a>","comments":[]},{"id":10257715,"level":4,"user":"StavrosK","time":1442917867,"time_ago":"22 minutes ago","content":"<p>Yes, exactly. It's the sort of thing that tends to get downvoted here.","comments":[]}]}]},{"id":10257575,"level":2,"user":"kristofferR","time":1442914894,"time_ago":"an hour ago","content":"<p><a href=\"http://www.piedpiper.com/\" rel=\"nofollow\">http://www.piedpiper.com/</a>","comments":[]},{"id":10257569,"level":2,"user":"PickledJesus","time":1442914779,"time_ago":"an hour ago","content":"<p><a href=\"https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)\" rel=\"nofollow\">https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)</a>","comments":[]},{"id":10257623,"level":2,"user":"return0","time":1442915884,"time_ago":"an hour ago","content":"<p><a href=\"http://www.piedpiper.com/\" rel=\"nofollow\">http://www.piedpiper.com/</a> , almost got owned by <a href=\"http://www.hooli.com/\" rel=\"nofollow\">http://www.hooli.com/</a> (who is now owned by homicide? I must have missed a few episodes.)","comments":[]},{"id":10257582,"level":2,"user":"shard","time":1442915032,"time_ago":"an hour ago","content":"<p>It's the name of the compression start-up in the show Silicon Valley.","comments":[]},{"id":10257576,"level":2,"time":1442914914,"time_ago":"an hour ago","content":"[deleted]","deleted":true,"comments":[]}]},{"id":10257542,"level":1,"user":"raverbashing","time":1442914227,"time_ago":"an hour ago","content":"<p>Does it compress data middle-out?","comments":[{"id":10257619,"level":2,"user":"return0","time":1442915789,"time_ago":"an hour ago","content":"<p>> The higher data density is achieved by a 2nd order context modeling, re-use of entropy codes, larger memory window of past data and joint distribution codes.<p>They still haven't cracked middle out...","comments":[]}]},{"id":10257688,"level":1,"user":"pibefision","time":1442917408,"time_ago":"29 minutes ago","content":"<p>Russ Hanneman says: "ROI guys, ROI..."","comments":[]}]},{"id":10257578,"level":0,"time":1442914953,"time_ago":"an hour ago","content":"[deleted]","deleted":true,"comments":[]},{"id":10257533,"level":0,"time":1442914060,"time_ago":"an hour ago","content":"[deleted]","deleted":true,"comments":[]},{"id":10257592,"level":0,"user":"kornakiewicz","time":1442915268,"time_ago":"an hour ago","content":"<p>"We hope that this format will be supported by major browsers in the near future, as the smaller compressed size would give additional benefits to mobile users, such as lower data transfer fees and reduced battery use."<p>Is this the same story everytime that G. invents something, implements it in Chrome and then gains advantage, because takes it as standard and other browser hadn't implement it yet?","comments":[{"id":10257614,"level":1,"user":"lorenzhs","time":1442915678,"time_ago":"an hour ago","content":"<p>No, this was first proposed for inclusion in Firefox two years ago: <a href=\"https://groups.google.com/forum/#!topic/mozilla.dev.platform/CBhSPWs3HS8\" rel=\"nofollow\">https://groups.google.com/forum/#!topic/mozilla.dev.platform...</a><p>This wasn't developed and deployed in secret. According to the comments in <a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=366559\" rel=\"nofollow\">https://bugzilla.mozilla.org/show_bug.cgi?id=366559</a>, the GitHub repository has been public since at least November 2014.<p>You may not like Google, but insinuating evil plans every time they do something cool isn't helping anyone.","comments":[]},{"id":10257635,"level":1,"user":"mhandley","time":1442916069,"time_ago":"an hour ago","content":"<p>There doesn't seem to be any technical downside to implementing it and likely significant upside. It's Apache-licensed which grants both copyright and patent rights that cover the code. The spec is published as a Internet Draft, scheduled to become an Informational RFC. What's not to like? I'm not one to drink the Google kool-aid, but seriously, what else would you like Google to do?","comments":[]}]}],"comments_count":37};
class HNReact extends Component {
render() {
return (
<Provider store={store}>
{() =>
<Navigator
initialRoute={{name: 'Index', component: Index}}
renderScene={(route, navigator) => {
_navigator = navigator;
if(route.component) {
return React.createElement(route.component, { navigator, ...route.passProps })
}
}}
/>
}
</Provider>
);
}
}
AppRegistry.registerComponent('HNReact', () => HNReact);