May. 21st, 2015

juan_gandhi: (VP)
12 копов было убито в Сан Хосе. С 1858-го года (Карл).
juan_gandhi: (VP)
А вот мне что-то кажется, что если Путина свергнуть, то наступит такой Айсис, ака ИГИЛ, что о нем будут вспоминать с ностальгиею.
juan_gandhi: (VP)
no time to investigate right now
      val meta = conn.createStatement().executeQuery(s"select * from $table limit 1").getMetaData
      val allNames = 1 to meta.getColumnCount map (i => meta.getColumnName(i) ->(meta.getColumnType(i), meta.getColumnDisplaySize(i))) toMap
      val filteredContent: TraversableOnce[String Map String] = content map (_.filterKeys(allNames.keySet.contains))
      def dataHasColumn(name: String) = {
        filteredContent.forall(_.contains(name))
      }
      val goodNames = allNames.filterKeys(dataHasColumn)
      val gnset = goodNames.toSet
      val nt2 = goodNames.toList // TODO(vlad): investigate this horrible bug (patient_sec is the table)
      val namesAndTypes: List[(String, (Int, Int))] = gnset.toList

      if (nt2.length > namesAndTypes.length) nt2 else namesAndTypes


In short, a map has 7 entries, but at some moment it returns a list of just 6 entries; results depends god knows from what.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 21st, 2025 06:25 am
Powered by Dreamwidth Studios