HijrahDate hd=HijrahChronology.INSTANCE.date(LocalDate.of(2014,11, 25));
Run Code Online (Sandbox Code Playgroud)
如果我们有HijrahDate
Instance,则应该有一个UmalquraCalendar API
显示月份名称的方法:
我使用groovy API检查此实例的属性:
['era':AH,
'class':class java.time.chrono.HijrahDate,
'prolepticMonth':17233,
'eraValue':1,
'dayOfWeek':2,
'leapYear':false,
'chronology':Hijrah-umalqura,
'dayOfYear':32]
Run Code Online (Sandbox Code Playgroud)
但是,我们找不到月份名称,该月份名称必须是以下列表项之一:
- Mu?arram(????的意思是“禁止”),之所以这么称呼,是因为在本月内战斗被禁止。穆哈拉姆邦包括阿修罗节。
- ?afar(?意思是“ void”),据称之所以命名是因为异教的阿拉伯房屋在一年中的这个时候是空的,而他们的乘员却聚集着食物。
拉布?我(Rab ?? al-Awwal,??????????)的意思是“第一个春天”。
拉布?II(Rab ?? ath-Th?n???????????或Rab ?? al-?khir ???? ????
..................... ............等等 SEE
因此,由于没有属性保存月份的名称,因此有一种方法可以检索此信息?
我按照说明进行操作:(将浏览器指向http://jsconsole.com,输入:listen,获取描述符,然后将那个小脚本放入我的网页中...),但我只得到以下输出:
Creating connection...
Connected to ...
sent remote command
Run Code Online (Sandbox Code Playgroud)
没有显示 console.log 中的任何内容。
我在 Windows 10 上尝试了 edge 和 google chrome。我也尝试在 node.js 下安装本地版本,但仍然没有运气。
不知道出了什么问题,有人可以帮忙吗?谢谢
我有以下域类
class Session{
static hasMany=[lessons:Lesson]
}
class BasicSession extends Session{
}
class AdvancedSession extends Session{
}
Run Code Online (Sandbox Code Playgroud)
知道Lesson也是一个域类:
class Lesson {
static belongsTo=[session:Session]
}
Run Code Online (Sandbox Code Playgroud)
检索属于Session subclass
(BasicSession
或AdvancedSession
)的所有课程的标准是什么
如果我想解释一下我的意思,我可以写:
// lessons belong only to AdvancedSession
Lesson.createCriteria().list{
session{
eq('class','slm.abdennour.AdvancedSession') // !!!
}
}
Run Code Online (Sandbox Code Playgroud) 我在grails项目中使用GORM API反映的afterUpdate方法。
class Transaction{
Person receiver;
Person sender;
}
Run Code Online (Sandbox Code Playgroud)
我想知道哪个字段被修改以使其afterUpdate
表现相应:
class Transaction{
//...............
def afterUpdate(){
if(/*Receiver is changed*/){
new TransactionHistory(proKey:'receiver',propName:this.receiver).save();
}
else
{
new TransactionHistory(proKey:'sender',propName:this.sender).save();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我可以使用beforeUpdate
:并在全局变量(以前称为Transaction)中更新之前赶上对象,然后在afterUpdate中previous
与当前对象进行比较。可能?
我们听说java8将包括 管理Hijri Date的Umalqura日历APi.
在哪里可以找到将Date转换为Hijri的样本?
的确,我找到了这段代码:
HijrahDate hdate = HijrahChronology.INSTANCE.date(LocalDate.of(2014, Month.JANUARY, 9));
Run Code Online (Sandbox Code Playgroud)
但是,我不能设置一个INPUT(java.util.Date)而不是3 INPUTS(年,月,日)
os.platform();
Run Code Online (Sandbox Code Playgroud)
上面的JS指令返回OS的名称.
当它在Ubuntu上运行时,它返回
'linux'
Run Code Online (Sandbox Code Playgroud)当它在Macbook上运行时,它返回
'darwin'
Run Code Online (Sandbox Code Playgroud)我想知道为什么不回来osx
,unix
或者bsd
......?
确实darwin
是OSX的叉子?
如何使用Node.js获取MAC下的OS类型?
假设,我们有:
var all=[
{firstname:'Ahmed', age:12},
{firstname:'Saleh', children:5 }
{fullname: 'Xod BOD', children: 1}
];
Run Code Online (Sandbox Code Playgroud)
预期结果是['firstname','age', 'children', 'fullname']
:该数组所有对象的键的并集:
all.map((e) => Object.keys(e) ).reduce((a,b)=>[...a,...b],[]);
Run Code Online (Sandbox Code Playgroud)
这工作正常,但是,我正在寻求使用直接reduce
方法而不是提高性能的解决方案map
,我执行了以下操作但失败了。
all.reduce((a,b) =>Object.assign([...Object.keys(a),...Object.keys(b)]),[])
Run Code Online (Sandbox Code Playgroud) 我有以下React组件:
export default class SignUpForm extends React.Component {
...
doSignupForm(event) {
// Some API call...
}
render() {
return (
<div>
<form action="/" onSubmit={this.doSignupForm.bind(this)} id="register-form">
<button type="submit" id="register_button">Sign Up</button>
</form>
</div>
);
}
};
Run Code Online (Sandbox Code Playgroud)
我想测试该按钮是否触发了该doSignupForm
功能 - 我该怎么做(理想情况下使用Mocha/Chai/Enzyme/Sinon)?
此外,正如您所看到的,该doSignupForm
函数会触发API调用 - 应该使用集成测试(?)单独测试此API调用.
我有以下架构:
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLInt,
GraphQLString
} from 'graphql';
let counter = 100;
const schema = new GraphQLSchema({
// Browse: http://localhost:3000/graphql?query={counter,message}
query: new GraphQLObjectType({
name: 'Query',
fields: () => ({
counter: {
type: GraphQLInt,
resolve: () => counter
},
message: {
type: GraphQLString,
resolve: () => 'Salem'
}
})
}),
mutiation: new GraphQLObjectType({
name: 'Mutation',
fields: () => ({
incrementCounter: {
type: GraphQLInt,
resolve: () => ++counter
}
})
})
})
export default schema;
Run Code Online (Sandbox Code Playgroud)
以下查询工作正常:
{counter, message}
Run Code Online (Sandbox Code Playgroud)
但是,mutation …
该npm run test
作品局部精细.
但是,travis坚持认为构建失败并显示以下日志:
react-test-renderer is an implicit dependency in order to support react@15.5+. Please add the appropriate version to your devDependencies. See https://github.com/airbnb/enzyme#installation
No coverage information was collected, exit without writing coverage information
/home/travis/build/abdennour/react-csv/node_modules/enzyme/build/react-compat.js:159
throw e;
^
Error: Cannot find module 'react-test-renderer/shallow'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at /home/travis/build/abdennour/react-csv/node_modules/enzyme/build/react-compat.js:151:34
at Object.<anonymous> (/home/travis/build/abdennour/react-csv/node_modules/enzyme/build/react-compat.js:219:5)
Run Code Online (Sandbox Code Playgroud)
任何的想法 ?我知道我的依赖是:
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-istanbul": "^0.11.0",
"babel-loader": "^6.2.8",
"babel-plugin-react-html-attrs": "^2.0.0",
"babel-plugin-syntax-decorators": "^6.13.0",
"babel-plugin-transform-class-properties": "^6.19.0", …
Run Code Online (Sandbox Code Playgroud) javascript ×3
grails ×2
java-8 ×2
node.js ×2
reactjs ×2
aop ×1
arrays ×1
browser ×1
build ×1
criteria ×1
darwin ×1
debugging ×1
enzyme ×1
grails-orm ×1
graphql ×1
graphql-js ×1
hijri ×1
inheritance ×1
macos ×1
mobile ×1
npm ×1
performance ×1
travis-ci ×1
unit-testing ×1