我有数据,其中一些项目是由"|"分隔的数字,如:
head(mintimes)
[1] "3121|3151" "1171" "1351|1381" "1050" "" "122"
head(minvalues)
[1] 14 10 11 31 Inf 22
Run Code Online (Sandbox Code Playgroud)
我想要做的是提取所有时间并将它们与最小值匹配.最终结果如下:
times values
3121 14
3151 14
1171 10
1351 11
1381 11
1050 31
122 22
Run Code Online (Sandbox Code Playgroud)
我试过了strsplit(mintimes, "|"),str_extract(mintimes, "[0-9]+")但我尝试过,但似乎没有用.有任何想法吗?
我正在尝试让 GStreamer SDK 的 basic-tutorial-5 在 OSX 上工作。
SDK 从http://gstreamer.freedesktop.org/data/pkg/osx/1.2.4.1/下载
教程(1.0)来自http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/
我收到以下错误
basic-tutorial-5.c:5:10: fatal error: 'gst/video/videooverlay.h' file not found
Run Code Online (Sandbox Code Playgroud)
当我跑
gcc `pkg-config gstreamer-1.0 gtk+-3.0 --cflags --libs` basic-tutorial-5.c -o basic5
Run Code Online (Sandbox Code Playgroud)
任何指针都会有所帮助!
谢谢。
编辑:
有一个gst/video/videooverlay.h在/local/frameworks/Gstreamer.framework/Headers。
的输出pkg-config gstreamer-1.0 gtk+-3.0 --cflags --libs不包括/Library/Frameworks/Gstreamer.framework/Versions/1.0/Headers
感谢@Biffen 使用时
gcc `pkg-config --cflags --libs gtk+-3.0` -o basic5 basic-tutorial-5.c -I/Library/Frameworks/Gstreamer.framework/Versions/1.0/Headers -framework GStreamer
Run Code Online (Sandbox Code Playgroud)
还有一点动作:
basic-tutorial-5.c:114:17: warning: 'gtk_button_new_from_stock' is deprecated
[-Wdeprecated-declarations]
play_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/gtkbutton.h:103:16: note:
'gtk_button_new_from_stock' declared here
GtkWidget* gtk_button_new_from_stock …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行Gstreamer Java教程(https://code.google.com/p/gstreamer-java/wiki/Tutorials).但我现在遇到了"没有这样的Gstreamer工厂"的错误.
从在互联网上寻找它似乎与计算机架构(32或64位)有关,但我看不出如何解决问题.
我正在运行OSX 10.8.5(64位),Java 1.7.
有任何想法吗?
谢谢!埃德
编辑:
java -version
java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
并且运行的代码是:
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.*;
import org.gstreamer.*;
import org.gstreamer.swing.VideoComponent;
public class VideoTest {
public VideoTest() {
}
private static Pipeline pipe;
private static String libDir;
private static final Object[][] DEPENDENCIES = {
// glib libraries
{"gio-2.0", new String[]{}, true}, …Run Code Online (Sandbox Code Playgroud) 我正在通过GStreamer文档工作.我正在OSX 10.8.5上运行,我可以使用示例4.1代码(http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-init.html)从中获取GStreamer的资格.命令行gcc eg41.c -o eg41 -framework GStreamer -I/Library/Frameworks/GStreamer.framework/Versions/1.0/Headers
和类似的例如4.2.现在我想要完成SDK附带的教程.我复制了整个"教程"文件夹,可以编译第一个gcc basic-tutorial-1.c -o basic1 -framework GStreamer -I/Library/Frameworks/GStreamer.framework/Versions/1.0/Headers
但是,当我尝试运行basic1文件时,我收到以下错误消息:
(basic1:62265): GStreamer-CRITICAL **: GstStateChangeReturn gst_element_set_state(GstElement *, GstState): assertion 'GST_IS_ELEMENT (element)' failed
(basic1:62265): GStreamer-CRITICAL **: GstBus *gst_element_get_bus(GstElement *): assertion 'GST_IS_ELEMENT (element)' failed
(basic1:62265): GStreamer-CRITICAL **: GstMessage *gst_bus_timed_pop_filtered(GstBus *, GstClockTime, GstMessageType): assertion 'GST_IS_BUS (bus)' failed
(basic1:62265): GStreamer-CRITICAL **: void gst_object_unref(gpointer): assertion 'object != NULL' failed
(basic1:62265): GStreamer-CRITICAL **: GstStateChangeReturn gst_element_set_state(GstElement *, GstState): assertion 'GST_IS_ELEMENT (element)' failed
(basic1:62265): GStreamer-CRITICAL **: void gst_object_unref(gpointer): assertion …Run Code Online (Sandbox Code Playgroud)