Aug. 9th, 2012

juan_gandhi: (Default)
Так как в райно доступны все методы объекта, то я ж блин из джаваскрипта могу вызывать foldRight, zipWith, andThen, filter, collect, map, и т.д. Сейчас буду переваривать этот факт.

Вот методы, которые я, похоже, могу вызвать:
Read more... )
P.S.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function mapFrom(map) {
  var out = {};

  var i = map.iterator();
  while(i.hasNext()) {
    var e = i.next();
    out[e._1()] = asJS(e._2())
  }
  return out;
}
juan_gandhi: (Default)
Как тут написал вчера один умный человек, в российской культуре главенствует садизм.

Ну конечно. Буржуазная революция тянется вот уже примерно 150 лет, никак не завершится. Конечно, маркиз актуален.

Вон тут этот, как его, Прилепин, отвечает же своим клеветникам, мол, ребята, Пётр Первый больше народу замочил, чем Сталин (русский вариант аргумента Годвина).

Мне это больше всего напоминает Философию в Будуаре.

Да и всё происходящее, весь этот безумный абсурд.

И если Гоголя рассматривать в аспекте его земляка Леопольда фон З.-М., то Башмачкин станет уже не таким уже и уникальным.

Короче, всё фигня. Добрых граждан забавят.

scala->js

Aug. 9th, 2012 01:08 pm
juan_gandhi: (Default)
 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
function arrayFrom(list) {
  var out = [];
  for (i = 0; i < list.size(); i++) { out[i] = asJS(list.apply(i)) }
  return out;
}

function mapFrom(map) {
  var out = {};

  var i = map.iterator();
  while(i.hasNext()) {
    var e = i.next();
    out[e._1()] = asJS(e._2())
  }
  return out;
}


function isListlike(name) {
  return name.indexOf("List") >= 0 || name.indexOf("Array") >= 0 || name.indexOf("$colon$colon") >= 0
}

function isMapLike(name) {
  return name.indexOf("Map") >= 0
}

function asJS(obj) {
  try {
    var cn = obj.getClass().getSimpleName();
    if (isListlike(cn)) return arrayFrom(obj);
    if (isMapLike(cn))  return mapFrom(obj);
  } catch (x) {}
  return obj;
}


critique?
juan_gandhi: (Default)
Как известно, пиццу делают круглую, режут её на треугольники и складывают в квадратную коробку.

Задача. Сделайте это оптимально. (Ну без фанатизма, не скатывая в шарик, к примеру - а просто нарезать на такие треугольники (минимальное количество), чтобы складывался почти квадрат).
juan_gandhi: (Default)
Написал Бараку про Пусей, чтоб повлиял на друга Вову типа. Вот что получил в ответ:

Dear Friend:

Thank you for writing. As President, it is my privilege to hear from Americans like you who take time to offer their perspective on the serious issues facing our Nation. I appreciate your message and value your input.

From putting Americans back to work to expanding access to medical care, my Administration continues to take bold action to do what is right for our Nation. We have enacted the most comprehensive financial reforms in decades, rescued and helped retool our auto industry, expanded student aid to millions of young people, helped level the playing field for working women, and made the largest investment in clean energy in our history. Because of the courageous acts of our service members, we have been able to end the war in Iraq and take down Osama bin Laden. We have also made historic commitments to provide for our troops as they return home. Securing our country’s future will take time, but I will not stop working to rebuild the kind of America where everyone gets a fair shot, everyone does their fair share, and everyone plays by the same rules.

I am always eager to hear ideas that will help our country adapt to changing times and lead us toward a brighter day. The enduring American spirit is revealed in the letters I receive, and I remain dedicated to ensuring it is reflected in our efforts to improve the lives of all Americans.

Thank you, again, for sharing your views. I encourage you to explore www.WhiteHouse.gov to learn more about the ways we are moving America forward.

Sincerely,

Barack Obama


Ну и кто он(и) после этого?

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

September 2025

S M T W T F S
 1 2345 6
78 9 10 111213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 15th, 2025 01:01 pm
Powered by Dreamwidth Studios