IntelliJ import subfolder as project - intellij-idea

Having a code structure like below which contains documentation at the root level how can I TELL IDEA to import the Code/spark subfolder as a project?
.
├── Code
│   ├── foo
│   │   ├── bar
│   │   └── baz
│   └── spark
│   ├── build.sbt
│   ├── common
│   ├── job1
│   ├── project
│   ├── run_application
│   ├── sbt
│   ├── scalastyle-config.xml
│   └── version.sbt
├── Docs

You need to add Content Root, go to Project Structure settings (Ctrl + Alt + Shift + s), select your module, then on the right panel click Add Content Root and select Docs folder. Then you can select it and mark as part of the Module, for documentation I believe it should be Resources.

Even better: use a proper build tool like gradle and then apply https://docs.gradle.org/current/userguide/composite_builds.html

Related

I want to change the display of pages

I want that instead of the home page https://ibb.co/Xb6VJsy, the product page https://ibb.co/bzL0KnS is displayed, I don't know how to do this.
This is the structure of my current Bundle:
└── Bogota
└── Bundle
└── NewBundle
├── BogotaNewBundle.php
└── Resources
├── config
│   └── oro
│   └── bundles.yml
├── public
│   └── first_theme
│   ├── css
│   │   └── styles.css
│   └── images
│   └── cathedral-of-bogota-pngrepo-com.png
└── views
└── layouts
└── first_theme
├── config
│   └── assets.yml
└── theme.yml
You can change the home page within the Web Catalog Management:
go to Marketing / Web Catalogs
click on "Edit Content Tree" for the chosen web catalog
And change the default content variant for the root tree node. By default, it's set to the "System Page" - "Oro Frontend Root". Set the "System Page Route" to "Oro Product Frontend Prduct Index":
For more details on the web catalog management, see the documentation:
https://doc.oroinc.com/user/concept-guides/content-management/web-catalog/
From the code level, you can achieve the same using the data migration:
https://doc.oroinc.com/backend/entities/fixtures/#data-fixtures

Unable to download Tensorflow C Language Bindings as an ExternalProject

I'm trying to include the C language bindings for Tensorflow found at https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.5.0.tar.gz in my CMake Project. Unfortunately, it seems as thought nothing is being downloaded, as the TENSORFLOW-prefix/src/TENSORFLOW directory is empty. I'm new to CMake and am not sure where I am going wrong. Any help would be appreciated.
Relevant source:
cmake_minimum_required(VERSION 3.17)
include(ExternalProject)
project(tfexec)
set(CMAKE_CXX_STANDARD 17)
ExternalProject_Add(TENSORFLOW
URL "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.5.0.tar.gz"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
ExternalProject runs at build time, so you actually need to run your build for this to do anything. This is what I see; it seems to be working fine:
alex#Alex-Desktop:~/test$ cmake-3.17 -S . -B build -DCMAKE_BUILD_TYPE=Release
...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/test/build
alex#Alex-Desktop:~/test$ cmake --build build/ -- -v
...
alex#Alex-Desktop:~/test$ tree build/TENSORFLOW-prefix/src/TENSORFLOW
build/TENSORFLOW-prefix/src/TENSORFLOW
├── LICENSE
├── THIRD_PARTY_TF_C_LICENSES
├── include
│   └── tensorflow
│   ├── c
│   │   ├── c_api.h
│   │   ├── c_api_experimental.h
│   │   ├── c_api_macros.h
│   │   ├── eager
│   │   │   ├── c_api.h
│   │   │   ├── c_api_experimental.h
│   │   │   └── dlpack.h
│   │   ├── tensor_interface.h
│   │   ├── tf_attrtype.h
│   │   ├── tf_datatype.h
│   │   ├── tf_file_statistics.h
│   │   ├── tf_status.h
│   │   ├── tf_tensor.h
│   │   └── tf_tstring.h
│   └── core
│   └── platform
│   ├── ctstring.h
│   └── ctstring_internal.h
└── lib
├── libtensorflow.so -> libtensorflow.so.2
├── libtensorflow.so.2 -> libtensorflow.so.2.5.0
├── libtensorflow.so.2.5.0
├── libtensorflow_framework.so -> libtensorflow_framework.so.2
├── libtensorflow_framework.so.2 -> libtensorflow_framework.so.2.5.0
└── libtensorflow_framework.so.2.5.0
7 directories, 23 files

cmake out of source build not working for nested source directories

I am having a directory structure of my source code as follows:
.
├── build
├── CMakeLists.txt
├── libs
│   ├── CMakeLists.txt
│   ├── ext
│   │   └── include
│   │   └── json.hpp
│   └── int
│   ├── CMakeLists.txt
│   └── net
│   ├── CMakeFiles
│   │   ├── CMakeDirectoryInformation.cmake
│   │   └── progress.marks
│   ├── cmake_install.cmake
│   ├── CMakeLists.txt
│   ├── include
│   │   ├── connection.hpp
│   │   └── conn_manager.hpp
│   ├── Makefile
│   └── src
│   ├── CMakeFiles
│   │   ├── CMakeDirectoryInformation.cmake
│   │   ├── libs.dir
│   │   │   ├── build.make
│   │   │   ├── cmake_clean.cmake
│   │   │   ├── cmake_clean_target.cmake
│   │   │   ├── DependInfo.cmake
│   │   │   ├── depend.make
│   │   │   ├── flags.make
│   │   │   ├── link.txt
│   │   │   └── progress.make
│   │   └── progress.marks
│   ├── cmake_install.cmake
│   ├── CMakeLists.txt
│   ├── connection.cpp
│   ├── conn_manager.cpp
│   └── Makefile
└── main
├── CMakeLists.txt
├── config
│   └── config.json
└── srcs
├── CMakeLists.txt
├── main.cpp
├── samvaadak.cpp
└── samvaadak.hpp
"build" is a folder from which I am running cmake. It runs and creates the final output executable inside build/dist/bin. But it also creates lot of intermediate inside the source tree (libs and main) and making it cluttered.
The top level CMakeLists.txt file looks like this.
project (samvaadak)
subdirs(main libs)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dist/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dist/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dist/bin)
Intermediate CMakeLists.txt files have the following content:
subdirs(src)
And, the CMakeLists.txt file for inner folder(s) where the source files are present, is like this:
include_directories(${samvaadak_SOURCE_DIR}/libs/int/net/include)
include_directories(${samvaadak_SOURCE_DIR}/libs/ext/include)
add_library(nettu conn_manager.cpp connection.cpp)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dist/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dist/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dist/bin)
How to tell cmake that build outside of libs and main folders and just build everything inside build?
You can disable in source builds:
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
Also recommended:
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
They need to be used before the first project() command.

Change modules loading priority

I would like to know the right way to change modules loading priorities in Linux. I want to have hdmi and LCD output the most quickly.
For now it take 3 seconds to came, I know it's not delay due to hdmi or TV because the first stuff I see on screen is some lines about mali init (mali is the name of the GPU here).
I use a A10-Olinuxino-Lime board with an homemade rootfs generated using buildroot and a custom Linux made for this kind of processor (linux-sunxi).
The tree of /etc/:
etc/
├── dhcp
│   ├── dhclient.conf
│   └── dhcpd.conf
├── dropbear
├── fstab
├── group
├── hostname
├── hosts
├── init.d
│   ├── rcK
│   ├── rcS
│   ├── S01logging
│   ├── S20urandom
│   ├── S40network
│   ├── S50dropbear
│   ├── S80dhcp-relay
│   ├── S80dhcp-server
│   ├── S80mali
│   └── S99TVOS
├── inittab
├── inittab~
├── inputrc
├── issue
├── ld.so.cache
├── ld.so.conf
├── ld.so.conf.d
├── mtab -> /proc/mounts
├── network
│   ├── if-down.d
│   ├── if-post-down.d
│   ├── if-post-up.d
│   ├── if-pre-down.d
│   ├── if-pre-up.d
│   ├── if-up.d
│   └── interfaces
├── nsswitch.conf
├── os-release
├── passwd
├── profile
├── protocols
├── random-seed
├── resolv.conf -> ../tmp/resolv.conf
├── securetty
├── services
├── shadow
├── ts.conf
└── wpa_supplicant.conf
Do you have any ideas ?
I'd create an /etc/init.d/S00modules script containing a sequence of insmod (or modprobe if your env supports it) lines.
If that doesn't help, then your modules are loaded even earlier,and you'll have to find how and where that happens. I'd first look at /sbin/init or what is used instead.

rails3 asset pipeline and file collisions

I'm updating an existing rails 2 app to rails 3, and having some trouble understanding the asset pipeline. I have read through the guide and as I understand it, files in any of the following directories will resolve to /assets:
app/assets
lib/assets
vendor/assets
and you could access them using helpers...i.e.
image_tag('logo.png')
But what I don't understand is how collisions are handled? For example, what if there are the following files:
app/assets/images/logo.png
lib/assets/images/logo.png
If I go to myapp.com/assets/images/logo.png, which file will be returned? I could check for collisions manually within my app, but this becomes a pain point when using gems that rely on the asset pipeline.
Based on what I've found, you can't have duplicate files, as rails will just return the first one found.
This seems like a bit of a design flaw, as a gem may not namespace their own assets
Why not taking advantage of the index manifest and organize your app/assets into decoupled modules? You can then reference to a particular image, image_tag('admin/logo.png'), and get for free your UI codebase organised in a more meaningful way. You could even promote a complex component, such as Single Page Application into it's own module and reuse it from different parts of the app.
Let's say you app is composed out of three modules: the public side, an admin UI and, e.g., a CRM to let your agents track the selling process at your company:
app/assets/
├── coffeescripts
│   ├── admin
│   │   ├── components
│   │   ├── index.coffee
│   │   └── initializers
│   ├── application
│   │   ├── components
│   │   ├── index.sass
│   │   └── initializers
│   └── crm
│   ├── components
│   ├── index.sass
│   └── initializers
├── images
│   ├── admin
│   ├── application
│   └── crm
└── stylesheets
├── admin
│   ├── components
│   └── index.sass
├── application
│   ├── components
│   └── index.sass
└── crm
├── components
└── index.sass
21 directories, 6 files
Don't forget to update your application.rb so they will be precompiled properly:
config.assets.precompile = %w(admin.js application.js crm.js
admin.css application.css crm.css)