How this react-redux exports connect? - ecmascript-6

As per this file connect is imported from the connect module using the ES6 syntax. The connect.js does not export connect but createConnect class.
How the connect is exported from the connect.js?

In the index.js the following import statement is used:
import connect from './connect/connect'
That imports the default export from ./connect/connect and assigns it to the name connect (you can name it whatever you want).
In connect.js the default export is on Line 90:
export default createConnect()
This exports the return value of the createConnect(), which is the function connect. Note that the name is not important, but it's common and logical to give it the same name as the module, it technically doesn't even need a name.
For details about default exports and imports see: Exploring ES6 - Default exports

Related

JS exporting / importing default and named export together

Sorry for the naming for the issue I select. This will most likely show how much confused I am :)
I am working on jhipster generated react project (really good structure, I liked it). What I want to do is to bind account menu item to store to include current user's login name. Current directory structure;
- .menus/account (exporting standart component and a default which is return value of connect HOC)
- .menus/admin
- .menus/user-management
- .menus/index.tsx
index.tsx exports all from the other account, admin, user-management
export * from 'acount'
export * from 'admin' ....
here, is there a possibility to import de default from account file ? or should I explicitly import it with another import statement ?

Load JSON file in vue.js with Typescript

I've created a vue.js with typescript app using vue-cli 3 and selecting the typescript option.
Now I'm trying to import a .json file:
import * as config from './config.json';
But keep getting the compiler error:
Version: typescript
2.7.17:25, tslint 5.9.1
Cannot find module './config.json'.
The config.json file is right next to the .ts that is trying to load it.
Is there any additional config I need to add to load .json with the vue-cli templates?
Add "resolveJsonModule": true to your tsconfig.json
There are a few ways to solve this. One would be to use require() instead of import for non-js files:
const config = require('./config.json')
You can also create a .d.ts file with a wildcard module declaration (under "Wildcard module declarations") which will allow you to import JS files. You can put it anywhere, including it the same as you would any .ts file.
// json-module.d.ts
declare module '*.json' {
const data: any
export default data
}
// since we use a default export, we now import it like this
import config from './config.json'

Exporting from Enterprise Guide to access database

i am attempting to export a sas dataset to an existing access database as a new table. i am using the Data copy files tool and have connected it to my Program.
i receive the following error: Target folder \filelocation\file.accdb does not exist or cannot be access on "NY52214"(computername).
i am using the following:
proc export data=WORK.DETAILS
dbms=accesscs
OUTTable="data"
replace;
DATABASE='\\filelocation\file.accdb';
RUN;
I have used a similar code to this to export to excel which works, so i am not sure what i am doing wrong. i am unable to utlize pc file server but everything i have searched indicates this should be working. i have tried different file locations, different versions of access. Can anyone tell me what i am missing please?

How to pick path of file from System properties in jmeter CSV Data Set Config

I am trying to use CSV Data Set Config to get some data from csv file to be used in jmeter script but i don't want to hardcode the file path as it will be changing according to the test environment. Is there a way i can pick this path from System properties i.e some export set in my bashrc file.
Export in my bashrc :
export NIMBUS4_PERFORMANCE_TEST_REPO=/Users/rahul/Documents/verecloud/performancetest/data/user.csv
I would suggest the following workaround:
Change "Filename" setting of the CSV Data Set Config to following:
${__BeanShell(System.getenv().get("NIMBUS4_PERFORMANCE_TEST_REPO"))}
Where:
System.getenv() - method which provides access to underlying operating system environment variables
__Beanshell() - JMeter built-in function which allows executing of arbitrary Beanshell code
you could create a softlink at some static path. For example,
say we have created a soft link to /user/data/csvs folder.
You are in say ~/Documents , there run below
ln -s /user/data/csvs
Now we can access it in the jmeter and you will also have the flexibility to modify the softlink to point to some other location too.
Only constraint i see is the pointed directory name shouldn't change.
Hope this will help!!!
You can have just users.csv if the file is in the same folder as the .jmx itself;
You can have ${location}\users.csv
And in your UserDefinedVariables you'll have
and in non-gui mode you'll refer as
%RUNNER_HOME%\Test.jmx -Jloc=%RUNNER_HOME%\users.csv -Jusers=100 -Jloop=1 -Jrampup=5

Plone/SQLAlchemy(?) - How can I import a python package (i.e. sqlalchemy) in a module in a subpackage?

I am trying to import sqlalchemy in a module in a subpackage.
Here is my folder layout
PloneInstance
my.package
my
package
subpackage
In the buildout.cfg file of the root folder, I add "sqlalchemy" to the eggs.
In my.package, in configure.zcml, I add:
In the subpackage, I have a blank __init__.py file, a configure.zcml file, and a file called mymodule.py
In mymodule.py I have a line for importing sqlalchemy
import sqlalchemy
Unfortunately, I am getting an error when I try to run an instance:
ImportError: No module named sqlalchemy
I'm assuming I am missing a step. How do I properly import python packages?
Thank you in advance. I apologize if my terminology is off.
Edit:
The module in question I am importing from turned out to be zope.sqlalchemy.
I accidentally overlooked this because prior to moving files to a subpackage, the import statement for zope.sqlalchemy was working without adding zope.sqlalchemy to the eggs section of the buildout.
Look in the setup.py file at the top directory of your package. You'll find a section like:
install_requires=['setuptools',
# -*- Extra requirements: -*-
],
In place of the "Extra requirements' comment, put a comma-separated list of strings specifying your package's requirements. You may even specify versions.
Do not add standard Plone packages to the list. They're taken for granted.
Re-run buildout after specifying your requirements. The result is that the new install requires will be added to your Python environment when you start Plone.