Welcome to the Gutenberg Editor

Of Mountains & Printing Presses

The goal of this new editor is to make adding rich content to WordPress simple and enjoyable. This whole post is composed of pieces of content—somewhat similar to LEGO bricks—that you can move around and interact with. Move your cursor around and you’ll notice the different blocks light up with outlines and arrows. Press the arrows to reposition blocks quickly, without fearing about losing things in the process of copying and pasting.

What you are reading now is a text block the most basic block of all. The text block has its own controls to be moved freely around the post…

… like this one, which is right aligned.

Headings are separate blocks as well, which helps with the outline and organization of your content.

A Picture is Worth a Thousand Words

Handling images and media with the utmost care is a primary focus of the new editor. Hopefully, you’ll find aspects of adding captions or going full-width with your pictures much easier and robust than before.

Beautiful landscape
If your theme supports it, you’ll see the “wide” button on the image toolbar. Give it a try.

Try selecting and removing or editing the caption, now you don’t have to be careful about selecting the image or other text by mistake and ruining the presentation.

The Inserter Tool

Imagine everything that WordPress can do is available to you quickly and in the same place on the interface. No need to figure out HTML tags, classes, or remember complicated shortcode syntax. That’s the spirit behind the inserter—the (+) button you’ll see around the editor—which allows you to browse all available content blocks and add them into your post. Plugins and themes are able to register their own, opening up all sort of possibilities for rich editing and publishing.

Go give it a try, you may discover things WordPress can already add into your posts that you didn’t know about. Here’s a short list of what you can currently find there:

  • Text & Headings
  • Images & Videos
  • Galleries
  • Embeds, like YouTube, Tweets, or other WordPress posts.
  • Layout blocks, like Buttons, Hero Images, Separators, etc.
  • And Lists like this one of course 🙂

Visual Editing

A huge benefit of blocks is that you can edit them in place and manipulate your content directly. Instead of having fields for editing things like the source of a quote, or the text of a button, you can directly change the content. Try editing the following quote:

The editor will endeavor to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017

The information corresponding to the source of the quote is a separate text field, similar to captions under images, so the structure of the quote is protected even if you select, modify, or remove the source. It’s always easy to add it back.

Blocks can be anything you need. For instance, you may want to add a subdued quote as part of the composition of your text, or you may prefer to display a giant stylized one. All of these options are available in the inserter.

You can change the amount of columns in your galleries by dragging a slider in the block inspector in the sidebar.

Media Rich

If you combine the new wide and full-wide alignments with galleries, you can create a very media rich layout, very quickly:

Accessibility is important — don’t forget image alt attribute

Sure, the full-wide image can be pretty big. But sometimes the image is worth it.

The above is a gallery with just two images. It’s an easier way to create visually appealing layouts, without having to deal with floats. You can also easily convert the gallery back to individual images again, by using the block switcher.

Any block can opt into these alignments. The embed block has them also, and is responsive out of the box:

You can build any block you like, static or dynamic, decorative or plain. Here’s a pullquote block:

Code is Poetry

The WordPress community

If you want to learn more about how to build additional blocks, or if you are interested in helping with the project, head over to the GitHub repository.


Thanks for testing Gutenberg!

👋

Torch-rnn

视频:https://youtu.be/NG-LATBZNBs?list=PLlF2F_XFTTKKR_vHU0UDrjU6PLxI_41Yk

安装:http://www.jeffreythompson.org/blog/2016/03/25/torch-rnn-mac-install/

https://github.com/jcjohnson/torch-rnn

注意:

要在python2.7环境下安装:

conda create -n python2 python=2.7 <anaconda 加这条表示安装所有库>


 

关于以上的错误,参考如下:

https://github.com/deepmind/torch-hdf5/issues/83#issuecomment-254427843

change


 

local process = io.popen(“gcc -E ” .. headerPath) — TODO pass -I

to

local process = io.popen(“gcc -D ‘_Nullable=’ -E ” .. headerPath) — TODO pass -I


 


 

在torch-rnn目录下执行:

th sample.lua -checkpoint cv/checkpoint_17000.t7 -length 2000 -gpu -1 <-temperature 0.2 取值在0-1之间,越小越像正常英语> > <shakespeare.txt 可选存到此文件中>

TensorFlow与OpenCV,读取图片,进行简单操作并显示

TensorFlow与OpenCV,读取图片,进行简单操作并显示 难度1

http://blog.csdn.net/helei001/article/details/52400497


 

import tensorflow as tf

import cv2

 

#file_path = ‘/Users/cloveai/Desktop/’

#ilename = ‘1.jpg’

 

image = cv2.imread(‘/Users/cloveai/Desktop/1.jpg’, 1)

cv2.namedWindow(‘image’, 0)

cv2.imshow(‘image’, image)

 

# Create a TensorFlow Variable

x = tf.Variable(image, name=’x’)

 

#model = tf.initialize_all_variables()

model = tf.global_variables_initializer()

with tf.Session() as session:

    x = tf.transpose(x, perm=[1, 0, 2])

    session.run(model)

    result = session.run(x)

 

cv2.namedWindow(‘result’, 0)

cv2.imshow(‘result’, result)

cv2.waitKey(0)

树莓派超级计算机

  1. 安装mpi4py https://www.youtube.com/watch?v=bBpKq3Y-E2g&list=PLlF2F_XFTTKI2lGpp-tDRthxVCqRG6gNz

http://www.tinkernut.com/2014/04/make-cluster-computer/

http://www.tinkernut.com/2014/05/make-cluster-computer-part-2/


 

cd ./mpi4py-2.0.0

mpiexec -n <numofprocessor> python demo/helloworld.py


 


 


 

  1. 安装opencv3 http://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

source ~./profile

workon cv

python

import cv2


 


 


 

  1. 安装tensorflow

https://github.com/samjabrahams/tensorflow-on-raspberry-pi#installing-from-pip

https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blo

另一种方式:https://github.com/samjabrahams/tensorflow-on-raspberry-pi

python3

import tensorflow


 


 

  1. 安装Google Assistant https://developers.google.com/assistant/sdk/prototype/getting-started-pi-python/run-sample


https://pypi.python.org/pypi/google-assistant-sdk

进入虚拟Python命令:source gooassistant/bin/activate

退出:deactivate

音频设备查看:arecord -l aplay -l 查看card和device

音频录制:arecord -d 10 -D plughw:<cardid>,<deviceid> test.wav ///默认保存在/home/pi

执行命令:google-assistant-demo


 


 


 


 


 


 


 

  1. 备份


 

scp -r filename.py <ip address>:/home/pi

mpiexec -r machinefile -n 1 python filename.py

MarI/O缺附件


 

  1. 安装bizhawk_prereqs_v1.4
  2. 网上下载Super Mario World (USA).sfc 或类似游戏,将文件名改为此
  3. 打开EmuHawk.exe,载入ROM。模拟器选择SNES。
  4. 在开局进行手动命名存档,存档名为DP1.State,将此存档放在模拟器根目录下和Lua目录下
  5. 载入lua脚本
  6. 观察
  7. 备份文件是Lua文件夹里的backup.xx.DP1.state.pool。每次断开重新开始时可以载入最后一个文件修改名字为DP1.state.pool


 

原地址:https://www.youtube.com/watch?v=qv6UVOQ0F44

AI test by Facebook

地址:https://github.com/facebook/bAbI-tasks


 

安装torch 和 luajit:

git clone https://github.com/torch/distro.git ~/torch –recursive

cd ~/torch

bash install-deps

./install.sh

source /Users/chenhongyu/torch/install/bin/torch-activate

luarocks make babitasks-scm-1.rockspec


 

每次执行前运行:

source /Users/chenhongyu/torch/install/bin/torch-activate


 


 


 

执行代码:

例如:

babi-tasks 3

fast-style-transfer 图像滤镜

网址:https://github.com/floydhub/fast-style-transfer


 


 

对于错误:

Traceback (most recent call last):

File “evaluate.py”, line 267, in <module>

main()

File “evaluate.py”, line 264, in main

batch_size=opts.batch_size)

File “evaluate.py”, line 147, in ffwd

preds = transform.net(img_placeholder)

File “src/transform.py”, line 14, in net

conv_t1 = _conv_tranpose_layer(resid5, 64, 3, 2)

File “src/transform.py”, line 38, in _conv_tranpose_layer

tf_shape = tf.pack(new_shape)

AttributeError: ‘module’ object has no attribute ‘pack’


 

修改src/transform.py”, line 14, 将tf.pack 替换成 tf.stack