catalyst

OO Design Patterns with Perl

ⅰ亾dé卋堺 提交于 2019-12-05 12:44:00
I am currently planning the design for a new system I will need to code that interacts with a back-end API. I was contemplating object composition and inheritance and decided that the most correct procedure in my situation would be to go with composition over inheritance as my objects have a "has a" relationship to one another and not an "is a". I find now though that because some objects are reliant on other, there may be cases were "object A" has an attribute which is "object B" and an attribute "object C" - however "object B" also has an attribute "object C". In hope that this analogy would

Multiple vs. single Catalyst applications

北城余情 提交于 2019-12-04 16:26:07
I have multiple Catalyst applications running as FCGI. Is there a benefit in consolidating them into a single one with multiple constrollers? Thanks, Simone RAM, probably? I think the minimum each server is going to hold onto is about 15MB so you might be able to save something like 100MB if you’re running 3 apps with with 3 servers. But that’s pure back of the napkin speculation. Another option, which would likely achieve most of the same savings would be to move to Plack deployment. E.g., the same three apps, without consolidation, deployed on the same server (this is untested but seems

Formatting timestamp field for output in TemplateToolkit

荒凉一梦 提交于 2019-12-04 15:14:37
I'm using Perl with Catalyst framework, DBIx class as ORM, TT for views, Postgresql as DB. I have a column with 'timestamp without timezone' type, and if I do manual query in Postgres the column value is in such format 2012-08-30 21:30:14 , but when I print the value in TT view file I get it like this 2012-08-30T15:03:13 , so obviously it gets formatted but by what exactly I can't tell. I want to use Template::Plugin::Date to format output timestamps, but I get Catalyst error: Couldn't render template "xxx/list.tt2: date error - bad time/date string: expects 'h:m:s d:m:y' got: '2012-08-30T21

SparkSql运行原理详细解析

浪尽此生 提交于 2019-12-04 04:52:57
  传统关系型数据库中 ,最基本的sql查询语句由projecttion (field a,field b,field c) , datasource (table A) 和 fieter (field a >10) 三部分组成。 分别对应了sql查询过程中的result , datasource和operation ,也就是按照result ——> datasource ——> operation 的顺序来描述,如下图所示:   但是sql实际执行过程是按照operation——> datasource——>result 的顺序来执行的这与sql语法正好相反,具体的执行过程如下:   1 . 语法和词法解析:对写入的sql语句进行词法和语法解析(parse),分辨出sql语句在哪些是关键词(如select ,from 和where),哪些是表达式,哪些是projection ,哪些是datasource等,判断SQL语法是否规范,并形成逻辑计划。   2 .绑定:将SQL语句和数据库的数据字典(列,表,视图等)进行绑定(bind),如果相关的projection和datasource等都在的话,则表示这个SQL语句是可以执行的。   3 .优化(optimize):一般的数据库会提供几个执行计划,这些计划一般都有运行统计数据,数据库会在这些计划中选择一个最优计划。   4 .执行

Is there any performance comparison between Perl web frameworks?

ぃ、小莉子 提交于 2019-12-03 16:19:07
问题 I have seen mentions (which sounded like unsubstantiated opinions, and dated ones at that) that Embperl is the fastest Perl web framework. I was wondering if there's a consensus on the relative speed of the major stable Perl web frameworks, or ideally, some sort of fact-based performance comparisons between implementations of the same sample webapps, or individual functionalities (e.g. session handling or form data processing), etc...? UPDATE : This question is specifically about the speed

Dancer vs Catalyst [Perl Web Frameworks] [closed]

你。 提交于 2019-12-03 04:50:27
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What do you think about both? I began reading a book about Catalyst, and found it pretty complex as compared to Dancer. so now I'm

Datasets in Apache Spark

匿名 (未验证) 提交于 2019-12-03 02:42:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Dataset<Tweet> ds = sc.read().json("path").as(Encoders.bean(Tweet.class)); ds.show(); JavaRDD<Tweet> dstry = ds.toJavaRDD(); System.out.println(dstry.first().getClass()); Caused by: java.util.concurrent.ExecutionException: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 50, Column 16: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 50, Column 16: No applicable constructor/method found for actual parameters "org.apache.spark.unsafe.types.UTF8String"; candidates are:

How do I handle errors in methods chains in Perl?

寵の児 提交于 2019-12-02 23:57:12
What is the best way to deal with exceptions threw in a method chaining in Perl? I want to assign a value of 0 or undef if any of the methods chained throw an exception Code sample: my $x = $obj->get_obj->get_other_obj->get_another_obj->do_something; What the best way to do it? Do I have to wrap in a try/catch/finally statement everytime? The context I want to apply this is: Im working in web development using Catalyst and DBIC and I do a lot of chained resultsets and if some of this resultset throw an exception I just want to assign a value of 0 or undef and then treat this error in the

What are best practices for deploying a Catalyst application to a production server?

依然范特西╮ 提交于 2019-12-02 19:39:45
What is a good way to deploy Catalyst applications to a production server? Currently I simply have a FastCGI dispatch script in the root of the repository and when I want to update the server code, I push the branch to the server. This is quite simple, but not perfect. If the code fails the tests on the server machine (for example because of unsatisfied dependencies), I am left with broken application. How do you deploy your Catalyst applications? Do you have a better way? A combination of a proxy load-balancer and two flip-flop fastcgi applications running alternatively as production and

Dancer vs Catalyst [Perl Web Frameworks] [closed]

女生的网名这么多〃 提交于 2019-12-02 18:02:06
What do you think about both? I began reading a book about Catalyst, and found it pretty complex as compared to Dancer. so now I'm giving Dancer a try, and it looks easier to learn and more "human friendly". This is a somewhat subjective question, but I'll try to give you an answer in an objective way. First things first, a disclaimer : I'm part of the Dancer development team, so my opinion should of course be considered somewhat biased :) Catalyst is more widely used than Dancer, and so there's more community support behind it - if you were to look for contractors with experience working with