针对躲藏的链接和hiddenlinks这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展(OK)隐马尔可夫模型(HiddenMarkovModel,HMM)server-client、Apac
针对躲藏的链接和hiddenlinks这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展(OK) 隐马尔可夫模型(Hidden Markov Model,HMM)server - client、Apache不会遵循符号链接(403 Forbidden)、c# – 添加mailto到actionlink的链接、css – Bootstrap3 .visible- * .hidden- * display inline等相关知识,希望可以帮助到你。
本文目录一览:- 躲藏的链接(hiddenlinks)(躲藏解析)
- (OK) 隐马尔可夫模型(Hidden Markov Model,HMM)server - client
- Apache不会遵循符号链接(403 Forbidden)
- c# – 添加mailto到actionlink的链接
- css – Bootstrap3 .visible- * .hidden- * display inline
躲藏的链接(hiddenlinks)(躲藏解析)
一种做弊技能,经过它超级链接被规划来被蜘蛛来拜访,而不能被人发现,做弊者从许多高排名的链接到他们想要推动的网页上。
(OK) 隐马尔可夫模型(Hidden Markov Model,HMM)server - client
vim tcp_server.c
/*
[root@bupt src]# cd markov-main/mim-hmm/src
[root@bupt src]# make
[root@bupt src]# ./hxx_baumwelch-1 0.5 0.5 0.5 0.5 0.7 0.2 0.1 0.1 0.2 0.7 0.9 0.1 100
*/
//ztg add
//-----------------------------------
extern "C"
{
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
}
//-----------------------------------
#include "hxx.hpp"
#include <algorithm>
#include <iostream>
#include <vector>
using std::cout;
using std::random_shuffle;
using std::vector;
char buf2[256];
void output_biglambda (const hxx_matrices&);
void hmm (char* argv[]);
//ztg add
//-----------------------------------
int main (int argc, char* argv[])
{
int iii, BUF_SIZE = 256;
char buf[BUF_SIZE];
char *token, *hmm_str[13];
/* delete the socket file */
unlink("/data/hmm_socket");
/* create a socket */
int server_sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
struct sockaddr_un server_addr;
server_addr.sun_family = AF_UNIX;
strcpy(server_addr.sun_path, "/data/hmm_socket");
/* bind with the local file */
bind(server_sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr));
/* listen */
listen(server_sockfd, 5);
int client_sockfd;
struct sockaddr_un client_addr;
socklen_t len = sizeof(client_addr);
while(1)
{
printf("server waiting:\n");
/* accept a connection */
client_sockfd = accept(server_sockfd, (struct sockaddr *)&client_addr, &len);
/* exchange data */
//read(client_sockfd, &ch, 1);
bzero(buf, BUF_SIZE);
recv(client_sockfd, buf, BUF_SIZE, MSG_NOSIGNAL);
printf("get char from client: %s\n", buf);
iii = 0;
token = strtok(buf, "-");
while (token != NULL)
{
hmm_str[iii++] = token;
//printf("%s\n", token);
token = strtok(NULL, "-");
}
for (int i=0; i<13; ++i) printf("%s\n", hmm_str[i]);
bzero(buf2, BUF_SIZE);
hmm(hmm_str);
send(client_sockfd, buf2, strlen(buf2), MSG_NOSIGNAL);
//bzero(buf2, BUF_SIZE);
//sprintf(buf2, "%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s", hmm_str[0], hmm_str[1], hmm_str[2], hmm_str[3], hmm_str[4], hmm_str[5], hmm_str[6], hmm_str[7], hmm_str[8], hmm_str[9], hmm_str[10], hmm_str[11], hmm_str[12]);
//send(client_sockfd, buf2, strlen(buf2), MSG_NOSIGNAL);
/* close the socket */
close(client_sockfd);
}
return 0;
}
//-----------------------------------
//ztg alter
//int main (int argc, char* argv[])
void hmm (char* argv[])
{
//ztg add
//-----------------------------------
/*
double a1 = atof(argv[1]), a2 = atof(argv[2]), a3 = atof(argv[3]), a4 = atof(argv[4]);
double b1 = atof(argv[5]), b2 = atof(argv[6]), b3 = atof(argv[7]), b4 = atof(argv[8]), b5 = atof(argv[9]), b6 = atof(argv[10]);
double p1 = atof(argv[11]), p2 = atof(argv[12]);
int times = atoi(argv[13]);
//*/
double a1 = atof(argv[0]), a2 = atof(argv[1]), a3 = atof(argv[2]), a4 = atof(argv[3]);
double b1 = atof(argv[4]), b2 = atof(argv[5]), b3 = atof(argv[6]), b4 = atof(argv[7]), b5 = atof(argv[8]), b6 = atof(argv[9]);
double p1 = atof(argv[10]), p2 = atof(argv[11]);
int times = atoi(argv[12]);
//-----------------------------------
/*
λ = (H, O, A, B, π )
H = {connect, disconnect}
O = {good, moderate, bad}
A = {a11, a12,
a21, a22};
B = {b11, b12, b13,
b21, b22, b23};
Pi = {p1, p2};
0.5 0.5 0.5 0.5 0.7 0.2 0.1 0.1 0.2 0.7 0.9 0.1
*/
//ztg alter
//-----------------------------------
/*
auto A = {.5, .5,
.5, .5};
auto B = {.7, .2, .1,
.1, .2, .7};
auto Pi = {.9, .1};
//*/
auto A = {a1, a2,
a3, a4};
auto B = {b1, b2, b3,
b4, b5, b6};
auto Pi = {p1, p2};
//-----------------------------------
hxx_matrices biglambda (A, B, Pi);
hxx_gen hg (A, B, Pi);
pair<int, int> tmp;
//ztg alter
//int T = 100000;
int T = times;
vector<int> Q (T);
vector<int> O (T);
for (int t = 0; t < T; ++t) {
tmp = hg ();
Q[t] = tmp.first;
O[t] = tmp.second;
}
vector<double> Xi, Gamma;
//random_shuffle (O.begin (), O.end ());
hxx_forwardbackward (O, biglambda, Xi, Gamma);
hxx_matrices newbiglambda (A, B, Pi);
hxx_baumwelch (O, Xi, Gamma, newbiglambda);
for (int t = 4; t < T; ++t) {
double likelihood = hxx_forward (O.cbegin () + t - 4, O.cbegin () + t + 1, A, B, Pi);
cout << Q[t] << " " << O[t] << " " << likelihood << "\n";
}
//ztg alter
//-----------------------------------
//*
cout << "Original biglambda\n";
output_biglambda (biglambda);
cout << "New biglambda\n";
output_biglambda (newbiglambda);
//*/
int ii = 0;
double *hmm_str[12];
int N = newbiglambda.N ();
int M = newbiglambda.M ();
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
hmm_str[ii++] = & newbiglambda.a (i, j);
}
}
for (int i = 0; i < N; ++i) {
for (int k = 0; k < M; ++k) {
hmm_str[ii++] = & newbiglambda.b (i, k);
}
}
for (int i = 0; i < N; ++i) {
hmm_str[ii++] = & newbiglambda.p (i);
}
sprintf(buf2, "%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%d", *hmm_str[0], *hmm_str[1], *hmm_str[2], *hmm_str[3], *hmm_str[4], *hmm_str[5], *hmm_str[6], *hmm_str[7], *hmm_str[8], *hmm_str[9], *hmm_str[10], *hmm_str[11], 100);
printf("%s\n", buf2);
//-----------------------------------
}
void output_biglambda (const hxx_matrices& biglambda) {
int N = biglambda.N ();
int M = biglambda.M ();
cout << "A = {";
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
cout << " " << biglambda.a (i, j);
}
}
cout << " }\n";
cout << "B = {";
for (int i = 0; i < N; ++i) {
for (int k = 0; k < M; ++k) {
cout << " " << biglambda.b (i, k);
}
}
cout << " }\n";
cout << "Pi = {";
for (int i = 0; i < N; ++i) {
cout << " " << biglambda.p (i);
}
cout << " }\n";
}
vim tcp_client.c
/*
gcc -g -Wall -o tcp_client tcp_client.c
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int main()
{
int iii, BUF_SIZE = 256;
char buf[BUF_SIZE];
double hmm[12] = {0.5, 0.5, 0.5, 0.5, 0.7, 0.2, 0.1, 0.1, 0.2, 0.7, 0.9, 0.1};
int times = 100;
char *token, *hmm_str[13];
/* create a socket */
int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
struct sockaddr_un address;
address.sun_family = AF_UNIX;
strcpy(address.sun_path, "/data/hmm_socket");
/* connect to the server */
int result = connect(sockfd, (struct sockaddr *)&address, sizeof(address));
if(result == -1)
{
perror("connect failed: ");
exit(1);
}
/* exchange data */
//char ch = ''A'';
//write(sockfd, &ch, 1);
//read(sockfd, &ch, 1);
//printf输出float和double都可以用%f,double还可以用%lf
//scanf输入float用%f,double输入用%lf,不能混用
//printf("%10.4f\n",123.45678), 10.4总宽10 (包括小数点), 小数部分保留4位(四舍五入), 结果为: 123.4568(前面两个空格)
bzero(buf, BUF_SIZE);
sprintf(buf, "%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%.10f-%d", hmm[0], hmm[1], hmm[2], hmm[3], hmm[4], hmm[5], hmm[6], hmm[7], hmm[8], hmm[9], hmm[10], hmm[11], times);
//linux下当连接断开,还发数据的时候,不仅send()的返回值会有反映,而且还会向系统发送一个异常消息,如果不作处理,系统会出BrokePipe,
//程序会退出,这对于服务器提供稳定的服务将造成巨大的灾难。为此,send()函数的最后一个参数可以设MSG_NOSIGNAL,禁止send()函数向系统发送异常消息
send(sockfd, buf, strlen(buf), MSG_NOSIGNAL);
bzero(buf, BUF_SIZE);
recv(sockfd, buf, BUF_SIZE, MSG_NOSIGNAL);
printf("get char from server: %s\n", buf);
iii = 0;
token = strtok(buf, "-");
while (token != NULL)
{
hmm_str[iii++] = token;
//printf("%s\n", token);
token = strtok(NULL, "-");
}
for (int i=0; i<13; ++i) printf("%s\n", hmm_str[i]);
/* close the socket */
close(sockfd);
return 0;
}
Apache不会遵循符号链接(403 Forbidden)
我在Ubuntu上设置Apache时遇到了一些麻烦。 我一直在遵循这个指南 。
# /usr/sbin/apache2 -v Server version: Apache/2.2.17 (Ubuntu) Server built: Feb 22 2011 18:33:02
我的公共目录/ var / www可以成功地提供并执行放置在其中的PHP页面。 不过,我想在/ var / www中创build一个符号链接,指向我的主文件夹中的一个目录,并在那里提供页面。
[root /var/www]# ll total 36 drwxr-xr-x 3 root root 4096 2011-09-11 14:22 . drwxr-xr-x 14 root root 4096 2011-06-04 22:49 .. lrwxrwxrwx 1 root root 16 2011-09-11 13:21 about -> /root/site/about
当我尝试访问/关于浏览器,我得到
Forbidden You don''t have permission to access /about on this server.
据我所知,我给了我想要服务的文件足够的权限:
符号链接和索引文件无法正常工作的.htaccessconfiguration
创build与其他文件的依赖关系的符号链接
任何方式来使Mac上的符号链接在Windows上工作?
如何将常规文件转换为Linux上的符号链接
Ant目标符号链接不能在Windows上工作
[root ~/site/about]# ll total 24 drwxr-xr-x 5 root root 4096 2011-09-11 13:20 . drwxr--r-- 3 root root 4096 2011-09-11 13:19 .. drwxr-xr-x 2 root root 4096 2011-09-11 13:21 contact -rwxr-xr-x 1 root root 1090 2011-09-11 13:19 index.PHP drwxr-xr-x 2 root root 4096 2011-09-11 13:20 me drwxr-xr-x 2 root root 4096 2011-09-11 13:21 resume
我知道FollowSymLinks选项,我相信它是在我的/ etc / apache2 / sites-enabled / 000-default文件中设置的:
DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options FollowSymLinks Indexes MultiViews AllowOverride None Order allow,deny allow from all </Directory>
任何想法,我可能会错过?
python符号链接在Windows 10创build者更新
目录recursion和符号链接
Amazon EC2 Apache符号链接不允许
从babun主目录创build符号链接到其他path
如何比较两个tar归档(包括文件内容,新的/删除的文件,符号链接)?
检查Apache是否拥有/root , /root/site和/root/site/about执行权限。
跑:
chmod o+x /root /root/site /root/site/about
加密的文件系统也可能导致403错误,例如加密的主文件夹的符号链接。
如果符号链接指向加密的文件夹,apache用户(例如www-data)不能访问内容,即使apache和文件/文件夹权限设置正确。 www-data用户的访问可以通过这样的调用来测试:
sudo -u www-data ls -l /var/www/html/<your symlink>/
有解决方法/解决方案,例如,将www-data用户添加到您的私人组(将加密数据公开给Web用户)或设置未加密的rsynced文件夹(可能相当安全)。 我自己可能会在开发过程中使用rsync解决方案。
https://askubuntu.com/questions/633625/public-folder-in-an-encrypted-home-directory
为我的目的一个方便的工具是lsyncd 。 这使我可以直接在加密的主文件夹中工作,并能够在apache网页中立即看到变化。 同步由文件系统中的更改触发,调用rsync。 由于我只在相当小的网页和脚本上工作,因此同步速度非常快。 我决定在rsync启动之前使用1秒的短暂延迟,即使可以设置延迟0秒 。
安装lsyncd(在Ubuntu中):
sudo apt-get install lsyncd
开始后台服务:
lsyncd -delay 1 -rsync /home/<me>/<work folder>/ /var/www/html/<web folder>/
我有一个类似的问题,我不能在我的新服务器很长一段时间解决。 除了palacsint的回答之外,还有一个很好的问题是:你使用的是Apache 2.4吗? 在Apache 2.4中,有一个不同的机制来设置使用上述配置时不起作用的权限,所以我使用了本博客中解释的解决方案 。
基本上,我需要做的是从我的配置文件转换:
Alias /demo /usr/demo/html <Directory "/usr/demo/html"> Options FollowSymLinks AllowOverride None Order allow,deny allow from all </Directory>
至:
Alias /demo /usr/demo/html <Directory "/usr/demo/html"> Options FollowSymLinks AllowOverride None Require all granted </Directory>
请注意订单和允许行已经被Require all全部取代
与这个问题有关,我只是想出了为什么我的虚拟主机给了我这个403。
我已经测试了这个问题的所有可能性,其他人没有运气。 这几乎让我发疯。
我正在通过符号链接设置一个类似于Capistrano方式部署的服务器,当我尝试访问DocRoot文件夹(现在是当前版本文件夹的符号链接)时,它给了我403。
我的虚拟主机是:
DocumentRoot /var/www/site.com/html <Directory /var/www/site.com/html> AllowOverride All Options +FollowSymLinks Require all granted </Directory>
和我的主要httpd.conf文件(默认的Apache 2.4安装):
DocumentRoot "/var/www" <Directory "/var/www"> Options -Indexes -FollowSymLinks -Includes (...)
事实证明,主要的选项定义是优先于我的虚拟场(对我来说是反直觉)。 所以我把它改为:
DocumentRoot "/var/www" <Directory "/var/www"> Options -Indexes +FollowSymLinks -Includes (...)
和尤里卡! (注意MAIN httpd.conf文件中的FollowSymLinks之前的加号,希望这能帮助别人失去灵魂。
对于升级到14.04之后出现问题的人,在升级之前更改root = / https://askubuntu.com/questions/452042/why-is-my-apache-not-working-after-upgrading-to-ubuntu-14-04升级后的var / www = / var / www / html
先禁用selinux(vim / etc / selinux / config)
vim /etc/httpd/conf/httpd.conf编辑符号链接和目录索引的以下行:
documentroot /var/www/html <directory /var/www/html> Options Indexes FollowSymLinks AllowOverride None </directory>
如果.htaccess文件,然后AllowOverride全部
还有另外一种符号链接可能会让你失望,就像我在我的情况中发现的那样。 如果您有一个SELinux系统作为服务器,并且符号链接指向一个NFS挂接的文件夹(其他文件系统可能会产生类似的症状), httpd可能会看到错误的上下文并拒绝提供目标文件夹的内容。
在我的情况下, /var/www/html (可以使用ls -Z获取)的SELinux上下文是unconfined_u:object_r:httpd_sys_content_t:s0 。 /var/www/html的符号链接将具有相同的上下文,但是它们的目标上下文(作为NFS挂接的文件夹)是system_u:object_r:nfs_t:s0 。
解决方案是将fscontext=unconfined_u:object_r:httpd_sys_content_t:s0到mount选项(例如# mount -t nfs -o v3,fscontext=unconfined_u:object_r:httpd_sys_content_t:s0 <IP address>:/<server path> /<mount point> )。 rootcontext是不相关的, defcontext被NFS拒绝。 我没有尝试context 。
总结
以上是小编为你收集整理的Apache不会遵循符号链接(403 Forbidden)全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
c# – 添加mailto到actionlink的链接
@foreach (var item in Model) { <tr> <td> @{ var email = "mailto:" + item.user.Firstname + "@testmail.org";} @Html.ActionLink(item.user.Fullname,email) </td>
只在浏览器中创建一个如下所示的链接:
http://localhost:53371/Open/mailto%3amail%40testmail.org
解决方法
试试这个:
@{ var email = "mailto:" + item.user.Firstname + "@testmail.org";} <a href="@email">@item.user.Firstname</a>
css – Bootstrap3 .visible- * .hidden- * display inline
当使用这些类时,它应用样式显示:block!important;当在正确的屏幕尺寸。
但有时候,我想使用它显示inline或inline-block的一些元素。
我怎么能干净地覆盖一些引导规则有选择?或者应该是引导中的功能请求?
编辑
似乎我不是唯一一个想知道这个问题。这是github issue。
感谢最新的答案!
解决方法
现在这在Bootstrap v3.2.0与this commit本地解决
根据new responsive classes documentation:
As of v3.2.0,the .visible-– classes for each breakpoint come in three variations,one for each CSS display property value listed below:
Group of classes | CSS display .visible-*-block | display: block; .visible-*-inline | display: inline; .visible-*-inline-block | display: inline-block;
例如,您可以使用:
<p>Device is: <span>Large</span></p>
其他实例
被问及Stackoverflow:
> Bootstrap 3 class visible-lg moves span to a new line
在Bootstrap中报告问题:
> #4929 – Responsive utility classes may cause unexpected wrapping
> #7808 – Using display inherit in responsive utilities causes elements to be wrongly displayed
> #8500 – responsive class usage with inline element
> #8869 – responsive .hidden-* classes change from display block to inline-block
> #10263 – visible-xs makes display=block even for inline elements
关于躲藏的链接和hiddenlinks的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于(OK) 隐马尔可夫模型(Hidden Markov Model,HMM)server - client、Apache不会遵循符号链接(403 Forbidden)、c# – 添加mailto到actionlink的链接、css – Bootstrap3 .visible- * .hidden- * display inline的相关知识,请在本站寻找。
本文标签: