This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insert_after(haystack, needle, thread) | |
{ | |
var browser=navigator.userAgent; | |
if((typeof haystack.innerText == 'undefined') || (!(browser.indexOf("MSIE")>0))) | |
{ | |
var haystackText = haystack.innerHTML; | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Task < ActiveRecord::Base | |
attr_accessor :infile_file_name | |
attr_accessor :infile_content_type | |
attr_accessor :infile_file_size | |
attr_accessor :infile_updated_at | |
validates_presence_of :name | |
has_attached_file :infile, :path => ":rails_root/public/system/:user_id/:project_id/:id/:filename" | |
belongs_to :project | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite> select * from delayed_jobs; | |
1|0|0|--- !ruby/struct:Delayed::PerformableMethod | |
object: !ruby/object:TextAnalysis {} | |
method_name: :start | |
args: [] | |
||2011-01-17 18:58:19.296379||||2011-01-17 18:58:19.296452|2011-01-17 18:58:19.296452 | |
2|0|0|--- !ruby/struct:Delayed::PerformableMethod | |
object: !ruby/object:TextAnalysis {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TasksController < ApplicationController | |
def start | |
require("textanalysis.rb") | |
a = TextAnalysis.new | |
a.start | |
flash[:notice] = "Processing" | |
redirect_to :action => "show" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
$KCODE="U" | |
require 'ftools' | |
require 'jcode' | |
require 'environment.rb' #環境に関する変数 | |
require 'settings.rb' #タスクの設定 | |
require "01morph.rb" #形態素解析のソースファイル | |
require "02freq.rb" #頻度計算のソースファイル |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#METHOD CALLING THE DELAYED_JOB | |
def start | |
@user = User.find(params[:user_id]) | |
@project = @user.projects.find(params[:project_id]) | |
Delayed::Job.enqueue(TextAnalysis.new(@project.tasks.find(22))) | |
flash[:notice] = "Processing" | |
redirect_to :action => "show" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Task < ActiveRecord::Base | |
attr_accessor :infile_file_name | |
attr_accessor :infile_content_type | |
attr_accessor :infile_file_size | |
attr_accessor :infile_updated_at | |
validates_presence_of :name | |
has_attached_file :infile, :path => ":rails_root/public/system/:user_id/:id/inputs/:filename" | |
belongs_to :user | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MediaRecorder recorder = new MediaRecorder(); | |
recorder.reset(); | |
recorder.setAudioSource(MediaRecorder.AudioSource.MIC); | |
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); | |
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); | |
recorder.setOutputFile("test/tmp.3gp"); | |
try { | |
recorder.prepare(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC [M] /home/dalla/Downloads/broadcom/src/wl/sys/wl_linux.o | |
/home/dalla/Downloads/broadcom/src/wl/sys/wl_linux.c: In function 'wl_attach': | |
/home/dalla/Downloads/broadcom/src/wl/sys/wl_linux.c:485:3: error: implicit declaration of function 'init_MUTEX' | |
make[2]: *** [/home/dalla/Downloads/broadcom/src/wl/sys/wl_linux.o] Error 1 | |
make[1]: *** [_module_/home/dalla/Downloads/broadcom] Error 2 | |
make[1]: Leaving directory `/usr/src/linux-2.6.37' | |
make: *** [all] Error 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% form_for :lesson, @lesson, :url => {:action => "create"}, :html => { :multipart => true } do |form| %> | |
Nome: <%= form.text_field :name %><br/> | |
Descricao <%= form.text_field :description %><br/> | |
Video: <%= form.file_field :video %><br/> | |
<%= form.hidden_field :uuid, :value => @uuid%> | |
<%= form.submit %> | |
<% end %> | |
<div id="teste"></div> | |
<script type="text/javascript"> | |
$("form").submit( |
OlderNewer