consti

Activity Graph

Page 1 of 1

2018-05-15

[06:06:45] consti: has joined #ruby
[07:42:21] consti: Quit: consti
[07:43:36] consti: has joined #ruby
[07:45:10] consti: Client Quit
[08:16:45] consti: has joined #ruby
[08:16:49] consti: Client Quit

2018-01-24

[15:32:14] consti: has joined #ruby
[16:55:22] consti: Quit: consti

2018-01-23

[03:21:59] consti: has joined #ruby
[04:41:55] consti: Quit: consti

2017-12-21

[16:21:05] consti: has joined #ruby
[16:28:40] consti: Quit: consti
[16:32:23] consti: has joined #ruby
[17:52:09] consti: Quit: consti

2017-10-14

[09:58:32] consti: has joined #ruby
[11:00:12] consti: Quit: consti

2017-10-13

[13:43:18] consti: has joined #ruby
[17:34:15] consti: Quit: consti

2017-10-12

[01:22:16] consti: has joined #ruby
[01:54:27] consti: Ping timeout: 240 seconds
[01:59:08] consti: has joined #ruby
[02:00:05] consti: Client Quit
[03:25:48] consti: has joined #ruby
[03:34:56] consti: Quit: consti
[03:52:07] consti: has joined #ruby
[03:57:02] consti: Ping timeout: 260 seconds
[04:01:25] consti: has joined #ruby
[04:06:35] consti: Ping timeout: 240 seconds
[04:24:50] consti: has joined #ruby
[09:14:25] consti: Quit: consti

2017-10-11

[06:57:14] consti: has joined #ruby
[19:02:12] consti: Quit: consti
[19:03:58] consti: has joined #ruby
[19:08:27] consti: Ping timeout: 240 seconds
[19:11:43] consti: has joined #ruby
[20:02:56] consti: Quit: consti
[22:18:31] consti: has joined #ruby
[22:21:00] consti: Client Quit
[22:41:54] consti: has joined #ruby
[22:43:18] consti: Client Quit
[23:12:27] consti: has joined #ruby
[23:26:52] consti: Quit: consti
[23:37:01] consti: has joined #ruby
[23:46:17] consti: Quit: consti

2017-10-10

[03:14:34] consti: has joined #ruby
[04:31:45] consti: Quit: consti

2017-10-09

[09:16:28] consti: has joined #ruby
[09:17:21] consti: Client Quit
[09:17:44] consti: has joined #ruby
[11:03:15] consti: Quit: consti

2017-10-02

[02:18:38] consti: has joined #ruby
[02:28:37] consti: Quit: consti

2017-09-30

[06:04:10] consti: has joined #ruby
[06:43:13] consti: Remote host closed the connection
[06:43:25] consti: has joined #ruby
[09:46:03] consti: Ping timeout: 258 seconds
[09:46:31] consti: has joined #ruby
[09:49:06] consti: Read error: Connection reset by peer

2016-07-15

[10:46:45] consti: has joined #ruby
[11:42:27] consti: Quit: Textual IRC Client: www.textualapp.com

2016-06-29

[09:11:28] consti: has joined #ruby
[16:49:21] consti: Quit: My MacBook has gone to sleep. ZZZzzz…

2016-06-18

[07:09:19] consti: has joined #ruby
[09:12:34] consti: Quit: Textual IRC Client: www.textualapp.com

2016-06-14

[08:32:49] consti: has joined #ruby
[08:55:40] consti: Quit: Textual IRC Client: www.textualapp.com

2016-01-29

[13:18:57] consti: Quit: Textual IRC Client: www.textualapp.com

2016-01-28

[05:32:56] consti: has joined #ruby

2016-01-22

[05:49:52] consti: Ping timeout: 250 seconds

2016-01-21

[09:23:33] consti: has joined #ruby

2016-01-20

[05:30:03] consti: Quit: Textual IRC Client: www.textualapp.com

2016-01-19

[09:01:43] consti: has joined #ruby

2015-12-23

[03:05:54] consti: Quit: Textual IRC Client: www.textualapp.com

2015-12-22

[11:53:44] consti: has joined #ruby

2015-10-05

[07:40:53] consti: has joined #ruby
[09:10:05] consti: Quit: Textual IRC Client: www.textualapp.com

2015-03-23

[09:02:28] consti: Hi! I'm trying to build json on CentOS 6; I get the following error: https://gist.github.com/anonymous/a837d5ac22486bb2a79a (/usr/bin/install: cannot stat `generator.so': No such file or directory)
[09:03:28] consti: I'm not even 100% sure if #ruby is the right channel for this :) ??? what's the best procedure to figure out what is really missing on my OS?
[09:05:58] consti: hanmac1: thanks!
[09:06:30] consti: avril14th: I'll look if I can fix it with hanmac1's comment - otherwise I'll go check #centos :)
[09:07:36] consti: hanmac1: you mean my rvm setup might be broken?

2014-07-26

[08:36:20] consti: whats the best pattern to solve the following issue: When a User signs up, he can create a new Location - if that Location already exists, he should use that Location (but he should not be able to change the Locations attributes). If a Location has no more users, it should be destroyed.
[08:38:33] consti: In User, I've: belongs_to :location; and accepts_nested_attributes_for :location. I've tried to solve the problem of 'duplicate' Location creations in User before_validation: user.location = Location.where(unique_place_id_i_get_from_google_maps: user.location.unique_place_id_i_get_from_google_maps).first_or_initialize
[09:12:41] consti: apeiros: thanks.. but that doesn't solve the problem. where(place_id: xxx).first_or_create will screw up my counter_caches. I'm really getting a little mad here. I planned to spend 30 minutes on 'fixing that little annoiance' and now I've screwed most of the things up and will probably do a git reset --hard ;)
[09:13:31] consti: apeiros: https://github.com/consti/ahsg/blob/master/app/models/user.rb#L45-L52
[09:32:03] consti: Ah.. the counter_cache thing is a problem in rails
[09:32:31] consti: setting an associated model (and _not_ saving it yet) will decrement the counter_cache.

2014-07-04

[04:40:15] consti: hi! I'm refactoring some code and have a snippet in the controller where I receive json data (as a params), which I split up and assign to variables. it's 4 loc and I'm not sure if I should move that somewhere else (if yes, where? would that be a module?) thanks!
[04:41:13] consti: or, better question: do you guys know of a good refactoring guideline? ;)
[04:44:19] consti: probably not.. you are right
[04:44:33] consti: I think I'm taking this too serious and spend too much time on details ;)
[04:46:14] consti: I've another thing: I've a Device model that can receive push notifications (iOS). That logic was in the controller, I moved that into Device#receive_push_notification. Would you move that into the Device class or in its own PushNotification class?
[04:46:27] consti: quazimodo : that sounds logical
[04:48:00] consti: quazimodo: no logic before assignment - so I'll just keep these in the controller. moving out the push notifications made sense.
[04:51:32] consti: quazimodo: yes :)
[04:59:23] consti: quazimodo: thanks!

2014-04-22

[10:14:49] consti: Hi! I've multiple items with GPS data and a timestamp. I'm trying to figure out a structure where I can group these items by their GPS coordinates and a time 'bucket': I've 4TB of photos from camera traps out of a jungle and I need to group them into time buckets (e.g. a lion runs by and we have 20 pictures of that, within a certain time range).
[10:17:37] consti: I can't figure out a good way to do that: right now I've created a model called CameraEvent (has_many photos) with uniqueness on a scope of latitude, longitude, hour_since_beginning_of_time (or something similar). That would at least group the images into hourly buckets for each lat/lng. But that's ugly and not really what I want. Does anyone have an idea how I could do that?
[10:19:25] consti: workmad3: that might be the right tool for the job. I've not worked with elasticsearch yet, but I'll look into it. thanks!
[10:22:09] consti: workmad3: that's pretty cool. But my main issue is something like 'auto-grouping'. I'm importing massive amounts of photos and need them to automagically group into 'events'. I set a threshold (like 10 minutes) and for all images that have been taken within that threshold at the same location I want a collection 'CameraEvent'.
[10:26:18] consti: workmad3: mh.. at the end of the day (literaly speaking, since that should go live tomorrow ;) ) I need a list of all events within a threshold (that doesn't have to be dynamic) and the collection of photos of each event.
[10:29:21] consti: workmad3: until tomorrow I'll only have to import a couple of species ;) (I'm running exiftool to extract/group the raw images into the species folders right now in the background.. I hope that's going to be finished until I'm done with the site). But yes, it's a short deadline. you'll probably see me on IRC for the next 20h! ;)
[10:47:03] consti: workmad3: wow! thanks!
[10:47:43] consti: workmad3: looking through it now, thanks!
[10:49:59] consti: workmad3: ah! that's so much more clever than my approach. I didn't think about adding two time ranges (start and end) into the model. I only added one (something like (time.to_i/3600)*3600 as the_hour)
[10:52:15] consti: workmad3: thanks! after importing the specific species for tomorrow, I'll have more than enough time to import the rest. unfortunately the uploading to S3 and resizing will take most of the time.
[10:52:53] consti: workmad3: will you hang around here later? I'll get things done and then would love to send you some bitcoin for beer or two (it that's your thing ;) )
[10:53:43] consti: workmad3: unfortunatly I don't. but maybe I'll come up with a way to extract that data from the raw files..
[10:55:07] consti: workmad3: no. just raw image files with a creation date (and exif data that hopefully includes GPS - some of the files don't).
[10:55:36] consti: workmad3: and the species_name_english in a invalid UTF8 user comment ;)
[10:58:27] consti: workmad3: did I mention that I'm doing this pro-bono? ;)
[11:01:27] consti: workmad3: I'll store the location within the event. unfortunately the cameras will move in different seasons
[11:02:00] consti: workmad3: I also named the 'event' class Event instead of CameraEvent
[11:02:36] consti: workmad3: location is two floats: latitude and longitude
[11:02:54] consti: workmad3: ok. you are right ..
[11:04:22] consti: workmad3: I _had_ a scaffold for CameraEvent (based on the exif data of some pictures.. some of the cameras did create sequences and events on their own.. but I had to learn that they misconfigured the cameras to only count something as an event as long as it was less than 3 photos.. so that didn't work)
[11:05:40] consti: workmad3: what's the best type for end_time/start_time (migration)? I went with date earlier - but now I'm not sure?
[11:32:06] consti: workmad3: thanks! (sorry, was afk)

2014-03-30

[14:35:14] consti: I have a named scope: scope :previous ->(id) do where("id < :id", id: id) end
[14:35:50] consti: I expect MyModel.previous(1) to return nil, just like MyModel.where("id < 1")
[14:35:59] consti: but it returns MyModel.all instead. What am I doing wrong?
[14:36:32] consti: * actually named scope is: scope :previous ->(id) do where("id < :id", id: id) end
[14:36:39] consti: * actually named scope is: scope :previous ->(id) do where("id < :id", id: id).first end
[14:37:06] consti: and I expect it to be the same as MyModel.where("id < 1").first
[14:37:52] consti: thanks, sorry. Thought I'd manage in my first try ;)
[14:40:43] consti: https://gist.github.com/consti/9873668
[14:45:29] consti: Got.. it. Scopes should be chainable. No .first in a scope. Thanks!
[16:42:42] consti: Hi! Is there any way to have an object, set some attr_accessor and then return the object (and return nil, if object is nil), in one line?
[16:43:53] consti: ACTION Something like this (using ActiveRecord from Rails in that case, but that's not important):Object.all.first.send(:my_accessor=, other_my_accessor).return_the_object
[16:44:40] consti: Something like this (using ActiveRecord from Rails in that case, but that's not important): Object.all.first.send(:my_accessor=, other_my_accessor).return_the_object
[16:51:04] consti: jhass: ah right.. I used that somewhere but forgot ;) thanks!

2014-03-29

[23:21:11] consti: Hi! What's the best practice to get a 'next' / 'previous' scope for nested resources? (E.g. cameras/1/photos/82 -> next would be cameras/1/photos/86 since photos with ID 82 and 86 belong to camera 1)
[23:28:23] consti: morenoh149: Photo belongs_to :camera, Camera has_many :photos; So there could be (and will be) multiple photos in between the different IDs that belong to other cameras (the last integer in the URL is the ID of Photo).
[23:33:27] consti: morenoh149: I thought there might be a best practice. You would think more people run into that 'issue' with nested resources. categories/5/posts/9 (how to I link to the next post within the same category?)
[23:36:20] consti: morenoh149: sure.. mh. I'll figure out a solution, but I thought there might be a best practice (or maybe I'm doing something completely wrong with my nested resources anyway.. ;) )