counterclockwise

Invalid anti-forgery token

时光总嘲笑我的痴心妄想 提交于 2021-02-07 13:35:40
问题 I'm getting an " Invalid anti-forgery token " when I try using POST method in a Clojure Webapp project I created using Compojure template. I researched, and Ring middle ware creates CSRF (cross site request forms) tokens to authenticated requests coming from other sites (to use someone else's credentials who has already logged in and access pages not allowed to access). These tokens are default, and we need to use ring.middleware 's wrap-params around our WebApp. Couldn't get anywhere much.

用canvas画太极图(一步步详解附带源代码)

泄露秘密 提交于 2020-08-09 22:43:50
canvas绘图 该元素负责在页面中设定一个区域,然后由js动态地在这个区域中绘制图形。这个技术最早是由美国苹果公司推出的,目的是为了取代flash,很快主流浏览器都支持它。 绘制路径 要绘制路径首先必须调用beginPath()方法,如果想绘制一条连接到起点的线条则调用closePath()方法;如果路径已完成,你想用fillStyle填充它,可以调用fill()方法。另外还可以调用stroke()方法对路径描边,使用strokeStyle。 接口 参数 功能 rect() x,y,width,height 从点x,y开始绘制一个矩形,宽和高分别由width和height指定,这个方法是绘制路径。而不是fillRect()和strokeRect()所绘制的独立形状 arc() x,y,radius,startAngle,endAngle,counterclockwise 六个参数 以x,y为圆心绘制一条弧线,半径为radius,起始和结束角度分别为startAngle和endAngle,最后一个参数表示角度是否按逆时针方向计算,值为false表示顺时针。 lineTo() x,y 从上一点开始绘制一条直线,到x,y为止 moveTo() x,y 将绘图游标移动到x,y,不画线。 按照上图,就能画出圆,半圆,,四分之一圆等等。 开始画图 1.先给背景一个背景颜色,并设置一块画布。

(八十八)c#Winform自定义控件-转子

夙愿已清 提交于 2020-08-08 21:04:09
官网 http://www.hzhcontrols.com/ 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。 GitHub: https://github.com/kwwwvagaa/NetWinformControl 码云: https://gitee.com/kwwwvagaa/net_winform_custom_control.git 如果觉得写的还行,请点个 star 支持一下吧 欢迎前来交流探讨: 企鹅群568015492 来都来了,点个【推荐】再走吧,谢谢 NuGet Install-Package HZH_Controls 目录 http://www.hzhcontrols.com/blog-63.html 用处及效果 准备工作 也没什么准备的,开撸 开始 添加一个用户控件UCRotor 添加一下属性 1 private Color rotorColor = Color.Black; 2 3 public Color RotorColor 4 { 5 get { return rotorColor; } 6 set 7 { 8 rotorColor = value; 9 Refresh(); 10 } 11 } 12 13 RotorAround rotorAround = RotorAround.None; 14 int

(八十八)c#Winform自定义控件-转子

拥有回忆 提交于 2020-07-29 04:17:10
官网 http://www.hzhcontrols.com/ 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。 GitHub: https://github.com/kwwwvagaa/NetWinformControl 码云: https://gitee.com/kwwwvagaa/net_winform_custom_control.git 如果觉得写的还行,请点个 star 支持一下吧 欢迎前来交流探讨: 企鹅群568015492 来都来了,点个【推荐】再走吧,谢谢 NuGet Install-Package HZH_Controls 目录 http://www.hzhcontrols.com/blog-63.html 用处及效果 准备工作 也没什么准备的,开撸 开始 添加一个用户控件UCRotor 添加一下属性 1 private Color rotorColor = Color.Black; 2 3 public Color RotorColor 4 { 5 get { return rotorColor; } 6 set 7 { 8 rotorColor = value; 9 Refresh(); 10 } 11 } 12 13 RotorAround rotorAround = RotorAround.None; 14 int

612.1.004 ALGS4 | Elementary Sorts

半世苍凉 提交于 2020-05-04 23:34:29
sublime编辑器写代码,命令行编译 减少对ide的依赖//可以提示缺少什么依赖import 所有示例代码动手敲一遍 Graham's Scan是经典的计算几何算法 shffule 与 map-reduce 有关—— 云计算 知道这些算法在身边切实的应用,对学习动力很有帮助 下一章开始,使用 git进行源代码管理! 先用来做自己的项目管理 Inspiration 计算机思维——不要重复造轮子 零件的通用性——拆分拆分再拆分,专业与分工细致 1.Callback = reference to executable code 核心思想是将函数作为实参传递给其他函数 Interface-Java 使我们能够以类型安全的方式使用为任何类型的数据开发的排序算法 Roadmap 对象需要实现Compareble Interface() 这些数据类型具有重新实现compareTo()方法的实例方法 排序实现里与数据类型无关 具体的比较由Comparable 接口处理 What I can use —— code Selection Sort | 选择排序 Insertion Sort | 插入排序 ShellSort | 希尔排序 点击链接可看动画演示 1 Two useful sorting abstrations Less private static boolean less

How to run/debug compojure web app via counterclockwise (or la clojure)

拥有回忆 提交于 2019-12-13 13:01:17
问题 I'm trying to write my first web app in compojure. I'm using ccw, and I File-New-Project, Clojure Project and use the "compojure" leiningen template. End up with project.clj looking like (defproject asdf "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :dependencies [[org.clojure/clojure "1.4.0"] [compojure "1.1.5"]] :plugins [[lein-ring "0.8.2"]] :ring {:handler asdf.handler/app} :profiles {:dev {:dependencies [[ring-mock "0.1.3"]]}}) src/asdf/handler

OpenGL, some normals reversed despite counterclockwise order

为君一笑 提交于 2019-12-11 14:12:15
问题 In the code below, I don't understand why some faces have their normals reversed. The triangles looks ordered in the anti-clockwise direction, but some faces remain black. When I modify the fragment shader with color = -vnormal; the two black faces are rendered correctly, but not the others, obviously. Thanks for any help given // minimalist but fonctional code using glew, glfw, glm #include <GL/glew.h> #include <GLFW/glfw3.h> #include <glm/vec3.hpp> #include <glm/vec4.hpp> #include <glm

Could not locate Clojure resource on classpath

天大地大妈咪最大 提交于 2019-12-11 11:39:20
问题 I am trying to access some of my clojure functions in my Java code (I am using Eclipse and CounterClockWise). Firstly, I was not sure how to do it? But then I found some answer here. I am using clojure.lang.RT package for calling .clj files in my Java code. While naming namespaces, .clj files proper conventions has been followed like ns test.clojure.core is in test.clojure package where-in core is .clj file. Also upon following some information, I have added java-source-path (i.e. java-source

Output is sent to console instead of REPL when using threads in Eclipse/CounterClockWise

拈花ヽ惹草 提交于 2019-12-10 13:56:25
问题 I tried this code from this guide: (defn my-fn [ms] (println "entered my-fn") (Thread/sleep ms) (println "leaving my-fn")) (let [thread (Thread. #(my-fn 1))] (.start thread) (println "started thread") (while (.isAlive thread) (print ".") (flush)) (println "thread stopped")) When I execute it, part of the output shows up in the REPL, and the other part shows up in the console (which pops up since I usually have it hidden because I don't use it). I want to send all the output to the REPL window