sudo apt-get install youtube-dl youtube-dl
youtube-dl -cit http.....(paste the link) youtube-dl http://www.youtube.com/watch?v=_z-hEyVQDRA
You can also specify other options
sudo apt-get install youtube-dl youtube-dl
youtube-dl -cit http.....(paste the link) youtube-dl http://www.youtube.com/watch?v=_z-hEyVQDRA
You can also specify other options
| irb1(main):029:0> "- dredtrnedtdj - uifsdkghdkjghjh ".split(/- /) | |
| => ["", "dredtrnedtdj ", "uifsdkghdkjghjh "] | |
| irb1(main):031:0> "- dredtrnedtdj - fsjfsgdgdgdffff-gdfjdgjdgdg".split(/- /).compact.reject(&:empty?).each {|t| puts "#{t}"} | |
| dredtrnedtdj | |
| fsjfsgdgdgdffff-gdfjdgjdgdg | |
| => ["dredtrnedtdj ", "uifsdkghdkjghjh ", "fsjfsgdgdgdffff-gdfjdgjdgdg"] | |
| irb1(main):032:0> "- dredtrnedtdj - fsjfsgdgdgdffff - gdfjdgjdgdg".split(/- /).compact.reject(&:empty?).each {|t| puts "#{t}"} | |
| dredtrnedtdj |
| http://www.tutorialspoint.com/ruby-on-rails/rails-migrations.htm | |
| http://railsguides.net/change-data-in-migrations-like-a-boss/ | |
| http://makandracards.com/makandra/15575-how-to-write-complex-migrations-in-rails |
| class ChangeValueTable_nameColumn_name < ActiveRecord::Migration | |
| def up | |
| db.update("UPDATE table_name SET column_name = 'new_value' WHERE party = 'old_value' ") | |
| end | |
| def down | |
| # action to be done after completing the up , | |
| # may be deleting the column after completing the values | |
| end |
| "hello".gsub(/[aeiou]/, '*') #=> "h*ll*" | |
| "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>" | |
| "hello".gsub(/./) {|s| s.ord.to_s + ' '} #=> "104 101 108 108 111 " | |
| "hello".gsub(/(?<foo>[aeiou])/, '{\k<foo>}') #=> "h{e}ll{o}" | |
| 'hello'.gsub(/[eo]/, 'e' => 3, 'o' => '*') #=> "h3ll*" |
6. Learning to Classify Text
Detecting patterns is a central part of Natural Language Processing. Words ending in -ed tend to be past tense verbs (5.). Frequent use of will is indicative of news text (3). These observable patterns — word structure and word frequency — happen to correlate with particular aspects of meaning, such as tense and topic. But how did we know where to start looking, which aspects of form to associate with which aspects of meaning?
The goal of this chapter is to answer the following questions:
How can we identify particular features of language data that are salient for classifying it? How can we construct models of language that can be used to perform language processing tasks automatically? What can we learn about language from these models?
| # http://www.icicletech.com/blog/web-scraping-with-ruby-using-mechanize-and-nokogiri-gems | |
| require "mechanize" | |
| url = ARGV[0] | |
| fp = File.new("wikilinks.txt", "w") | |
| agent = Mechanize.new { |agent| agent.user_agent_alias = "Mac Safari" } | |
| html = agent.get(url).body |
Negotiation Tactic #1 – Is That Your Best Offer?
Negotiation Tactic #2 – Referencing an Expert Opinion
Negotiation Tactic #3 – Asking a Closed-Ended Question
Negotiation Tactic #4 – Asking an Open-Ended Question
Negotiation Tactic #5 – Concede Small
| require 'date' | |
| Date.parse("November 17, 2014").strftime('%Y-%m-%d') | |
| #=>"2014-11-17" | |
| Date.parse("November 17, 2014").strftime('%y/%m/%d') | |
| #=>"14/11/17" | |
| # change the '-', '/' or use any separators |