小编jac*_*arm的帖子

如何安装 Leaflet.draw 插件?

我在安装Leaflet.draw 插件时遇到问题。我花了几个小时试图弄清楚如何安装它,但失败了。有人可以向我解释我该如何使用它吗?

javascript dictionary leaflet

8
推荐指数
2
解决办法
8598
查看次数

Unity 3.5到Unity 4.5.4

我正在尝试将我的旧Unity xCode(Unity 3.5)项目更新为Unity(4.5.4).应用程序将使用此方法崩溃:

UnitySendMessage([className UTF8String],[methodNameName UTF8String],nil);

请帮帮我.

xcode unity-game-engine ios ios8

7
推荐指数
1
解决办法
684
查看次数

相邻的,倾斜的块之间的细线,具有透明度

我有半透明块的问题.主要问题是"块"元素与其伪元素(之前)之间的细线.这个问题出现在每个现代桌面浏览器中(Opera,Firefox,Chrome.虽然不了解Safari).代码如下:

HTML:

<div class="block"></div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.block{
  position: relative;
  width: 200px;
  height: 200px;
  margin-left: 100px;
  background-color: rgba(0, 0, 0, 0.5);
  transform: skewX(-21deg);
}
.block:before{
  content: '';
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 100px;
  height:200px;
  background-color: rgba(0, 0, 0, 0.5);
}
Run Code Online (Sandbox Code Playgroud)

关于jsfiddle的例子:https://jsfiddle.net/Farmatique/xw877edw/

即使我将背景颜色不透明度设置为1,此问题仍然存在.

任何帮助/建议表示赞赏.

html css

7
推荐指数
1
解决办法
640
查看次数

如何解决Android Firebase错误"默认FirebaseApp未在此过程中初始化"?

我使用FirebaseAuth进行用户注册电子邮件和密码,我已经在我的项目中添加了插件和依赖项.

MainActivity.java

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
EditText ed_email, ed_pass;
Button but_login;
ProgressDialog progressDialog;
FirebaseAuth firebaseAuth;
Context context;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    context=getApplicationContext();
    FirebaseApp.initializeApp(context);
    firebaseAuth=FirebaseAuth.getInstance();

    ed_email= (EditText) findViewById(R.id.ed_email);
    ed_pass= (EditText) findViewById(R.id.ed_pass);
    but_login= (Button) findViewById(R.id.but_login);
    but_login.setOnClickListener(this);
    progressDialog=new ProgressDialog(this);
}
public void registerUser(){
    String email=ed_email.getText().toString().trim();
    String pass=ed_pass.getText().toString().trim();
    if(TextUtils.isEmpty(email)){
        Toast.makeText(getApplicationContext(),"Invalid Input",Toast.LENGTH_SHORT).show();
        return;
    }
    if(TextUtils.isEmpty(pass)){
        Toast.makeText(getApplicationContext(),"Invalid Input",Toast.LENGTH_SHORT).show();
        return;
    }
    progressDialog.setMessage("You are registering...");
    progressDialog.show();
    firebaseAuth.createUserWithEmailAndPassword(email,pass).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
        @Override
        public void onComplete(@NonNull Task<AuthResult> task) {
            if (task.isSuccessful()) { …
Run Code Online (Sandbox Code Playgroud)

java android firebase firebase-authentication firebase-realtime-database

7
推荐指数
2
解决办法
2万
查看次数

struct.error:unpack需要长度为16的字符串参数

使用pdfminer(pdf2txt.py)处理PDF 文件(2.pdf)时收到以下错误:

pdf2txt.py 2.pdf 

Traceback (most recent call last):
  File "/usr/local/bin/pdf2txt.py", line 115, in <module>
    if __name__ == '__main__': sys.exit(main(sys.argv))
  File "/usr/local/bin/pdf2txt.py", line 109, in main
    interpreter.process_page(page)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdfinterp.py", line 832, in process_page
    self.render_contents(page.resources, page.contents, ctm=ctm)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdfinterp.py", line 843, in render_contents
    self.init_resources(resources)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdfinterp.py", line 347, in init_resources
    self.fontmap[fontid] = self.rsrcmgr.get_font(objid, spec)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdfinterp.py", line 195, in get_font
    font = self.get_font(None, subspec)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdfinterp.py", line 186, in get_font
    font = PDFCIDFont(self, spec)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer/pdffont.py", line 654, in __init__ …
Run Code Online (Sandbox Code Playgroud)

python pdf pdf-parsing pdftotext pdfminer

7
推荐指数
1
解决办法
3984
查看次数

我如何编写自己的`reduce`函数?

我想reduce自己写.但在过去的4个小时里,我做不到.

var a = [10, 21, 13, 56];

function add(a, b) { return a + b }
function foo(a, b) { return a.concat(b) }

Array.prototype.reduce2 = function () {
  // I do not understand how to handle the function of the inlet
  // I know that I should use arguments, but I don't know how many arguments there will be
  var result = 0;
  for(var i = 0; i < arguments.length; i++) {
    result += arguments[i];
  }
 return …
Run Code Online (Sandbox Code Playgroud)

javascript

7
推荐指数
2
解决办法
2256
查看次数

Ember引擎和Ember简单Auth

我正在我的应用程序中实现ember-engine.我正在使用ember-simple-auth插件进行身份验证.它适用于主要的应用程序路线.

我使用addon提供的mixin扩展受保护的路由.

// app/routes/protected.js
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

export default Ember.Route.extend(AuthenticatedRouteMixin);
Run Code Online (Sandbox Code Playgroud)

现在我创建了一个用户引擎.它有用户列表和其他一些东西.我希望用户只有在经过身份验证后才能访问此页面.在主应用程序路由中,我可以使用mixin扩展路由,如果用户未经过身份验证,它将重定向到登录路由.但同样的事情不适用于用户引擎路由.

有关如何使用Ember引擎实现Ember-simple-auth的任何想法?

参考: -

Ember引擎 - https://github.com/ember-engines/ember-engines

Ember simple auth - https://github.com/simplabs/ember-simple-auth

编辑-

//lib/users-engine/routes/edit.js
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin);
Run Code Online (Sandbox Code Playgroud)

我试图像上面那样扩展引擎路线.

javascript authentication ember.js ember-engines

7
推荐指数
1
解决办法
364
查看次数

使用ASP MVC和React进行用户身份验证

在C#和声明中,很容易设置登录系统.我想知道如何正确地使用React和C#作为后端?

我一定要送login,并password从阵营的形成有xmlhttp post request,如果它存在检查?我应该setup claims然后呢?发送和ID作为JSON结果返回并保存到我的本地存储?这对我来说没有任何意义,因为已有声称.或者我应该检查每次刷新是否有任何声明,如果有,请至少将该ID发送回React的视图?

有任何想法吗?

c# asp.net authentication asp.net-mvc reactjs

6
推荐指数
1
解决办法
3337
查看次数

根据用户权限显示/隐藏内容的最佳方法

我正在寻找根据用户的权限显示或隐藏用户内容的最佳方式.我可以很容易地检查当前用户是否是管理员,或类似的东西,但让我们说用户想要编辑他们的帖子.然后管理员和作者都需要能够看到编辑按钮.

什么是最好的解决方案?

之前,我使用了这个自定义'can'帮助程序,但在Ember Auth更新后,此解决方案停止了工作.看到这里.

authorization ember.js

5
推荐指数
1
解决办法
523
查看次数

相对定位伪元素和绝对定位伪元素之间的差异

请考虑以下三种情况:

方案一:

div {
  width: 100px;
  height: 100px;
  background-color: black;    
}

div:before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: darkred;
  position: relative;
}
Run Code Online (Sandbox Code Playgroud)

方案二:

div {
  width: 100px;
  height: 100px;
  background-color: black;    
}

div:before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: darkred;
  position: absolute;
}
Run Code Online (Sandbox Code Playgroud)

方案三:

div {
  width: 100px;
  height: 100px;
  background-color: black;    
}

div:before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: darkred;
  display:block;
  position: relative;
}
Run Code Online (Sandbox Code Playgroud)

方案一(相对位置)未显示darkred伪元素。但是当它变成position:absolute伪元素时,它是可见的。另外,如方案三所示,当我display:block向方案一(相对位置)添加属性时,该元素可见。

为什么relative …

css

5
推荐指数
1
解决办法
814
查看次数