« first day (941 days earlier)      last day (2314 days later) » 

1:49 AM
11
A: Search just code

Some Helpful CommenterAs lunboks notes you can search code blocks with the code: search term. e.g. code:"new" So you should be able to use user:me code:"new" to find what you're looking for. It doesn't appear to search bodies or titles, but I couldn't find any documentation for it.

 
 
4 hours later…
6:16 AM
I'm wondering if it would be perceived as a good thing if I said I left the previous place because I was looking for a place where I could work on improving my personality.
 
 
2 hours later…
8:18 AM
hi guys i want to develop a website that is used for crowd funding. is it wise to use ruby developed application for crowdfunding(open source web projects)?
 
8:51 AM
Why not?
 
do you know any best opensource application that i can use for the same @JanDvorak
 
 
5 hours later…
1:40 PM
@WaseemAkram Ruby is excellent for writing web apps. I think that most web apps can be driven by a Ruby web server and be profitable, if they are going to be.
 
@WaseemAkram That's way too broad. It's like asking if steel is a good material to build things in
Realistically you should use the tools you're already familiar with, if your goal is to build and ship a product
If you're a developer looking at which technology to learn next, Rails is a good candidate
If you're not a developer, then Ruby is the wrong choice. Ruby on Rails is not a CMS that you can do minimal customization/styling work on and have a more or less working product.
 
@meagar That's an excellent answer.
 
Thanks :)
I'm using a lot of Ember these days, and I miss Rails
 
I'm interested in visual programming languages. Any experience, which one should I learn? Goal: for fun, criteria: freeware, turing-complete (and not a tarpit) or at least general purpose, high-level
I like the node editor in Blender
A good programming game is also welcome, but I've already played most of the freeware ones, at least of what I know
 
2:00 PM
I've only played briefly with Scratch, VPL (Microsoft Robotics), and Lego Mindstorms
 
Scratch seems a bit low-level, though I did use it a bit as a turtle
 
Watched its presentation at the Emerging Languages Camp 2010 at OSCON.
Looks really nice.
 
I'll take a look, thanks
 
2:04 PM
VPL/Mindstorms are only fun if you have the hardware
 
I've already completed Colobot, or at least the version I had available
functional programming game sounds great
 
cube composer is neat
 
Hope all are doing well!
 
I'm at 4.1 and moving
 
2:20 PM
Actually want to change the status of Invoice records from from the front end in ruby on rails. when it is in missing state , toggle to present and so on.
 
4.3 was fun
 
def update

if @invfolup.update(invfolup)
flash[:notice] = 'Invfolup Updated'
if request.xhr?
render json: true
else
redirect_to '/invfolups/:id'
end
else
if request.xhr?
render json: false
else
render 'edit'
end
end
end
<tr class="tr-<%= cycle('odd', 'even') %>">

	<td class="col-1"><%= invfolup.invno %></td>
	<td class="col-1"><%= number_to_currency(invfolup.amount, :unit => 'AED ', :delimiter => ",", :precision => 0) %></td>
	<!-- <td class="col-1"><%= link_to invfolup, invfolup %></td> -->

	<% if invfolup == "MISSING" %>
	<td class="col-1"><span onclick: "changeStatus(this)", data: { id: invfolup.id }><%= invfolup.status %></span></td>
	<% else %>
	<td class="col-1"><span onclick: "changeStatus(this)", data: { id: invfolup.id }><%= invfolup.status %></span></td>
window.changeStatus = function(e) {
e.preventDefault();
var id = $(e.target).data('id');
$.ajax({
type: 'PUT',
url: '/invfolups/' + id,
dataType: 'script',
data: { invfolup: { status: 'PRESENT' } }, // add params here
success: function (data) {
// whatever you return from server will be inside data variable
$(e.target).text("PRESENT")
});
}
where is the mistake? it is not changing the status? any views please share!!!
 
I don't even know why my solution to the last level works but it does...
Ok, gotcha
 
@MuhammadYaseen can you put it in a gist or something? It is hard to read like this.
 
how do i do that?
 
2:25 PM
@MuhammadYaseen gist.github.com
 
 
1 hour later…
3:29 PM
Good morning, all.
 
Morning!
 
Morning Wayne
 
Good morning, good to see you.
 
 
2 hours later…
5:13 PM
good afternoon :D
 
Hello Jared, Marc, everyone.
 
6:08 PM
hi there, someone knows how to access with mongoid to the friendlist array in this bson?
>>

current_user

=> #<User _id: BSON::ObjectId('57a4df6927d8754bd68aaade'), contacts: [{"_id"=>BSON::ObjectId('57a4df7a27d8754bd68aaadf'), "created_at"=>Fri, 05 Aug 2016 18:48:26 UTC +00:00, "friendlist"=>[BSON::ObjectId('57a4df6927d8754bd68aaade'), BSON::ObjectId('5790f58a27d8757b4ff547fd'), BSON::ObjectId('5790f43727d87576358ae575')], "owner"=>"57a4df6927d8754bd68aaade", "updated_at"=>Fri, 05 Aug 2016 18:48:26 UTC +00:00}], created_at: Fri, 05 Aug 2016 18:48:09 UTC +00:00, email: "testauth@myApp.com"
 
6:22 PM
@MarcosR.Guevara Hello, welcome.
 
oookay hi everyone
so who here remembers the whole discussion i had a while back regarding rewriting a giant rails application into elixir, etc.. ?
 
wasn't that just like Friday or something?
 
I remember it (strange words coming from me, I know).
 
well.. we have finally reached a decision. and the decision is as follows: NO WAY
 
6:24 PM
@CuddleBunny For me, Friday is a long time ago :)
@Nima No rewrite at all?
 
@Nima in my place you would have been fired for making that decision.
 
basically it came down to this:
elixir is great, everyone loved it. it has many features superior to ruby.
BUT. the eco system is seriously immature.
 
As in, you didn't suggest anything that actually got implemented
 
once we actually started looking more into it, we realized a lot of stuff are basically missing, deployment tools are nowhere near as we want it to be. some of our core libraries that we are using for our business are missing (especially Geolocation) stuff
 
@JanDvorak That sounds like a... well, kind of nasty place to work.
 
6:26 PM
no no..
we would essentially have to reinvent the wheel for those missing libraries AND do a full rewrite ..
 
@Nima What were the other suggestions on the table?
 
Scala, Go
 
What caused those proposals to fail?
 
It's not as extreme, but one of the arguments they did have was that I hadn't come up with good ideas - and a rewrite was used as an example of a ridiculous one
 
they didnt fail.. elixir just won the popularity contest
 
6:28 PM
So Elixir was the only one that was seriously considered?
 
ironically what ended up happening is that everyone voted on: Not even considering elixir until phoenix framework reaches version >= 3.x stable ..
 
What is its current version?
 
1.x
i think 1.2
way too immature for our taste..
 
It's odd to pick a specific number, because projects put different meaning in version numbers.
For example, if the project were doing semantic versioning, then major version numbers could be incremented for quite small changes.
 
well.. the idea was that by the time they reach version 3 (semantic versioning) .. the ecosystem would have matured for us to re-evaluate..
right
 
6:31 PM
Hmm. Well, OK.
 
i guess the general idea here is to make the move when its reached a certain level of maturity ..
hopefully it will get there by 3.x
at least rails did..
 
Anyhow, it sounds like a good decision for your team. Just be glad you don't work at @JanDvorak's company ;)
 
using rails prior to 3 was painful ..
IMO..
 
I used Rails prior to 1. I don't know if it was painful, but not having Rails at all sure was painful. We were happy to jump on that alpha.
 
.. even when the eco system was basically non existent?
 
6:34 PM
Yes. Because cgi was really painful.
 
oh yea.. lol
 
12 hours ago, by Jan Dvorak
I'm wondering if it would be perceived as a good thing if I said I left the previous place because I was looking for a place where I could work on improving my personality.
 
our current situation is different i guess..
jumping to phoenix 1.x from rails 4.2 .. sounds really insane ..
 
Jumping to anything might be insane, but we talked about that last week.
 
yea lol
but long story short, we will keep a close eye on phoenix. most likely even use it for smaller internal projects to get the feel of it
i feel like at this point rails is really here to stay.. given its track record: Github, Basecamp, AirBnb, Shopify, ...
it has been battle tested IMO
 
6:40 PM
Can't overstate the value of that
And the things that come with it: A huge ecosystem of tooling to help deploy, monitor and scale
 
right
at the end i think we dodged a serious bullet .. this rewrite would have destroyed us
 
The Ruby ecosystem is the best that I have seen so far (rbenv/rubygems/bundler/herokuo/etc.). I think some of the other modern languages do or will soon have ecosystems that awesome, but I haven't seen them yet.
 
i think what is gonna happen now are 3 things:
1. given the enthusiasm of devs.. execs will allows fridays to be spend on playing with elixir
2. instead of a full rewrite, will be hiring another devops team to properly scale this
3. will be slowly refactoring and breaking the giant monolithic app to bunch of smaller ones and move to SOA
:)
 
microservices time?
 
6:47 PM
seems to be moving in that direction
i frankly rather than a full rewrite ..its less risky
 
Martin Fowler, I think, has some articles on enterprise-scale refactoring using microservices, introducing them in a controlled fashion without any rewrites or outages.
I do know that the happiest days of my career involved gentle little steps towards some goal. The worst days involved giant leaps.
 
Except when you're doing olympics
 
lol @JanDvorak
 
@JanDvorak another tastier visual programming language: youtube.com/watch?v=LhWkR0nUd1A
 
6:59 PM
Gives me diabetes :-)
 
@CuddleBunny I... um... what was that advertising?
 
@WayneConrad an augmented reality visual programming app, ingeniously designed to teach your children to program using perishable items
 
I'm torn between disgust and awe.
 
The ultimate goal is to introduce them into code bowling so that they can eat as many tokens as necessary.
 
What a strange world we've created.
 
7:05 PM
We didn't start the fire.
 
I just logged on now and reading the last 5-7 lines was strangely hilarious...
@Nima Wow, I see. So the team is going work on optimizing the codebase instead?
 
yea
lol
@Blueshift ... lol.. what was hilarious about it?
out of curiosity
 
7:21 PM
Well introducing children to code by bowling stuff just feels sort of wrong somehow, and the comments around that were just funny/a little sarcastic. I found it awesome
 
oh yea lol
@Blueshift .. we wont be dumping elixir entirely though.. will evaluate again once phoenix reaches 3.x
 
If they keep up with the current pace, then that shouldn't be an "in the far future" type of thing @Nima
 
yea.. i know, i guess the idea is keep evaluating the maturity of ecosystem / deployment tools
 
BTW, I hope with all the work your team is going to put into optimizing the codebase now your bills to Phusion Passenger get cut down quite a bit lol
 
hah .. not likely
 
7:26 PM
Well this is nifty, Rails5 + Rethink DB for realtime app blog.phusion.nl/2016/08/04/…
 
RethinkDB looks interesting. Anyone here used it before?
 
Not me.
 
7:46 PM
It looks shiny. I'd love to know what they mean by "real time."
I can't imagine they mean hard real time (with strict time guarantees). They probably mean soft real time (a squishy sort of real time that sort of means "able to keep up well enough that you won't notice when it doesn't.)
Or they just mean "real fast."
 
Probably the latter. I'm thinking MeteorJS real-time type of thing.
 
@WayneConrad a little more info rethinkdb.com/blog/realtime-web . Looks like when you make a query it marks that session as a listener to that, and knows when its resultset gets updated and pushes it to the client
 
Heh, @Jared I just found that link and was going to link.
 
I think they are abusing a word that has and should have a strict technical meaning. I wish they wouldn't.
 
Hehe :D
 
7:53 PM
Now "realtime" is going to mean "fast or something, so you should use it" kind of like how "HD" now means "better so you should buy it."
 
That's a trend that's been going on for a while now.
 
Or like how I can't call myself a hacker anymore because the public has changed it to mean "criminal who uses computers."
 
@WayneConrad would you prefer "asynchronously updating resultsets". Sounds less sexy that way
 
Sexy is marketing's problem. I need to communicate accurately with other technical people.
 
I think realtime for them and the folks behind projects such as Meteor, means that if I change something on document A from my end, and another user changes something else on the same document, those changes will be pushed to the client in "real time" - not instantly, but fast enough without a page refresh that it will be seen as "real time/"
 
7:55 PM
I get it. I just have to adapt to the language changing under my feet, as usual :)
 
You're right though, technically most likely they are abusing the word. But oh well, you know : )
 
Yea but marketing usually wins. As was the case with bytes.
 
As much as I hate crisp technical words getting changed to mean something squishy, language doesn't belong to any one person or group. It's the most prolitariat thing there is: The people, as a whole, get to decide what words mean, and nobody gets to tell them otherwise.
@Jared What do "bytes" mean now?
 
Probably...
 
Haha!
 
8:00 PM
: )
Bbl lunch time
 
@WayneConrad Mebi-byts vs mega-bytes
en.wikipedia.org/wiki/Mebibyte see table to the right for the 'new' byte types
megabyte = 1000 kilobytes. Mebibytes = 1024 Kibibytes
 
Interesting. It's probably needed. I don't know whether it'll "take".
 
Its been around since 1998, so one would think it should have took. I think the group that knows its 1024 just knows 3TB HDD doesn't actually mean 3TB
 
Yeah, mebi/gibi/tebi/pebi bytes have been around since high school
They've been built into *nix tools for ages
@WayneConrad I think "realtime" in Internet terms has long been co-opted
"real-time collaboration" and all that
"Fast enough that you can have a conversation" is all people mean by "real-time" in consumer-facing speak
 
8:18 PM
I guess I should get modernized at some point.
 
Nah, us youngsters will make sure we code the universe for backwards compatibility
 
8:29 PM
Thanks :)
There will be heated debates on a mailing list somewhere about whether to continue to support the hack that supports the obsolete Wayne module.
 
8:49 PM
Hello everyone :)
 
Hello, good afternoon (evening, morning, night, etc.)
 
^^
Can someone help me about rspec on rails? ^^
 
Just ask, and if someone will help if they can.
 
i try to do some unit test for login and creating an account , so i have this following code
require "rails_helper"

RSpec.describe AuthenticationsController, type: :controller do

describe "register" do

context "create new user" do
it "Should work" do
user = create(:user)
post :register_user, params: {email: user.email, password: user.password, password_confirmation: user.password }
expect(response.status).to eq 200
end
end

context "login user" do
it "Should work" do
user = create(:user)
post :authenticate_user, params: {email: user.email, password: user.password}
The first one ( Create new user ) works
but for the second one, I have this following error :
1) AuthenticationsController register login user Should work
Failure/Error: if user.valid_password?(params[:password])

NoMethodError:
undefined method `valid_password?' for nil:NilClass
 
I'm surprised your first one works
Assuming you're using FactoryGirl's create, the line create(:user) creates a database record
 
8:54 PM
there is my factories file
FactoryGirl.define do
factory :user, class: User do
email "test@test.com"
password "qwerty"
password_confirmation "qwerty"
end
end
 
You're then taking that database record's email and password and posting to your register_user action, which sounds like it should try to create a new user with the same credentials, which should definitely not work
You should be using build(:user) to create a non-persisted record
 
oh, so instead of using create(:user) i have to use build(:user) ?
 
Well, no
If it's working then changing from create to build is irrelevant because your underlying system seems broken
You should figure out why using create(:user) doesn't cause a failure first
This is assuming that your register_user action creates a new user record with the given email/password
Do you not have a uniquness constraint on email in your user model?
 
nop
i will add this in my model
validates_uniqueness_of :email, case_sensitive: false
validates_format_of :email, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: [:create, :update]
i try to figure out why its not working the second one
 
Hi
row = {name: 'Joe', date: '12/4/16', address: '2 xyz', email: 'joe@doe.com', parking: true}

row is invalid if any one of the above field is nil or not present.

def is_valid?
  valid = true
  if row[:name] == nil || row[:date] == nil || row[:address] == nil || row[:email] == nil || row[:parking]
    valid = false
  end
  valid
end

Is there any way that I can simplify and refactor the above method in rails?
 
hey guys
if there's more railsistas here right now, I'd like to request advice if I may
0
Q: Ruby on Rails models - Cannot modify association because it goes through more than one other association

Alfredo GallegosI'm working on maintenance for a system running on Rails that uses ActiveAdmin for administrative interfaces and I'm running into problems: Cannot modify association 'NightclubBoss#promotions' because it goes through more than one other association I have the following models: User AdminUser N...

 

« first day (941 days earlier)      last day (2314 days later) »