text 解析本地josn-18-8-9

解析本地josn-18-8-9

josn
Sub TestJson()
Dim jsstr As String

'vb搞个字符串要加n个引号,真是烦人
jsstr = "{""系别"":""历史系"",""班级"":""一班""," & _
         """学员"":[{""姓名"":""张三"",""年龄"":25,""性别"":""男""}," & _
                   "{""姓名"":""李四"",""年龄"":20,""性别"":""男""}," & _
                   "{""姓名"":""小明"",""年龄"":20,""性别"":""女""}" & _
                  "]" & _
         "}"
        
'前期绑定方便使用智能提示
Dim scobj As New MSScriptControl.ScriptControl
Dim age As Integer

'ScriptControl使用的脚本语言。除了js,也支持Vbscript
scobj.Language = "JavaScript"

'往脚本里添加代码,参数是字符串
scobj.AddCode ("var query = " & jsstr)

'JSON对象获取属性的表示方法:对象.属性
'属性的值如果是个包含多个对象的数组,可以使用索引表示取得对象:对象.属性[0]
'Eval是表达式求值
age = scobj.Eval("query.学员[2].年龄")

Debug.Print "历史系一班的第3个学员的年龄是" & age & "岁"
        
End Sub

text 环回登录包括关系

loopback login include relation
module.exports = function(Appuser) {
  Appuser.afterRemote('login', async (ctx, user, next) => {
  if(user){
  // console.log("hit")
  user.token = user.id;
  let userData = await Appuser.find({
  fields:{password: false, username: false, realm: false, '_id': 0},
  include:{
  relation: 'stocks',
  scope: {
  fields: ['name', 'symbol']
 }, },  where: {
  id: user.userId
  }
 })  console.log()
  user.userData = userData[0]
 } })
};

text api

whther api
http 'api.openweathermap.org/data/2.5/forecast?q=Warszawa,POL&APPID=1d17111d8a80cd72629838112d6ddcef

text Cuando despues de registrar o登录los datos del customer no aparecen dentro del header

Cuando despues de registrar o登录los datos del customer no aparecen dentro del header

customer-data-doesnt-load
<referenceContainer name="content">
        <block name="customer.section.config" class="Magento\Customer\Block\SectionConfig"
               template="Magento_Customer::js/section-config.phtml"/>
        <block name="customer.customer.data"
               class="Magento\Customer\Block\CustomerData"
               template="Magento_Customer::js/customer-data.phtml"/>
    </referenceContainer>

text 客户数据无法加载

Cuando despues de registrar o登录los datos del customer no aparecen dentro del header

customer-data-doesnt-load
<referenceContainer name="content">
        <block name="customer.section.config" class="Magento\Customer\Block\SectionConfig"
               template="Magento_Customer::js/section-config.phtml"/>
        <block name="customer.customer.data"
               class="Magento\Customer\Block\CustomerData"
               template="Magento_Customer::js/customer-data.phtml"/>
    </referenceContainer>

text FindThePrecious

FindThePrecious

FindThePrecious
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="description" content="All the informations to support Sauron and win against elves, dwarves, hobbits, etc.">
    <title>FindThePrecious.com</title>
</head>
<body>

    <header>
        <h1>FindThePrecious.com</h1>
        <nav>
            <ul>
                <li><a href="#fellows">Fellows</a></li>
                <li><a href="#ring">The Ring</a></li>
                <li><a href="#reward">Get my reward</a></li>
                <li><a href="#hunters">Best hunters</a></li>
                <li><a href="#join">Join the army</a></li>
                <li><a href="#contact">Contact us</a></li>
            </ul>
        </nav>
    </header>

    <section id="carousel">
        <h2>Dangerous fellowship try to destroy the ring</h2>
        <p>Orcs, Goblins, Balrogs, protect your master Sauron</p>
    </section>

    <section id="fellows">
        <h2>Fellows wanted dead</h2>
        <p>(or alive if you want to eat them later)</p>
        <div id="choice_fellows">
            <button class="switch_cat_fellow">Most wanted</button>
            <button class="switch_cat_fellow">Most dangerous</button>
            <button class="switch_cat_fellow">Already captured</button>
        </div>
        <div id="portrait">
            <div class="box_portrait">
                <a href="https://placeholder.com"><img src="http://via.placeholder.com/150x150" alt="Wizard portrait"></a>
                <p class="money">Reward 1000 gold coins</p>
                <h3>The Wizard</h3>
                <p>Small description</p>
            </div>

            <div class="box_portrait">
                <a href="https://placeholder.com"><img src="http://via.placeholder.com/150x150" alt="Hobbit portrait"></a>
                <h3>Hobbit #3</h3>
                <p>Small description</p>
            </div>

            <div class="box_portrait">
                <a href="https://placeholder.com"><img src="http://via.placeholder.com/150x150" alt="Dwarf portrait"></a>
                <p class="money">Reward 250 gold coins</p>
                <h3>Yummy Dwarf</h3>
                <p>Small description</p>
            </div>
        </div>
    </section>

    <section id="reward">
        <h2>I have captured one of them, how to get my reward ?</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. </p>
        <a href="https://placeholder.com"><img src="http://via.placeholder.com/140x140" alt="reward"></a>
        <button id="button_contact">Contact us</button>
    </section>

    <section id="hunters">
        <h2>Best hunters</h2>
        <div class="box_hunter">
            <a href="https://placeholder.com"><img src="http://via.placeholder.com/70x70" alt="ElvesKiller22"></a>
            <h3>ElvesKiller22</h3>
            <p>2 captures - </p><a href="">Profile</a>
            <span class="like_count">Like 68K</span>
        </div>
        <div class="box_hunter">
                <a href="https://placeholder.com"><img src="http://via.placeholder.com/70x70" alt="Goblin45"></a>
                <h3>Goblin45</h3>
                <p>1 capture - </p><a href="">Profile</a>
                <span class="like_count">Like 68K</span>
            </div>
    </section>

    <section id="ring">
        <h2>About the ring</h2>
        <div class="box_ring">
            <h3>Ring Capabilities</h3>
            <p>What can our master Sauron do with the ring ?</p>
            <table>
                <tr><td>Feature</td><td>Description</td></tr>
                <tr><td>Main</td><td>One ring to rules them all</td></tr>
                <tr><td>Invisibilty</td><td>You can't see me</td></tr>
                <tr><td>Power</td><td>Destroy the world</td></tr>
            </table>
        </div>
        <div class="box_ring">
            <h3>Why the ring is so awesome ?</h3>
            <p>My precioooooussssss ! Hrk Hrk, we want our preeciooooouuussss !!</p>
            <p>Gollum</p>
            <a href="https://placeholder.com"><img src="http://via.placeholder.com/110x110" alt="Gollum portrait"></a>
        </div>
    </section>
    
    <section id="join">
        <h2>Join Mordor Army, we need you !</h2>
        <a href="https://placeholder.com"><img src="http://via.placeholder.com/140x140" alt="Join Mordor Army"></a>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit. </p>
        <a href="http://SauronRulesThemAll.com">More info on SauronRulesThemAll.com</a>
    </section>
    
    <section id="contact">
        <h2>Contact us</h2>
        <form method="POST" action="contact.php">
            <input type="email" name="mail" id="mail">
            <input type="text" name="postal_adress" id="postal_adress">
            <select name="reason" id="reason">
                <option>I have seen one of them</option>
                <option>I want to give money to Sauron</option>
                <option>I want to have a badass armor like Uruk-Haï</option>
            </select>
            <input type="text" name="message" id="message" placeholder="Your message">
        </form>
    </section>

    <footer>
        <div>
            <a href="">About us</a>
            <a href="#fellows">Fellows</a>
            <a href="#join">Join our army</a>
            <a href="">FAQ</a>
            <a href="reward">Reward conditions</a>
            <a href="">Legal mentions</a>
        </div>
        <div>
            <a href="http://Sauron4Ever.com">Sauron4Ever.com</a>
            <a href="">Follow him also on twitter</a>
        </div>
    </footer>
    
</body>
</html>

text 生成自定义导轨模板

default-rails-template
run 'rm README.doc'
run 'touch README.md'

gem 'haml-rails'

gem_group :development, :test do
  gem 'rspec-rails' 
  gem 'annotate'
  gem 'guard-rspec'
end

run 'bundle install'
generate 'rspec:install'
git :init 
git add: '--all', commit: '-m "Initial Commit" '
template-info
```rails new <project name> -T -m <path to template file>```  (-T Stops default testing files from being created )

text 找不到错误代客

error valet not found
in fresh installation of composer and you face " valet command not found "
type this line and you will see the magic hahahha : 

test -d ~/.composer && bash ~/.composer/vendor/bin/valet install || bash ~/.config/composer/vendor/bin/valet install

text Putty安全复制客户端

使用Putty Secure Copy Client向/从Linux服务器和Windows推送/拉出文件。

putty-secury-copy-client
pscp user@server.example.com:/home/username/file-to-download.zip C:\Users\Username\new-file.zip

text 安装犰狳

在Qt项目#linux #Qt中安装libarmadillo

install.sh
sudo apt-get install liblapack-dev
sudo apt-get install libblas-dev
sudo apt-get install libboost-dev

sudo apt-get install libarmadillo-dev
project.pro
LIBS += -llapack -lblas -larmadillo