previous相关知识
-
$ionicHistory API的相关知识$ionicHistory 定义:$ ionicHistory在用户浏览应用程序时跟踪页面。获取页面信息,进行页面跳转操作。特点:Should a user navigate few pages deep on one tab, and then switch to a new tab and back, the back button relates not to the previous tab, but to the previous pages visited within that tab.记录历史界面,而不会在两个界面中来回返回。方法列表:viewHistory()返回该应用程序的视图历史数据,如所有的视图和历史记录Returns: objectReturns an object containing the apps view history data.currentView()该应用程序的当前视图。Returns: objectReturns the current view.current
-
android6.0官方教程笔记——Starting Another ActivityAfter completing the previous lesson, you have an app that shows an activity (a single screen) with a text field and a button. In this lesson, you’ll add some code to MyActivity that starts a new activity when the user clicks the Send button. Ⅰ.Respond to the Send Button 1.In Android Studio, from the res/layout directory, edit the activity_my.xml file. 2.To the <Button> element, add the an
-
微信小程序实现类3D轮播图在写微信小程序时,有写到实现3D轮播图的效果,可以直接使用微信小程序中自带的组件swiper来实现效果图如下:image.png1.swiper的相关属性indicator-dots 是否显示小圆点,也可以自己重新设置小圆点circular 是否衔接滑动,就是实现无限滚动previous-margin 与上一张图片的间距next-margin 与下一张图片的间距autoplay 实现自动滚动这里主要利用了circular实现无限滚动,然后再加上前后间距,再设置图片的层级和透明度就可以实现了,将图片及容器的高度设置好就差不多可以实现了wxml文件<!--carousel/index.wxml--><swiper class="imageContainer" bindchange="handleChange" previous-margin="50rpx" next-margin="5
-
MySQL DELETE JOIN语句Summary: in this tutorial, we’ll show you how to delete data from multiple tables by using MySQL DELETE JOIN statement.In the previous tutorial, we showed you several ways to delete records from multiple tables by using:A single DELETE statement on multiple tables.A single DELETE statement on multiple tables where the child tables have ON DELETE CASCADE referential actions for the foreign keys.This tutorial
previous相关课程
previous相关教程
- 5.4 项目之间切换 PyCharm 是允许在不同窗口打开多个项目的,如何在多个打开项目中切换呢?使用下面的命令:Window -> Next Project Window Window -> Previous Project Window
- 使用 TensorBoard 记录训练中的各项指标 在前面的学习中,我们学习到了如何使用 TensorBoard 来记录 Loss 等基本的参数。那么我们可以定义更加复杂的参数指标,以至于可以自定义指标吗?答案是可以的,那么我们这节课便来学习一下如何在 TensorBoard 之中输出更加复杂的指标甚至自定义指标。In the previous tutorial, we learned how to use the TensorBoard to record basic parameters such as Loss. So can we define more complex parameter metrics to the point where we can customize metrics? The answer is yes, so let’s take a look at how to output more complex metrics or even custom metrics in the TensorBoard.自定义指标大致可以分为两种:There are two broad categories of custom metrics:使用回调进行自定义的输出; Custom output using callbacks;在自定义循环中手动添加输出。 Manually add output in a custom loop我们这节课来分别学习以下如何使用两者来进行自定义的输出。In this lesson, we will learn how to use each of the following to customize the output.
- 2.13 takeLastWhile 操作符 从集合的最后一项开始取出满足条件元素,这样操作一直持续到出现第一个不满足条件元素出现为止,暂停取元素,返回取出元素的集合。源码定义public inline fun <T> List<T>.takeLastWhile(predicate: (T) -> Boolean): List<T> { if (isEmpty())//如果当前集合是一个空的,那么直接返回空集合 return emptyList() val iterator = listIterator(size)//表示从集合index = size开始迭代,那么size - 1也是最后一个元素,也即是迭代器的previous,也就是从集合尾部开始向头部迭代 while (iterator.hasPrevious()) {//含有上一个元素的元素继续进入迭代 if (!predicate(iterator.previous())) {//直到某个元素的前一个元素不符合条件,也是从最后一项开始遇到第一个不符合条件的元素,不进入以下操作 iterator.next() val expectedSize = size - iterator.nextIndex()//由于从尾部开始迭代,那么符合条件元素集合的expectedSize等于原集合size与当前下一个元素的index的差值 if (expectedSize == 0) return emptyList()//差值为0的话说明,在原集合尾部开始迭代就不符合条件被终止,所以返回空集合 return ArrayList<T>(expectedSize).apply {//拿到符合条件元素集合size,创建expectedSize大小新集合,并把迭代器中的元素遍历加入到新集合中 while (iterator.hasNext()) add(iterator.next()) } } } return toList()}源码解析takeLastWhile 操作符是一个集合的扩展内联函数,也是一个高阶函数,它接收一个以接收T泛型参数返回一个 Boolean 类型的 Lambda 表达式,也是即是 takeLastWhile 取元素的条件的实现。原理图解使用场景适用于取出集合中后半部分具有相同特征的元素场景。fun main(args: Array<String>) { val strList = listOf("java", "javaScript", "kotlin", "C", "C++", "javaFx", "python","Go", "Swift", "Scala") strList.takeLastWhile { it.startsWith("S") }.forEach { print("$it ") }}
- 1.3 如何学习和使用第三方模块 这里我们演示在 Nginx 中使用第三方模块。 Openresty 社区提供了一款 Nginx 中的 Echo 模块,即echo-nginx-module。在 Nginx 中添加了该模块后,我们在配置文件中可以使用该模块提供的 echo 指令返回用户响应,简单方便。该模块的源码在 github 上,并且有良好的文档和使用示例,非常方便开发者使用。现在我们在 Nginx 的源码编译阶段加入该第三方模块,具体操作如下:[root@server shencong]# pwd/root/shencong[root@server shencong]# mkdir nginx-echo# 下载 nginx 源码包和第三方模块的源码包 [root@server shencong]# wget http://nginx.org/download/nginx-1.17.6.tar.gz[root@server shencong]# wget https://github.com/openresty/echo-nginx-module/archive/v0.62rc1.tar.gz# 解压[root@server shencong]# tar -xzf nginx-1.17.6.tar.gz[root@server shencong]# tar -xzf v0.62rc1.tar.gz[root@server shencong]# lsecho-nginx-module-0.62rc1 nginx-1.17.6 nginx-1.17.6.tar.gz nginx-echo v0.62rc1.tar.gz[root@server shencong]# cd nginx-1.17.6# 使用--add-module添加第三方模块,参数为第三方模块源码[root@server shencong]# ./configure --prefix=/root/shencong/nginx-echo --add-module=/root/shencong/echo-nginx-module-0.62rc1编译完成后,我们就可以去nginx-echo目录中的 nginx.conf文件中添加echo 指令 。准备如下的配置(可以参参考社区提供的示例):...http { server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } # 新增测试 echo 指令配置 location /timed_hello { default_type text/plain; echo_reset_timer; echo hello world; echo "'hello world' takes about $echo_timer_elapsed sec."; echo hiya igor; echo "'hiya igor' takes about $echo_timer_elapsed sec."; } location /echo_with_sleep { default_type text/plain; echo hello world; echo_flush; # ensure the client can see previous output immediately echo_sleep 2.5; # in sec echo "'hello' takes about $echo_timer_elapsed sec."; } }}...启动 Nginx 后,我们就可以在浏览器上请求者两个 URI 地址,看到相应 echo 返回的信息了。第二个配置是使用了 echo_sleep 指令,会使得请求在休眠 2.5s 后才返回。
- 2. 在自定义循环之中自定义输出指标 在上面的例子之中,我们发现了在调用回调的过程之中,最核心的语句是如下的指示输出语句:In the example above, we found that the core statement during a callback call is the following directive output statement:tf.summary.scalar()既然如此,那么我们是否可以自己定义何时进行输出,以及输出什么内容呢?答案是肯定的,我们这一小结就会采用 tf.summary.scalar() 这一个核心 API 来进行自定义的指标的输出。In that case, can we define for ourselves when to output and what to output? The answer is yes, and we’ll use TF. For this summary. It’s not gonNA happen. SCALAR () is the core API for custom metric output.首先,我们仍然采用前面的模型与数据:First, we still use the previous models and data:import tensorflow as tfimport numpy as np(train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_data()# 数据归一化train_images = train_images / 255.0test_images = test_images / 255.0train_dataset = tf.data.Dataset.from_tensor_slices((train_images, train_labels))train_dataset = train_dataset.shuffle(buffer_size=1024).batch(64)valid_dataset = tf.data.Dataset.from_tensor_slices((test_images, test_labels))valid_dataset = valid_dataset.batch(64)model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(256, activation='relu'), tf.keras.layers.Dense(10, activation='softmax')])然后我们就可以定义我们的文件写入器,并且指定其日志写入目录:Then we can define our file writer and specify its log to write to the directory:file_writer = tf.summary.create_file_writer("logs/3")file_writer.set_as_default()最后就到了我们的重头戏,我们可以编写自定义循环,并且在自定义循环之中定义我们要输出的指标,以及输出的频率等:Finally, we get to the point where we can write a custom loop, and in the custom loop we define the metrics we want to output, the frequency of output, and so on:loss_fn = tf.keras.losses.SparseCategoricalCrossentropy()optimizer = tf.keras.optimizers.Adam()val_acc = tf.keras.metrics.SparseCategoricalAccuracy()epochs = 3for epoch in range(epochs): for batch_i, (x_batch_train, y_batch_train) in enumerate(train_dataset): with tf.GradientTape() as tape: outputs = model(x_batch_train, training=True) loss_value = loss_fn(y_batch_train, outputs) grads = tape.gradient(loss_value, model.trainable_weights) optimizer.apply_gradients(zip(grads, model.trainable_weights)) if batch_i % 10 == 0: # 对训练数据进行Log tf.summary.scalar('train_loss', data=float(loss_value), step=epoch*len(train_dataset)+batch_i) print("Loss at step %d: %.4f" % (epoch*len(train_dataset)+batch_i, float(loss_value))) for batch_i, (x_batch_train, y_batch_train) in enumerate(valid_dataset): # 对测试数据进行Log outputs = model(x_batch_train, training=False) val_acc.update_state(y_batch_train, outputs) tf.summary.scalar('valid_acc', data=float(val_acc.result()), step=epoch) val_acc.reset_states()在这里,我们在训练的过程之中使用 tf.summary.scalar 这个 API 进行指标的输出;而且我们让其没 10个批次进行一次输出。Here, we use the TF. In the training process. It’s not gonNA happen. The scalar API does the metric’s output; and we let it do it all at once in less than 10 batches.于是我们可以得到我们在训练集上的 Loss 指标为:So we get our Loss indicator on the training set as follows:由此,我们完成了如何自定义进行指标输出的工作。This completes the work of customizing the output of the metric.
- 3.3 内存异常 内存不足可能会导致系统发生颠簸,这是因为虽然内存不足时系统会终止某些进程来释放内存,但又会继续启动其他进程。要查看内存不足的确凿证据,请检查二进制事件日志中 am_proc_died 和 am_proc_start 条目的密集程度。内存不足还可能会减慢任务切换速度,并且可能会阻止进行返回尝试(因为用户尝试返回到的任务已被终止)。如果启动器被终止,它会在用户触摸主屏幕按钮时重启,并且日志中会显示启动器重新加载其内容。查看历史指标二进制事件日志中的 am_low_memory 条目表示最后一个缓存的进程已终止。在此之后,系统开始终止各项服务。日志范例如下:grep "am_low_memory" bugreport-2015-10-01-18-13-48.txt10-01 18:11:02.219 4600 7513 I am_low_memory: 4110-01 18:12:18.526 4600 14112 I am_low_memory: 3910-01 18:12:18.874 4600 7514 I am_low_memory: 3810-01 18:12:22.570 4600 14112 I am_low_memory: 4010-01 18:12:34.811 4600 20319 I am_low_memory: 4310-01 18:12:37.945 4600 6521 I am_low_memory: 4310-01 18:12:47.804 4600 14110 I am_low_memory: 43查看系统颠簸指标关于系统颠簸(分页、直接回收等)的其他指标包括 kswapd、kworker 和 mmcqd 消耗的 CPU 周期。日志范例如下:CPU INFO (top -n 1 -d 1 -m 30 -t)User 15%, System 54%, IOW 28%, IRQ 0%User 82 + Nice 2 + Sys 287 + Idle 1 + IOW 152 + IRQ 0 + SIRQ 5 = 529 PID TID PR CPU% S VSS RSS PCY UID Thread Proc15229 15229 0 19% R 0K 0K fg root kworker/0:229512 29517 1 7% D 1173524K 101188K bg u0_a27 Signal Catcher com.google.android.talk24565 24570 3 6% D 2090920K 145168K fg u0_a22 Signal Catcher com.google.android.googlequicksearchbox:search19525 19525 2 6% R 3476K 1644K fg shell top top24957 24962 2 5% R 1706928K 125716K bg u0_a47 Signal Catcher com.google.android.GoogleCamera19519 19519 3 4% S 0K 0K fg root kworker/3:1 120 120 0 3% S 0K 0K fg root mmcqd/118233 18233 1 3% S 0K 0K fg root kworker/1:125589 25594 1 2% D 1270476K 75776K fg u0_a8 Signal Catcher com.google.android.gms19399 19399 2 1% S 0K 0K fg root kworker/2:2 1963 1978 1 0% S 1819100K 125136K fg system android.fg system_server 1963 1981 3 0% S 1819100K 125136K fg system android.display system_server获取内存快照内存快照是一种 dumpstate,其中会列出正在运行的 Java 进程和本机进程.日志范例如下:Total PSS by OOM adjustment: 86752 kB: Native 22645 kB: surfaceflinger (pid 197) 18597 kB: mediaserver (pid 204) 136959 kB: System 136959 kB: system (pid 785) 220218 kB: Persistent 138859 kB: com.android.systemui (pid 947 / activities) 39178 kB: com.android.nfc (pid 1636) 28313 kB: com.android.phone (pid 1659) 13868 kB: com.redbend.vdmc (pid 1646) 9534 kB: Persistent Service 9534 kB: com.android.bluetooth (pid 23807) 178604 kB: Foreground 168620 kB: com.google.android.googlequicksearchbox (pid 1675 / activities) 9984 kB: com.google.android.apps.maps (pid 13952) 188286 kB: Visible 85326 kB: com.google.android.wearable.app (pid 1535) 38978 kB: com.google.process.gapps (pid 1510) 31936 kB: com.google.android.gms.persistent (pid 2072) 27950 kB: com.google.android.gms.wearable (pid 1601) 4096 kB: com.google.android.googlequicksearchbox:interactor (pid 1550) 52948 kB: Perceptible 52948 kB: com.google.android.inputmethod.latin (pid 1566) 150851 kB: A Services 81121 kB: com.google.android.gms (pid 1814) 37586 kB: com.google.android.talk (pid 9584) 10949 kB: com.google.android.music:main (pid 4019) 10727 kB: com.motorola.targetnotif (pid 31071) 10468 kB: com.google.android.GoogleCamera (pid 9984) 33298 kB: Previous 33298 kB: com.android.settings (pid 9673 / activities) 165188 kB: B Services 49490 kB: com.facebook.katana (pid 15035) 22483 kB: com.whatsapp (pid 28694) 21308 kB: com.iPass.OpenMobile (pid 5325) 19788 kB: com.google.android.apps.googlevoice (pid 23934) 17399 kB: com.google.android.googlequicksearchbox:search (pid 30359) 9073 kB: com.google.android.apps.youtube.unplugged (pid 21194) 7660 kB: com.iPass.OpenMobile:remote (pid 23754) 7291 kB: com.pujie.wristwear.pujieblack (pid 24240) 7157 kB: com.instagram.android:mqtt (pid 9530) 3539 kB: com.qualcomm.qcrilmsgtunnel (pid 16186) 204324 kB: Cached 43424 kB: com.amazon.mShop.android (pid 13558) 22563 kB: com.google.android.apps.magazines (pid 13844) 4298 kB: com.google.android.apps.enterprise.dmagent (pid 13826)
previous相关搜索
-
pack
package
package文件
padding
pages
page对象
panda
panel
panel控件
param
parameter
parcel
parent
parentnode
parents
parse
parse error
parseint
partition
pascal