-
theWord Modules
-
→
theWord Downloads
Download free theWord modules. What is theWord? How do I view theWord Modules? Need help?
-
1,259
Total Files -
11
Total Categories -
91
Total Contributors -
1,180,365
Total Downloads -
Robertson, Archibald Thomas — The Minister and His Greek New Testament
Latest File -
Joel
Latest Submitter
- Files Uploaded Today
4 user(s) are online (in the past 30 minutes)
0 members, 3 guests, 0 anonymous users
- theWord Modules
- → theWord Downloads
Starting with the word „Modules“, I have heard that .o or .obj files are modules, and it gets confused when talking about modularisation. Real modules is a different thing, read on!
For at least since 1990 modules have been used in the Fortran language, so the idea is pretty old, but why care?
Well, in C and C++ we have a big problem with included header files. Every #include
means to include the whole file and pass it as whole to the sources which are to be resolved by the compiler. The process itself is fine as we know, but with many includes and multiple files the build time gets very large, especially when standard libraries are used. It is pretty much wasted time because many of the same includes in different sources (especially in bigger projects) are passed over and over again.
Finally the C++20 standard addresses that issue with modules and defines some rules similar to what is established in Fortran:
- No more duplication of code passed to the compiler as import behaves differently compared to using #include with header files. Modules are precompiled units
- You can select the units you are interested, meaning what is not required will not be considered thus reducing the compile time even further
- No more include guards or similar compile hacks required since modules are imported only once
Set let’s start using C++20 today! Well, not quite. The standard is a bit over a year old (published on Dec 2020) and unfortunately the software is WIP. If you want to test it and keep opensource you should try Clang. GCC has been becoming better, but you need to compile system libraries into modules for your program. I am testing here GCC 11.1.0 and clang 13.0.0. You also should ensure you have the latest version of these compilers. With an up-to-date Arch or Manjaro that is the case. With Ubuntu you should wait for 22.04 LTS when it’s release or the Alpha/Beta daily build, being provided currently. On Visual Studio side use version 19.25 or later.
Now let’s check a module we created for our application. We call it helloworld.cpp:
module;
#include <iostream>
export module helloworld;
export void hello(){
std::cout << "Test" << std::endl;
}
And for the main.cpp we just have:
import helloworld; // import declaration
int main() {
hello();
}
Finally, we create a CMakeLists.txt which should work with Clang, GCC and MSVC. We used the ninja generator to get this built, but as a generated Makefile it should work as well:
cmake_minimum_required(VERSION 3.16)
project(main LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(PREBUILT_MODULE_PATH ${CMAKE_BINARY_DIR}/modules)
function(add_module name)
file(MAKE_DIRECTORY ${PREBUILT_MODULE_PATH})
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# using Clang
add_custom_target(${name}.pcm
COMMAND
${CMAKE_CXX_COMPILER}
-std=c++20
-c
${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}
-Xclang -emit-module-interface
-o ${PREBUILT_MODULE_PATH}/${name}.pcm
)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
add_custom_target(${name}.pcm
COMMAND
${CMAKE_CXX_COMPILER}
-std=c++20
-fmodules-ts
-c
${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}
-o ${name}.pcm
)
#g++ -std=c++20 -fmodules-ts -xc++-system-header iostream
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# using Visual Studio C++
add_custom_target(${name}.obj
COMMAND
${CMAKE_CXX_COMPILER} /experimental:module
/c
${CMAKE_CURRENT_SOURCE_DIR}/${ARGN}
)
endif()
endfunction()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# using Clang
add_compile_options(-fprebuilt-module-path=${PREBUILT_MODULE_PATH})
add_module(helloworld helloworld.cpp)
add_executable(mainExe main.cpp helloworld.cpp)
add_dependencies(main helloworld.pcm)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
add_compile_options(-fmodules-ts)
add_module(helloworld helloworld.cpp)
add_executable(main main.cpp)
add_custom_target(module helloworld.cpp)
target_link_options(main PUBLIC "LINKER:helloworld.pcm")
add_dependencies(main helloworld.pcm)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# using Visual Studio C++
add_compile_options(/experimental:module /c)
add_module(helloworld helloworld.cpp)
add_executable(mainExe main.cpp)
add_dependencies(main helloworld.pcm)
endif()
As you can see the main file does not use any #include, but instead one import. Within the modules you can include files so legacy support is still possible as to be expected.
Conclusion
As you can see, the feature is very promising, but CMake does not yet support this directly. The CMakeLists.txt I created as example helps you to get around, but it is not as portable as it could be. Let’s hope CMake improves in future versions and creates some good interface for the use of modules directly.
#1
Vaughn
- LocationKaufman, Texas
Offline
Posted 24 February 2012 — 01:46 PM
Dear Swordsman, our friend David Cox is making modules at a unbelievable rate for The Word program. They are posted at: http://www.twmodules.com/! We should figure out a way to convert them into e-Sword modules and have them available here. I would love to see a programmer come up with a way to do this. However, I do understand that this can be very complicated at time. I would also like to give the credit for the modules to David and then explain you did the conversion if that is even wanted by the person that does it. Anyway, I get a few updates from this site each day of new postings. Of course just food for thought
.
Grace and Peace,
Your fellow Swordsman,
Vaughn R. Jacobs
- Back to top
#2
pfpeller
pfpeller
-
- Moderators
-
- 1,112 posts
Moderator
- LocationWA
Offline
Posted 25 February 2012 — 09:53 AM
Hi Vaughn,
Josh has posted previously step by step instructions on how to convert theWord modules to e sword modules. If you would like to attempt it, please see this post.
http://www.biblesupp…__fromsearch__1
Blessings,
Peter
- Back to top
#3
Vaughn
Vaughn
- LocationKaufman, Texas
Offline
Posted 25 February 2012 — 12:35 PM
I have been able to get in contact with a programmer friend and we is going to look into what he can come up with to assist in these conversions. I will let you know what I find out and come up with as it develops.
Grace and Peace,
Your fellow Swordsman,
Vaughn R. Jacobs
- Back to top
#4
APsit190
APsit190
- LocationLand of the Long White Cloud (AKA New Zealand)
Offline
Posted 25 February 2012 — 04:55 PM
Hi Vaughn,
Josh has posted previously step by step instructions on how to convert theWord modules to e sword modules. If you would like to attempt it, please see this post.
http://www.biblesupp…__fromsearch__1Blessings,
Peter
I have been able to get in contact with a programmer friend and we is going to look into what he can come up with to assist in these conversions. I will let you know what I find out and come up with as it develops.
Pete and Vaughn,
I’ve been looking at this quite seriously, and to be honest there has been a (proverbial wheel) program invented for this very kind of thing, and I think all it needs to be done for the conversion of The Word resources to e-Sword resources is just the tweaking of the code in that program to convert from Database A to Database B.
If you guys remember, Clint Branham had written a doozy little module conversion program called eSword9Converter. This program converted MS Access database file to SQLite database files (See screenshots below).
eSword9Converter in single conversion mode
[attachment=409:es9con_single.jpg]
eSword9Converter in batch conversion mode
[attachment=410:es9con_batch.jpg]
Considering (going by Josh’s post to which you, Pete, linked to in your reply to Vaughn) that both the Word and e-Sword resources are SQLite database files, I don’t think that it would be difficult to see if Clint could write a similar program that would convert The Word resources to the e-Sword format.
Click here to email Clint, and see how he may be able to help you guys out.
I hope all this may be helpful to you. If this can work, then it will be great.
Blessings,
- Back to top
#5
pfpeller
pfpeller
-
- Moderators
-
- 1,112 posts
Moderator
- LocationWA
Offline
Posted 25 February 2012 — 05:05 PM
Stephen,
That is a good suggestion. Costas Sterigou has written a very good program that imports e sword resources to theWord. I am sure that a program could be written that does it the other way around.
The program would have to take into account that theWord modules can be compressed from within the program and many of them are in RVF format and not rtf and need to be converted back to rtf first. You can convert a theWord module back to rtf from within the theWord itself. You can also de-compress the theWord resources from within theWord. I am not sure how easy it would be for a program to be able to do these two tasks independent of theWord.
Blessings,
Peter
- Back to top
#6
APsit190
APsit190
- LocationLand of the Long White Cloud (AKA New Zealand)
Offline
Posted 25 February 2012 — 05:26 PM
That is a good suggestion. Costas Sterigou has written a very good program that imports e sword resources to theWord. I am sure that a program could be written that does it the other way around.
Hi Pete,
Yeah, and guess what, he had initially written that kind of program when e-Sword was using MS Access database files. So considering that both The Word and e-Sword resources files are in SQLite format, then conversion shouldn’t be a too bigger hassle. Well in theory anyway.
So, well hopefully, Clint might be able to help out, and if so, then a lot of prayers would be answered.
An alternative (this could be regarded at best as unethical, at worst illegal, or, O well, so what — I don’t give a toss attitude ) is reverse engineer Costas conversion tool and, ummm, ummm, ummm, use his code to do it for e-Sword. What a way to go! Great sort of fun stuff to do.
Blessings,
- Back to top
#7
Josh Bond
Josh Bond
- LocationGallatin, TN
Offline
Posted 25 February 2012 — 05:54 PM
All the conversion utility needs to do is open the database, execute the SQL statements to change the schema, and save the database as a new filename. That’s the main part of what my instructions involve—manually executing SQL statements. The SQL statements are already done—so the programmer just needs code to execute the SQL statements.
Issue #1
There really can’t be a completely automated conversion of TheWord Books to e-Sword topics. The Word calls its book resource «Books». e-Sword calls its book resource «Topics». TheWord uses a relational database schema to determine the display order of chapters in the book modules. e-Sword uses an antiquated numbering «system» for display order, such as 0.0, 0.1, etc for front matter chapters like Title Page and Preface. And e-Sword uses 01, 02, etc for main chapter titles. TheWord stores the display ordering data. e-Sword just sorts alphabetically/alphanumerically. So you lose TheWord’s display order data. A human will have to manually number the chapters, and front mater material in the order they should appear when TheWord Books are converted to e-Sword topics.
Issue #2
The other issue is, TheWord uses real RTF hyperlinks for scripture references. This will make a mess of the module in e-Sword 10. So the conversion utility will need to, at a minimum, strip the RTF hyperlinks from the text. Ideally, it would convert the RTF hyperlinks to e-Sword tooltips. That’s the other part of what my (manual) conversion instructions explain.
- Back to top
#8
APsit190
APsit190
- LocationLand of the Long White Cloud (AKA New Zealand)
Offline
Posted 25 February 2012 — 06:47 PM
TheWord stores the display ordering data. e-Sword just sorts alphabetically/alphanumerically. So you lose TheWord’s display order data. A human will have to manually number the chapters, and front mater material in the order they should appear when TheWord Books are converted to e-Sword topics.
Hi Josh,
It’s actually programmably possible, and there’s no need for any actual physical editing required. Well in theory anyway. All that is required is in the way one sets the arrays to sort the data within two kinds of boolean statements — if and for statements. One may also need to have this placed in an iterative (while) statement as well so that it count and sort through the data. We know what the rtf code is that e-Sword uses, and basically all it should take is one to replaced with the other, and then sort it all with the arrays within a loop counter.
You know, you evoke my thinking of how to solve programming difficulties. I realize that there is no one simple solution to this, but as Pete put it, » Costas Sterigou has written a very good program that imports e sword resources to The Word,» then the reality is a program is extremely possible to do it the other way around, and I don’t think its all that complicated and messy, where no physical editing is required when using such a program.
You see, Josh, software are developed where they have the capability to convert data from one format to another. Open Office is an excellent example of this in where it converts MS Word documents to OO with extremely minimal format loss (maybe only approx 1 or 2 percent if that). So, taking these things into consideration, then looking at what Sterigou has done, then we need to look at the how to do it part of it.
Blessings,
Edited by APsit190, 25 February 2012 — 06:55 PM.
- Back to top
#9
Josh Bond
Josh Bond
- LocationGallatin, TN
Offline
Posted 25 February 2012 — 07:00 PM
Hi Josh,
It’s actually programmably possible, and there’s no need for any actual physical editing required. Well in theory anyway. All that is required is in the way one sets the arrays to sort the data within two kinds of boolean statements — if and for statements. One may also need to have this placed in an iterative (while) statement as well so that it count and sort through the data. We know what the rtf code is that e-Sword uses, and basically all it should take is one to replaced with the other, and then sort it all with the arrays within a loop counter.
Sounds like you have it figured out. If that’s all there is to it, then you can whip this out tonight, right?
Seriously, the loop counter’s great but e-Sword doesn’t show Topics based on the order of the database. It shows Topics based on an alphanumeric/alphabetical sort of the value preceding each topic entry. The best a program could do is append a number ( 0 or 00 or 000 to 1 or 10 or 100) to number each topic based on the program’s determination of how the Topics appear in TheWord (whew, got all that?). But even still, manual editing would be required to differentiate front matter material from chapter topics, as only a human can tell the difference. That’s not the end of the world, though. It’s better than what we have now.
Now, going the other way from e-Sword to TheWord is easy. Super easy. Because TheWord displays chapter topics based on data in the database, rather than using an alphabetical sort «system».
Edited by Josh Bond, 25 February 2012 — 07:14 PM.
- Back to top
#10
Josh Bond
Josh Bond
- LocationGallatin, TN
Offline
Posted 25 February 2012 — 07:12 PM
My good Brent could code Tooltip 4 to read TheWord modules into Tooltip like he currently reads e-Sword books into Tooltip. That would be cool. TheWord uses a very different and much more complex schema, though.
- Back to top
На данной странице находятся упражнения с ответами по английскому языку из учебника Spotlight 11 из раздела Word Perfect, Module 6.
Exercise 1. Fill in: establish, extraterrestrial, waves, signals, technologically, race.
Упражнение 1. Вставить слова: establish, extraterrestrial, waves, signals, technologically, race. Полученные сочетания испoльзуйте в предложениях.
ЗаданиеОтвет
1) __ life
2) __ communication
3) send communication __
4) human __
5) __ advanced
6) radio __
1) My job at the Aeronautical Agency is to __ through radar.
2) Some people believe that aliens have tried to __ .
3) Are other planets inhabited by __ ?
4) Some of the most __ companies are located in the US.,
5) __ transmit information over millions of miles.
6) A major part of the science of biology is the study of the __ .
1) extraterrestrial life – внеземная жизнь
2) establish communication – установить контакт
3) send communication signals – посылать сигналы коммуникации
4) human race – человеческая раса
5) technologically advanced – технологически продвинутый
6) radio waves – радио-волны
1) My job at the Aeronautical Agency is to send communication signals through radar. – Моя работа в авиационном агентстве заключается в том, чтобы посылать сигналы коммуникации.
2) Some people believe that aliens have tried to establish communication. – Некоторые люди считают, что инопланетяне попытались установить контакт.
3) Are other planets inhabited by extraterrestrial life? – Населены ли другие планеты внеземной жизнью?
4) Some of the most technologically advanced companies are located in the US. – Некоторые их наиболее технологически продвинутых компаний находятся в США.
5) Radio waves transmit information over millions of miles. – Радио-волны передают информацию на миллионы миль.
6) A major part of the science of biology is the study of the human race. – Основной частью науки биологии является изучение человеческой расы.
Exercise 2. Circle the correct item.
Упражнение 2. Выбрать правильный вариант.
ЗаданиеОтвет
1) The sun is at the centre of our race/solar system.
2) Satellites/lasers are used for communication purposes and scientific research.
3) Somebody stole the antenna/radio waves from my car.
4) Astronomers use a cosmos/telescope to study the stars and planets.
5) We can try sending out an SOS signal/ broadcast with this torch.
6) Hailey’s Comet/Star approaches Earth approximately every 76 years.
7) Sometimes you make me feel like I’m talking/ speaking to a wall.
The results of the fiction/survey are very interesting.
1) The sun is at the centre of our solar system. – Солнце находится в центре нашей солнечной системы.
2) Satellites are used for communication purposes and scientific research. – Спутники используются для коммуникационных и научных целей.
3) Somebody stole the antenna waves from my car. – Кто-то украл антенну из моей машины.
4) Astronomers use a telescope to study the stars and planets. – Астрономы используют телескоп, чтобы изучать звезды и планеты.
5) We can try sending out an SOS signal with this torch. – При помощи этого фонарика мы можем попробовать подать сигнал бедствия.
6) Hailey’s Comet approaches Earth approximately every 76 years. – Комета Галлея приближается к Земле приблизительно каждые 76 лет.
7) Sometimes you make me feel like I’m talking to a wall. – Иногда у меня от тебя такое чувство, что как будто я говорю со стеной.
The results of the survey are very interesting. – Результаты исследования очень интересны.
Exercise 3. Complete the dialogue with the words in the list.
Упражнение 3. Вставить слова.
ЗаданиеОтвет
• developments • headlines • coverage • press • update • scandal
A: Hey, Amber. You’ll never guess what I read in the newspaper 1) __ this morning.
B: What?
A: You mean the latest political 2) __ didn’t catch your eye?
B: No, it didn’t. Tell me!
A: You didn’t happen to read any articles in the 3) __ today?
B: No, I didn’t.
A: Or see a live 4) __ on TV?
B: Will you tell me already?
A: If we turn on the TV right now, I bet we’ll hear the latest 5) __ on the issue.
В: I can’t believe I’m going to hear this from a news 6) __ and not from you. What kind of a friend are you?
A: Hey, Amber. You’ll never guess what I read in the newspaper headlines this morning. – Эй, Амбер. Ты ни за что не угадаешь, что я прочитала этим утром в газетных заголовках.
B: What? – Что?
A: You mean the latest political scandal didn’t catch your eye? – Ты хочешь сказать, что последний политический скандал не попался тебе на глаза?
B: No, it didn’t. Tell me! – Нет. Расскажи!
A: You didn’t happen to read any articles in the press today? – Ты не читала статей в прессе сегодня?
B: No, I didn’t. – Нет.
A: Or see a live update on TV? – И не видела по тв выпуск новостей в прямом эфире?
B: Will you tell me already? – Ты скажешь уже?
A: If we turn on the TV right now, I bet we’ll hear the latest developments on the issue. – Если мы прямо сейчас включим телевизор, то, готова поспорить, мы услышим последние известия о событии.
В: I can’t believe I’m going to hear this from a news coverage and not from you. What kind of a friend are you? – Я не могу поверить, что услышу это из новостей, а не от тебя. Ну и что ты за подруга?
Exercise 4. Fill in the verbs whine, comfort, unfold, drag and come in the correct tense.
Упражнение 4. Вставить глаголы whine, comfort, unfold, drag, come в правильной форме.
ЗаданиеОтвет
1) I can’t believe this scandal __ before our eyes! It’s the top story on the news.
2) Paul __ his brother when his wife died.
3) Sunrise magazine __ out once a week.
4) She could hear the dog __ as she was walking away.
5) They helped me __ the box to the other side of the room.
1) I can’t believe this scandal unfolded before our eyes! It’s the top story on the news. – Я не могу поверить, что этот скандал развернулся перед нашими глазами! Это самая популярная история в новостях.
2) Paul comforted his brother when his wife died. – Пол утешил своего брата, когда его жена умерла.
3) Sunrise magazine comes out once a week. – Журнал “Санрайз” выходит раз в неделю.
4) She could hear the dog whining as she was walking away. – Когда она уходила, то могла слышать, как скулит собака.
5) They helped me drag the box to the other side of the room. – Они помогли мне утащить коробку на другую сторону комнаты.