alloy

程序员如何在30岁后越老越吃香?

混江龙づ霸主 提交于 2021-02-20 12:55:15
程序员是一门靠手艺吃饭的工作,最根本的就是技术能力。从初级到高级,从高级到资深,从资深到架构,就像爬楼一样,站的越高需要看到的视野越开阔。30岁前程序员靠体力,30岁后需要靠脑力,需要靠技术视野打开更广阔的职业生涯。程序员们很苦恼,技术层出不穷让人应接不暇,需要不停学习新的技术避免被淘汰,但是仅仅靠学习新技术就好了吗?所谓的技术视野到底是什么,又如何去提升呢? 1 驱动力 首先需要明白做一件事情一定需要一定的驱动力,那么对于提升技术视野的驱动力在哪呢? 兴趣 兴趣爱好是最好的老师,所以兴趣是第一驱动力。如果你对一门技术充满好奇心,你一定想尽办法弄清楚它的原理,并且迫不及待的进行实践。 谷歌有一个20%的计划,规定员工可以拿出20%的时间从事自己兴趣爱好的事情。于是从中诞生了Gmail, Google Glass等创新性的产品。这些产品的诞生第一原动力就是兴趣爱好! 态度与使命 兴趣不等于工作,日常工作往往枯燥乏味让人提不起劲,这时候靠什么支撑,可以多想想自己的态度和使命。每一件事情做完后可以反思,是否用了100%的能力,不要留有遗憾。做事也需要有使命感,比如阿里的"让天下没有难做的生意"、腾讯的"科技向善"、美团的"Eat better, live better",每一家伟大公司都有一个伟大使命,让你的日常工作和公司使命关联起来,瞬间是不是觉得自己在从事一项拯救地球的事业。

Bug on unconstrained Strings

≯℡__Kan透↙ 提交于 2021-02-11 18:06:08
问题 Alloy appears to have a bug when relations include unconstrained Strings. No instance is found for the following: sig foo{ bar: String, yak: Int } pred show[]{one f:foo | f.yak=0} run show for 1 If we change this to bar: Int , Alloy finds an instance with an arbitrary value. 回答1: This "known for ages" bug has thankfully a workaround. For things to work, you need to "implicitly declare" some string values by using them in a fact or a predicate. As an example, the following signature fact will

Generating .als files corresponding to model instances with Alloy API

本秂侑毒 提交于 2021-02-11 13:39:26
问题 suppose I have the following model : sig counter{ value: Int, } { value > 0 value < 3 } pred show{} run show for exactly 1 counter I would like to generate the als files corresponding to the two instances of this model : open counter one sig counter_1 extends counter{}{ value=1 } fact { counter = {counter_1}} and, open counter one sig counter_2 extends counter{}{ value=2 } fact { counter = {counter_2}} I have used the Alloy API to generate the instances but I cant find the method to export

Lock Challenge in Alloy

我只是一个虾纸丫 提交于 2021-01-07 06:41:23
问题 I would like to solve the following lock challenge using Alloy. My main issue is how to model the integers representing the digit keys. I created a quick draft: sig Digit, Position{} sig Lock { d: Digit one -> lone Position } run {} for exactly 1 Lock, exactly 3 Position, 10 Digit In this context, could you please: tell me if Alloy seems to you suitable to solve this kind of problem? give me some pointers regarding the way I could model the key digits (without using Int s)? Thank you. 回答1:

The Pomodoro Technique

微笑、不失礼 提交于 2020-12-29 17:52:11
[TOC] 简介 番茄工作法是简单易行的时间管理方法,是由弗朗西斯科·西里洛于1992年创立的一种相对于 GTD 更微观的时间管理方法。 What to solve 各种Deadline逼近的时候,是否会处于一种或轻或重的焦虑状态而导致效率低下? 是不是沉迷于刷微博、打赏主播、追剧、网上冲浪而忘记了时间的流逝? 闪动的QQ、微信、邮件是否时刻牵动着你的心? 在当下,有着太多的外界诱惑,使得你不得不停下来去响应,一回过神,就忘记之前该干啥了,所有计划全部打乱,一回想,我这几天都干了啥?似乎一刻都没有停歇,但内心却仍然感到无限空虚。 一世穷忙为阿谁,终日逢人皱两眉。 How to use 番茄工作法只是提出一个理念并介绍了一些方法,目的是让我们做事情变得专注高效,但是每个人都有自己独特的生活环境和工作情况,非常建议大家自己看下原版书籍,并结合自身实际总结归纳出适合自己的方式,以下是一些示例。 腾讯内部分享:专注当下,我的腾讯式番茄工作法 经过 1700 个番茄时间,番茄工作法改变了我什么 Some applications 试过很多番茄工作法的软件、网站、APP,只能说100%符合你期望的基本没有,除非你按照自身需求定制开发,如果你阅读过原书,会发现作者更推崇的是纸+笔+简单的统计工具如Excel之类的,而不是复杂的软件app,因为这会让你将重心转移到这些软件的使用上

How to use String in Alloy?

旧街凉风 提交于 2020-01-17 03:55:43
问题 How to use String in Alloy? What kind of function or operators for String are supported in Alloy? I searched questions here and find String is a keyword in Alloy. But I cannot find any reference about how to use String in Alloy. Could you give one? If not, is possible to give a brief about String in Alloy? 回答1: You can actually use strings in Alloy, but only as literals to specify constant values (i.e., no string operations are supported, and Alloy does not implement a string solver). That

Problem in generation of world in predicate

对着背影说爱祢 提交于 2020-01-17 02:22:08
问题 I'm having a problem in the generation of the world for last predicate, even though there are more than 3 signatures, only 3 are shown. What am I missing? Do I need to specify something in pred show(){} ? Do I need to run the predicate enforcing a specific number of objects? open util/boolean // Signatures abstract sig Sensor { available: one Bool } sig HeartRateSensor extends Sensor{} sig BloodPressureSensor extends Sensor{} sig SleepMonitoringSensor extends Sensor{} sig Smartwatch { user:

The util/ordering module and ordered subsignatures

佐手、 提交于 2019-12-31 04:36:30
问题 Consider the following Alloy model: open util/ordering[C] abstract sig A {} sig B extends A {} sig C extends A {} pred show {} run show for 7 I understand why, when I run show for 7 , all the instances of this model have 7 atoms of signature C. (Well, that's not quite true. I understand that the ordered signature will always have as many atoms as the scope allows, because util/ordering tells me so. But that's not quite the same as why .) But why do no instances of this model have any atoms of

possibly inconsistent behaviour in Alloy's typechecking of predicates?

拟墨画扇 提交于 2019-12-25 07:47:31
问题 Apologies for any newbie errors - this is my first ever posting here. I am not sure if this is a bug, or is the result of some subtlety in Alloy's typechecking. In the example below, I would expect the predicate "strange" to be inconsistent, because B and C are disjoint sets. However, Alloy (version 4.2) claims to find models of the predicate. The models it displays look wrong. For example, there is a model containing just one atom, B$0, labelled as the witness $strange_a. In this model, the

Specifying A Scope for Sig in Alloy

南楼画角 提交于 2019-12-25 05:34:56
问题 i am new to Alloy and there is an error due to which my program can't execute or show. Error iam having is A Syntax error has occurred: You must specify a scope for "this/Name" My Code is module language/Family sig Name { } abstract sig Person { name: one Name, siblings: Person, father: lone Man, mother: lone Woman } sig Man extends Person { wife: lone Woman } sig Woman extends Person { husband: lone Man } sig Married extends Person { } fact { no p: Person | p in p.^(mother + father) wife =