小编Aym*_*lah的帖子

Makefile中“ include”和“ -include”之间的区别

在makefile中,include和之间的含义是-include什么?

例子:

-include $(APPINCLUDES)

include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)
Run Code Online (Sandbox Code Playgroud)

c makefile include

13
推荐指数
2
解决办法
2687
查看次数

Ruby on Rails Omniauth facebook不会返回电子邮件

我一直在努力设置我的Omniauth for facebook我不知道我做错了什么.

我无法收到用户的电子邮件.返回的哈希只包含"name"和"uid",甚至不包含"first_name"和"last_name"

devise.rb:

  config.omniauth :facebook, "KEY", "SECRET"
Run Code Online (Sandbox Code Playgroud)

omn​​iauth_callbacks_controller.rb:

class OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def facebook
    logger.info request.env["omniauth.auth"]
    @user = User.from_omniauth(request.env["omniauth.auth"])
    sign_in_and_redirect @user
  end
end 
Run Code Online (Sandbox Code Playgroud)

user.rb:

class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
       :recoverable, :rememberable, :trackable, :validatable,
       :omniauthable, :omniauth_providers => [:facebook]

has_many :authentications

def self.from_omniauth(auth)
  logger.info auth
  user = where(email: auth.info.email).first
  if(user != nil)
    user.authentications.where(provider: auth.provider, uid: auth.uid).first_or_create do |l|
      user.authentications.create!(user_id: user.id,
                                  provider: auth.provider,
                                  uid: auth.uid) …
Run Code Online (Sandbox Code Playgroud)

facebook ruby-on-rails devise omniauth-facebook

7
推荐指数
3
解决办法
4923
查看次数

Ruby on Rails JPEG转换为PDF

我想JPEG在网站上具有上传功能,并将那些图像转换为PDF然后保存到我的S3

我知道如何将内容上传到,S3所以这不是问题。这里的问题是从几个上传的图像到的转换PDF。我在看什么

我进行了很多搜索,但没有发现任何能满足我想要的宝石。找到了一些在线服务,但没有提供API。发现prawn并处理了其他宝石,PDF但来源不包括图片。

我如何以某种可行的方式实现这一目标?

PS:我将使用heroku托管我的应用程序。

pdf jpeg ruby-on-rails heroku amazon-s3

2
推荐指数
1
解决办法
2068
查看次数

C#WPF例外

我正在使用WPF,在我的主窗口上,每当我尝试做任何事情时它都会给我这个错误"调用线程无法访问此对象,因为另一个线程拥有它." 这些例如,

this.Visibility = Visibility.Visible
((Storyboard)this.FindResource("HideWindow")).Begin()
Run Code Online (Sandbox Code Playgroud)

我真的不知道那是什么,并且在大量需要帮助时我无法执行我的代码的第一行.更多信息:我无法打开另一个窗口,给我的线程不是STA错误

LoginWindow objLoginWindow = new LoginWindow();
objLoginWindow.ShowDialog();
objLoginWindow = null;
Run Code Online (Sandbox Code Playgroud)

这是例外.

System.InvalidOperationException was unhandled by user code
HResult=-2146233079
Message=The calling thread cannot access this object because a different thread owns it.
Source=WindowsBase
StackTrace: at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) 
at Menupedia.LoadingWindow.OpenNewWindow() in c:\Users\xxxx\Desktop\menupedia\Menupediaa\Menupedia\LoadingWindow.xaml.cs:line 51 
at Menupedia.LoadingWindow.TimeElapsed(Object sender, ElapsedEventArgs e) in c:\Users\xxxx\Desktop\menupedia\Menupediaa\Menupedia\LoadingWindow.xaml.cs:line 39 
at System.Timers.Timer.MyTimerCallback(Object state)
Run Code Online (Sandbox Code Playgroud)

c# wpf window exception storyboard

0
推荐指数
1
解决办法
632
查看次数