我已经彻底搜索了整个访问被拒绝的问题,并且没有找到任何与我自己的系统上访问Windows窗体相关的问题,所有问题都与Web应用程序有关.
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
byte[] imgdata;
FileStream fsrw;
string fname;
openFileDialog1.Filter = "Sai Files(*.JPG;*.GIF)|*.jpg;*.gif|All files (*.*)|*.*";
openFileDialog1.ShowDialog();//opens the dialog box
fname = openFileDialog1.FileName;//stores the file name in fname
pictureBox1.ImageLocation = fname;//gives the image location to picturebox
fsrw = new FileStream("C:\\Users\\Sainath\\Desktop", FileMode.Open, FileAccess.ReadWrite);
imgdata = new byte[fsrw.Length];
fsrw.Read(imgdata, 0, Convert.ToInt32(fsrw.Length));
fsrw.Close();
string s = "insert into imagetest values(@p1,@p2)";
SqlConnection con = new SqlConnection("server=.;Data Source=.;Initial Catalog=Work;Integrated …Run Code Online (Sandbox Code Playgroud) 有没有办法在多行上显示悬停文本/让它识别文本中的特殊字符行'\n'?
我正在寻找的虚拟版本是:
data <- data.frame(cbind(rnorm(10, 8), rnorm(10, 2)))
names(data)<-c("thing1", "thing2")
data$hovertext <- paste("here's a coordinate: ",
round(data$thing1,1), sep = "\n")
p <- plot_ly(data, type = 'scatter', x = thing1, y = thing2,
text = hovertext, hoverinfo = 'text', mode = "markers")
Run Code Online (Sandbox Code Playgroud)
这当然只是忽略了分隔符并在一行上打印.我可以通过剧情/ R来识别断行吗?
我正在使用rmarkdown和LaTeX/Beamer构建演示文稿.我想减少显示的R命令和R输出之间的间距.我相信这与LaTeX/Beamer中的段落间距选项有关.
这是我应该在rmarkdown(块选项,knit_hooks或其他什么?),pandoc Yaml标题(一些pandoc选项?)或LaTeX beamer模板文件中做的事情?我觉得它应该在LaTeX模板文件中.
下面是一个最小markdown文件的工作示例,以及我用来控制一些beamer设置的.tex模板文件.
example.Rmd
---
title: "Untitled"
author: "Ryan"
date: "March 1, 2016"
output:
beamer_presentation:
pandoc_args: '--latex-engine=xelatex'
includes:
in_header: latex-topmatter.tex
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Vertical Spacing is too much
Here is a working example.
- some
- bullets
Example code:
```{r, echo = TRUE}
a <- 1
a
a+a
```
Run Code Online (Sandbox Code Playgroud)
乳胶topmatter.tex
% declare overall beamer theme to use as baseline
\usetheme{default}
% make code-output smaller
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{fontsize=\tiny,commandchars=\\\{\}}
% make console-output smaller:
\makeatletter
\def\verbatim{\tiny\@verbatim \frenchspacing\@vobeyspaces …Run Code Online (Sandbox Code Playgroud) 我正在尝试在R markdown中创建一个已订购部分的报告
第1节标题
1.1分节1
1.2分节3
第2节标题
2.1
2.2分节
2.2.1 another sub section
Run Code Online (Sandbox Code Playgroud)有没有办法获得R markdown来生成这样的有序列表?
我在创建打印ggplot2使用scale_fill_gradientn.我想在缩放图例的最小值和最大值处添加文本.例如,在图例最小显示"最小"和图例最大显示"最大".有些帖子使用离散填充并添加带有数字而不是文本的标签(例如此处),但我不确定如何使用该labels功能scale_fill_gradientn仅在最小和最大时插入文本.目前我很容易出错:
Error in scale_labels.continuous(scale, breaks) :
Breaks and labels are different lengths
Run Code Online (Sandbox Code Playgroud)
这种类型的缩放/填充是否可以在ggplot2中使用此文本标签?
# The example code here produces an plot for illustrative purposes only.
# create data frame, from ggplot2 documentation
df <- expand.grid(x = 0:5, y = 0:5)
df$z <- runif(nrow(df))
#plot
ggplot(df, aes(x, y, fill = z)) + geom_raster() +
scale_fill_gradientn(colours=topo.colors(7),na.value = "transparent")
Run Code Online (Sandbox Code Playgroud) Rstudio版本1.0.136
R版本3.3.2
奇怪的是,当我在一个.Rmd带有Rmarkdown 的文件中逐行运行代码(它在代码中有中文注释)时 ,控制台将打印一个警告如下:
Warning message:
In strsplit(code, "\n", fixed = TRUE) :
input string 1 is invalid in this locale
Run Code Online (Sandbox Code Playgroud)
它太烦人了,因为它会出现每一行.我在RStudio的设置中更改了默认文本编码,但是UTF-8和BG2312都不能阻止出现此警告消息.请注意,它只是在行代码逐行时出现,如果我选择一个块按一个按钮来生成一个html,则不会出现警告.我的代码如下:
```{r}
da=read.table("m-intcsp7309.txt",header=T)
head(da)
# date intel sp??
length(da$date)
# 444??
intc=log(da$intc+1)
# ??
plot(cars)
# ??????
plot(cars)
# ?????????
plot(cars)
```
Run Code Online (Sandbox Code Playgroud)
我测试它不是来自中文评论,我
只是在现在才使用英语时遇到它.以下是更多信息:
Sys.getlocale()
[1] "LC_COLLATE=Chinese (Simplified)_People's Republic of China.936;
LC_CTYPE=Chinese (Simplified)_People's Republic of China.936;
LC_MONETARY=Chinese (Simplified)_People's Republic of China.936;
LC_NUMERIC=C;LC_TIME=Chinese (Simplified)_People's Republic of China.936"
Run Code Online (Sandbox Code Playgroud) 我有2台计算机在不同的地方(因此不可能使用相同的wifi网络),One包含大约50GB的数据(MongoDB文件),我想将它移动到第二个,这对分析来说要强大得多.但是如何让Stro上的MongoDB识别出那个文件夹?
我非常欣赏RMarkdown中的"code_folding"功能.但是,我真正需要的是让代码始终显示并切换输出上的显示.
---
title: "test file"
author: "dayne"
date: "June 10, 2016"
output:
html_document:
code_folding: hide
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Here is a basic example.
```{r}
3 + 4
```
Run Code Online (Sandbox Code Playgroud)
有没有办法切换输出而不是代码?我想到的最好(但不是理想的)解决方案是添加collapse=TRUE到块中,但代码和输出仍然同时显示.
链接到已编译的文档:http://rpubs.com/daynefiler/188408
是否可以将CSS类添加到某个代码块?
假设以下文件:
---
title: "Untitled"
output: html_document
---
```{r cars}
summary(cars)
```
Run Code Online (Sandbox Code Playgroud)
我想给那些标记为'cars'的块一个CSS类,例如.myClass.有没有可能像
```{r cars} {.myClass}
summary(cars)
```
Run Code Online (Sandbox Code Playgroud)
或者?我知道黑客喜欢将整个块包裹在另一个块中<div>.我对一个直接的解决方案感兴趣.
当我在创建新x11()设备后绘制两个图形并想要设置整体标题时,它不能很好地显示.标题字符串的顶部位于窗口顶部栏的后面.有没有办法来解决这个问题?我找不到有?x11帮助的x11客户端偏好中或其中的任何内容.
这个脚本:
x11()
x <- rnorm(1000, 0, 1)
hist(x)
title('Title', outer = TRUE)
Run Code Online (Sandbox Code Playgroud)
看起来像这样:
