Skip to content

Instantly share code, notes, and snippets.

SELECT MAX(`ChannelsSong`.`time`) as last, `Channel`.`name`, `ChannelsSong`.`id` FROM `channels_songs` AS `ChannelsSong` LEFT JOIN `channels` AS `Channel` ON (`ChannelsSong`.`channel_id` = `Channel`.`id`) WHERE 1 = 1 GROUP BY `ChannelsSong`.`channel_id` ORDER BY last DESC
SELECT SQL_NO_CACHE SQL_BIG_RESULT MAX(`ChannelsSong`.`time`) as last, `Channel`.`name`, `ChannelsSong`.`id` FROM `channels_songs` AS `ChannelsSong` LEFT JOIN `channels` AS `Channel` ON (`ChannelsSong`.`channel_id` = `Channel`.`id`) WHERE 1 = 1 GROUP BY `ChannelsSong`.`channel_id` ORDER BY last DESC;
SELECT SQL_NO_CACHE SQL_BIG_RESULT, MAX(`ChannelsSong`.`time`) as last, `Channel`.`name`, `ChannelsSong`.`id` FROM `channels_songs` AS `ChannelsSong` LEFT JOIN `channels` AS `Channel` ON (`Channel`.`id` = `ChannelsSong`.`channel_id`) LEFT JOIN `songs` AS `Song` ON (`Song`.`id` = `ChannelsSong`.`song_id`) LEFT JOIN `artists` AS `Artist` ON (`Artist`.`id` = `Song`.`artist_id`) WHERE 1 = 1 GROUP BY `ChannelsSong`.`channel_id` ORDER BY `ChannelsSong`.`time` DESC
find . -name '*.*' -exec iconv --from-code=ISO-8859-1 --to-code=UTF-8 {} \;
Charset csets = Charset.forName("UTF-8");
ByteBuffer x = csets.encode(plist);
class GenresMovies < ActiveRecord::Migration
def self.up
end
def self.down
end
end
ERROR: Error installing rails:
activesupport requires tzinfo (~> 0.3.16, runtime)
bente-oleanders-macbook-pro:torrify oleander$ sudo gem install rails --prerelease
ERROR: Error installing rails:
activesupport requires tzinfo (~> 0.3.16, runtime)
class CreateMovies < ActiveRecord::Migration
def self.up
create_table :movies do |t|
t.integer :id
t.string :title
t.string :imdb
t.integer :grade
t.integer :year
t.integer :length
t.string :url
INSERT INTO `channels` (`id`, `name`, `clicked`, `link`, `active`, `alias`) VALUES
('2', 'NRK mPetre', '9', '', '1', 'NRK mPetre'),
('3', 'NRK 5.1', '2', '', '1', 'NRK 5.1'),
('4', 'Jazz', '0', '', '1', 'Jazz'),
('5', 'NRK Alltid Folkemusikk', '0', '', '1', 'NRK Alltid Folkemusikk'),
('6', 'NRK Sami Radio', '16', '', '1', 'NRK Sami Radio'),
('7', 'NRK P1', '2', '', '1', 'NRK P1'),
('8', 'Gull', '0', '', '1', 'Gull'),
('9', 'NRK P3', '5', '', '1', 'NRK P3'),
('10', 'NRK Trøndelag', '5', '', '1', 'NRK Trøndelag'),
Stationar:Rubyfy linus$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes