« first day (961 days earlier)      last day (2294 days later) » 
01:00 - 12:0012:00 - 19:00

1:26 AM
Is there a way to memoize within a method? (I don't want to pollute the class with an instance variable.)
 
user4710450
1:49 AM
@thesecretmaster it is similar somehow to Java
 
user4710450
Why isn't Java compiled to native code?
 
user4710450
The reason is that it makes that programming language more portable :)
 
4
Q: Static local variables for methods in Ruby?

ZequezI have this: def valid_attributes { :email => "some_#{rand(9999)}@thing.com" } end For Rspec testing right? But I would like to do something like this: def valid_attributes static user_id = 0 user_id += 1 { :email => "some_#{user_id}@thing.com" } end I don't want user_id to be acces...

 
user4710450
I can't think of a modern language running natively
 
@Ehsan webassembly
actually, define "runs natively"
 
user4710450
1:52 AM
Some of them like Clojure, Groovy and Kotlin are written on the top of JVM
 
user4710450
Do you mean asm.JS?
 
Thx team
 
compiling for x86 specifically is a bad idea.
 
user4710450
@JanDvorak Why?
 
What if your customer has an ARM?
 
user4710450
1:54 AM
Yup, but then you should handle writing an interpreter for that
 
x86 emulation? Just nope.
 
user4710450
And noone users Ruby on ARM ( very rarely )
 
PowerPC?
 
user4710450
Compilers and Interpreters is a very advanced topic and I think I'm not completely qualified to talk about it :|
 
user4710450
@JanDvorak I meant Raspberry Pi mainly
 
1:57 AM
Well, Ruby is a great language for RPi
 
Anyone here using linux? I'm about to set up a dual boot, but was wondering if there's a better flavor (other than ubuntu) for a dev env.
 
user4710450
Ubuntu
 
VM?
 
user4710450
Dual boot with Kali Linux
 
I'll stick to Windows, thank you
 
user4710450
2:00 AM
Also used to dual boot with Win 10
 
I've played around with it on a VM, but I want mutli-monitor support. :D
 
VMs should support multi-monitor setups
 
user4710450
@JanDvorak Man is Rails on windows really possible?
 
Why not?
 
I'm on win 10 right now, typically a c#/ms dev, but I started learning about hadoop and python, and wanted to, idk, get with the times, haha, that includes working with Rails, which I plan to start tomorrow. I don't think I've ever met anyone that does ruby on windows
 
2:01 AM
o/
 
user4710450
I got old for ages when I wanted to install gems :(
 
user4710450
@silencedmessage What do you want Linux for?
 
Honestly just to get used to working in an environment other than Windows. I'm really limiting myself by sticking strictly with MS.
 
user4710450
@silencedmessage Try CYGWIN
 
user4710450
It's awesome
 
user4710450
2:03 AM
 
Awesome, thanks! I figured someone here might have some great insight. Much appreciated!
 
user4710450
But if you want linux really just install Ubuntu
 
user4710450
The dual boot is quite easy with win 10
 
The last time I dual booted was XP. :-p I'm sure not tooooo much has changed, haha.
 
user4710450
Just create an Ubuntu install stick and in the setup options choose Install Alongside Win 10 .
 
user4710450
2:05 AM
It is worth trying :)
 
...they really make it that easy now?
 
user4710450
Yup but make sure you have an empty partition for Ubuntu
 
That's the hard part :-D
 
user4710450
I remember once I was trying to install Linux Mint and in the partioning section I just formatted whole my laptop hard drive ( 1TB )
 
I have an empty hdd that I'm going to put it on.
Ouch, that sucks, haha.
 
user4710450
2:06 AM
Cool.
 
user4710450
Go for Ubuntu if possible but Cygwin/MingW is also a good alternative
 
I figured it's best to just throw myself into the real thing. Trial by fire. ;)
 
user4710450
And if you are into hacking also give Kali Linux a try :)
 
Haha, I am not... yet. :-p Is it Kali I keep seeing on Mr. Robot?
 
user4710450
It has an awesome tool called Metasploitable which is written in Ruby :)
 
user4710450
2:09 AM
@silencedmessage lol. I just watched the first episode of the first season of this series and I hate it!
 
user4710450
Hacking is totally different from what it is shown in series/films
 
This sounds crazy, but if you stick it out to episode 8 or 9, your head will explode. It gets so good! Some of the hacks are realistic, but they even make fun of themselves at one point... someone says something to the effect of "Some Holywood producer is going to come along and make a flashy tv show about hacking and ruin another generation's idea of how computing actually works"
 
user4710450
@silencedmessage OK. In my free time I will watch the rest.
 
It gets really good! :) Thanks for the pointers @Ehsan and @JanDvorak! :)
 
user4710450
Have you guys heard about this conference?
 
user4710450
@silencedmessage Most Welcome!
 
user4710450
Hope succeed with Ubuntu!
 
2:26 AM
@silencedmessage Ehsan and Jan have probobly already answered most of your guestions, but if you run into any problems I may also be able to help. I dual boot win 10 (for autodesk stuff) and linux mint. Had too do alot of troubleshooting with grub to get them to behave though
 
user4710450
@thesecretmaster Linux Mint is cool too!
 
user4710450
but its just a clone of Ubuntu with GNOME :|
 
user4710450
Ubuntu is installed much easier than Mint.
 
@Ehsan I like the UI a bit better, it was my first non-mac OS so I wanted something similar to OSX.
 
user4710450
As I mentioned it has GNOME, for UI Ubuntu uses UNITY revently
 
user4710450
2:30 AM
But generally choosing which Linux distro. is completely up to your flavor
 
user4710450
There is also KUbuntu which uses KDE as Display manager
 
user4710450
Also with cygwin you can have GNOME installed ( which isn't really cool, though )
 
Yeah, I just used mint by default because I built my PC (at that time I knew nothing), then thought, I'll just install OSX. Then my friend who was helping me said the only free os is linux, and directed me to mint. And the rest is history
 
user4710450
@silencedmessage I really recommend you forget about Python and Ruby , and go for Node.JS which has a nice future indeed
 
so does Ruby
 
user4710450
2:40 AM
not Really
 
user4710450
Node.JS has far better future
 
user4710450
just let mye open my history and give you a reference
 
user4710450
I asked a question in Hacker News also
 
user4710450
 
user4710450
Take a look at that question
 
2:44 AM
What is the future of ruby? I like ruby :/
 
I'm actually on Ubuntu now. :) I think my Windows install is still in place, hehe.
 
user4710450
@silencedmessage Great!
 
user4710450
What do you want to start with?
 
user4710450
NodeJs is the up-to-minute technology
 
And I know some node... I know Angular 1.x pretty well, I use Sencha's ExtJs at my current job (absolute garbage), but it seems like ruby/python are really hot right now (node too!). I just want to stay relevant.
 
user4710450
2:46 AM
OK, sure
 
user4710450
Python is installed by default
 
user4710450
But for RoR
 
user4710450
type in below:
 
user4710450
sudo apt install ruby
sudo gem install rails
 
user4710450
Thats it!
 
user4710450
2:47 AM
What database will be you using?
 
Fantastic, this is awesome.
Absolutely no idea yet. haha
 
user4710450
PostGreSQL is a good choice
 
user4710450
though I choose MYSQL for development
 
@Ehsan All I get from that quora link about ruby v nodejs is this quote "Node.js (node) has already become more popular on github than Ruby on Rails (rails)." by "Kyle Phillips, writes a lot of js"
 
user4710450
OK, choose whatever technology you like but for me ( a Java/JavaScript lover ) Node.JS is the best!
 
2:49 AM
I may go with a noSQL option, maybe mongo. I'm going to work on just learning the basic sytanx and stuff first, basic hello world. Gotta go though, thanks again everyone!
 
user4710450
@silencedmessage From where?
 
user4710450
Rails Tutorial is the best source for learning
 
user4710450
 
user4710450
@silencedmessage Mainly Node.JS is used with Express.JS
 
user4710450
Angular.JS just brings complexity but React.JS does the job well
 
2:51 AM
@Ehsan also from the link this: "Use the right tool for the job, instead of fitting the job to the tool!" which seems about right to me. Ruby and js both have their places.
 
user4710450
These are my opinions, though
 
user4710450
@thesecretmaster Forget about that link!
 
user4710450
In today age backend isn't that important
 
user4710450
since there are many tools out there
 
user4710450
You could have your website set up in a minute using wordpress
 
user4710450
3:20 AM
Could you please take a look at this:
 
user4710450
Is it looking cool?
 
4:17 AM
@Fuser97381 Hi Fuser, long time no see. Take a look at the memoize gem. I've used it a few times with good success. I don't use it so much anymore--I've come to prefer the @somevar ||= someexpression idiom most of the time, but it's still a good gem.
@silencedmessage Hi, I run Linux. For Windows, I run it in a VM. I don't like dual-boot, because (1) Windows upgrades tend to goof up dual-boot. At least, up until Windows XP, they did. and (2) I have to reboot to switch. With a VM, I have both at the same time. Also, VirtualBox with its extensions makes sharing clipboard and files between the native OS and the VM very easy.
@silencedmessage Rails on Windows is possible, but troublesome once you start using any of the numerous gems that people write to enhance Rails. Many of them were written on Linux, and may run on Windows, or may not, or may run mostly on Windows.
@Ehsan PostgresSql is an excellent database. I prefer it over Mysql for many reasons. Among others, Its CLI is much more polished, and I prefer to use a CLI to interact with the database. Also, I think it supports SQL 92 very well.
 
user4710450
@WayneConrad Yeah, many people agree with you including me
 
user4710450
But MYSQL for development does fine but not for production :|
 
Both PostgreSql and Mysql have the huge advantage of being neither Oracle nor SqlServer :D
 
user4710450
@WayneConrad +1
 
user4710450
How can I control asset manager?
 
4:24 AM
I don't know what that is, so I guess I can't tell you.
 
user4710450
It loads a css before another one and everything is getting messy :|
 
@Ehsan It's looking pretty good. In my browser, there's something funky going on here:
 
user4710450
I hope this fake generator gets ready by night
 
user4710450
@WayneConrad, could you please upload the image here?
 
user4710450
click the upload button and choose from web and paster that URL.
 
4:34 AM
 
user4710450
Thanks
 
I'd tell you what browser I'm running, but these awful tabletized interfaces make it impossible for me to find anything anymore. We've replaced words with stupid cutesy symbols, and then we move them around every other version.
OK, there it is. Hidden under an unlabeled question mark on a menu. Yeah, that's a UI win for sure. Firefox 48.0.1 on Debian Linux. It could be you're using a font that I don't have installed.
 
user4710450
@WayneConrad Actually its a google font
 
I don't know google fonts.
 
user4710450
It seems it doesn't load glyph-icons too :(
 
user4710450
4:39 AM
This is the font:
https://fonts.google.com/specimen/BioRhyme
 
Do I have to install a google font, or does it magically get installed by going to the page?
If they're like any other fonts under Linux, I have to install it.
 
user4710450
@WayneConrad No it should be included to the web page automatically
 
Ah, OK.
 
user4710450
But it seems confusing,
 
user4710450
What is the latest version of FireFox?
 
4:43 AM
This is kind of old; I don't know if it applies here:
2
Q: Google Fonts don't work in Firefox

user2154508I really can't use the Google Fonts in Firefox. Basically i have one font from Google Fonts, it works fine in other browsers, but, in the firefox, the font doesn't work. My Source: HEAD: <link href="http://fonts.googleapis.com/css?family=PT+Sans:400,700" rel="stylesheet" type="text/css" /> A...

 
user4710450
Actually mine is 46.0.1
 
user4710450
and loads fine!
 
user4710450
Ubuntu
 
Debian stable
However, I'm not using the Firefox package from Debian.
 
user4710450
Is it an official dist. ?
 
4:46 AM
Debian stable tends to be a year or two old (it's very stable), so for browsers I pick up the packages built by the browser maker.
@Ehsan I don't understand the question.
 
user4710450
Is the browser the one distributed by mozzilla.org?
 
user4710450
Or its a customized version?
 
This is what I'm running: debian.org/releases/stable
 
user4710450
@WayneConrad Hmm... Nevermind
 
user4710450
I guess it works fine on Chrome
 
user4710450
4:47 AM
I don't really care for IE :|
 
It's the one distributed by Mozilla.
 
user4710450
So that's OK most people use Chrome
 
Chrome sends my window manager into a tizzy. I think it's a video card going bad, but I don't know for sure.
My computer sits six feet from a 100W radio transmitter with an unbalanced antenna--I'm afraid that stray RF has caused some damage. The sound card was the first to go, then the video card got a little... sensitive.
 
user4710450
@WayneConrad OMG! Thats too dangerous
 
user4710450
Even for your health
 
4:50 AM
You don't want to touch anything metal when I'm transmitting--an RF burn is kind of painful :D
 
user4710450
Microwaves are too dangerous and they increase the probability of cancers :|
 
No, these aren't microwaves, just HF between 3 and 30 mHz. Not super dangerous, especially for occasional short-term exposure. Probably a little above FCC recommended limits, but unlikely to cause any health problems.
 
user4710450
@WayneConrad Thats a relief :)
 
I run an end-fed antenna; those are famous for causing stray RF near the transmitter. The antenna voltage near the transmitter is thousands of volts, although the amperage is very low. It causes all kinds of interesting effects.
 
Hope all are doing well.
 
4:54 AM
Hello @MuhammadYaseen, doing well, thank you. I hope you are well also.
 
user4710450
@WayneConrad Quite interesting!
 
Yes, thank you very much.
 
Alright, I'm going back to the PS3... playing Oblivion tonight, a game I'm new to. Enjoying the fun of everything being new and difficult. ttyl.
 
user4710450
 
user4710450
You can do these kind of stuff with that high voltages!
 
user4710450
5:00 AM
The image is taken from one of Nikola Tesla's experiments!
 
@Ehsan That looks like one of Tesla's experiments. My voltages are a long way from that.
 
user4710450
@WayneConrad Have fun its an awesome game!
 
user4710450
The film at least was great
 
user4710450
Haven't played the game yet :|
 
Guys, sorry to interrupt I am getting my controller displaying after my table entries why?For better understanding see the picture:
 
user4710450
5:07 AM
What is this exactly!?
 
user4710450
Could please host the application somewhere/put the code on github, so I could view your code?
 
This is my orders index view will all customer entries.
 
user4710450
@MuhammadYaseen Seems cool.
 
user4710450
Whats the problem?
 
Why I am getting rendered /orders below my table entries?
 
user4710450
5:14 AM
@MuhammadYaseen , answering that question is kinda impossible without viewing your controller/view.
 
user4710450
Let me see
 
user4710450
 order.oorder
 
user4710450
What is this?
 
user4710450
Is it typo?
 
user4710450
5:17 AM
If you posted your migration it could be also useful ...
 
user4710450
It seems you have scaffolded that project :|
 
user4710450
Don't scaffold until you become an experienced Rails developer ( as pointed out by Michael Hartl )
 
20150418132430_create_orders.rb
class CreateOrders < ActiveRecord::Migration
	def change
		create_table :orders do |t|
			t.string :slno
			t.string :customer
			t.string :oorder
			t.timestamps null: false
		end
	end
end
 
user4710450
You must forgive me
 
user4710450
I'm not that experienced to figure out whats going on
 
5:25 AM
It's okay.....
 
user4710450
In fact I am learning some functions by looking at your code :)
 
At least you had a look at my code and you typed too many things...
 
user4710450
Have you generated it with scaffolding tool?
 
user4710450
Just curious
 
user4710450
or write the code yourself?
 
5:28 AM
Actually I don't remember because It is made before but right now I just refactored it.
 
user4710450
Could you please give the result of
 
user4710450
Order.all
 
user4710450
in your rails console
 
It's not refactoring if it changes what the code does
2
 
user4710450
and application layout
 
user4710450
5:34 AM
I gtg
 
user4710450
Bye
 
wait please
I am getting that when I upload order.csv file and if create a record from the console it is working fine.
 
 
2 hours later…
user4710450
7:55 AM
Hi
 
user4710450
Just a question
 
user4710450
I am sure I've seen it before but can't remeber it
 
user4710450
How can I escape the contents of a text area in rails?
 
user4710450
for example <script> tags
 
user4710450
9:11 AM
OMG
 
user4710450
This Faker gem creates even Game Of Thrones characters!
 
user4710450
lol
 
user4710450
10:48 AM
Is anybody online?
 
user4710450
Is it possible to create a hash with strings as keys and functions as values?
 
user4710450
Something like this :
 
user4710450
hash = {'adress',Faker::Address.gen}
 
user4710450
with which I can call that function like this:
 
10:50 AM
Look at Object#method
 
user4710450
hash['adress']
 
user4710450
@JanDvorak Excuse me, I can't understand that, how can I accomplish that kind of hash?
 
That specifically won't work. You could use Faker::Address as a value because that is an object.
 
user4710450
Is it possible to do that with method references?
 
23
Q: How can I get a reference to a method?

GeoIs it possible in Ruby to get a reference to methods of an object ( I would like to know if this can be done without procs/lambdas ) , for example , consider the following code : class X def initialize @map = {} setup_map end private def setup_map # @map["a"] = get referenc...

As @JanDvorak said, you want to be using Object#method
 
user4710450
10:54 AM
Hmmm. That is what I was looking for. Thanks!
 
Thanks @JanDvorak! I'd never knew that you can use method references.
 
user4710450
Wait a minute!
 
user4710450
something isn't working :(
 
user4710450
>> def test
>>   return 5
>> end
=> :test
>> hehe = {testing:method(:test)}
=> {:testing=>#<Method: Object#test>}
>> hehe['testing']
=> nil
>>
 
user4710450
Take a look at this
 
10:59 AM
Taken
 
user4710450
why isn't returning 5?
 
:testing != "testing"
 
user4710450
Sorry, I'm back again
 
user4710450
So the correct way is this?
 
user4710450
hehe[:testing]
 
11:01 AM
Did you try?
 
any android developer here?
 
user4710450
>> hehe[:testing]
=> #<Method: Object#test>
 
@faisaliqbal No, I'm a human
 
user4710450
@faisaliqbal Isn't it apparent from the name of the room?
 
user4710450
@JanDvorak, what's wrong here?
 
11:02 AM
@faisaliqbal I googled android development once.
 
okok
 
@Ehsan Nothing really. You've got your method, you just need to call it.
 
user4710450
@thesecretmaster lol. I didn't do that whole my life
 
user4710450
>> hehe[:testing]()
SyntaxError: (irb):7: syntax error, unexpected '(', expecting end-of-input
hehe[:testing]()
               ^
	from /usr/bin/irb:11:in `<main>'
>>
 
user4710450
How can I call the method?
 
11:04 AM
.call
I think
 
user4710450
Yeah, that did the job!
 
user4710450
hehe[:testing].call
 
user4710450
that finally worked!
 
foo.() also works
also, foo[]
 
11:06 AM
@JanDvorak Are those alias's for call or do they only work with Object#method
 
user4710450
You know how this tool comes handy?
 
user4710450
It really makes the website dynamic
 
user4710450
I hope my hobby project gets finished tonight, so you can see how I managed to create it!
 
irb(main):023:0> method(:puts).method(:"()")
NameError: undefined method `()' for class `Method'
        from (irb):23:in `method'
        from (irb):23
        from C:/Ruby23-x64/bin/irb.cmd:19:in `<main>'
irb(main):024:0> method(:puts).method(:"[]")
=> #<Method: Method#[]>
 
I do not understand that at all.
 
user4710450
11:11 AM
Yeah
 
user4710450
What's the point in calling method on method?
 
It gives you a method of that method
 
user4710450
:| Quite advanced topic
 
:| is a valid symbol, BTW
irb(main):027:0> :| == :"|"
=> true
 
user4710450
Guys could you please take a look at this?
 
user4710450
 
@JanDvorak mind = blown
 
user4710450
Now I want to do something like this :
 
cute lib
 
user4710450
send('Faker::Address.city')
 
send whom?
 
user4710450
11:14 AM
actually I want to invoke that method
 
user4710450
Faker::Address.city
 
user4710450
This is the method
 
user4710450
Now I wonder if it is possible to use it like :
 
user4710450
send('Faker::Address.city')
 
Try it in irb
 
11:15 AM
It's not.
 
user4710450
@thesecretmaster Rails console in fact, I don't know how to use gems in irb
 
require "gemname"
=> true
 
user4710450
Any way rails console does that for me
 
Faker::Address.method :city
 
user4710450
I want to possibly store that in a string
 
11:17 AM
What about Faker::Address.send("city")
 
user4710450
to make it dynamic
 
symbols can be dynamic too
you could also use a string and do:
Faker::Address.method "city".to_sym
 
user4710450
Is there anyway to implement this dynamicly?
 
user4710450
like this :
 
class Kernel
  def method_missing str
    #lots of grey magic
  end
end
 
user4710450
11:19 AM
command = 'Faker::Address.city'
send(command)
 
@thesecretmaster don't
 
user4710450
@thesecretmaster I would be grateful if you put an example
 
@Ehsan I would be grateful if he didn't
 
There is definitely a better way then eval
 
user4710450
11:19 AM
You know I want to store these commands in DB.
 
You don't
 
user4710450
@JanDvorak why not?
 
Never put program code in the database
 
user4710450
@JanDvorak I know it might sound dangerous but I'm really curious about it
 
I'm really curious about LSD
 
user4710450
11:21 AM
It would make it much cleaner
 
user4710450
Instead of adding all those methods to controller, I will put the code in DB
 
bad idea
 
Maybe if you gave some context @JanDvorak or I could help you figure out a better way than stroring it in the DB
 
user4710450
Come on, who wants to hack a useful and unimportant website?
 
user4710450
OK. I just want to store these commands :
 
user4710450
11:23 AM
Faker::Address.street_name
 
For what purpose?
 
user4710450
Faker::Address.street_address
 
user4710450
@thesecretmaster to make website more dynamic
 
user4710450
and add those to another place rather than controller
 
You can store a validation type. That they are derived from your library's method names is an implementation detail.
 
user4710450
11:24 AM
Example please!
I am newbie yet!
 
Also, you could just use 1 line to store them in an array with the Object#method thing Jan talked about earlier.
 
user4710450
>> eval('Faker::Address.city')
=> "Quitzonstad"
 
user4710450
This did the trick
 
user4710450
but is really dangerous :|
 
@JanDvorak Sorry
 
user4710450
11:37 AM
Have you heard about any api which you can send a Galaxy name to and get the image back?
 
Google Images
 
user4710450
How?
 
They probably won't like automated requests though
 
user4710450
I want something like this :
 
user4710450
 
11:38 AM
Yeah, no.
 
user4710450
It's a pity :(
 
user4710450
How awesome the fake generator could become with that
 
You could create that generator if you have some time to kill
 
user4710450
How? In Rails?
 
user4710450
11:40 AM
@thesecretmaster Of course I have!
 
Find a bunch of images manually, associate them with the galaxy names and maybe some stats in a database, then design an api for it.
 
user4710450
@thesecretmaster No not that way
 
user4710450
Dynamically if possible
 
Yeah, after you've created the API you can access it dynamically
 
user4710450
Yeah but that could be limited
 
user4710450
11:43 AM
to a number of galaxies
 
user4710450
Doesn't nasa have that kind of api?
 
user4710450
I wonder what they do with that huge budget they get every year!
 
@Ehsan Probably not. If anyone would have an api like that it would probably be the IAU or something.
They spend the budget on shooting stuff at the sky and catching the things that fall.
By the way here is a list of notable galaxys: en.wikipedia.org/wiki/List_of_galaxies
 
user4710450
@thesecretmaster Thanks.
 
11:50 AM
Also NASA runs the "Astronomy picture of the day (APOD)" api, which is worth the entire budget.
 
user4710450
Yes
 
user4710450
Check this out :
https://api.nasa.gov/index.html#live_example
 
user4710450
I can run this program for a year every day and collect 365 images at the end of the year :)
 
mostly of Andromeda, I would guess
 
01:00 - 12:0012:00 - 19:00

« first day (961 days earlier)      last day (2294 days later) »