rascal

【CSS】367- 用 CSS3 制作导航条和毛玻璃效果

我只是一个虾纸丫 提交于 2021-01-15 19:44:39
点击上方“前端自习课”关注,学习起来~ 导航条对于每一个Web前端攻城狮来说并不陌生,但是毛玻璃可能会相对陌生一些。简单的说,毛玻璃其实就是让图片或者背景使用相应的方法进行模糊处理。这种效果对用户来说是十分具有视觉冲击力的。 本次分享的主题:通过CSS3来制作类似下面的导航条和毛玻璃效果。 导航条是梯形形状的。 背景区域的毛玻璃效果。 把导航条和毛玻璃效果在一篇文章中分享其实是有原因的。因为这两个效果的实现离不开一个重要的思想。 用语言来描述就是:父元素设置position:relative,其伪元素(after或者before)设置 position:absolute,并且让top,bottom,left,right都为0,伪元素占满父元素的整个空间,最后设置z-index将背景放在父元素后边。 具体代码如下。 .container { position : relative ; } .container::after { content : '' ; position : absolute ; left : 0 ; right : 0 ; bottom : 0 ; top : 0 ;  z-index : -1 ; } 什么意思呢?稍安勿躁,我会在接下来的两个实战例子中对这段代码的意思一一道来。 1.导航条 1.1:平行四边形导航条 平行四边形制作的思想

What is the best way to ignore comments in a java file with Rascal?

你说的曾经没有我的故事 提交于 2020-02-04 22:57:41
问题 I built a module to count the lines of code (LOC) of a Java project. For this purpose I had to ignore : blank lines single line comments and multiline comments (/*......*/). I achieved the first two using the list comprehension on the file lines with regexes and I solved also the third point visiting the whole file strings with the proper pattern matching and substitution. I was wondering, is there a better and/or more performant way to reach the same goal? PS: I opted for substitution, even

What is the best way to ignore comments in a java file with Rascal?

天大地大妈咪最大 提交于 2020-02-04 22:57:17
问题 I built a module to count the lines of code (LOC) of a Java project. For this purpose I had to ignore : blank lines single line comments and multiline comments (/*......*/). I achieved the first two using the list comprehension on the file lines with regexes and I solved also the third point visiting the whole file strings with the proper pattern matching and substitution. I was wondering, is there a better and/or more performant way to reach the same goal? PS: I opted for substitution, even

Hover tooltiptext in Rascal figure

此生再无相见时 提交于 2020-01-21 23:51:52
问题 Is it possible to produce a figure in Rascal that shows a tooltiptext during hover? I mean the little yellow thing like the one prescribed by the title attribute of a <a> tag in HTML. 回答1: yes in these slides (http://homepages.cwi.nl/~jurgenv/teaching/evolution1314/slides/intro-visualization.pdf) an example is shown: FProperty popup(str S){ return mouseOver(box(text(S), fillColor("lightyellow"), grow(1.2),resizable(false))); } box(size(50),fillColor("red"), popup("Hello")) 来源: https:/

Accessing downstream annotations of a node in Rascal

人盡茶涼 提交于 2020-01-17 11:34:17
问题 Simple question: in Rascal how does one access annotations of descendants of a node? GetTraversalContextNodes() returns upstream nodes -- "myContext[-1]" doesn't work. getChildren() returns a list of children, but the list is a list of values. The Name@Annotation syntax requires that "Name" be a node. What magic do you do on "Name" to get it to refer to a node? 回答1: If you just want the children that are themselves nodes, you could use code like the following: list[node] nl = [ n | node n <-

How to prevent rascal_builder from running on every save in Eclipse IDE

我们两清 提交于 2020-01-15 09:46:48
问题 I've been working on a Rascal project in Eclipse 2018. The project is roughly 500 LOC. My problem is that saving a file within the project takes about 20 to 40 seconds. This is due to rascal_builder running after every save. Since I am accustomed to saving many times during editing, this is starting to reduce my productivity. Is there a way to stop rascal_builder from being invoked every save and have it run only when actual execution of the program is requested? I am not interested in

Rascal ambiguity not resolved by disambiguation rules

烈酒焚心 提交于 2020-01-03 03:15:08
问题 I'm trying to get a disambiguation working, one in the same vein as the question I asked a few days ago. In that previous question, there was an undocumented limitation in the language implementation; I'm wondering if there's something similar going on here. Tests [tuvw]1 are all throwing ambiguity exceptions (BTW: How do you catch those? [Edit: answered]). All of them look like they ought to pass. Note that they have to be unambiguous in order to pass. Neither the priority rule Scheme nor

Running a Rascal program from outside the REPL

可紊 提交于 2019-12-13 02:05:57
问题 I'd really like to be able to run some Rascal's program from outside the REPL (e.g. as part of a script, or called from another program). What I'm using Rascal for is and intermediate stage in a larger framework so I am wondering what the best way to go about integrating executing the Rascal code from another program. 回答1: Right now the best way is to package your code together with the Rascal shell executable jar. There is a convenience class JavaToRascal for calling into Rascal code.

Rascal: what does the bool collectBindings in creating AST do?

非 Y 不嫁゛ 提交于 2019-12-12 16:19:38
问题 I have a question about creating a AST in rascal. I normally do the following: model = createM3FromEclipseProject(|project://testproject|); decls = createAstsFromEclipseProject(model.id, false); At first i would set the collectBindings to true. But for some projects i get a stack overflow error. This could be because i use Luna eclipse but it made me wonder what the collectionbinding does? I tried to look it up but i could not find any documentation (maybe my google skills are bad). I also

Pattern matching AST nodes in Rascal

不问归期 提交于 2019-12-12 03:26:14
问题 I have the following AST definition: data Exp = app(Exp fun, Exp body) | var(str name) | nat(int nat) | func(list[str] formal, Exp body) | cond(Exp cond, Exp then, list[tuple[Exp,Exp]] elifs, Exp otherwise) | let(list[str] vars, list[Exp] exps, Exp body) | seq(Exp lhs, Exp rhs) | mul(Exp lhs, Exp rhs) | div(Exp lhs, Exp rhs) | md(Exp lhs, Exp rhs) | add(Exp lhs, Exp rhs) | sub(Exp lhs, Exp rhs) | eq(Exp lhs, Exp rhs) | gt(Exp lhs, Exp rhs) | lt(Exp lhs, Exp rhs) | geq(Exp lhs, Exp rhs) | leq