maasha

Activity Graph

Page 1 of 9 | Next »

2018-10-08

[18:02:49] maasha: has joined #ruby
[18:15:14] maasha: Sooooo, I am carrying around a database session object that is being passed to a ton of methods, I wonder if I can make it a module wide variable?
[18:27:45] maasha: baweaver: hm, I better try
[18:30:40] maasha: who needs details
[18:30:44] maasha: this is not C :o)
[19:16:02] maasha: Quit: Page closed

2018-10-06

[07:06:45] maasha: has joined #ruby
[07:07:53] maasha: I have an array of hashes. I want to create a new array with the first hash value for each hash?
[07:08:50] maasha: [{a: 1, b: 2}, {a: 3, b: 4}] => [1, 3]
[07:09:49] maasha: hash slice flatten?
[07:12:14] maasha: yeah, inject it was. This works ary.sort_by { |e| -1 * e[:score] }.inject([]) {|a, e| a << e[:relation] }
[07:13:13] maasha: some sort of Schwartzian transform ;o)
[07:14:03] maasha: :oD - but it is that structure
[07:15:35] maasha: apeiros: great! I love ruby golfing !
[07:54:43] maasha: Quit: Page closed

2018-09-12

[12:45:48] maasha: has joined #ruby
[12:46:53] maasha: I get a complaint from this: https://gist.github.com/iehdk/5c3071a428c98e47743acbd798c55f7a - uninitialized constant Atom
[12:47:23] maasha: and Atom is in module ChemOMactic::Entities::Atom - so ?
[13:12:32] maasha: Quit: Page closed

2018-08-21

[13:29:05] maasha: has joined #ruby
[13:30:24] maasha: Howdy, how do you freeze a docstring? MYDOCST = <<FOO; blabla; FOO ?
[13:37:06] maasha: apeiros: gotit
[16:33:24] maasha: Ping timeout: 252 seconds

2018-07-05

[12:42:43] maasha: has joined #ruby
[12:43:02] maasha: I forgot how to make ruby include gems in ~/.gem ?
[12:44:52] maasha: Bish: none set
[12:45:02] maasha: On Debian/Linux
[12:48:31] maasha: konsolebox: this is deep inside some docker image - so everything is a bit funky
[12:49:01] maasha: konsolebox: basically I have copied compiled gems from one image to another to reduce image size
[12:49:16] maasha: Bish: well, it is a Unix type OS :o)
[12:49:48] maasha: Bish: Debian could be Herd
[12:52:00] maasha: So gems are in /home/biodsl/.gems/ - I think I need to set some GEM_HOME or GEM_PATH env
[13:00:40] maasha: konsolebox: I am biodsl, but I get '`require': cannot load such file -- BioDSL (LoadError)'
[13:01:46] maasha: konsolebox: I did try GEM_HOME and GEM_PATH, but that didn't do the trick, perhaps that is specific to rvm
[13:06:30] maasha: konsolebox: yes, hmm
[13:08:26] maasha: konsolebox: yup, I want to reduce docker image size from ~800Mb. The goal is 130Mb (base image is 101Mb)
[13:09:51] maasha: konsolebox: this biodsl requires extensions to be build using gcc. I am most confident with Debian type systems.
[13:10:22] maasha: konsolebox: so I need the build-essentials packages and they are bulky
[13:26:46] maasha: konsolebox: that is exactly what I am working on. Got it to work even! Image is 287Mb, so still need to remove 50% if possible
[13:29:05] maasha: konsolebox: ah, well, I always go back to Debian for stability
[13:51:11] maasha: Quit: Page closed

2016-04-26

[07:18:25] maasha: has joined #RubyOnRails
[07:18:32] maasha: hi, do something exists in Rails that lets users construct forms?
[07:20:05] maasha: yeah, client users
[07:20:55] maasha: OK, what is the most simple and robust way to produce forms according to user specs?
[07:21:50] maasha: now that it appears users can't create forms on their own
[07:23:07] maasha: a rather generic collection of scientific data which is currently picked up in Excel sheets which is awful
[07:25:45] maasha: http://django-forms-builder.readthedocs.org/en/latest/
[08:07:54] maasha: Quit: Page closed

2016-01-28

[20:17:06] maasha: has joined #ruby
[20:19:02] maasha: I need help to produce an idiot-proof app to run on Windows
[20:19:08] maasha: hence my question here ... ;o)
[20:19:45] maasha: What are the options to create an app that can be run on Windows without having to install Ruby and all sorts of dependencies?
[20:21:02] maasha: jhass: yup, looks interesting. Anything else?
[20:22:24] maasha: jhass: ok
[20:23:09] maasha: Ox0deb: right
[20:23:17] maasha: What about shoes?
[20:24:24] maasha: Ox0deb: I will have to investigate :o)
[20:25:34] maasha: What shoes clone is the main stream one?
[20:25:36] maasha: http://shoesrb.com/ ?
[20:27:35] maasha: Ox0deb: shoes died several times IIRC
[20:28:43] maasha: jruby dependency
[20:29:32] maasha: headius: I prefere MRI
[20:31:28] maasha: headius: Its build on Java and Oracle destroyed Java?
[20:31:39] maasha: ACTION ducks
[20:35:34] maasha: ACTION runs
[20:36:39] maasha: .oO(Java rednecks)
[20:57:28] maasha: Quit: Page closed

2015-11-19

[09:14:14] maasha: has joined #ruby
[09:14:46] maasha: I am looking for a way to extract Yard documentation for specific classes and render in Github markdown, ideas?
[09:20:38] maasha: adaedra: indeed it should be possible, I was just looking to see if anyone knew before jumping though hoops
[09:45:57] maasha: Ping timeout: 246 seconds

2015-11-11

[19:08:37] maasha: has joined #ruby
[19:08:55] maasha: Can I get rake to skip a task if it was completed successfully earlier - like writing file.
[19:24:45] maasha: jhass: hm, how would a rule like that downloads a file, but only once?
[19:24:54] maasha: *look like
[20:14:55] maasha: Quit: Page closed

2015-10-22

[16:29:18] maasha: has joined #ruby
[16:29:42] maasha: Do anyone know if there is a Ruby gem for parsing text files and generate C++ code ala flex/bison?
[16:30:35] maasha: I need a C++ code generator - and for some stupid reason such are written in C or C++
[16:30:51] maasha: when makes it difficult and error prone at all levels.
[17:37:37] maasha: Quit: Page closed

2015-09-26

[09:06:26] maasha: has joined #ruby
[09:07:05] maasha: Hey, I am trying to grasp google hash - if you look at the last green box here: http://www.platanus.cz/blog/working-with-huge-hashes-in-ruby - it is pure coincidence that no collisions occur?
[09:38:43] maasha: Quit: Page closed
[14:02:00] maasha: I cant even find any bug reports on memory leaks in 2.2.3 maybe they are in japanese
[14:18:10] maasha: aaaaah https://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/
[14:27:34] maasha: stupid gc
[14:31:13] maasha: [k-: it pretty much describes the issue I have exactly
[14:32:22] maasha: [k-: I have a hash with 1.5M symbols as keys and true as value that I use to filter streamed records. Memory exceeds 6G in an hour
[14:32:51] maasha: so something is leaking
[15:36:16] maasha: Quit: Page closed

2015-09-25

[15:53:19] maasha: has joined #ruby
[15:55:12] maasha: I am experiencing what looks like a giant memory leak in ruby 2.2.3p173 - something leaks will querying a largish Hash a lot of times.
[16:17:21] maasha: Quit: Page closed
[18:11:30] maasha: has joined #ruby
[18:12:43] maasha: There appear to be a nasty memory leak in ruby 2.2.3p173 connected to Hash/Symbols ?
[20:37:34] maasha: Ping timeout: 246 seconds

2015-09-22

[07:48:21] maasha: has joined #ruby
[07:49:42] maasha: I am experiencing what appears to be a memory leak or a problem with GC. I am filtering huge amounts of strings using a hash lookup to pick candidates. Ruby 2.1.2p95
[07:50:01] maasha: Memory use exeeds 6Gb
[07:50:27] maasha: The hash is build from an ascii table ~60M and the data is streamed.
[07:54:13] maasha: yeah, I am compiling and reading what Sam Saffron has blogged on
[07:56:08] maasha: So I am also using Set and wonder if it may be better to use Google Hash where GC is disabled.
[08:11:51] maasha: Hm, Set is also 25% slower than Hash, really?
[08:19:27] maasha: apeiros: but that is a lot of overhead :o(
[08:20:15] maasha: apeiros: I would expect it could be optimized to run at the same speed as Hash?
[08:21:04] maasha: apeiros: hm, wonder if that is a feature request @ rubylang?
[08:22:50] maasha: apeiros: I wonder if I could.
[08:23:35] maasha: apeiros: how wise
[08:28:01] maasha: apeiros: looking at the source in set.rb it looks sort of OK, until you get to SortedSet
[08:29:21] maasha: apeiros: of cause it is all ruby, and would benefit from using the C API
[08:37:55] maasha: Ping timeout: 246 seconds

2015-09-18

[12:09:11] maasha: has joined #ruby
[12:09:41] maasha: if it possible to traverse a tree with a recursive each method?
[12:13:55] maasha: Ping timeout: 246 seconds

2015-09-02

[11:30:14] maasha: has joined #ruby
[11:31:31] maasha: what is the better way of doing: str[10..20] = str[10..20].upcase! ?
[11:31:38] maasha: (I forgot)
[11:34:36] maasha: Ox0dea: oh, year never mind the bang. So how many str copies will be made this way?
[11:34:49] maasha: I strikes me as terribly inefficient
[11:35:14] maasha: apeiros: sure
[11:37:25] maasha: right, so using [] this way how many temporary arrays are created behind the scene?
[11:38:30] maasha: so c arrays
[11:41:56] maasha: ok, so the slice creates a temporary String object?
[11:43:16] maasha: Ox0dea: so I can safely assume that this is quite efficient.
[11:43:54] maasha: Ox0dea: always suspicious :o)
[11:44:17] maasha: apeiros: ruby is actually quite ok with a bit of inline C here and there.
[11:45:54] maasha: right, thanks, back to hacking ...
[12:44:07] maasha: Quit: Page closed

2015-08-19

[10:18:46] maasha: has joined #ruby
[10:19:14] maasha: How do you check the if the mode of a unix file is 640 in Ruby?
[10:19:42] maasha: File.stat can do certains things ...
[10:27:25] maasha: wow, rsync is stupid
[10:28:05] maasha: or rather, the chmod syntax is convoluted big time
[10:43:27] maasha: anisha: hm, a file with -rw-r--r-- == 644 permissions and .mode & 0777 returns 420?
[11:20:32] maasha: Quit: Page closed

2015-08-18

[08:24:16] maasha: has joined #ruby
[08:25:30] maasha: I have a method: def size; @node_id; end that rubocop doesn't like -> trivial accessor warning - should be resolved with attr_reader. Now what is the best way to do that?
[08:26:19] maasha: something with an alias perhaps
[08:28:25] maasha: adeponte: it may, but there is likely a point
[08:30:53] maasha: attr_reader :size, :node_id; alias_method :size, :node_id
[08:31:06] maasha: works and without warnings.
[09:34:14] maasha: Quit: Page closed

2015-07-06

[08:49:57] maasha: has joined #ruby
[08:51:07] maasha: I am running mpiexec from a ruby script using a system call. Unfortunately the system call returns successfully before the actually mpi execution is complete. How to properly wait for that?
[08:53:18] maasha: Ox0dea: the ruby script should not continue until the mpiexec is done
[09:11:50] maasha: Ox0dea: so I am running a 1 core ruby script here that starts a mpi job on some thousand cores. When that job is done the ruby script should continue.
[09:12:34] maasha: Ox0dea: yes, I can't seem to find a clean solution either
[09:13:44] maasha: Ox0dea: exactly. So how to do this?
[09:13:55] maasha: Ox0dea: or maybe mpi have some magic.
[09:26:03] maasha: grmruu#%&!mph!!!! s/supercomputer/super stupid computer/
[09:26:24] maasha: "Computer: Kill Flanders"
[09:26:31] maasha: I mean - how hard can it be?
[09:28:59] maasha: Ox0dea: process table on which nodes ?
[09:29:30] maasha: Ox0dea: hm, right.
[09:30:43] maasha: -report-pid looks like it
[09:34:40] maasha: Ox0dea: yup, I am working on it.
[09:39:35] maasha: Ox0dea: Unfortunately, these supercomputers are shared :o(
[09:40:34] maasha: Ox0dea: it is run from the login node.
[09:41:26] maasha: Ox0dea: yes
[12:55:40] maasha: Quit: Page closed

2015-07-03

[18:51:48] maasha: has joined #ruby
[18:56:37] maasha: Generic computer science question: Is there a described standard way of dealing with parantheses when evaluating expressions?
[18:57:21] maasha: I am going to write a parser for some pattern matching logic involving regex type operators and modifiers including logical operators.
[18:58:09] maasha: wasamasa: I was thinking of a clear system of reducing parans (or whatever it is called when you remove redundant parans)
[18:59:32] maasha: wasamasa: ok, so what rules does the compiler follow and is there an easy read on that topic?
[19:01:34] maasha: wasamasa: I guess to. I am just beginning researching this. I am going to look at compiler compilers - like YACC - but maybe that will just kill you :o)
[19:04:56] maasha: wasamasa: right. I kinda dig reverse polish notation since it eliminates parens. I fear there are several ways parens can be dealt with and you end up with monolithic blobs of evil.
[19:20:55] maasha: Quit: Page closed

2015-06-26

[12:17:13] maasha: has joined #ruby
[12:20:21] maasha: Anyone have experience executing a ruby script through qsub from within the ruby script?
[12:22:30] maasha: jhass: yup, but qsub is ugly. I want it abstracted away to you call a ruby script with a few arguments and behind the scene this ruby script is run through qsub.
[12:23:26] maasha: And I dont want to maintain multiple scripts to run a command.
[12:25:01] maasha: shevy: can you show a demo?
[12:30:24] maasha: shevy: and how does the .run method work?
[12:32:54] maasha: shevy: right, thanks
[13:56:49] maasha: Ping timeout: 246 seconds

2015-06-25

[10:03:14] maasha: has joined #ruby
[13:40:02] maasha: Iterate over all odd numbers from 11 to 99 ?
[13:41:24] maasha: (3..7).reject(&:even?)
[13:41:30] maasha: will have to do :o)
[13:47:44] maasha: gotit thanks
[15:05:31] maasha: Ping timeout: 246 seconds

2015-06-23

[12:59:40] maasha: has joined #ruby
[13:00:28] maasha: So hash keys are default in the input order. Can you insert a new key/value pair after a particular key?
[14:28:37] maasha: Ping timeout: 246 seconds

2015-06-11

[08:09:06] maasha: has joined #ruby
[08:09:18] maasha: what is the latest active shoes project?
[08:10:05] maasha: greenshoes?
[08:10:51] maasha: shoes4 requires jruby :o(
[08:11:27] maasha: ponga: if you fail with shoes it is pretty bad :o)
[08:12:17] maasha: .oO(nuts)
[12:31:01] maasha: Can you include instance methods to a class from outside the class? https://gist.github.com/maasha/57826c5e54b6b8852c1b
[12:31:46] maasha: _from outside_ ?
[12:32:35] maasha: ljarvis: this works. thanks
[14:04:58] maasha: Ping timeout: 246 seconds

2015-05-27

[07:35:52] maasha: has joined #ruby
[07:38:08] maasha: When calling a method using hash arguments, is there any way to check for duplicate keys?
[07:38:45] maasha: method(foo: 23, foo: 34) => warning -> you are stupid
[07:39:15] maasha: apeiros: hm, somehow I am missing that.
[07:40:48] maasha: apeiros: how can I raise an exception on this warning?
[07:41:11] maasha: never mind about the receiver side
[07:44:37] maasha: apeiros: ok, I better think this over. Thanks
[07:48:41] maasha: And now to something completely different. Do we have a tool to compare two ruby-profs?
[09:58:35] maasha: Rakefile issue: I would like to have `rake simplecov` require simplecov before running unit tests. However, this dosn't run the tests: https://gist.github.com/maasha/3d59df2ae117b2ffd62d
[09:59:44] maasha: there is a typo, but that is not the reason. lemmy fix this gist.
[10:12:59] maasha: ljarvis: like SimpleCov.start on l 44?
[10:13:26] maasha: ljarvis: it seems to be troubling others as well: https://github.com/colszowka/simplecov/issues/37
[10:39:41] maasha: I dont get it. rake test runs the test suite ok, rake simplecov appears to do nothing: https://gist.github.com/maasha/3d59df2ae117b2ffd62d
[10:40:31] maasha: I can even comment out line 41
[11:29:50] maasha: stupid rakefile
[11:30:18] maasha: ACTION pissed off, huge, green and superstrong
[11:31:07] maasha: http://www.howardandrewjones.com/wp-content/uploads/2015/02/hulk-computer.jpg
[14:16:03] maasha: So why is it that `rake test` works and `rake simplecov` simply exists? https://gist.github.com/maasha/d50da68852778771b41c
[14:19:24] maasha: jhass: yeah maybe: https://gist.github.com/maasha/d50da68852778771b41c
[14:20:59] maasha: jhass: gitst updated with -P and -T output
[14:30:54] maasha: jhass: right, thanks. I need to study rake files further.
[14:33:36] maasha: jhass: it works, but I need to understand why -> reading. Thanks again!
[14:37:58] maasha: Ping timeout: 246 seconds

2015-05-20

[11:26:35] maasha: has joined #ruby
[11:27:24] maasha: Is there a more clever way to do this?: value = value.to_sym if value.is_a? String
[11:38:02] maasha: adaedra: but if the value is nil or Fixnum ...
[13:40:55] maasha: Ping timeout: 246 seconds

2015-05-19

[07:25:25] maasha: ACTION have high hopes for rubinius.
[07:26:00] maasha: apeiros: how come?