gin

Mocking in GWT application showcase with the help of GIN

跟風遠走 提交于 2019-12-05 07:16:01
问题 I need an example of well-structured full-stack GWT application written in the best practices: with MVP pattern usage, GIN modules (at least 2: production module and the mocking one for tests), JRE light-weight tests (extending TestCase class). The primary goal of this request is to find out how GWT app should be effectively tested with the help of GIN. This showcase doesn't need to be huge. Several simple tests for one presenter would be enough. I have already took a look at "Contacts"

Eliminating GWT ActivityMapper boilerplate

佐手、 提交于 2019-12-03 12:44:51
问题 I am using the GWT Activities and Places framework to structure my application and it is turning out nicely. One thing that annoys me though is that the ActivityMapper implementation is (1) receiving all the views in the application (2) contains a giant if/else block for instantiating activities based on the received place. It will only get worse as the number of views increases. I am already using Gin but I don't see how I can use it here. How can I reduce or eliminate the boilerplate from

PostgreSQL: GIN or GiST indexes?

巧了我就是萌 提交于 2019-12-03 04:09:56
问题 From what information I could find, they both solve the same problems - more esoteric operations like array containment and intersection (&&, @>, <@, etc). However I would be interested in advice about when to use one or the other (or neither possibly). The PostgreSQL documentation has some information about this: GIN index lookups are about three times faster than GiST GIN indexes take about three times longer to build than GiST GIN indexes are about ten times slower to update than GiST GIN

Eliminating GWT ActivityMapper boilerplate

跟風遠走 提交于 2019-12-03 02:12:40
I am using the GWT Activities and Places framework to structure my application and it is turning out nicely. One thing that annoys me though is that the ActivityMapper implementation is (1) receiving all the views in the application (2) contains a giant if/else block for instantiating activities based on the received place. It will only get worse as the number of views increases. I am already using Gin but I don't see how I can use it here. How can I reduce or eliminate the boilerplate from my ActivityMapper ? There isn't a great answer yet. I have code generation schemes in mind, but it's all

PostgreSQL: GIN or GiST indexes?

为君一笑 提交于 2019-12-02 17:26:59
From what information I could find, they both solve the same problems - more esoteric operations like array containment and intersection (&&, @>, <@, etc). However I would be interested in advice about when to use one or the other (or neither possibly). The PostgreSQL documentation has some information about this: GIN index lookups are about three times faster than GiST GIN indexes take about three times longer to build than GiST GIN indexes are about ten times slower to update than GiST GIN indexes are two-to-three times larger than GiST However I would be particularly interested to know if

Deferred binding failed

大兔子大兔子 提交于 2019-12-01 11:02:42
My application is throwing: java.lang.RuntimeException: Deferred binding failed for 'com.mygwtapp.client.gin.ClientAppGinjector' (did you forget to inherit a required module?) on this code inside the EntryPoint: private final ClientAppGinjector injector = GWT.create(ClientAppGinjector.class); What could be the problem? Here's the full error Log: java.lang.RuntimeException: Deferred binding failed for 'com.mygwtapp.client.gin.ClientAppGinjector' (did you forget to inherit a required module?) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) at com.google.gwt.core.client

使用Golang的Gin框架和vue编写web应用

≯℡__Kan透↙ 提交于 2019-11-30 06:46:58
背景: 之前使用Golang的Gin框架进行一些运维内部后端的API接口开发,对外提供提供 json 类型的数据响应,但是该种方式在浏览器访问数据时数据格式不友好(由于是API接口,一般需要使用postman之类的工具来验证接口返回数据),后来尝试了使用Golang的 template 模板来结合html进行数据渲染,但也发现比较缺乏美感。之后决定使用前端框架来渲染后端数据,由于vue框架的各种优势,比如简单、数据的双向绑定等等好处,决定使用vue框架来开启我的前端之旅。接下来简单来讲解下使用Golang后端和vue前端进行融合的示例。 基于Gin框架的后端API 编写基于Gin框架的API: # 查看源码文件 $ cat main.go /** * @File Name: main.go * @Author: xxbandy @http://xxbandy.github.io * @Email: * @Create Date: 2018-12-02 22:12:59 * @Last Modified: 2018-12-02 22:12:52 * @Description: */ package main import ( _ "fmt" "github.com/gin-gonic/gin" "math/rand" "net/http" ) func HelloPage(c

GWT-GIN Multiple Implementations?

ⅰ亾dé卋堺 提交于 2019-11-29 23:13:09
问题 I have the following code public class AppGinModule extends AbstractGinModule{ @Override protected void configure() { bind(ContactListView.class).to(ContactListViewImpl.class); bind(ContactDetailView.class).to(ContactDetailViewImpl.class); } } @GinModules(AppGinModule.class) public interface AppInjector extends Ginjector{ ContactDetailView getContactDetailView(); ContactListView getContactListView(); } In my entry point AppInjector appInjector = GWT.create(AppGinModule.class); appInjector

Golang下的html/template模块使用

陌路散爱 提交于 2019-11-29 03:43:20
关于 template 模板,Golang语言提供了两个包 text/template 和 html/template ,前者主要用来处理文本文件的变量渲染,而后者主要用于对html之类的网页文件进行渲染。由于最近在使用 gin框架 编写REST API,顺便学习 template 的使用,再此记录一下。 html/template 常用的对象和方法 template 模板的使用主要是在对 Template 结构体的相关方法进行操作。我们首先得初始化一个 Template 对象。 type Template struct { Tree *parse.Tree } # 初始化一个template对象 ## Must函数会在Parse返回err不为nil时,调用panic,不需要初始化后再调用Parse方法去检测 func Must(t *Template,err error) *Template ## New函数用来创建一个指定的HTML模板 func New(name string) *Template ## ParseFiles函数用来从一个指定的文件中创建并解析模板 func ParseFiles(filenames ...string) (*Template, error) ## ParseGlob函数从指定的匹配文件中创建并解析模板,必须得至少匹配一个文件 func

28.awk

末鹿安然 提交于 2019-11-28 22:13:59
9.6/9.7awk 9.6 awk上: 支持分段 例如,passwd文件比较有规律,以冒号作为间隔。那我们可以用awk来分段匹配。就是root为一段,数字为一段这样吧他匹配出来 比grep sed的强大之处在于可以以段的匹配出来 并且不用加特殊的字符,例如脱意、花括号,问号等等 ~1. awk -F ':' '{print $1}' test.txt -F指定分隔符 表示打印这个文件的第一段,以:作为间隔 $0表示所有段 ~2. 不加-F awk '{print $1}' test.txt 如果没有指定间隔符,他将默认空格为间隔 ~3. 不加-F awk '{print $0}' test.txt 可以打印所有的这个文件,相当于cat ~4. 不加-F awk '{print $1,$2,$3}' test.txt 默认分割,打印出第一段第二段第三段。不加-F指定的话,就默认空格间隔 ~5. awk -F ':' '{print $1"#"$2"#"$3}' test.txt 打印出来的一二三段以#作为间隔,列出来 ~6. awk的匹配功能 awk '/oo/' test.txt 将带有oo的全部打印出来 ~7. awk -F ‘:’ ‘$1 ~ /oo/' test.txt 指定以:作为间隔的第一段,匹配出带有oo的字符。需要加 ~ ~8. awk -F ':' '$1 ~