Readit News logoReadit News
xi commented on PRQL – A proposal for a better SQL   github.com/max-sixty/prql... · Posted by u/maximilianroos
maximilianroos · 4 years ago
I wrote this over the holidays, because I find SQL wonderfully elegant in its function, but really frustrating in its form.

Let me know any feedback — as you can see it's still at the proposal stage. If it gains some traction I'll write an implementation.

xi · 4 years ago
Maybe you'd like to check FunSQL.jl, my library for compositional construction of SQL queries. It also follows algebraic approach and covers many analytical features of SQL including aggregates/window functions, recursive queries and correlated subqueries/lateral joins. One thing where it differs from dlpyr and similar packages is how it separates aggregation from grouping (by modeling GROUP BY with a universal aggregate function).
xi commented on SQL: The difference between WHERE and HAVING   sql-bits.com/the-differen... · Posted by u/FedericoRazzoli
barrkel · 4 years ago
There's no good reason for using two different keywords for filtering and it harms composability. But of course SQL isn't very composable anyhow.

Preferably, SQL would look more like:

  FROM Foo f
  WHERE f.value < 10
  JOIN Bar b on b.id = f.bar_id
  WHERE b.other_value > 20
  SELECT f.group, f.value
  GROUP BY f.group the_group AGGREGATING SUM(f.value) the_sum
  WHERE the_sum > 100
  ORDER BY the_group
And so on. FROM introduces a source of data which flows into the next line. SELECT does a projection, GROUP BY applies aggregation operators on groups and also does a projection. WHERE could be inserted pretty much anywhere.

xi · 4 years ago
This is pretty close to how my Julia library [0] for composable construction of SQL queries works:

    From(foo) |>
    Where(Get.value .< 10) |>
    Join(From(bar) |> As(:bar), on = Get.bar.id .== Get.bar_id) |>
    Where(Get.bar.other_value .> 20) |>
    Select(Get.group, Get.value) |>
    Group(Get.group) |>
    Where(Agg.sum(Get.value) .> 100) |>
    Order(Get.group)
There is no HAVING and the you can use any tabular operators in any order. Aggregates are also separated from grouping and can be used in any context after Group is applied.

[0] https://github.com/MechanicalRabbit/FunSQL.jl

xi commented on War in Europe is not a hysterical idea   washingtonpost.com/opinio... · Posted by u/smacktoward
dfkf · 11 years ago
Key piece: "In the past few days, Russian troops bearing the flag of a previously unknown country, Novorossiya, have marched across the border of southeastern Ukraine."

There were ten Russian soldiers from the border patrol who were detained by the Ukrainian army. They have been just released and sent back to Russia. Strange reaction by a country who is apparently under an open attack by Russia, isn't it?

This BS is getting tiresome. I really hope this won't end like in Georgia where a Georgian attack was justified by Russian armored columns pouring the the Kodori gorge. Only later, when nobody cared a report of the Fact-Finding Mission dryly stated that the Georgian claims "could not be substantiated". I really want Ukrainian (and not only Ukrainian) politicians to eat all the sh1t they have been throwing on the fan.

xi · 11 years ago
Are you serious? Regular Russian troops have been fighting and dying in Ukraine for weeks now.

http://www.nato.int/cps/en/natolive/news_112103.htm

http://uk.reuters.com/article/2014/08/28/uk-ukraine-crisis-r...

xi commented on War in Europe is not a hysterical idea   washingtonpost.com/opinio... · Posted by u/smacktoward
monochr · 11 years ago
It isn't a hysterical idea, it is a retarded idea.

For starters her example of Poland circa 1938 completely ignores that the Poland in question was actually a re-incarnation of the Polish-Lithuanian commonwealth and not Poland-the-country-of-Poles we have today (one which took close to a third it's territory though ethnically cleansing Prussia and Silesia of Germans, courtesy of the Soviet union at the end of WWII). One in which Poles were the minority population in the majority of the territory[1] and those territories would eventually become the countries of Ukraine and Belarus.

For comparison here is the same map of Ukraine today for Russian speakers: https://en.wikipedia.org/wiki/File:Ukraine_census_2001_Russi...

Who is shocked that regions with more than half the population being Russian want to get back into Russia, especially considering the first move of the new Ukrainian parliament was to ban the use of Russian in government (something the president himself vetoed so it wouldn't look like his cabinet was filled with right wing nationalists)?

[1] https://en.wikipedia.org/wiki/File:Polish_language_frequency...

xi · 11 years ago
A Russian native speaker does not equal a Russian. About 2/3 of the population of Donetsk region identify themselves as ethnic Ukrainians. More than half of those name Russian as their native language.
xi commented on Live map of Russia advancing into Ukraine   liveuamap.com/?ll=48.1167... · Posted by u/vincvinc
zorbo · 11 years ago
> needless escalation, when part of Ukraine is occupied by Russia?

The occupation of Ukraine is something that's only happening as of just now. Before that, the situation in Ukraine was much more akin to a civil war. The escalations by the Ukrainian government have been happening since the beginning of this whole thing.

xi · 11 years ago
Crimea was occupied by Russian forces in February. Military hostilities in mainland Ukraine started in April when Sloviansk has been captured by Russian ex-FSB officer Igor Girkin and his gang of Russian ultranationalists.
xi commented on Russia enacts 'draconian' law for bloggers and online media   bbc.co.uk/news/technology... · Posted by u/richardwigley
pipy · 11 years ago
Hello, Kirill. :)

The expert is a journalist, from a newspaper «Тиждень». [1]

Here are the qoutes:

Донбасс – это не просто депрессивный регион. Там дикое количество ненужных людей. Я абсолютно осознанно об этом говорю. В Донецкой области примерно 4 миллиона жителей. И не менее 1,5 миллионов лишних. Нам не надо понимать Донбасс. Нам надо понимать украинский национальный интерес. А Донбасс нужно использовать как ресурс. [...] В отношении Донбасса: я не знаю рецепта, как это сделать быстро. Однако наиглавнейшее, что нужно сделать: есть люди, которых необходимо просто убить.

Which means that there is an "excess of 1.5 millions of people" in Donetsk Region, that "[people of] Donetsk Region mustn't be undestood [by the people from the rest of Ukraine], and Donetsk Region [and it's people] must be used as a resource instead" and "I don't know how to solve that problem [to remove excessive civilians], but the main thing is that some people must be physically eliminated".

So:

1. There are 1.5 millions of civilians of Donetsk region that are excessive.

2. People of Donetsk region mustn't be understood by the rest of Ukraine. Which literally means that they do not fit in Ukrainian Nation, they are not part of it.

3. He doesn't know the recipe how to remove the excessive civilians, but some people must be physically eliminated.

In the context of the whole TV show he is talking about elimination of excessive civilians. One could argue if he considers possible to physically eliminate 1.5 million of them, or only part of them and drive others by away by force or by economical means, etc.

> The "expert" (another journalist, in fact) never suggested to "physically eliminate about 1.5 million of civilians of Donetsk and Luhansk regions that are not able to fit in Ukrainian Nation" or anything close to it.

So, even though I have already claimed that it was too emotional for me to mention this TV show, I consider myself to have provided reasonable translation of his words.

P.S.

I've actually used pyyaml parser. :)

Edit: here is the relevant part of the show for you to check: [2]

[1] http://tyzhden.ua/Author/76/Publications/

[2] https://www.youtube.com/watch?v=mhYyj5l9Lx0

xi · 11 years ago
Which means that there is an "excess of 1.5 millions of people" in Donetsk Region, that "[people of] Donetsk Region mustn't be undestood [by the people from the rest of Ukraine], and Donetsk Region [and it's people] must be used as a resource instead" and "I don't know how to solve that problem [to remove excessive civilians], but the main thing is that some people must be physically eliminated".

Wow, this is truly creative editing. None of your insertions are implied from the context and the quotes you picked up are several minutes apart. In particular, he talks about 1.5 millions of people lacking meaningful job prospects as one of the causes of the unrest (which is true). A few minutes later, when he talks about about killing people, nowhere he implies millions of civilians, in fact, it's obvious he means armed militants.

xi commented on Russia enacts 'draconian' law for bloggers and online media   bbc.co.uk/news/technology... · Posted by u/richardwigley
mpyne · 11 years ago
> Because there are no forces of Russian federation, probably apart from some Spec Ops, logistics and reconnaissance units.

Or in other words, Russian military forces have invaded a neighboring nation, unless there is permission from Kiev for such uniformed armed forces to be on the sovereign territory of Ukraine?....

As far as I can tell, your link [1] implies that the only reason Kiev is using air strikes or artillery is because of the presence of hostile military forces in their sovereign territory.

So, yes, I would suggest Russia should "abandon" the people of Donetsk and Luhansk (and for that matter, Crimea), return to its own sovereign territory, and then the fighting will stop as there will quickly be no hostile forces to launch artillery or air strikes against.

You implied with that link [1] that Russia intervened only after Kiev started committing atrocities against people in Donetsk and Luhansk, but the order appears to be completely opposite.

> I actually watch Ukrainian mainstream television and recently one of the experts was openly talking about the need to "physically eliminate about 1.5 million of civilians of Donetsk and Luhansk regions that are not able to fit in Ukrainian Nation" [2].

> And he didn't get fined or jailed for this words, or even challenged by the TV host.

He wouldn't be fined or jailed in the U.S. either, due to the First Amendment (although maybe you could make a good case that it's "hate speech"). Does that make the U.S. "fascist"?

Maybe the TV host didn't challenge him because his comments are already so backward and idiotic as to not need further emphasis.

And either way, are you trying to imply that some random asshole on T.V. spouting their stupid backward opinion about a million people he's never met, is justification enough to invade the sovereign territory of another nation. I mean, even Bush 43 tried to put a better case together than that when he went off to disaster in Iraq...

xi · 11 years ago
Maybe the TV host didn't challenge him because his comments are already so backward and idiotic as to not need further emphasis.

I'll give you a better explanation: the TV host didn't challenge him because it never happened. The "expert" (another journalist, in fact) never suggested to "physically eliminate about 1.5 million of civilians of Donetsk and Luhansk regions that are not able to fit in Ukrainian Nation" or anything close to it.

xi commented on Tehran tracked, captured, studied, copied RQ-170   medium.com/war-is-boring/... · Posted by u/vinnyglennon
meric · 11 years ago
"Then the world will realize how valuable what the US stood for despite its shortcomings."

The West, maybe.

Not if you're living in a Middle Eastern country, with oppressive rulers kept in power by US funds, forcing the country to sell its oil resources cheaply.

Not if you're living in Eastern Ukraine, where the US toppled an elected government to install a government that is hostile to your people. http://www.presstv.com/detail/2014/03/25/355978/nuke-8-milli... You could pretty much tell her attitude to them by the way she suggested the 8 million ethnic Russians living in Eastern Ukraine should be nuked.

Not if you're living in Iraq, Syria, Lebanon, Libya, Somalia, Sudan, Iran. https://www.youtube.com/watch?v=9RC1Mepk_Sw#t=79 All countries where the U.S. has sought to destroy domestic, independent, public institutions if and when they arise.

If you're living in an African country where the U.S. has previously tried to destabilize your government, and where China instead have offered to build infrastructure for your country, you might not be so sad that the US has lost a drone, which it was probably using for spying purposes.

If the world was Panem, then U.S. is the Capitol, and its closest allies are the Capitol's adjacent districts.

Of course, you're probably from the U.S., if not, then probably, U.K or Australia, or N.Z. Of course you'd have something to lose if the US will some day not be able to police the world.

EDIT: What's the downvote for? A lack of citations?

xi · 11 years ago
> EDIT: What's the downvote for? A lack of citations?

Maybe because of them? The article about Timoshenko is written by a serious antisemitic nutjob.

xi commented on How ‘Bacon and Eggs’ Became the American Breakfast   americantable.org/2012/07... · Posted by u/boh
gxs · 12 years ago
I can't remember off the top of my head, but it's amazing how many of our american "traditions" are a result of marketing.

While there is nothing inherently bad about this, it definitely gives me a sense that something is not authentic when I come to learn it was the result of a marketing campaign.

This bacon and eggs breakfast is just one example. Grilled cheese and tomato soup is another. Can anyone recall any others?

xi · 12 years ago
Orange juice?

...The Florida industry’s aggressive marketing of oranges and orange juice is a key feature of orange juice history, as it slowly developed demand for the product. In 1907 oranges became the first perishable fruit “ever” to be advertised. As crops expanded quickly, marketing became crucial to avoid overproduction. The growth of farmer cooperatives came largely out of a need to market the products. The Florida Citrus Exchange was organized in 1910 to market fresh citrus and also to do research on processing citrus. It created advertising programs and “built national and international sales organizations.”

http://shkrobius.livejournal.com/312073.html

xi commented on Things you didn't know about Python   speakerdeck.com/u/mitsuhi... · Posted by u/d0ugal
xi · 13 years ago
Armin's implementation of `cached_property` is not entirely correct. Well, it works, but the branch where `value` is not `missing` is never executed: the object's `__dict__` takes precedence over the descriptor as long as the descriptor does not define `__set__` method.

Here is an implementation of `cached_property` I use:

    class cached_property(object):

        def __init__(self, fget):
            self.fget = fget
            self.__name__ = fget.__name__
            self.__module__ = fget.__module__
            self.__doc__ = fget.__doc__

        def __get__(self, obj, objtype=None):
            if obj is None:
                return self
            value = self.fget(obj)
            # For a non-data descriptor (`__set__` is not defined),
            # `__dict__` takes precedence.
            obj.__dict__[self.__name__] = value
            return value

u/xi

KarmaCake day141May 24, 2010
About
The author of PyYAML, LibYAML, HTSQL, DataKnots.jl, PrettyPrinting.jl, and FunSQL.jl.
View Original