小编Aip*_*ipi的帖子

在macOS终端上搜索命令历史记录

在macOS终端中搜索命令历史记录的快捷方式是什么?

历史可供搜索多长时间?它存放在哪里?

macos bash history

22
推荐指数
6
解决办法
2万
查看次数

Vuex 和事件总线有什么区别?

试图理解组件间通信的原理,产生了一个疑问:Vue 事件总线策略和 Vuex 处理组件通信的主要区别是什么?除此之外,什么时候使用它们的最佳时间以及在同一个项目中使用两者的最佳实践是什么?

javascript vue.js vue-component vuex vuejs2

8
推荐指数
1
解决办法
3323
查看次数

严重错误:找不到“ QuickTime / QuickTime.h”文件

我将macOS更新为Sierra,并且我的一些文件消失了。最重要的是Allegro的图书馆。我正在尝试再次安装它,就像我第一次看到的视频(https://www.youtube.com/watch?v=UJtmJfWNTJY)一样,但是显示了以下错误消息:

'$Users/macbookpro/Downloads/allegro/include/allegro5/platform/alosx.h:43:12: fatal error: 
      'QuickTime/QuickTime.h' file not found'
  #import <QuickTime/QuickTime.h>
Run Code Online (Sandbox Code Playgroud)

我进行了搜索,发现这只是Xcode中的更改参数,但是,尽管使用了终端,但我没有使用Xcode来编译我的代码。有什么提示吗?

macos installation xcode allegro macos-sierra

5
推荐指数
1
解决办法
2886
查看次数

ERROR 1075 表定义不正确;只能有一个自动列,并且必须将其定义为键

我正在创建表之间的关系,这是自动增加两列id_quotation和所必需的seq_quotationid_quotation我正在引用另一个表(tb_core_process_id_quotation)列,我已经在其中增加了它。

下面的表 (tb_core_process_customer_data) 将被其他表用来捕获公共数据和主要客户数据。为了做到这一点,这三个验证键是必要的:cpf_cnpjid_quotation并且seq_quotation对于该数据库中的整个表来说是通用的。

tb_core_process_customer_data 查询:

CREATE TABLE tb_core_process_customer_data(
cpf_cnpj VARCHAR(255) NOT NULL,
id_quotation INT NOT NULL,
seq_quotation INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255),
dt_birth DATE,
cd_insurance_type INT,
PRIMARY KEY (cpf_cnpj, seq_quotation, id_quotation),
FOREIGN KEY (cd_insurance_type) REFERENCES tb_nm_insurance_type(cd_insurance_type),
FOREIGN KEY (id_quotation) REFERENCES tb_core_process_id_quotation(id_quotation)
);
Run Code Online (Sandbox Code Playgroud)

tb_core_process_id_quotation 查询:

CREATE TABLE tb_core_process_id_quotation(
id_quotation INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id_quotation)
);
Run Code Online (Sandbox Code Playgroud)

因此,我很难将这三个键联系起来并进行验证。当我尝试创建 tb_core_process_customer_data 时,以下消息让我失望:

ERROR 1075 (42000): Incorrect table definition; there …

mysql sql

5
推荐指数
1
解决办法
1万
查看次数

什么"......"在Javascript(ES6)中意味着什么?

我正在学习Redux,React和ES6.我已经用JS开发了,但是这个ES6的新世界让我很惊讶,有许多新的东西,比如"=>"来声明箭头函数和其他.然而,在这个新的Redux研究中,我...在我的代码中间面对.

贝娄我有一个例子:

import { combineReducers, createStore } from 'redux'

const userReducer = (state={}, action) => {
    switch(action.type) {
        case 'CHANGE_NAME':
            state = {...state, name: action.payload};
            break;
        case 'CHANGE_AGE':
            state = {...state, age: action.payload};
            break;
    }
    return state;
};

const tweetsReducer = (state=[], action) => {
    return state;
};

const reducers = combineReducers ({
    user: userReducer,
    tweetsReducer: tweetsReducer,
});


const store = createStore(reducers);

store.subscribe(() =>
    console.log('The chage was: ', store.getState())
);

store.dispatch({type: 'CHANGE_NAME', payload: 'Will'})
store.dispatch({type: 'CHANGE_AGE', payload: 21}); …
Run Code Online (Sandbox Code Playgroud)

javascript ecmascript-6 redux

5
推荐指数
1
解决办法
4582
查看次数

如何在React-Router URL中删除尾部斜杠

我开始在我的应用程序中使用react-router,但我注意到当URL(/url/)末尾带有斜杠时,它不起作用。我对其进行了更多搜索,阅读了所有文档和react-router问题并尝试使用<Redirect from='/*/' to="/*" />,但这不是一个好的解决方案,因为它也无法正常工作。因此,阅读更多内容后,我发现了/?在URL末尾插入的建议,但仍然没有用。

route.js的代码:

export default (
    <Route path="/" component={App}>
        <IndexRoute component={ProfileFillComponents} />
        <Route path="/seguro-residencia" handler={require('./components/Forms/Residencial/ProfileFill/profileFillComponents')} />
        <Route path="/seguro-residencia/informacoes-pessoais" component={CotationNumber} />
    </Route>
)
Run Code Online (Sandbox Code Playgroud)

index.js的代码:

render((<Router history={browserHistory} routes={routes} />), document.getElementById('root'));
Run Code Online (Sandbox Code Playgroud)

进行更多搜索后,我发现一个人提供了强制在URL末尾加斜杠的功能,然后我决定做出相反的选择,强制不使用斜杠。

使用无尾部斜杠功能更新route.js代码:

export default (
    <Route onEnter={forceTrailingSlash} onChange={forceTrailingSlashOnChange}>
        <Route path="/" component={App}>
            <IndexRoute component={ProfileFillComponents} />
            <Route path="/seguro-residencia" handler={require('./components/Forms/Residencial/ProfileFill/profileFillComponents')} />
            <Route path="/seguro-residencia/informacoes-pessoais" component={CotationNumber} />
        </Route>
    </Route>
)

function forceNoTrailingSlash(nextState, replace) {
  const path = nextState.location.pathname;
  if (path.slice(-1) === '/') {
    replace({
      ...nextState.location,
      pathname: path.slice(1,path.lastIndexOf('/')-1)
    });
  } …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-router

5
推荐指数
2
解决办法
5490
查看次数

功能:以下是使用和不使用where子句的区别?

我是Haskell的新手,并实现了计算BMI(身体质量指数)的功能.但我必须采取两种方式:

-- Calculate BMI using where clause
:{
calcBmis :: (RealFloat a) => [(a, a)] -> [a]  
calcBmis xs = [bmi w h | (w, h) <- xs]  
    where bmi weight height = weight / height ^ 2
:}
-- Input: calcBmis [(70, 1.7), (90, 1.89)]
-- Output: [24.221453287197235, 25.195263290501387]
Run Code Online (Sandbox Code Playgroud)

-- Calculate BMI using just list comprehension
:{
calcBmis :: (RealFloat a) => [(a, a)] -> [a] 
calcBmis xs = [bmi w h | (w, h) <- xs]
bmi …
Run Code Online (Sandbox Code Playgroud)

haskell

0
推荐指数
1
解决办法
51
查看次数

Git初学者:如何删除git历史记录和git数据?

如何从我的目录中删除myentire git历史记录和任何其他git数据?

git directory github repository

-4
推荐指数
1
解决办法
254
查看次数