小编Ann*_*lee的帖子

保护/加密R包代码以进行分发

我正在R中编写一个包,并希望保护/加密代码.基本上,在查看我的包代码时,它应该是加密的而且不可读.我已经读过有人加密了他的代码(1),但我还没有找到更多相关信息.我知道我可以用C/C++编写代码并编译它,但是我想把它放在R中并在那里" 保护 "它.

我的问题是:这可能吗,这怎么可能?

我感谢你的回答!

参考:

(1)链接

obfuscation r

10
推荐指数
2
解决办法
7206
查看次数

把手 - 期待'OPEN_INVERSE_CHAIN','INVERSE','OPEN_ENDBLOCK',得到'EOF'

我正在尝试把手,我正在使用以下简单的模板:

<html>

<head></head>

<body>

    <h1>{{title}}</h1>
    <p>{{body}}</p>

    {{#each list}}
    <ul>
        <li>{{@index}}. {{this}}</li>
    </ul>
    </br>
    {{{htmlTag}}} 

    {{#if user.admin}}
    <button class="launch">Launch Spacecraft</button> {{else}}
    <button class="login"> Log in</button> 
    {{/if}} 
    {{!-- This is a comment --}}

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

app.js看起来如下:

require('dotenv').config()
const express = require('express')
const logger= require('morgan')
const path = require('path')

const app = express()

app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'hbs')
app.use(logger(process.env.LOG_ENV))

app.get('/', (req, res) => {
    const titel = "This is a titel"
    const body = "Lorem ipsum dolor sit amen ..." …
Run Code Online (Sandbox Code Playgroud)

javascript node.js express handlebars.js

10
推荐指数
2
解决办法
5701
查看次数

将xml_nodeset转换为data.frame

我在用rvest.我想将结果转换为数据框:

> links <- pgsession %>% jump_to(urls[2])  %>%  read_html() %>% html_nodes("a")    
> links
{xml_nodeset (114)}
 [1] <a href="/Mitglieder/Detail/1213412">Date</a>
 [2] <a href="/Account/ChangePassword">Kennwort ändern</a>
 [3] <a href="/Account/BenutzernamenAendern/124312234">Benutzernamen ändern</a>
 [4] <a href="/Account/LogOff">Abmelden</a>
...    
Run Code Online (Sandbox Code Playgroud)

我使用以下方法:

library(plyr)
ldply(xmlToList(links), data.frame)
Error in UseMethod("xmlSApply") : 
    no applicable method for 'xmlSApply' applied to an object of class "xml_nodeset"
df1 <- data.frame(character(13000))
df1 <- rbind(df1, data.frame(links ))# append to data.frame
Run Code Online (Sandbox Code Playgroud)

但是,我收到一个错误:

Error in UseMethod("xmlSApply") : 
    no applicable method for 'xmlSApply' applied to an object of class "xml_nodeset" …
Run Code Online (Sandbox Code Playgroud)

statistics r

9
推荐指数
1
解决办法
6573
查看次数

获取TypeError:当使用cheerio和jsonframe进行抓取时,selector.includes不是一个函数

我正在尝试使用以下代码废弃网站:

const cheerio = require('cheerio');
const jsonframe = require('jsonframe-cheerio');

const $ = cheerio.load('https://coinmarketcap.com/all/views/all/');
jsonframe($); // initializes the plugin

//exception handling 
process.on('uncaughtException', err =>
  console.error('uncaught exception: ', err))
process.on('unhandledRejection', (reason, p) =>
  console.error('unhandled rejection: ', reason, p))

const frame = {
    "crypto": {         
        "selector": "tbody > tr",   
        "data": [{             
            "name": "td:nth-child(2) > a:nth-child(3)", 
            "url": {                                  
                "selector": "td:nth-child(2) > a:nth-child(3)",    
                "attr": "href"                     
            },
            "marketcap": "tr > td:nth-child(4)",
            "price": "tr > td:nth-child(5) > a:nth-child(1)", 
        }]
    }

};

let companiesList = $('tbody').scrape(frame);
console.log(companiesList); 
Run Code Online (Sandbox Code Playgroud)

但是,我 …

javascript node.js cheerio jsonframe-cheerio

9
推荐指数
2
解决办法
973
查看次数

Twitter Boostrap - 水平对齐标签到下拉列表

我想在下拉菜单旁边有下拉列表的标签.

在下面找到我当前示例的样子:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<ul class="nav nav-pills" role="tablist">
  <li role="presentation">Order: </li>
  <li role="presentation" class="dropdown">
    <a href="#" class="dropdown-toggle" id="drop4" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Ticker<span class="caret"></span></a>
    <ul class="dropdown-menu" id="menu1" aria-labelledby="drop4">
      <li>
        <a href="#">Action</a>
      </li>
      <li>
        <a href="#">Another action</a>
      </li>
      <li>
        <a href="#">Something else here</a>
      </li>
      <li role="separator" class="divider"></li>
      <li>
        <a href="#">Separated link</a>
      </li>
    </ul>
  </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

有关如何正确对齐标签的任何建议吗?

Thx提前!

css twitter-bootstrap

9
推荐指数
1
解决办法
198
查看次数

从网站刮痧表,用javascript:subOpen href链接

我想为此页面上的每个链接搜索后面的页面详细信息页面.

我可以在这个页面上获得所有信息:PAGE

但是,我想在详细信息页面上获取所有信息,但href链接看起来像这样,例如:

href="javascript:subOpen('9ca8ed0fae15d43dc1257e7300345b99')"
Run Code Online (Sandbox Code Playgroud)

这是我的示例电子表格,使用该ImportHTML函数来获得一般概述.

Google电子表格

有关如何获取详细信息页面的任何建议?

UPDATE

我实现了以下方法:

function doGet(e){
  var base = 'http://www.ediktsdatei.justiz.gv.at/edikte/ex/exedi3.nsf/'
  var feed =  UrlFetchApp.fetch(base + 'suche?OpenForm&subf=e&query=%28%5BVKat%5D%3DEH%20%7C%20%5BVKat%5D%3DZH%20%7C%20%5BVKat%5D%3DMH%20%7C%20%5BVKat%5D%3DMW%20%7C%20%5BVKat%5D%3DMSH%20%7C%20%5BVKat%5D%3DGGH%20%7C%20%5BVKat%5D%3DRH%20%7C%20%5BVKat%5D%3DHAN%20%7C%20%5BVKat%5D%3DWE%20%7C%20%5BVKat%5D%3DEW%20%7C%20%5BVKat%5D%3DMAI%20%7C%20%5BVKat%5D%3DDTW%20%7C%20%5BVKat%5D%3DDGW%20%7C%20%5BVKat%5D%3DGA%20%7C%20%5BVKat%5D%3DGW%20%7C%20%5BVKat%5D%3DUL%20%7C%20%5BVKat%5D%3DBBL%20%7C%20%5BVKat%5D%3DLF%20%7C%20%5BVKat%5D%3DGL%20%7C%20%5BVKat%5D%3DSE%20%7C%20%5BVKat%5D%3DSO%29%20AND%20%5BBL%5D%3D0').getContentText();

       var d = document.createElement('div'); //assuming you can do this
       d.innerHTML = feed;//make the text a dom structure
       var arr = d.getElementsByTagName('a') //iterate over the page links
       var response = "";
       for(var i = 0;i<arr.length;i++){
         var atr = arr[i].getAttribute('onclick');
         if(atr) atr = atr.match(/subOpen\((.*?)\)/) //if onclick calls subOpen
         if(atr && atr.length > 1){ //get the id
            var detail …
Run Code Online (Sandbox Code Playgroud)

javascript google-sheets

8
推荐指数
1
解决办法
279
查看次数

无法索引文件

我用我正在运行的git从github克隆了我的repo git version 2.16.2.windows.1.

但是,当我想提交它时,我收到以下错误:

error: open("src/hoc/Aux.js"): No such file or directory
error: unable to index file src/hoc/Aux.js
fatal: adding files failed
Run Code Online (Sandbox Code Playgroud)

您可以在下面找到文件夹和文件内容:

在此输入图像描述

有什么建议我做错了吗?

感谢您的回复!

更新

请在下面找到git status给我的东西:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        README.md
        config/
        package-lock.json
        package.json
        public/
        scripts/
        src/

nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)

更新1 …

git

8
推荐指数
1
解决办法
3554
查看次数

Ckeditor - 在"选择"字段中加载动态字段值

我正在尝试为ckeditor中的下拉字段加载动态输入值:

正如您在按下按钮时所看到的,下拉列表中未加载任何值:

在此输入图像描述

我想在我的下拉列表中加载以下值(应该与onLoad函数中的reged匹配):

{{ $slot }}
{{$example }}
{{ $Product2}}
{{$category1 }}
Run Code Online (Sandbox Code Playgroud)

由于代码片段不在堆栈片段上运行,因此我在codepen上完全解决了问题.请参阅以下链接:https://codepen.io/anon/pen/NBXObP

我的插件代码如下所示:

var selectedList = []

CKEDITOR.replace("editor", {
  extraPlugins: "insertData"
});

CKEDITOR.plugins.add( 'insertData', {

    icons: '',
    init: function( editor ) {

        editor.addCommand( 'insertData', new CKEDITOR.dialogCommand( 'insertDataDialog' ) );
        editor.ui.addButton( 'InsertData', {
            label: 'Insert InsertData',
            command: 'insertData',
            toolbar: 'insert'
        });

        if ( editor.contextMenu ) {
            editor.addMenuGroup( 'insertDataGroup' );
            editor.addMenuItem( 'insertDataItem', {
                label: 'Edit InsertData',
                icon: this.path + 'icons/insertData.png',
                command: 'insertData',
                group: 'insertDataGroup'
            });

            editor.contextMenu.addListener( …
Run Code Online (Sandbox Code Playgroud)

javascript wysiwyg ckeditor ckeditor4.x

8
推荐指数
1
解决办法
427
查看次数

Goutte - Get inner values from $crawler-&gt;filter()

I am using PHP 7.1.33 and "fabpot/goutte": "^3.2". My composer file looks like the following:

{
    "name": "ubuntu/workspace",
    "require": {
        "fabpot/goutte": "^3.2"
    },
    "authors": [
        {
            "name": "admin",
            "email": "admin@admin.com"
        }
    ]
}

Run Code Online (Sandbox Code Playgroud)

I am trying to get details by a time range from a webpage but struggle how to pass the $crawler-values to my final result array $res1Array.

I tried the following:

<?php
require 'vendor/autoload.php';

use Goutte\Client;
use Symfony\Component\DomCrawler\Crawler;

/**
 * Crawls Detail Calender
 * Does …
Run Code Online (Sandbox Code Playgroud)

php goutte domcrawler

8
推荐指数
1
解决办法
1994
查看次数

类是受管理的,但未在persistence.xml文件中列出

我在我的项目中遇到以下异常:

管理类"com.testApp.domain.Register",但未在persistence.xml文件中列出

我的persistence.xml文件看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

    <persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <properties>
            <property name="hibernate.archive.detection" value="class, hbm" />
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.format_sql" value="true" />

            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
            <property name="hibernate.hbm2ddl.auto" value="update" />

            <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
            <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:." />
            <property name="hibernate.connection.username" value="SA" />
            <property name="hibernate.connection.password" value="" />

            <property name="hibernate.c3p0.min_size" value="5" />
            <property name="hibernate.c3p0.max_size" value="20" />
            <property name="hibernate.c3p0.timeout" value="300" />
            <property name="hibernate.c3p0.max_statements" value="50" />
            <property name="hibernate.c3p0.idle_test_period" value="3000" />

        </properties>
    </persistence-unit>

</persistence>
Run Code Online (Sandbox Code Playgroud)

我已经尝试过这篇 …

java spring persistence hibernate jpa

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