juan_gandhi: (VP)
How many even numbers do you need so that their product is odd?

1) With integer numbers
2) With integer complex numbers
juan_gandhi: (VP)
/**
 * A marker interface for classes that have no data inside
 * Meaning, two instances are equal if they have the same class
 */
public interface JustCode extends Serializable {
}
...
public interface Function<X, Y> extends JustCode {
  Y apply(X x);
}
...
public interface Function2<X, Y, Z> extends JustCode {
  Z apply(X x, Y y);
}
...
  
  public int hashCode(JustCode x) {
    return x == null ? 0 : x.getClass().hashCode();
  }

  public boolean equal(JustCode x, JustCode y) {
    return x == null ? y == null : y != null && x.getClass() == y.getClass();
  }



No shit, just discovered this kind of data.
You've probably noticed that I kind of prefer S to OOP. :)
juan_gandhi: (VP)
20 year from now Java will have monads!

juan_gandhi: (VP)
"Hi Vlad,

I hope the year has started well for you. I just wanted to reach out because your old resume fits companies that I work for. Are you still working on the same types of projects? I work with small tech shops, one company in particular that I am very excited about has been founded by a CEO that has 15 exits and 10 IPO’s. Not only that, but we also work with some bigger ones, like Dropbox.

Let me know if this interests you at all. If not let’s keep in touch in case you ever need anything, since things always tend to change in the crazy Bay Area."

"Hi Pedro,

Yes, I'm working on the same types of projects as before, with variations.

I just did not exactly get it, you are asking me if this interests me at all - what is "this"? I see you are very excited, that's good for a while, but dangerous in the long run, probably. Getting more sober and specific would help a lot."

"Hi Vlad,

Great to hear from you and thanks for the feedback! I mentioned that I work with some shops and wanted to know if you are interested in knowing more about them in case you were looking for something new. I am very excited but I only use that excitement in certain situations, only when necessary of course. Let me know if you are interested in new job opportunities in the bay area. I’d be more than happy to help out."

(probably meaning he does not have anything, but wants to sell me)
juan_gandhi: (VP)
Короче, есть, скажем, пять вопросов для экзамена, каждый в нескольких вариантах; задача - изготовить варианты, чтобы они максимально различались. Ну типа всех возможных будет 55, а мне надо 27, ну вот взять первые 27 из таких.

С таким смаком навалял это на скале. Типа такого:

    def findFurthest(current: List[Index])(collection: List[Index]) = collection.map(i => (distance(current)(i), i)).max(order)._2

    def sortByDistance(source: List[Index], target:List[Index] = Nil): List[Index] = source match {
      case Nil => target
      case more => {
        val furthest = findFurthest(target)(source)
        sortByDistance(source.filterNot(furthest==), furthest::target)
      }
    }

    val sorted = sortByDistance(allIndexes).reverse

fun/fuck

Sep. 9th, 2012 11:45 pm
juan_gandhi: (Default)
JavaScript/Scala
Read more... )

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 91011121314
15161718192021
22232425262728
2930     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 10th, 2025 01:40 am
Powered by Dreamwidth Studios