小编Row*_*ski的帖子

在c#中找到一个形状的外接圆和内圆

我需要找到这种形状的外接圆和内圆

在此输入图像描述

我的代码找到了外接圆,但是外圆是错的

for (int r = 1; ; r++) //r is radius
{
    int found = 0; //counts found pixels
    int wrong = 0; //counts pixels that are on the circle but have different color that desirable
    int good = 0; //counts pixels that are on the circle with desirable color
    for (int y = point.Y - r ; y <= point.Y + r ; y++) //point is the center of the figure (110,110)
    {
        for (int x = point.X …
Run Code Online (Sandbox Code Playgroud)

c# math

4
推荐指数
1
解决办法
931
查看次数

如何在 Tomcat 6 上的 JSF 2.0 应用程序中设置 HttpOnly 标志

我在 Sof链接上找到了这个解决方案, 但我不得不从两个原因改变它:

  1. 没有 .getFacesContext() 函数
  2. 我没有特定的 cookie 文件(请参阅ourcookiename=yourcookievalue 行)

我的代码是这样的:

FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
response.addHeader("Set-Cookie", "; HTTPOnly");
Run Code Online (Sandbox Code Playgroud)

原始代码

FacesContext facesContext = FacesContext.getCurrentInstance().getFacesContext();   
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();    
response.addHeader("Set-Cookie", "yourcookiename=yourcookievalue; HTTPOnly");
Run Code Online (Sandbox Code Playgroud)

如果我错了,请纠正我。先感谢您

httponly tomcat6 jsf-2

2
推荐指数
1
解决办法
2091
查看次数

标签 统计

c# ×1

httponly ×1

jsf-2 ×1

math ×1

tomcat6 ×1