1
0
forked from SPC/spc-site

Compare commits

...

24 Commits

Author SHA1 Message Date
06bed316b5 Merge remote-tracking branch 'upstream/dev' 2024-08-14 14:42:39 +03:00
7bdc1fd674 Fix data 2024-08-10 12:04:40 +03:00
9cbef1a1e3 Merge remote-tracking branch 'spc/main' into dev 2024-08-10 11:55:19 +03:00
7d2a2ead3f Update to match upstream 2024-04-30 19:03:41 +03:00
7e7a89424c Modify mentors 2024-04-13 10:45:52 +03:00
aca13da8cc Modify mentors 2024-04-12 18:55:39 +03:00
c6e762f96b Update form link 2024-04-01 11:27:07 +03:00
a8eb773e6c Update mentors 2024-04-01 09:48:01 +03:00
183f02f26f Fix rendering for masters 2024-03-03 18:28:58 +03:00
be2a9499c6 Some fixes for magprog 2024-03-02 20:50:35 +03:00
5e207a1a64 Move data out of resources. Deliver as separate directory. 2024-03-02 19:10:56 +03:00
7053c866f9 Alternative way for link passing and substitution in markdown 2024-03-02 16:58:59 +03:00
523ac48fb6 Remove iframe. For some reason it breaks site 2024-03-01 09:30:38 +03:00
a1da3f9a5e Visual update for language switch 2024-02-29 19:54:03 +03:00
f73fb0c2fb Implement parent context and proper language switch 2024-02-29 09:29:22 +03:00
bf746a4227 Hack to fix language switch 2024-02-28 22:06:36 +03:00
f1ee6c5942 Update language management 2024-02-23 12:11:06 +03:00
c2a60646f7 Update to DataForge 0.8 2024-02-19 20:14:25 +03:00
671ae6357f Update to DataForge 0.8 2024-02-19 19:47:37 +03:00
72ac07db5a [WIP] refactor in progress 2024-01-19 22:25:23 +03:00
f65b537255 [WIP] refactor in progress 2024-01-04 19:06:08 +03:00
1923a1d296 [WIP] refactor in progress 2024-01-04 11:26:23 +03:00
d2a31ce33e update orgs 2023-10-28 14:05:15 +03:00
d0afbae699 Add Gorbachev.md. 2023-07-11 18:31:34 +03:00
66 changed files with 1180 additions and 966 deletions

2
.gitignore vendored
View File

@ -1,7 +1,7 @@
.gradle/ .gradle/
build/ build/
.idea/ .idea/
/logs/ logs/
!gradle/wrapper/gradle-wrapper.jar !gradle/wrapper/gradle-wrapper.jar
/deploy.ps1 /deploy.ps1

View File

@ -4,15 +4,15 @@ job("Deploy") {
} }
container(image = "gradle:jdk17-alpine") { container(image = "gradle:jdk17-alpine") {
env["SPC_HOST"] = Params("spc-host") env["SPC_HOST"] = "{{ project:spc-host }}"
env["SPC_USER"] = Secrets("spc-webmaster-user") env["SPC_USER"] = "{{ project:spc-webmaster-user }}"
env["SPC_ID"] = Secrets("spc-webmaster-id") env["SPC_ID"] = "{{ project:spc-webmaster-id }}"
kotlinScript { api -> kotlinScript { api ->
api.space().projects.automation.deployments.start( api.space().projects.automation.deployments.start(
project = api.projectIdentifier(), project = api.projectIdentifier(),
targetIdentifier = TargetIdentifier.Key("spc-site"), targetIdentifier = TargetIdentifier.Key("spc-site"),
version = "current", version = "current",
// automatically update deployment status based on a status of a job // automatically update deployment status based on the status of the job
syncWithAutomationJob = true syncWithAutomationJob = true
) )
api.gradle("uploadDistribution") api.gradle("uploadDistribution")
@ -26,9 +26,9 @@ job("Restart service"){
} }
container(image = "gradle:jdk17-alpine") { container(image = "gradle:jdk17-alpine") {
env["SPC_HOST"] = Params("spc-host") env["SPC_HOST"] = "{{ project:spc-host }}"
env["SPC_USER"] = Secrets("spc-webmaster-user") env["SPC_USER"] = "{{ project:spc-webmaster-user }}"
env["SPC_ID"] = Secrets("spc-webmaster-id") env["SPC_ID"] = "{{ project:spc-webmaster-id }}"
kotlinScript { api -> kotlinScript { api ->
api.gradle("reloadDistribution") api.gradle("reloadDistribution")
} }

View File

@ -35,7 +35,7 @@ dependencies {
implementation("io.ktor:ktor-server-netty:$ktorVersion") implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-http-redirect:$ktorVersion") implementation("io.ktor:ktor-server-http-redirect:$ktorVersion")
implementation("io.ktor:ktor-server-forwarded-header:$ktorVersion") implementation("io.ktor:ktor-server-forwarded-header:$ktorVersion")
implementation("ch.qos.logback:logback-classic:1.2.11") implementation("ch.qos.logback:logback-classic:1.4.12")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion") testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
} }
@ -52,22 +52,23 @@ apiValidation{
val host = System.getenv("SPC_HOST") val host = System.getenv("SPC_HOST")
val user = System.getenv("SPC_USER") val user = System.getenv("SPC_USER")
//val password = System.getenv("SPC_PASSWORD") val password = System.getenv("SPC_PASSWORD")
val identityString = System.getenv("SPC_ID") val privateKey = System.getenv("SPC_ID")
//val publicKey = System.getenv("SPC_PUBKEY")
val serviceName = "sciprog-site" val serviceName = "sciprog-site"
if (host != null && user != null || identityString != null) { if (host != null && user != null || privateKey != null) {
val uploadDistribution by tasks.creating { val uploadDistribution by tasks.creating {
group = "distribution" group = "distribution"
dependsOn("installDist") dependsOn("installDist")
doLast { doLast {
JSch { JSch {
addIdentity("spc-webmaster", identityString.encodeToByteArray(), null, null) addIdentity("webmaster", privateKey.encodeToByteArray(), null, null)
}.useSession(host, user) { }.useSession(host, user) {
//stopping service during the upload //stopping service during the upload
execute("sudo systemctl stop $serviceName") execute("sudo systemctl stop $serviceName")
uploadDirectory(buildDir.resolve("install/spc-site"), "/opt") uploadDirectory(buildDir.resolve("install/spc-site"), "/opt")
//adding executable flag to the entry point //adding an executable flag to the entry point
execute("sudo chmod +x /opt/spc-site/bin/spc-site") execute("sudo chmod +x /opt/spc-site/bin/spc-site")
execute("sudo systemctl start $serviceName") execute("sudo systemctl start $serviceName")
} }
@ -78,7 +79,7 @@ if (host != null && user != null || identityString != null) {
group = "distribution" group = "distribution"
doLast { doLast {
JSch { JSch {
addIdentity("spc-webmaster", identityString.encodeToByteArray(), null, null) addIdentity("webmaster", privateKey.encodeToByteArray(), null, null)
}.useSession(host, user) { }.useSession(host, user) {
execute("sudo systemctl restart $serviceName") execute("sudo systemctl restart $serviceName")
} }

View File

@ -12,15 +12,15 @@ language: en
<h2>Master program</h2> <h2>Master program</h2>
</header> </header>
<p>Master program "Scientific programming" at MIPT aims to prepare specialists both in application programming and domain field (such as physics, biology, biotechnology, computer science and other research areas).</p> <p>Master program "Scientific programming" at MIPT aims to prepare specialists both in application programming and domain field (such as physics, biology, biotechnology, computer science and other research areas).</p>
<p> In modern science and technology application level programming is an integral part of any major work. And in order to be successful in this field one needs to know both software engineering and the domain field. </p> <p> In modern science and technology, application level programming is an integral part of any major work. And in order to be successful in this field, one needs to know both software engineering and the domain field. </p>
<ul class="actions"> <ul class="actions">
<li><a href="${resolvePageRef("education.masters")}" class="button next">More</a></li> <li><a href="/education/masters" class="button next">More</a></li>
</ul> </ul>
</div> </div>
</section> </section>
<hr/> <hr/>
## Courses in 2022-2023: ## Courses in 20222023:
### [Scientific literature seminar](#) ### [Scientific literature seminar](#)
*curated by [Aleksandr Svetlichnyi](${resolvePageRef("team")}#svetlichnyi)* *curated by [Aleksandr Svetlichnyi](${resolvePageRef("team")}#svetlichnyi)*
@ -46,11 +46,6 @@ Actual program: [SPC-A-6](https://npm.mipt.ru/youtrack/articles/SPC-A-6)
Actual program: [SPC-A-3](https://npm.mipt.ru/youtrack/articles/SPC-A-3) Actual program: [SPC-A-3](https://npm.mipt.ru/youtrack/articles/SPC-A-3)
### [Instruments of development](https://npm.mipt.ru/youtrack/articles/SPC-A-5)
*curated by [Alexander Nozik](${resolvePageRef("team.index")}#nozik)*
Actual program: [SPC-A-5](https://npm.mipt.ru/youtrack/articles/SPC-A-5)
### [Advanced Python](https://npm.mipt.ru/youtrack/articles/SPC-A-4) ### [Advanced Python](https://npm.mipt.ru/youtrack/articles/SPC-A-4)
*by Mikhail Zelenyy* *by Mikhail Zelenyy*

View File

@ -0,0 +1,4 @@
---
pageName: SPC
language: en
---

View File

@ -1,3 +1,4 @@
--- ---
type: team type: team
title: Varvara Kaplenko title: Varvara Kaplenko

View File

@ -1,3 +1,7 @@
---
language: en
---
**Director of the centre** **Director of the centre**
* PhD in particle physics. * PhD in particle physics.

View File

@ -4,6 +4,7 @@ title: Vladimir Palmin
id: palmin id: palmin
order: 10 order: 10
language: en language: en
published: false
image: image:
path: images/people/palmin.jpg path: images/people/palmin.jpg
position: left position: left

View File

@ -1 +1,5 @@
---
language: en
---
**Vice-director for education** **Vice-director for education**

View File

@ -0,0 +1,109 @@
---
type: project
title: BM@N infrastructure
order: 150
language: en
image: images/projects/bmn/nica.png
---
## Information Systems for BM@N
Our team works on development of information systems and services for BM@N (Baryonic Matter at Nuclotron) experiment, part of NICA (Nuclotron-based Ion Collider fAсility) megaproject (located in Dubna, Russia). These works are performed together with scientists from JINR and other institutions.
The overall view of NICA complex with already running experiment BM@N and future collider experiments MPD and SPD is shown in Fig. 1. BM@N studies collisions of elementary particles and ions with a fixed target with energies up to 6 GeV per nucleon, which is a very interesting energy region for fundamental nuclear physics research.
<span class="image fit">
<strong>Fig. 1</strong>
<img src="snark://ref/images/projects/bmn/nica.png" alt="Fig. 1"/>
</span>
### Event Metadata System
Event metadata systems (EMS) are widely used in the physics experiments on particle collisions, where large numbers of experimental events, typically billions, are collected. At the stage of particular physics analysis of experimental data, only a small subset of collected events meeting certain criteria is usually of interest, and passing over the whole amount of stored data to form the subset is overly time-consuming and resource-intensive. Instead, metadata systems allow one to obtain only the required events (or, at least, references to them) via searching and filtering based on given fields (event attributes) recorded in the metadata system.
The NICA Event Metadata System has been developed for storing necessary event metadata for the NICA experiments. The information system makes it possible to quickly search for a necessary subset of physics events by required parameters to use in further event data processing. It provides summary description of collision events and their identifiers to search and select events for a desired analysis task, enables their management and convenient access; provides online and offline interfaces for selecting events of interest, such as Web and REST API services, and a dedicated C++/ROOT interface.
The Event Metadata System, including the Event Catalogue based on PostgreSQL, Metadata API, Web Service, and other developed components, has been provisioned using a common deployment system for the first experiment of the NICA project, BM@N. The main interfaces to EMS, namely, Web UI and REST API have been developed using Kotlin multiplatform technology as a part of the single full-stack project. The EMS provides acceptable response times for the expected amount of the event metadata. The system and its services will be further evolved and improved following operational experience.
Figs. 2 and 3 illustrate high-level EMS architecture and its basic Web UI view.
<span class="image fit">
<strong>Fig. 2</strong>
<img src="snark://ref/images/projects/bmn/ems-arch.png" alt="Fig. 2"/>
</span>
<span class="image fit">
<strong>Fig. 3</strong>
<img src="snark://ref/images/projects/bmn/ems-web.png" alt="Fig. 3"/>
</span>
### Next-Generation Event Visualization (Event Display) System
In high-energy physics experiments, the ability to display both detector geometry and particle tracks has become an essential feature, required for physicists to better understand particular collision events as well as to present the physical results to a wider audience.
For BM@N experiment, a new event visualization solution was developed based on VisionForge, a modern open-source visualization system. An important part of the solution is integration of the system with experiment's software framework BmnRoot, which is a CERN ROOT-based environment.
Figs. 4, 5 illustrate how the Web interface of a new system looks like. The user can conveniently move and rotate the camera, zoom-in and zoom-out the scene as needed, browse the scene graph (object tree). For every object it is possible to change display properties such as color, opacity and visibility. Note that the full BM@N geometry model includes more than 400,000 primitives so rendering them all requires significant resources. To optimize the resource usage, so-called “prototypes” were implemented in VisionForge model for three-dimensional objects. For a single prototype its geometry is rendered only once and reused for multiple objects, which helps to significantly reduce memory usage.
<span class="image fit">
<strong>Fig. 4</strong>
<img src="snark://ref/images/projects/bmn/vis-1.png" alt="Fig. 4"/>
</span>
<span class="image fit">
<strong>Fig. 5</strong>
<img src="snark://ref/images/projects/bmn/vis-2.png" alt="Fig. 5"/>
</span>
### Condition Database Services
The Unified Condition Database (shortly called UniConDa) of the BM@N experiment is one of the advanced information systems required to support automation of experimental data collecting and processing, providing a central storage for experiment metadata being necessary for event data processing, including session and run information, detector and subsystem parameters, and descriptions of simulated event files.
The condition database has been earlier implemented based on the PostgreSQL database management system in accordance with a well-designed scheme. An ecosystem of its supplementary services is constantly being improved to increase overall degree of database integration and convenience of the use by collaboration members.
For the UniConDa ecosystem, the REST API, a modern HTTP-based interface for integration with both ROOT-based and non-ROOT software systems of the experiment, was developed.
Additionally, Smart Data Parser, a part of the BM@N information system based on the Unified Condition Database, was created to solve the task of the parameter data migration from accumulated files of ASCII text, CSV or XML formats to the Unified Condition Database of the BM@N experiment (Fig. 6).
<span class="image fit">
<strong>Fig. 6</strong>
<img src="snark://ref/images/projects/bmn/sdp.png" alt="Fig. 6"/>
</span>
### Monitoring Service
The software infrastructure of the BM@N experiment contains a set of various information systems that are essential for the work with experimental or simulated data on all processing stages, including the collection, storage, intermediate processing and physics analysis. In case one of such systems stops functioning, the work with BM@N data by collaboration members gets either impossible or, at least, much less productive. Due to this fact, the timely detection of possible failures in the systems due to software or hardware failures is fairly important.
The developed Monitoring Service is used to check availability and health status of information systems. This includes measuring, storing, visualizing and sending alert notifications on monitored parameters, such as CPU, memory and disk utilization, DBMS functioning parameters, response times of databases and API endpoints, ping round-trip times, and so on. The current implementation of the BM@N monitoring service is illustrated in Figs. 7, 8. Note that a related task of building highly available information services is currently a work in progress.
<span class="image fit">
<strong>Fig. 7</strong>
<img src="snark://ref/images/projects/bmn/mon-arch.png" alt="Fig. 7"/>
</span>
<span class="image fit">
<strong>Fig. 8</strong>
<img src="snark://ref/images/projects/bmn/mon-db.png" alt="Fig. 8"/>
</span>
### Slow Control System Viewer
Web interface for slow control system of BM@N was developed. It visualizes various sensor data graphs based on parameters and time intervals provided by user as shown in Fig. 9.
<span class="image fit">
<strong>Fig. 9</strong>
<img src="snark://ref/images/projects/bmn/scs.png" alt="Fig. 9"/>
</span>
### References
1. K. Gertsenberger, P. Klimai, M. Zelenyi. Auxiliary Services for the Condition Database of the BM@N Experiment at NICA // Phys.Part.Nucl.Lett. 20 (2023) 1217. https://www.doi.org/10.1134/S1547477123050291
2. E. Alexandrov, I. Alexandrov, A. Chebotov, A. Degtyarev, I. Filozova, K. Gertsenberger, P. Klimai, A. Yakovlev. Implementation of the Event Metadata System for physics analysis in the NICA experiments // Journal of Physics: Conference Series 2438 (2023) 012046. https://www.doi.org/10.1088/1742-6596/2438/1/012046
2. A. Degtyarev, K. Gertsenberger, P. Klimai. Usage of Apache Cassandra for Prototyping the Event Metadata System of the NICA Experiments // Phys.Part.Nucl.Lett. 19 (2022) 5, 562-565. https://doi.org/10.1134/S1547477122050144
3. A. Chebotov, K. Gertsenberger, P. Klimai, A. Moshkin. Information System Based on the Condition Database for the NICA Experiments, User WEB Application, and Related Services // Phys.Part.Nucl.Lett. 19 (2022) 5, 558-561. https://doi.org/10.1134/S1547477122050132
4. E. Alexandrov, I. Alexandrov, A. Degtyarev, K. Gertsenberger, I. Filozova, P. Klimai, A. Nozik, A. Yakovlev. Design of the Event Metadata System for the Experiments at NICA // Phys.Part.Nucl.Lett. 18 (2021) 5, 603-616. https://doi.org/10.1134/S1547477121050034
5. K. Gertsenberger, I. Alexandrov, I. Filozova, E. Alexandrov, A. Moshkin, A. Chebotov, M. Mineev, D. Pryahina, G. Shestakova, A. Yakovlev, A. Nozik, P. Klimai. Development of Information Systems for Online and Offline Data Processing in the NICA Experiments // Phys.Part.Nucl. 52 (2021) 4, 801-807. https://doi.org/10.1134/S1063779621040250
6. K.V. Gertsenberger, A.I. Chebotov, P.A. Klimai, I.N. Alexandrov, E.I. Alexandrov, I.A. Filozova, A.A. Moshkin. Implementation of the Condition Database for the Experiments of the NICA Complex // CEUR Workshop Proceedings, Vol. 3041 (2021) 128-132. https://doi.org/10.54546/MLIT.2021.53.54.001
7. E.I. Alexandrov, I.N. Alexandrov, A.G. Degtyarev, I.A. Filozova, K.V. Gertsenberger, P.A. Klimai, A.V. Yakovlev. Development of the Event Metadata System for the NICA experiments // CEUR Workshop Proceedings, Vol. 3041 (2021) 439-444. https://doi.org/10.54546/MLIT.2021.80.18.001
8. M.N.Kapishin et al, The Report on Project “Studies of Baryonic Matter at the Nuclotron (BM@N)”, https://bmn.jinr.ru/wp-content/uploads/2022/10/BMNproject_2021cor2.pdf

View File

@ -0,0 +1,5 @@
---
language: en
---
Our team works on development of information systems and services for BM@N (Baryonic Matter at Nuclotron) experiment, part of NICA (Nuclotron-based Ion Collider fAсility) megaproject (located in Dubna, Russia). These works are performed together with scientists from JINR and other institutions.

View File

@ -1,3 +1,7 @@
---
language: en
---
Controls.kt is a data acquisition framework (work in progress). It is based on DataForge, a software framework for automated data processing. Controls.kt is a data acquisition framework (work in progress). It is based on DataForge, a software framework for automated data processing.
[Repository and documentation](https://github.com/mipt-npm/controls.kt) [Repository and documentation](https://github.com/mipt-npm/controls.kt)

View File

@ -21,7 +21,7 @@ A presentation on application of (old version of) DataForge to Troitsk nu-mass a
<iframe width="100%" height="315" src="https://www.youtube.com/embed/OpWzLXUZnLI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> <iframe width="100%" height="315" src="https://www.youtube.com/embed/OpWzLXUZnLI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Questions and Answers ## Questions and Answers
In this section we will try to cover DataForge main ideas in the form of questions and answers. In this section, we will try to cover DataForge main ideas in the form of questions and answers.
### General ### General
**Q**: I have a lot of data to analyze. The analysis process is complicated, requires a lot of stages and data flow is not always obvious. To top it the data size is huge, so I don't want to perform operation I don't need (calculate something I won't need or calculate something twice). And yes, I need it to be performed in parallel and probably on remote computer. By the way, I am sick and tired of scripts that modify other scripts that control scripts. Could you help me? **Q**: I have a lot of data to analyze. The analysis process is complicated, requires a lot of stages and data flow is not always obvious. To top it the data size is huge, so I don't want to perform operation I don't need (calculate something I won't need or calculate something twice). And yes, I need it to be performed in parallel and probably on remote computer. By the way, I am sick and tired of scripts that modify other scripts that control scripts. Could you help me?

View File

@ -1,3 +1,7 @@
---
language: en
---
A metadata processing workflow manipulation framework. A metadata processing workflow manipulation framework.
[Repository and documentation](https://github.com/mipt-npm/dataforge-core) [Repository and documentation](https://github.com/mipt-npm/dataforge-core)

View File

@ -1,3 +1,7 @@
---
language: en
---
An experimental Kotlin library for mathematical operations, built on the principle of context-oriented programming using mathematical abstractions. An experimental Kotlin library for mathematical operations, built on the principle of context-oriented programming using mathematical abstractions.
[Repository and documentation](https://github.com/mipt-npm/kmath) [Repository and documentation](https://github.com/mipt-npm/kmath)

View File

@ -1 +1,5 @@
---
language: en
---
Geological gas storage monitoring and leaks prevention using muons from atmosphere. Geological gas storage monitoring and leaks prevention using muons from atmosphere.

View File

@ -1,3 +1,7 @@
---
language: en
---
A kotlin visualization library wrapping popular [Plotly](https://plotly.com/javascript/) library. A kotlin visualization library wrapping popular [Plotly](https://plotly.com/javascript/) library.
[Repository and documentation](https://github.com/mipt-npm/plotly.kt) [Repository and documentation](https://github.com/mipt-npm/plotly.kt)

View File

@ -1,3 +1,7 @@
---
language: en
---
A visualization framework written in Kotlin-multiplatform A visualization framework written in Kotlin-multiplatform
[Repository and documentation](https://github.com/mipt-npm/visionforge) [Repository and documentation](https://github.com/mipt-npm/visionforge)

View File

@ -4,4 +4,4 @@ title: WIP
language: en language: en
--- ---
This page is work in progress. This page is a work in progress.

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@ -48,7 +48,7 @@
if ($sidebar.length > 0) { if ($sidebar.length > 0) {
//adding exclusion for home link //adding exclusion for home link
var $sidebar_a = $sidebar.find('a').not('.spc-home'); let $sidebar_a = $sidebar.find('a').not('.spc-home');
$sidebar_a $sidebar_a
.addClass('scrolly') .addClass('scrolly')
@ -71,7 +71,7 @@
}) })
.each(function () { .each(function () {
var $this = $(this), let $this = $(this),
id = $this.attr('href'), id = $this.attr('href'),
$section = $(id); $section = $(id);
@ -81,7 +81,7 @@
// Scrollex. // Scrollex.
$section.scrollex({ $section.scrollex({
mode: 'middle', // mode: 'middle',
top: '-20vh', top: '-20vh',
bottom: '-20vh', bottom: '-20vh',
initialize: function () { initialize: function () {
@ -133,7 +133,7 @@
// Spotlights. // Spotlights.
$('.spotlights > section') $('.spotlights > section')
.scrollex({ .scrollex({
mode: 'middle', // mode: 'middle',
top: '-10vh', top: '-10vh',
bottom: '-10vh', bottom: '-10vh',
initialize: function () { initialize: function () {
@ -151,7 +151,7 @@
}) })
.each(function () { .each(function () {
var $this = $(this), let $this = $(this),
$image = $this.find('.image'), $image = $this.find('.image'),
$img = $image.find('img'), $img = $image.find('img'),
x; x;
@ -171,7 +171,7 @@
// Features. // Features.
$('.features') $('.features')
.scrollex({ .scrollex({
mode: 'middle', // mode: 'middle',
top: '-20vh', top: '-20vh',
bottom: '-20vh', bottom: '-20vh',
initialize: function () { initialize: function () {
@ -187,20 +187,22 @@
} }
}); });
})(jQuery); })(jQuery);
//From https://www.w3schools.com/howto/howto_js_collapsible.asp
const coll = document.getElementsByClassName("collapsible");
let i;
for (i = 0; i < coll.length; i++) { //From https://www.w3schools.com/howto/howto_js_collapsible.asp
coll[i].addEventListener("click", function() { let collapsibles = document.getElementsByClassName("collapsible");
this.classList.toggle("active");
const content = this.nextElementSibling; Array.from(collapsibles).forEach(item => {
if (content.style.maxHeight){ item.addEventListener("click", function () {
this.classList.toggle("collapsible-expanded");
let target = item.attributes.getNamedItem("data-target").value;
let content = document.getElementById(target);
if (content.style.maxHeight) {
content.style.maxHeight = null; content.style.maxHeight = null;
} else { } else {
content.style.maxHeight = content.scrollHeight + "px"; content.style.maxHeight = content.scrollHeight + "px";
} }
}); });
} })

View File

@ -1,18 +1,18 @@
(function($) { (function ($) {
/** /**
* Generate an indented list of links from a nav. Meant for use with panel(). * Generate an indented list of links from a nav. Meant for use with panel().
* @return {jQuery} jQuery object. * @return {jQuery} jQuery object.
*/ */
$.fn.navList = function() { $.fn.navList = function () {
var $this = $(this); const $this = $(this);
$a = $this.find('a'), $a = $this.find('a'),
b = []; b = [];
$a.each(function() { $a.each(function () {
var $this = $(this), const $this = $(this),
indent = Math.max(0, $this.parents('li').length - 1), indent = Math.max(0, $this.parents('li').length - 1),
href = $this.attr('href'), href = $this.attr('href'),
target = $this.attr('target'); target = $this.attr('target');
@ -20,8 +20,8 @@
b.push( b.push(
'<a ' + '<a ' +
'class="link depth-' + indent + '"' + 'class="link depth-' + indent + '"' +
( (typeof target !== 'undefined' && target != '') ? ' target="' + target + '"' : '') + ((typeof target !== 'undefined' && target !== '') ? ' target="' + target + '"' : '') +
( (typeof href !== 'undefined' && href != '') ? ' href="' + href + '"' : '') + ((typeof href !== 'undefined' && href !== '') ? ' href="' + href + '"' : '') +
'>' + '>' +
'<span class="indent-' + indent + '"></span>' + '<span class="indent-' + indent + '"></span>' +
$this.text() + $this.text() +
@ -39,16 +39,17 @@
* @param {object} userConfig User config. * @param {object} userConfig User config.
* @return {jQuery} jQuery object. * @return {jQuery} jQuery object.
*/ */
$.fn.panel = function(userConfig) { $.fn.panel = function (userConfig) {
// No elements? let $this = $(this);
if (this.length == 0) // No elements?
if (this.length === 0)
return $this; return $this;
// Multiple elements? // Multiple elements?
if (this.length > 1) { if (this.length > 1) {
for (var i=0; i < this.length; i++) for (let i = 0; i < this.length; i++)
$(this[i]).panel(userConfig); $(this[i]).panel(userConfig);
return $this; return $this;
@ -56,8 +57,7 @@
} }
// Vars. // Vars.
var $this = $(this), let $body = $('body'),
$body = $('body'),
$window = $(window), $window = $(window),
id = $this.attr('id'), id = $this.attr('id'),
config; config;
@ -101,7 +101,7 @@
// Panel. // Panel.
// Methods. // Methods.
$this._hide = function(event) { $this._hide = function (event) {
// Already hidden? Bail. // Already hidden? Bail.
if (!config.target.hasClass(config.visibleClass)) if (!config.target.hasClass(config.visibleClass))
@ -119,7 +119,7 @@
config.target.removeClass(config.visibleClass); config.target.removeClass(config.visibleClass);
// Post-hide stuff. // Post-hide stuff.
window.setTimeout(function() { window.setTimeout(function () {
// Reset scroll position. // Reset scroll position.
if (config.resetScroll) if (config.resetScroll)
@ -127,7 +127,7 @@
// Reset forms. // Reset forms.
if (config.resetForms) if (config.resetForms)
$this.find('form').each(function() { $this.find('form').each(function () {
this.reset(); this.reset();
}); });
@ -147,13 +147,13 @@
.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); .css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)');
$this $this
.on('click', 'a', function(event) { .on('click', 'a', function (event) {
var $a = $(this), const $a = $(this),
href = $a.attr('href'), href = $a.attr('href'),
target = $a.attr('target'); target = $a.attr('target');
if (!href || href == '#' || href == '' || href == '#' + id) if (!href || href === '#' || href === '' || href === '#' + id)
return; return;
// Cancel original event. // Cancel original event.
@ -164,9 +164,9 @@
$this._hide(); $this._hide();
// Redirect to href. // Redirect to href.
window.setTimeout(function() { window.setTimeout(function () {
if (target == '_blank') if (target === '_blank')
window.open(href); window.open(href);
else else
window.location.href = href; window.location.href = href;
@ -178,20 +178,20 @@
} }
// Event: Touch stuff. // Event: Touch stuff.
$this.on('touchstart', function(event) { $this.on('touchstart', function (event) {
$this.touchPosX = event.originalEvent.touches[0].pageX; $this.touchPosX = event.originalEvent.touches[0].pageX;
$this.touchPosY = event.originalEvent.touches[0].pageY; $this.touchPosY = event.originalEvent.touches[0].pageY;
}) })
$this.on('touchmove', function(event) { $this.on('touchmove', function (event) {
if ($this.touchPosX === null if ($this.touchPosX === null
|| $this.touchPosY === null) || $this.touchPosY === null)
return; return;
var diffX = $this.touchPosX - event.originalEvent.touches[0].pageX, const diffX = $this.touchPosX - event.originalEvent.touches[0].pageX,
diffY = $this.touchPosY - event.originalEvent.touches[0].pageY, diffY = $this.touchPosY - event.originalEvent.touches[0].pageY,
th = $this.outerHeight(), th = $this.outerHeight(),
ts = ($this.get(0).scrollHeight - $this.scrollTop()); ts = ($this.get(0).scrollHeight - $this.scrollTop());
@ -199,8 +199,8 @@
// Hide on swipe? // Hide on swipe?
if (config.hideOnSwipe) { if (config.hideOnSwipe) {
var result = false, let result = false;
boundary = 20, const boundary = 20,
delta = 50; delta = 50;
switch (config.side) { switch (config.side) {
@ -250,12 +250,12 @@
}); });
// Event: Prevent certain events inside the panel from bubbling. // Event: Prevent certain events inside the panel from bubbling.
$this.on('click touchend touchstart touchmove', function(event) { $this.on('click touchend touchstart touchmove', function (event) {
event.stopPropagation(); event.stopPropagation();
}); });
// Event: Hide panel if a child anchor tag pointing to its ID is clicked. // Event: Hide panel if a child anchor tag pointing to its ID is clicked.
$this.on('click', 'a[href="#' + id + '"]', function(event) { $this.on('click', 'a[href="#' + id + '"]', function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
@ -267,12 +267,12 @@
// Body. // Body.
// Event: Hide panel on body click/tap. // Event: Hide panel on body click/tap.
$body.on('click touchend', function(event) { $body.on('click touchend', function (event) {
$this._hide(event); $this._hide(event);
}); });
// Event: Toggle. // Event: Toggle.
$body.on('click', 'a[href="#' + id + '"]', function(event) { $body.on('click', 'a[href="#' + id + '"]', function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
@ -285,9 +285,9 @@
// Event: Hide on ESC. // Event: Hide on ESC.
if (config.hideOnEscape) if (config.hideOnEscape)
$window.on('keydown', function(event) { $window.on('keydown', function (event) {
if (event.keyCode == 27) if (event.keyCode === 27)
$this._hide(event); $this._hide(event);
}); });
@ -300,20 +300,20 @@
* Apply "placeholder" attribute polyfill to one or more forms. * Apply "placeholder" attribute polyfill to one or more forms.
* @return {jQuery} jQuery object. * @return {jQuery} jQuery object.
*/ */
$.fn.placeholder = function() { $.fn.placeholder = function () {
// Browser natively supports placeholders? Bail. // Browser natively supports placeholders? Bail.
if (typeof (document.createElement('input')).placeholder != 'undefined') if (typeof (document.createElement('input')).placeholder != 'undefined')
return $(this); return $(this);
// No elements? // No elements?
if (this.length == 0) if (this.length === 0)
return $this; return $this;
// Multiple elements? // Multiple elements?
if (this.length > 1) { if (this.length > 1) {
for (var i=0; i < this.length; i++) for (let i = 0; i < this.length; i++)
$(this[i]).placeholder(); $(this[i]).placeholder();
return $this; return $this;
@ -325,38 +325,38 @@
// Text, TextArea. // Text, TextArea.
$this.find('input[type=text],textarea') $this.find('input[type=text],textarea')
.each(function() { .each(function () {
var i = $(this); const i = $(this);
if (i.val() == '' if (i.val() === ''
|| i.val() == i.attr('placeholder')) || i.val() === i.attr('placeholder'))
i i
.addClass('polyfill-placeholder') .addClass('polyfill-placeholder')
.val(i.attr('placeholder')); .val(i.attr('placeholder'));
}) })
.on('blur', function() { .on('blur', function () {
var i = $(this); const i = $(this);
if (i.attr('name').match(/-polyfill-field$/)) if (i.attr('name').match(/-polyfill-field$/))
return; return;
if (i.val() == '') if (i.val() === '')
i i
.addClass('polyfill-placeholder') .addClass('polyfill-placeholder')
.val(i.attr('placeholder')); .val(i.attr('placeholder'));
}) })
.on('focus', function() { .on('focus', function () {
var i = $(this); const i = $(this);
if (i.attr('name').match(/-polyfill-field$/)) if (i.attr('name').match(/-polyfill-field$/))
return; return;
if (i.val() == i.attr('placeholder')) if (i.val() === i.attr('placeholder'))
i i
.removeClass('polyfill-placeholder') .removeClass('polyfill-placeholder')
.val(''); .val('');
@ -365,10 +365,10 @@
// Password. // Password.
$this.find('input[type=password]') $this.find('input[type=password]')
.each(function() { .each(function () {
var i = $(this); const i = $(this);
var x = $( const x = $(
$('<div>') $('<div>')
.append(i.clone()) .append(i.clone())
.remove() .remove()
@ -377,28 +377,28 @@
.replace(/type=password/i, 'type=text') .replace(/type=password/i, 'type=text')
); );
if (i.attr('id') != '') if (i.attr('id') !== '')
x.attr('id', i.attr('id') + '-polyfill-field'); x.attr('id', i.attr('id') + '-polyfill-field');
if (i.attr('name') != '') if (i.attr('name') !== '')
x.attr('name', i.attr('name') + '-polyfill-field'); x.attr('name', i.attr('name') + '-polyfill-field');
x.addClass('polyfill-placeholder') x.addClass('polyfill-placeholder')
.val(x.attr('placeholder')).insertAfter(i); .val(x.attr('placeholder')).insertAfter(i);
if (i.val() == '') if (i.val() === '')
i.hide(); i.hide();
else else
x.hide(); x.hide();
i i
.on('blur', function(event) { .on('blur', function (event) {
event.preventDefault(); event.preventDefault();
var x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); const x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]');
if (i.val() == '') { if (i.val() === '') {
i.hide(); i.hide();
x.show(); x.show();
@ -408,11 +408,11 @@
}); });
x x
.on('focus', function(event) { .on('focus', function (event) {
event.preventDefault(); event.preventDefault();
var i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']'); const i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']');
x.hide(); x.hide();
@ -421,7 +421,7 @@
.focus(); .focus();
}) })
.on('keypress', function(event) { .on('keypress', function (event) {
event.preventDefault(); event.preventDefault();
x.val(''); x.val('');
@ -432,17 +432,17 @@
// Events. // Events.
$this $this
.on('submit', function() { .on('submit', function () {
$this.find('input[type=text],input[type=password],textarea') $this.find('input[type=text],input[type=password],textarea')
.each(function(event) { .each(function (event) {
var i = $(this); const i = $(this);
if (i.attr('name').match(/-polyfill-field$/)) if (i.attr('name').match(/-polyfill-field$/))
i.attr('name', ''); i.attr('name', '');
if (i.val() == i.attr('placeholder')) { if (i.val() === i.attr('placeholder')) {
i.removeClass('polyfill-placeholder'); i.removeClass('polyfill-placeholder');
i.val(''); i.val('');
@ -452,7 +452,7 @@
}); });
}) })
.on('reset', function(event) { .on('reset', function (event) {
event.preventDefault(); event.preventDefault();
@ -460,10 +460,10 @@
.val($('option:first').val()); .val($('option:first').val());
$this.find('input,textarea') $this.find('input,textarea')
.each(function() { .each(function () {
var i = $(this), const i = $(this);
x; let x;
i.removeClass('polyfill-placeholder'); i.removeClass('polyfill-placeholder');
@ -478,11 +478,10 @@
x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]'); x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]');
if (i.val() == '') { if (i.val() === '') {
i.hide(); i.hide();
x.show(); x.show();
} } else {
else {
i.show(); i.show();
x.hide(); x.hide();
} }
@ -498,7 +497,7 @@
case 'textarea': case 'textarea':
i.val(i.attr('defaultValue')); i.val(i.attr('defaultValue'));
if (i.val() == '') { if (i.val() === '') {
i.addClass('polyfill-placeholder'); i.addClass('polyfill-placeholder');
i.val(i.attr('placeholder')); i.val(i.attr('placeholder'));
} }
@ -523,22 +522,23 @@
* @param {jQuery} $elements Elements (or selector) to move. * @param {jQuery} $elements Elements (or selector) to move.
* @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations. * @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations.
*/ */
$.prioritize = function($elements, condition) { $.prioritize = function ($elements, condition) {
var key = '__prioritize'; const key = '__prioritize';
// Expand $elements if it's not already a jQuery object. // Expand $elements if it's not already a jQuery object.
if (typeof $elements != 'jQuery') if (typeof $elements != 'jQuery')
$elements = $($elements); $elements = $($elements);
// Step through elements. // Step through elements.
$elements.each(function() { $elements.each(function () {
var $e = $(this), $p, const $e = $(this);
$parent = $e.parent(); let $p;
const $parent = $e.parent();
// No parent? Bail. // No parent? Bail.
if ($parent.length == 0) if ($parent.length === 0)
return; return;
// Not moved? Move it. // Not moved? Move it.
@ -552,7 +552,7 @@
$p = $e.prev(); $p = $e.prev();
// Couldn't find anything? Means this element's already at the top, so bail. // Couldn't find anything? Means this element's already at the top, so bail.
if ($p.length == 0) if ($p.length === 0)
return; return;
// Move element to top of parent. // Move element to top of parent.

View File

@ -5,7 +5,7 @@ section_title: Как поступить?
language: ru language: ru
--- ---
Чтобы принять участие в программе, необходимо: Чтобы принять участие в программе, необходимо:
* заполнить **[анкету](https://forms.yandex.ru/cloud/641ad7fe73cee702c7753776/)**. В анкете надо указать одного или нескольких научных руководителей, с которыми вы бы хотели работать; * заполнить **[анкету](https://forms.yandex.ru/cloud/660a6e8690fa7b0435e99a28/)**. В анкете надо указать одного или нескольких научных руководителей, с которыми вы бы хотели работать;
* **до 1 июня (I поток) или до 15 июля (II поток)** пройти собеседование с научными руководителями и согласовать предполагаемый план обучения; * **до 1 июня (I поток) или до 15 июля (II поток)** пройти собеседование с научными руководителями и согласовать предполагаемый план обучения;
* подать документы в магистратуру МФТИ согласно [правилам поступления](https://pk.mipt.ru/master/). * подать документы в магистратуру МФТИ согласно [правилам поступления](https://pk.mipt.ru/master/).
@ -13,7 +13,7 @@ language: ru
**ВАЖНО:** предварительное согласование с научным руководителем является **обязательным** для обучения в нашей магистратуре. **ВАЖНО:** предварительное согласование с научным руководителем является **обязательным** для обучения в нашей магистратуре.
Сроки приёма документов при поступлении на очные программы магистратуры в МФТИ в 20232024 учебном году: Сроки приёма документов при поступлении на очные программы магистратуры в МФТИ в 20242025 учебном году:
* I поток поступления: 10 апреля 20 июля; * I поток поступления: 10 апреля 20 июля;
* II поток поступления: 21 июля 4 августа. * II поток поступления: 21 июля 4 августа.

View File

@ -5,8 +5,7 @@ section_title: О программе
language: ru language: ru
--- ---
<iframe width="100%" height="315" src="https://www.youtube.com/embed/pniPs5ne294" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> [Видео презентация программы](https://youtu.be/pniPs5ne294?si=TzY9yvt6PmYcDIq7)
Магистерская программа МФТИ **"Научное программное обеспечение"** создана при поддержке двух школ МФТИ: Физтех-школы физики и исследований им. Ландау ([ЛФИ](https://mipt.ru/education/departments/lpr/)) и Физтех-школы прикладной математики и информатики ([ФПМИ](https://mipt.ru/education/departments/fpmi/)), а также ряда академических и промышленных партнеров. В ее основе лежит взаимодействие студента и [научного руководителя](#mentors). Магистерская программа МФТИ **"Научное программное обеспечение"** создана при поддержке двух школ МФТИ: Физтех-школы физики и исследований им. Ландау ([ЛФИ](https://mipt.ru/education/departments/lpr/)) и Физтех-школы прикладной математики и информатики ([ФПМИ](https://mipt.ru/education/departments/fpmi/)), а также ряда академических и промышленных партнеров. В ее основе лежит взаимодействие студента и [научного руководителя](#mentors).

View File

@ -0,0 +1,27 @@
---
content_type: magprog_mentor
name: Михаил Андреев
id: Andreev
image: images/mentors/Andreev.jpg
language: ru
---
#### Организация
Сбербанк КИБ
Департамент Глобальных Рынков
#### Биография
Образование.
МФТИ, факультет проблем физики и энергетики (2001).
Кандидат технических наук (2004), аспирантура Института Космических Исследований РАН, отдел технологий спутникового мониторинга.
Большой опыт работы в промышленной разработке программных систем. С 2013 года в инвестиционных банках для задач торговли и управления рисками внебиржевых производных финансовых инструментов.
Читаю на ФПМИ курс по выбору «Математические модели и численные методы в финансах» -- вводный курс по расчетам производных финансовых инструментов для 4ого курса бакалавриата.
#### Направление исследований
Производные финансовые инструменты, вычислительные финансы.
#### Требования к студентам
* Владение C++ и Python
* Базовые теоретические знания в области количественных финансов

View File

@ -0,0 +1,5 @@
**Сбербанк КИБ. Департамент Глобальных Рынков.**
Моделирование производных финансовые инструментов, вычислительные финансы.
Ключевые слова: *Вычислительные финансы, C++, Python.*

View File

@ -3,8 +3,8 @@ content_type: magprog_mentor
name: Андрей Александрович Ефанов name: Андрей Александрович Ефанов
id: Efanov id: Efanov
image: images/mentors/Efanov.jpg image: images/mentors/Efanov.jpg
published: false
language: ru language: ru
published: false
--- ---
#### Организация #### Организация

View File

@ -0,0 +1,35 @@
---
content_type: magprog_mentor
name: Алексей Юрьевич Горбачев
id: Gorbachev
image: images/mentors/Gorbachev.jpg
language: ru
---
#### Организация
Заведующий лабораторией протеомного анализа ФГБУ ФНКЦ ФХМ им. Ю.М. Лопухина ФМБА России.
#### Биография
* Победитель Всероссийской олимпиады по биологии (Диплом III степени, 2004).
* Обучение в МГУ им. М.В. Ломоносова, биологический факультет, кафедра молекулярной биологии (2004-2009).
* Обучение в аспирантуре ФГБУ ФНКЦ ФХМ ФМБА России по специальности Биохимия (2009-2012).
* Защита кандидатской диссертации (2014).
* Руководство проектом "Разработка системы генетического скрининга
сердечно-сосудистых заболеваний" в рамках программы трансляционных исследований и инноваций Сколковского Института Науки и Технологий при сотрудничестве с РЖД (2015-2016).
* Коммерческая деятельность в рамках собственной научно-исследовательской компании "Институт геномного анализа", создание проекта Zenome (2016-н.в.)
* Научная деятельность в ФГБУ ФНКЦ ФХМ им. Ю.М. Лопухина ФМБА России в должности заведующего лабораторий протеомного анализа (2022-н.в.)
#### Направление исследований
* Изучение механизмов долговременной эпигенетической памяти у адгезивно-инвазивных форм кишечной палочки (E. coli), ассоциированной с болезнью Крона.
* Исследование репертуаров T-клеточных рецепторов у пациентов с болезнью Крона.
* Протеогеномное профилирование образцов рака молочной железы как основа для разработки платформы прототипирования персонализированных панелей для тераностики.
* Разработка новых методов диагностики рака с помощью секвенирования свободной циркулирующей ДНК плазмы крови.
#### Требования к студентам
* Знание языков программирования: Python, R, bash.
* Умение работать с Git.
* Английский язык на уровне чтения технической документации.
* Знание ОС Linux и Windows на уровне опытного пользователя.
* Знания биохимии и молекулярной биологии на уровне университетской программы.

View File

@ -0,0 +1,3 @@
**Заведующий лабораторией протеомного анализа ФГБУ ФНКЦ ФХМ им. Ю.М. Лопухина ФМБА России.**
Ключевые слова: *Био-информатика, протеомный анализ, диагностика рака*.

View File

@ -0,0 +1,20 @@
---
content_type: magprog_mentor
name: Александр Владимирович Куликов
id: Kulikov
image: images/mentors/Kulikov.jpg
language: ru
---
* Руководитель проекта Департамента инцидентов и рисков АНО "Аналитический центр при Правительстве РФ".
* Доцент кафедры высшей математики МФТИ
#### Биография
Закончил в 2006 году механико-математический факультет МГУ, в 2009 защитил кандидатскую диссертацию по специальности 01.01.05 - теория вероятностей и математическая статистика по теме "Многомерные когерентные меры риска и их применение к решению задач финансовой математики". Доцент кафедры высшей математики, также преподает различные курсы по финансовой математике в физтех-школе ФПМИ. Сфера научных интересов - финансовая математика, оценка риска, ценообразование производных финансовых инструментов. Занимался риск-менеджментом в ООО "Газпром экспорт", ПАО "НК "Роснефть". На данный момент руководитель проекта Департамента инцидентов и рисков АНО "Аналитический центр при Правительстве РФ"
#### Направление исследований
Финансовая математика, оценка риска, ценообразование производных финансовых инструментов.
#### Требования к студентам
Хорошие знания теории вероятностей, математической статистики и случайных процессов, желательны базовые знания в финансовой математике.

View File

@ -0,0 +1,5 @@
**Руководитель проекта Департамента инцидентов и рисков АНО "Аналитический центр при Правительстве РФ"**
Финансовая математика, оценка риска, ценообразование производных финансовых инструментов.
Ключевые слова: *математические инструменты, финансы, оценка риска*

View File

@ -4,6 +4,7 @@ name: Владимир Пальмин
id: Palmin id: Palmin
image: images/mentors/Palmin.jpg image: images/mentors/Palmin.jpg
language: ru language: ru
published: false
--- ---
#### Организация #### Организация

View File

@ -4,6 +4,7 @@ name: Айно Константиновна Скасырская
id: Skasyrskaya id: Skasyrskaya
image: images/mentors/Skasyrskaya.jpg image: images/mentors/Skasyrskaya.jpg
language: ru language: ru
published: false
--- ---
#### Организация #### Организация

View File

@ -0,0 +1,19 @@
---
content_type: magprog_mentor
name: Тимур Жарников
id: Zharnikov
image: images/mentors/Zharnikov.jpg
language: ru
---
Ведущий научный сотрудник в области геофизических методов исследования скважин и распределенных оптоволоконных измерений.
#### Биография
Выпускник Физтеха. Тимур Жарников имеет более чем 20-летний опыт работы в области акустического каротажа, оптического зондирования и полимерной физики. Начал свою карьеру в Российской академии наук в области полимерной физики. Затем он работал с Schlumberger в качестве старшего научного сотрудника в течение более чем 10 лет по акустическому каротажу и распределенным измерениям волоконной оптики. Затем работал в других компаниях в качестве научного специалиста.
#### Направление исследований
Разработка эффективных методов анализа и интерпретации данных геофизических измерений (акустика и распределенные оптоволоконные измерения). Разработка научно-прикладного ПО.
#### Требования к студентам
Хорошая подготовка по физике и математике.

View File

@ -0,0 +1,5 @@
**Ведущий научный сотрудник в области геофизических методов исследования скважин и распределенных оптоволоконных измерений**
Разработка эффективных методов анализа и интерпретации данных геофизических измерений (акустика и распределенные оптоволоконные измерения). Разработка научно-прикладного ПО.
Ключевые слова: *научное ПО, вычислительная физика, акустика, прикладные исследования*

View File

@ -6,13 +6,9 @@ image: images/mentors/kluev.jpg
language: ru language: ru
--- ---
#### Организация
КПМ РИТМ
#### Биография #### Биография
Учился и защищался в БелГУ, с 2022 года работаю в КПМ РИТМ лидом команды программирующих математиков. Учился и защищался в БелГУ, с 2022 года работаю в Julia ORG лидом команды программирующих математиков.
#### Направления исследований #### Направления исследований

View File

@ -1,4 +1,4 @@
**Лидер команды программирующих математиков КПМ РИТМ** **Лидер команды программирующих математиков на Julia**
Разработка и исследования методов компьютерного моделирования гибридных динамических систем. Разработка и исследования методов компьютерного моделирования гибридных динамических систем.

View File

@ -6,18 +6,14 @@ image: images/mentors/komisov.jpg
language: ru language: ru
--- ---
#### Организация
КПМ РИТМ
#### Биография #### Биография
2019 - к.ф.-м.н. * 2019 - к.ф.-м.н.
Московский государственный университет им. М.В. Ломоносова, Москва Московский государственный университет им. М.В. Ломоносова, Москва
2012 - Магистр * 2012 - Магистр
НИУ "БелГУ" НИУ "БелГУ"
Инженерно физический, Кафедра теоретической и математической физики, Прикладные математика и физика Инженерно физический, Кафедра теоретической и математической физики, Прикладные математика и физика
2010 - Бакалавр * 2010 - Бакалавр
НИУ БелГУ НИУ БелГУ
Инженерно физический, Кафедра теоретической и математической физики, Прикладные математика и физика Инженерно физический, Кафедра теоретической и математической физики, Прикладные математика и физика

View File

@ -1,4 +1,4 @@
**CTO КПМ РИТМ** **Разработчик на Julia**
Разработка и исследования методов компьютерного моделирования гибридных динамических систем. Разработка и исследования методов компьютерного моделирования гибридных динамических систем.

View File

@ -4,6 +4,7 @@ name: Ирина Геннадьевна Низовцева
id: Nizovtseva id: Nizovtseva
image: images/mentors/Nizovtseva.jpg image: images/mentors/Nizovtseva.jpg
language: ru language: ru
published: false
--- ---
#### Биография #### Биография
* К.ф.-м.н. с 2009г (направление 01.04.14) * К.ф.-м.н. с 2009г (направление 01.04.14)

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

View File

@ -1,4 +1,4 @@
kotlin.code.style=official kotlin.code.style=official
toolsVersion=0.14.9-kotlin-1.8.20 toolsVersion=0.15.2-kotlin-1.9.22
snarkVersion=0.1.0-dev-1 snarkVersion=0.1.0-dev-1

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -1,7 +1,6 @@
rootProject.name = "spc-site" rootProject.name = "spc-site"
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
//enableFeaturePreview("VERSION_CATALOGS")
pluginManagement { pluginManagement {

View File

@ -4,63 +4,22 @@ import io.ktor.server.application.Application
import io.ktor.server.application.call import io.ktor.server.application.call
import io.ktor.server.application.install import io.ktor.server.application.install
import io.ktor.server.application.log import io.ktor.server.application.log
import io.ktor.server.config.tryGetString
import io.ktor.server.plugins.forwardedheaders.ForwardedHeaders import io.ktor.server.plugins.forwardedheaders.ForwardedHeaders
import io.ktor.server.plugins.forwardedheaders.XForwardedHeaders import io.ktor.server.plugins.forwardedheaders.XForwardedHeaders
import io.ktor.server.response.respondRedirect import io.ktor.server.response.respondRedirect
import io.ktor.server.routing.get import io.ktor.server.routing.get
import io.ktor.server.routing.routing import io.ktor.server.routing.routing
import space.kscience.dataforge.context.Global import space.kscience.dataforge.context.Context
import space.kscience.dataforge.context.request import space.kscience.dataforge.context.request
import space.kscience.dataforge.data.DataTree import space.kscience.dataforge.data.forEach
import space.kscience.snark.html.SiteBuilder import space.kscience.dataforge.names.Name
import space.kscience.snark.html.SnarkHtmlPlugin import space.kscience.dataforge.workspace.FileData
import space.kscience.snark.html.readDirectory import space.kscience.dataforge.workspace.directory
import space.kscience.snark.ktor.prepareSnarkDataCacheDirectory import space.kscience.snark.html.SnarkHtml
import space.kscience.snark.html.readSiteData
import space.kscience.snark.ktor.site import space.kscience.snark.ktor.site
import java.nio.file.FileSystems import kotlin.io.path.Path
import java.nio.file.Files import kotlin.io.path.exists
import java.nio.file.Path
import kotlin.io.path.createDirectories
import kotlin.io.path.isRegularFile
import kotlin.io.path.relativeTo
import kotlin.io.path.toPath
private fun Application.copyResource(resource: String, dataDirectory: Path) {
val uri = javaClass.getResource("/$resource")?.toURI()
?: error("Resource $resource not found")
val targetPath = dataDirectory.resolve(resource)
if (Files.isDirectory(targetPath)) {
log.info("Using existing data directory at $targetPath.")
} else {
log.info("Copying data from $uri into $targetPath.")
targetPath.createDirectories()
//Copy everything into a temporary directory
fun copyFromPath(rootPath: Path) {
Files.walk(rootPath).forEach { source: Path ->
if (source.isRegularFile()) {
val relative = source.relativeTo(rootPath).toString()
val destination: Path = targetPath.resolve(relative)
destination.parent.createDirectories()
Files.copy(source, destination)
}
}
}
if ("jar" == uri.scheme) {
FileSystems.newFileSystem(uri, emptyMap<String, Any>()).use { fs ->
val rootPath: Path = fs.provider().getPath(uri)
copyFromPath(rootPath)
}
} else {
val rootPath = uri.toPath()
copyFromPath(rootPath)
}
}
}
@Suppress("unused") @Suppress("unused")
@ -69,26 +28,33 @@ fun Application.spcModule() {
install(ForwardedHeaders) install(ForwardedHeaders)
install(XForwardedHeaders) install(XForwardedHeaders)
val snark = Global.request(SnarkHtmlPlugin) val context = Context {
plugin(SnarkHtml)
val dataDirectory = Path.of(
environment.config.tryGetString("ktor.environment.dataDirectory") ?: "data"
)
if (!prepareSnarkDataCacheDirectory(dataDirectory)) {
copyResource("common", dataDirectory)
copyResource("home", dataDirectory)
copyResource("magprog", dataDirectory)
} }
val siteData: DataTree<Any> = snark.readDirectory(dataDirectory) val snark = context.request(SnarkHtml)
site(snark, siteData, block = SiteBuilder::spcSite) val dataDirectoryString = environment.config.propertyOrNull("snark.dataDirectory")?.getString() ?: "data"
val dataDirectory = Path(dataDirectoryString)
if(!dataDirectory.exists()){
error("Data directory at $dataDirectory is not resolved")
}
val siteData = snark.readSiteData(context) {
directory(snark.io, Name.EMPTY, dataDirectory)
}
siteData.forEach { namedData ->
log.debug("Loading data {} from {}", namedData.name, namedData.meta[FileData.FILE_PATH_KEY])
}
routing { routing {
get("magprog") { get("magprog") {
call.respondRedirect("education/masters") call.respondRedirect("education/masters")
} }
site(context, siteData, content = spcSite)
} }
} }

View File

@ -3,7 +3,6 @@ package center.sciprog
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import kotlinx.html.* import kotlinx.html.*
import space.kscience.dataforge.data.Data import space.kscience.dataforge.data.Data
import space.kscience.dataforge.data.DataTree
import space.kscience.dataforge.data.await import space.kscience.dataforge.data.await
import space.kscience.dataforge.data.getByType import space.kscience.dataforge.data.getByType
import space.kscience.dataforge.meta.Meta import space.kscience.dataforge.meta.Meta
@ -11,7 +10,6 @@ import space.kscience.dataforge.meta.get
import space.kscience.dataforge.meta.getIndexed import space.kscience.dataforge.meta.getIndexed
import space.kscience.dataforge.meta.string import space.kscience.dataforge.meta.string
import space.kscience.dataforge.names.Name import space.kscience.dataforge.names.Name
import space.kscience.dataforge.names.parseAsName
import space.kscience.snark.html.* import space.kscience.snark.html.*
@ -22,22 +20,19 @@ private val Data<*>.fragment: String
get() = meta["fragment"].string ?: "" get() = meta["fragment"].string ?: ""
internal fun SiteBuilder.bmk(data: DataTree<Any>, prefix: Name = "bmk".parseAsName()) { internal val bmk = HtmlSite {
// val data: DataTree<Any> = snark.readDirectory(dataPath.resolve("content"))
site(prefix, data) {
static("assets") static("assets")
static("images") static("images")
static("common.assets.webfonts", "assets/webfonts") static("common.assets.webfonts", "assets/webfonts")
static("common", "") static("common", "")
val about: Data<HtmlFragment> = data.resolveHtml("about") val about: Data<PageFragment> = siteData.resolveHtml("about")
val team: Data<HtmlFragment> = data.resolveHtml("team.index") val team: Data<PageFragment> = siteData.resolveHtml("team.index")
val teamData: Map<Name, Data<HtmlFragment>> = data.resolveAllHtml { _, meta -> meta["type"].string == "team" } val teamData: Map<Name, Data<PageFragment>> = siteData.resolveAllHtml { _, meta -> meta["type"].string == "team" }
val solutions: Data<HtmlFragment> = data.resolveHtml("lotSeis") val solutions: Data<PageFragment> = siteData.resolveHtml("lotSeis")
val partners: Data<HtmlFragment> = data.resolveHtml("partners") val partners: Data<PageFragment> = siteData.resolveHtml("partners")
val partnersData = runBlocking { data.getByType<Meta>("partnersData")!!.await() } val partnersData = runBlocking { siteData.getByType<Meta>("partnersData")!!.await() }
page { page {
head { head {
@ -130,7 +125,7 @@ internal fun SiteBuilder.bmk(data: DataTree<Any>, prefix: Name = "bmk".parseAsNa
header("major") { header("major") {
h2 { +about.title } h2 { +about.title }
} }
htmlData(about) fragment(about)
} }
} }
} }
@ -139,7 +134,7 @@ internal fun SiteBuilder.bmk(data: DataTree<Any>, prefix: Name = "bmk".parseAsNa
header("major") { header("major") {
h2 { +team.title } h2 { +team.title }
} }
htmlData(team) fragment(team)
teamData.values.sortedBy { it.order }.forEach { data -> teamData.values.sortedBy { it.order }.forEach { data ->
span("image left") { span("image left") {
img { img {
@ -148,14 +143,14 @@ internal fun SiteBuilder.bmk(data: DataTree<Any>, prefix: Name = "bmk".parseAsNa
} }
} }
h3 { +data.title } h3 { +data.title }
htmlData(data) fragment(data)
} }
} }
section("main") { section("main") {
id = solutions.fragment id = solutions.fragment
header("major") { header("major") {
h2 { +solutions.title } h2 { +solutions.title }
htmlData(solutions) fragment(solutions)
span("image fit") { span("image fit") {
img { img {
src = resolveRef("images/fresnel_lands_critdepth2.png") src = resolveRef("images/fresnel_lands_critdepth2.png")
@ -167,7 +162,7 @@ internal fun SiteBuilder.bmk(data: DataTree<Any>, prefix: Name = "bmk".parseAsNa
id = partners.fragment id = partners.fragment
header("major") { header("major") {
h2 { +partners.title } h2 { +partners.title }
htmlData(partners) fragment(partners)
table { table {
partnersData.getIndexed("content").values.forEach { partnersData.getIndexed("content").values.forEach {
tr { tr {
@ -288,5 +283,4 @@ internal fun SiteBuilder.bmk(data: DataTree<Any>, prefix: Name = "bmk".parseAsNa
} }
} }
} }
}
} }

View File

@ -7,15 +7,19 @@ import space.kscience.dataforge.meta.Meta
import space.kscience.dataforge.meta.get import space.kscience.dataforge.meta.get
import space.kscience.dataforge.meta.int import space.kscience.dataforge.meta.int
import space.kscience.dataforge.meta.string import space.kscience.dataforge.meta.string
import space.kscience.dataforge.names.* import space.kscience.dataforge.names.Name
import space.kscience.dataforge.names.NameToken
import space.kscience.dataforge.names.parseAsName
import space.kscience.dataforge.names.replaceLast
import space.kscience.snark.html.* import space.kscience.snark.html.*
import kotlin.collections.component1 import kotlin.collections.component1
import kotlin.collections.component2 import kotlin.collections.component2
import kotlin.collections.set import kotlin.collections.set
context(WebPage) private fun FlowContent.spcSpotlightContent(
landing: HtmlData, context(PageContextWithData, FlowContent) private fun spcSpotlightContent(
content: Map<Name, HtmlData>, landing: Data<PageFragment>,
content: Map<Name, Data<PageFragment>>,
) { ) {
// Banner // Banner
// Note: The "styleN" class below should match that of the header element. // Note: The "styleN" class below should match that of the header element.
@ -32,7 +36,7 @@ context(WebPage) private fun FlowContent.spcSpotlightContent(
h1 { +(landing.meta["title"].string ?: "???") } h1 { +(landing.meta["title"].string ?: "???") }
} }
div("content") { div("content") {
htmlData(landing) fragment(landing)
} }
} }
} }
@ -63,8 +67,9 @@ context(WebPage) private fun FlowContent.spcSpotlightContent(
header("major") { header("major") {
h3 { +(entry.meta["title"].string ?: "???") } h3 { +(entry.meta["title"].string ?: "???") }
} }
val infoData = data.resolveHtmlOrNull(name.replaceLast { NameToken(it.body + "[info]") }) ?: entry val infoData =
htmlData(infoData) data.resolveHtmlOrNull(name.replaceLast { NameToken(it.body + "[info]") }) ?: entry
fragment(infoData)
ul("actions") { ul("actions") {
li { li {
a(classes = "button") { a(classes = "button") {
@ -82,16 +87,13 @@ context(WebPage) private fun FlowContent.spcSpotlightContent(
} }
internal fun SiteBuilder.spcSpotlight( internal fun SiteContextWithData.spcSpotlight(
address: String, address: String,
contentFilter: (Name, Meta) -> Boolean, contentFilter: (Name, Meta) -> Boolean,
) { ) {
val pageName = address.parseAsName() val pageName = address.parseAsName()
val languagePrefix = languagePrefix val body = siteData.resolveHtmlOrNull(pageName) ?: error("Could not find body for $pageName")
val body = data.resolveHtmlOrNull(languagePrefix + pageName) val content: Map<Name, Data<PageFragment>> = siteData.resolveAllHtml { name, meta -> contentFilter(name, meta) }
?: data.resolveHtmlOrNull(pageName) ?: error("Could not find body for $pageName")
val content: Map<Name, Data<HtmlFragment>> =
data.resolveAllHtml { name, meta -> name.startsWith(languagePrefix) && contentFilter(name, meta) }
val meta = body.meta val meta = body.meta
page(pageName) { page(pageName) {
@ -107,10 +109,6 @@ internal fun SiteBuilder.spcSpotlight(
} }
content.forEach { (name, contentBody) -> content.forEach { (name, contentBody) ->
page(name, contentBody.meta) { page(name, contentBody.meta, spcPage(contentBody))
spcPageContent {
htmlData(contentBody)
}
}
} }
} }

View File

@ -2,19 +2,17 @@ package center.sciprog
import html5up.forty.fortyScripts import html5up.forty.fortyScripts
import kotlinx.html.* import kotlinx.html.*
import space.kscience.dataforge.data.Data import space.kscience.dataforge.data.*
import space.kscience.dataforge.data.DataTree import space.kscience.dataforge.meta.Meta
import space.kscience.dataforge.meta.* import space.kscience.dataforge.meta.get
import space.kscience.dataforge.meta.string
import space.kscience.dataforge.names.Name import space.kscience.dataforge.names.Name
import space.kscience.dataforge.names.asName import space.kscience.dataforge.names.asName
import space.kscience.dataforge.names.startsWith import space.kscience.dataforge.names.startsWith
import space.kscience.snark.html.* import space.kscience.snark.html.*
import kotlin.reflect.typeOf
context(WebPage) internal fun HTML.spcPageContent( internal fun spcPage(content: Data<PageFragment>) = HtmlPage {
fragment: FlowContent.() -> Unit,
) {
val title by pageMeta.string { SPC_TITLE } val title by pageMeta.string { SPC_TITLE }
val pageName by pageMeta.string { title } val pageName by pageMeta.string { title }
spcHead(pageName) spcHead(pageName)
@ -30,7 +28,8 @@ context(WebPage) internal fun HTML.spcPageContent(
} }
pageMeta["image"]?.let { imageMeta -> pageMeta["image"]?.let { imageMeta ->
val imagePath = val imagePath =
imageMeta.value?.string ?: imageMeta["path"].string ?: error("Image path not provided") imageMeta.value?.string ?: imageMeta["path"].string
?: error("Image path not provided")
val imageClass = imageMeta["position"].string ?: "main" val imageClass = imageMeta["position"].string ?: "main"
span("image $imageClass") { span("image $imageClass") {
img { img {
@ -39,7 +38,7 @@ context(WebPage) internal fun HTML.spcPageContent(
} }
} }
} }
fragment() fragment(content)
} }
} }
} }
@ -49,34 +48,7 @@ context(WebPage) internal fun HTML.spcPageContent(
} }
} }
@Suppress("UNCHECKED_CAST") internal val spcHomePage = HtmlPage {
internal val FortyDataRenderer: DataRenderer = object : DataRenderer {
context(SiteBuilder)
override fun invoke(name: Name, data: Data<Any>) {
if (data.type == typeOf<HtmlFragment>()) {
data as Data<HtmlFragment>
val languageMeta: Meta = Language.forName(name)
val dataMeta: Meta = if (languageMeta.isEmpty()) {
data.meta
} else {
data.meta.toMutableMeta().apply {
Language.LANGUAGES_KEY put languageMeta
}
}
page(name, dataMeta) {
spcPageContent {
htmlData(data)
}
}
}
}
}
context(WebPage) private fun HTML.spcHomePage() {
spcHead() spcHead()
body("is-preload") { body("is-preload") {
wrapper { wrapper {
@ -110,23 +82,23 @@ context(WebPage) private fun HTML.spcHomePage() {
// Main // Main
div { div {
id = "main" id = "main"
section { // section {
div("inner home_creationinfo") { // div("inner home_creationinfo") {
a(href = "https://mipt.ru/education/departments/fpmi/") { // a(href = "https://mipt.ru/education/departments/fpmi/") {
span("image") { // span("image") {
img { // img {
src = "images/FPMI.jpg" // src = "images/FPMI.jpg"
alt = "FPMI" // alt = "FPMI"
height = "60dp" // height = "60dp"
width = "60dp" // width = "60dp"
} // }
} // }
} // }
p { // p {
+"Centre was created in 2022 based on the Phystech School of Applied Mathematics and Informatics at MIPT" // +"Centre was created in 2022 based on the Phystech School of Applied Mathematics and Informatics at MIPT"
} // }
} // }
} // }
section { section {
div("inner") { div("inner") {
@ -156,14 +128,14 @@ context(WebPage) private fun HTML.spcHomePage() {
article { article {
span("image") { span("image") {
img { img {
src = resolveRef("images/pic01.jpg") src = page.resolveRef("images/pic01.jpg")
alt = "" alt = ""
} }
} }
header("major") { header("major") {
h3 { h3 {
a(classes = "link") { a(classes = "link") {
href = resolvePageRef("education") href = page.resolvePageRef("education")
+"""Education""" +"""Education"""
} }
} }
@ -173,14 +145,14 @@ context(WebPage) private fun HTML.spcHomePage() {
article { article {
span("image") { span("image") {
img { img {
src = resolveRef("images/pic02.jpg") src = page.resolveRef("images/pic02.jpg")
alt = "" alt = ""
} }
} }
header("major") { header("major") {
h3 { h3 {
a(classes = "link") { a(classes = "link") {
href = resolvePageRef("research") href = page.resolvePageRef("research")
+"""Research""" +"""Research"""
} }
} }
@ -192,14 +164,14 @@ context(WebPage) private fun HTML.spcHomePage() {
article { article {
span("image") { span("image") {
img { img {
src = resolveRef("images/pic03.jpg") src = page.resolveRef("images/pic03.jpg")
alt = "" alt = ""
} }
} }
header("major") { header("major") {
h3 { h3 {
a(classes = "link") { a(classes = "link") {
href = resolvePageRef("consulting.index") href = page.resolvePageRef("consulting.index")
+"""Consulting""" +"""Consulting"""
} }
} }
@ -209,14 +181,14 @@ context(WebPage) private fun HTML.spcHomePage() {
article { article {
span("image") { span("image") {
img { img {
src = resolveRef("images/pic04.jpg") src = page.resolveRef("images/pic04.jpg")
alt = "" alt = ""
} }
} }
header("major") { header("major") {
h3 { h3 {
a(classes = "link") { a(classes = "link") {
href = resolvePageRef("team") href = page.resolvePageRef("team")
+"""Team""" +"""Team"""
} }
} }
@ -263,24 +235,29 @@ context(WebPage) private fun HTML.spcHomePage() {
} }
} }
internal fun SiteBuilder.spcHome(homePageData: DataTree<Any>, prefix: Name = Name.EMPTY) { private fun SiteContextWithData.allPagesIn(location: String) {
siteData.filterByType<PageFragment> { name, meta, _ ->
name.startsWith(location) && meta["type"].string == "page"
}.forEach { (name, content) ->
page(name, content = spcPage(content), pageMeta = content.meta)
}
}
//val homePageData: DataTree<Any> = snark.readDirectory(dataPath.resolve("content"))
site(prefix, homePageData) { internal val spcHome: HtmlSite = HtmlSite {
multiLanguageSite(
Language("en", route = Name.EMPTY),
Language("ru"),
) {
static("assets") static("assets")
static("images") static("images")
static("common", "") static("common", "")
withLanguages( page(content = spcHomePage, pageMeta = siteData.meta ?: Meta.EMPTY)
"en" to "",
"ru" to "ru"
) {
page { spcHomePage() }
localizedPages("consulting", dataRenderer = FortyDataRenderer) allPagesIn("consulting")
localizedPages("education", dataRenderer = FortyDataRenderer) allPagesIn("education")
spcSpotlight("team") { _, meta -> spcSpotlight("team") { _, meta ->
meta["type"].string == "team" meta["type"].string == "team"
@ -290,5 +267,5 @@ internal fun SiteBuilder.spcHome(homePageData: DataTree<Any>, prefix: Name = Nam
name.startsWith("projects".asName()) && meta["type"].string == "project" name.startsWith("projects".asName()) && meta["type"].string == "project"
} }
} }
}
} }

View File

@ -2,7 +2,7 @@ package center.sciprog
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import kotlinx.html.* import kotlinx.html.*
import space.kscience.dataforge.data.DataTree import space.kscience.dataforge.data.Data
import space.kscience.dataforge.data.await import space.kscience.dataforge.data.await
import space.kscience.dataforge.data.getByType import space.kscience.dataforge.data.getByType
import space.kscience.dataforge.meta.Meta import space.kscience.dataforge.meta.Meta
@ -29,35 +29,38 @@ import kotlin.collections.set
// } // }
//} //}
private val HtmlData.imagePath: String? get() = meta["image"]?.string ?: meta["image.path"].string private val Data<PageFragment>.imagePath: String? get() = meta["image"]?.string ?: meta["image.path"].string
private val HtmlData.name: String get() = meta["name"].string ?: error("Name not found") private val Data<PageFragment>.name: String get() = meta["name"].string ?: error("Name not found")
context(WebPage) class MagProgSection( context(PageContext)
class MagProgSection(
val id: String, val id: String,
val title: String, val title: String,
val style: String, val style: String,
val content: FlowContent.() -> Unit, val content: FlowContent.() -> Unit,
) )
context(WebPage) private fun wrapSection( context(PageContext)
private fun wrapSection(
id: String, id: String,
title: String, title: String,
sectionContent: FlowContent.() -> Unit, sectionContent: FlowContent.() -> Unit,
): MagProgSection = MagProgSection(id, title, "wrapper style1 fullscreen fade-up") { ): MagProgSection = MagProgSection(id, title, "wrapper style1 fullscreen") {
div("inner") { div("inner") {
h2 { +title } h2 { +title }
sectionContent() sectionContent()
} }
} }
context(WebPage) private fun wrapSection( context(PageContextWithData)
block: HtmlData, private fun wrapSection(
section: Data<PageFragment>,
idOverride: String? = null, idOverride: String? = null,
): MagProgSection = wrapSection( ): MagProgSection = wrapSection(
idOverride ?: block.id, idOverride ?: section.id,
block.meta["section_title"]?.string ?: error("Section without title"), section.meta["section_title"]?.string ?: error("Section without title"),
) { ) {
htmlData(block) fragment(section)
} }
private val CONTENT_NODE_NAME = Name.EMPTY//"content".asName() private val CONTENT_NODE_NAME = Name.EMPTY//"content".asName()
@ -68,26 +71,29 @@ private val PROGRAM_PATH: Name = CONTENT_NODE_NAME + "program"
private val RECOMMENDED_COURSES_PATH: Name = CONTENT_NODE_NAME + "recommendedCourses" private val RECOMMENDED_COURSES_PATH: Name = CONTENT_NODE_NAME + "recommendedCourses"
private val PARTNERS_PATH: Name = CONTENT_NODE_NAME + "partners" private val PARTNERS_PATH: Name = CONTENT_NODE_NAME + "partners"
context(WebPage) private fun FlowContent.programSection() { private val programSection = PageFragment {
val programBlock = data.resolveHtmlOrNull(PROGRAM_PATH)!! val programBlock = data.resolveHtmlOrNull(PROGRAM_PATH)!!
val recommendedBlock = data.resolveHtmlOrNull(RECOMMENDED_COURSES_PATH)!! val recommendedBlock = data.resolveHtmlOrNull(RECOMMENDED_COURSES_PATH)!!
div("inner") { div("inner") {
h2 { +"Учебная программа" } h2 { +"Учебная программа" }
htmlData(programBlock) fragment(programBlock)
button(classes = "fit collapsible") { button(classes = "fit collapsible") {
attributes["data-target"] = "recommended-courses-content" attributes["data-target"] = "recommended-courses-content"
+"Рекомендованные курсы" +"Рекомендованные курсы"
} }
div(classes = "collapsible-content") { div(classes = "collapsible-content") {
id = "recommended-courses-content" id = "recommended-courses-content"
htmlData(recommendedBlock) fragment(recommendedBlock)
} }
} }
} }
context(WebPage) private fun FlowContent.partners() {
//val partnersData: Meta = resolve<Any>(PARTNERS_PATH)?.meta ?: Meta.EMPTY private val partners = PageFragment {
val partnersData: Meta = runBlocking { data.getByType<Meta>(PARTNERS_PATH)?.await() } ?: Meta.EMPTY val partnersData: Meta = runBlocking {
//TODO add meta reading step to data preparation
data.getByType<Meta>(PARTNERS_PATH)?.await()
} ?: Meta.EMPTY
div("inner") { div("inner") {
h2 { +"Партнеры" } h2 { +"Партнеры" }
div("features") { div("features") {
@ -115,8 +121,8 @@ context(WebPage) private fun FlowContent.partners() {
// val photo: String? by meta.string() // val photo: String? by meta.string()
//} //}
context(WebPage) private fun FlowContent.team() { private val team = PageFragment {
val team = data.findByContentType("magprog_team").values.sortedBy { it.order } val team = data.findHtmlByContentType("magprog_team").values.sortedBy { it.order }
div("inner") { div("inner") {
h2 { +"Команда" } h2 { +"Команда" }
@ -131,7 +137,7 @@ context(WebPage) private fun FlowContent.team() {
alt = imagePath alt = imagePath
) { ) {
h3 { +member.name } h3 { +member.name }
htmlData(member) fragment(member)
} }
} }
} }
@ -170,8 +176,8 @@ context(WebPage) private fun FlowContent.team() {
// } // }
} }
context(WebPage) private fun FlowContent.mentors() { val mentors = PageFragment {
val mentors = data.findByContentType("magprog_mentor").entries.sortedBy { it.value.id } val mentors = data.findHtmlByContentType("magprog_mentor").entries.sortedBy { it.value.id }
div("inner") { div("inner") {
h2 { h2 {
@ -200,7 +206,7 @@ context(WebPage) private fun FlowContent.mentors() {
} }
val info = data.resolveHtmlOrNull(name.replaceLast { NameToken(it.body + "[info]") }) val info = data.resolveHtmlOrNull(name.replaceLast { NameToken(it.body + "[info]") })
if (info != null) { if (info != null) {
htmlData(info) fragment(info)
} }
} }
} }
@ -208,7 +214,8 @@ context(WebPage) private fun FlowContent.mentors() {
} }
} }
context(WebPage) internal fun HTML.magProgHead(title: String) { context(PageContext)
internal fun HTML.magProgHead(title: String) {
head { head {
title { title {
+title +title
@ -258,7 +265,8 @@ context(WebPage) internal fun HTML.magProgHead(title: String) {
} }
} }
context(WebPage) internal fun BODY.magProgFooter() { context(PageContext)
internal fun BODY.magProgFooter() {
footer("wrapper style1-alt") { footer("wrapper style1-alt") {
id = "footer" id = "footer"
div("inner") { div("inner") {
@ -297,46 +305,43 @@ context(WebPage) internal fun BODY.magProgFooter() {
} }
} }
context(SnarkContext) private val HtmlData.mentorPageId get() = "mentor-${id}" context(SnarkContext) private val Data<PageFragment>.mentorPageId get() = "mentor-${id}"
internal fun SiteBuilder.spcMasters(magProgData: DataTree<Any>, prefix: Name = "education.masters".parseAsName()) {
//val magProgData: DataTree<Any> = snark.readDirectory(dataPath.resolve("content")) internal val spcMasters = HtmlSite {
site(prefix, magProgData) {
static("assets") static("assets")
static("images") static("images")
static("common", "") static("common", "")
page { page {
val sections = listOf<MagProgSection>( val sections = listOf(
wrapSection(page.data.resolveHtmlOrNull(INTRO_PATH)!!, "intro"), wrapSection(data.resolveHtmlOrNull(INTRO_PATH)!!, "intro"),
MagProgSection( MagProgSection(
id = "partners", id = "partners",
title = "Партнеры", title = "Партнеры",
style = "wrapper style3 fullscreen fade-up" style = "wrapper style3 fullscreen fade-up"
) { ) {
partners() fragment(partners)
}, },
// section(props.data.partners), // section(props.data.partners),
MagProgSection( MagProgSection(
id = "mentors", id = "mentors",
title = "Научные руководители", title = "Научные руководители",
style = "wrapper style2 spotlights", style = "wrapper style2 spotlights fade-up",
) { ) {
mentors() fragment(mentors)
}, },
MagProgSection( MagProgSection(
id = "program", id = "program",
title = "Учебная программа", title = "Учебная программа",
style = "wrapper style3 fullscreen fade-up" style = "wrapper style3 fullscreen fade-up"
) { ) {
programSection() fragment(programSection)
}, },
wrapSection(page.data.resolveHtmlOrNull(ENROLL_PATH)!!, "enroll"), wrapSection(data.resolveHtmlOrNull(ENROLL_PATH)!!, "enroll"),
wrapSection(id = "contacts", title = "Контакты") { wrapSection(id = "contacts", title = "Контакты") {
htmlData(page.data.resolveHtmlOrNull(CONTACTS_PATH)!!) fragment(data.resolveHtmlOrNull(CONTACTS_PATH)!!)
team() fragment(team)
} }
) )
@ -350,7 +355,10 @@ internal fun SiteBuilder.spcMasters(magProgData: DataTree<Any>, prefix: Name = "
li { li {
a( a(
classes = "spc-home", classes = "spc-home",
href = "/" //TODO provide a way to navigate out-of-site href = resolvePageRef(
Name.EMPTY,
site.parent!!
)
) { ) {
i("fa fa-home") { i("fa fa-home") {
attributes["aria-hidden"] = "true" attributes["aria-hidden"] = "true"
@ -383,19 +391,18 @@ internal fun SiteBuilder.spcMasters(magProgData: DataTree<Any>, prefix: Name = "
} }
val mentors = data.findByContentType("magprog_mentor").values.sortedBy { val mentors = siteData.findHtmlByContentType("magprog_mentor").values.sortedBy {
it.order it.order
} }
mentors.forEach { mentor -> mentors.forEach { mentor ->
page(mentor.mentorPageId.asName()) { page(mentor.mentorPageId.asName(), siteData) {
magProgHead("Научное программирование: ${mentor.name}") magProgHead("Научное программирование: ${mentor.name}")
body("is-preload") { body("is-preload") {
header { header {
id = "header" id = "header"
a(classes = "title") { a(classes = "title") {
href = "$homeRef#mentors" href = "${page.homeRef}#mentors"
+"Научные руководители" +"Научные руководители"
} }
nav { nav {
@ -403,7 +410,7 @@ internal fun SiteBuilder.spcMasters(magProgData: DataTree<Any>, prefix: Name = "
mentors.forEach { mentors.forEach {
li { li {
a { a {
href = resolvePageRef(it.mentorPageId) href = page.resolvePageRef(it.mentorPageId)
+it.name.substringAfterLast(" ") +it.name.substringAfterLast(" ")
} }
} }
@ -421,12 +428,12 @@ internal fun SiteBuilder.spcMasters(magProgData: DataTree<Any>, prefix: Name = "
span("image $imageClass") { span("image $imageClass") {
mentor.imagePath?.let { photoPath -> mentor.imagePath?.let { photoPath ->
img( img(
src = resolveRef(photoPath), src = page.resolveRef(photoPath),
alt = mentor.name alt = mentor.name
) )
} }
} }
htmlData(mentor) fragment(mentor)
} }
} }
} }
@ -434,5 +441,4 @@ internal fun SiteBuilder.spcMasters(magProgData: DataTree<Any>, prefix: Name = "
} }
} }
} }
}
} }

View File

@ -1,18 +1,14 @@
package center.sciprog package center.sciprog
import kotlinx.html.* import kotlinx.html.*
import space.kscience.dataforge.meta.get
import space.kscience.dataforge.meta.string import space.kscience.dataforge.meta.string
import space.kscience.snark.html.WebPage import space.kscience.snark.html.*
import space.kscience.snark.html.homeRef
import space.kscience.snark.html.languages
import space.kscience.snark.html.resolvePageRef
import java.time.LocalDate import java.time.LocalDate
internal const val SPC_TITLE = "Scientific Programming Centre" internal const val SPC_TITLE = "Scientific Programming Centre"
context(WebPage) context(PageContext)
internal fun HTML.spcHead(title: String = SPC_TITLE) { internal fun HTML.spcHead(title: String = SPC_TITLE) {
head { head {
title { title {
@ -53,8 +49,7 @@ internal fun HTML.spcHead(title: String = SPC_TITLE) {
} }
} }
context(WebPage) context(PageContext, FlowContent) internal fun spcHomeMenu() {
internal fun FlowContent.spcHomeMenu() {
nav { nav {
id = "menu" id = "menu"
ul("links") { ul("links") {
@ -106,8 +101,8 @@ internal fun FlowContent.spcHomeMenu() {
} }
} }
context(WebPage) context(PageContext, FlowContent)
internal fun FlowContent.spcFooter() { internal fun spcFooter() {
footer { footer {
id = "footer" id = "footer"
div("inner") { div("inner") {
@ -158,8 +153,8 @@ internal fun FlowContent.spcFooter() {
} }
} }
context(WebPage) context(PageContextWithData, FlowContent)
internal fun FlowContent.wrapper(contentBody: FlowContent.() -> Unit) { internal fun wrapper(contentBody: FlowContent.() -> Unit) = postprocess {
div { div {
id = "wrapper" id = "wrapper"
// Header // Header
@ -172,11 +167,16 @@ internal fun FlowContent.wrapper(contentBody: FlowContent.() -> Unit) {
} }
if (languages.isNotEmpty()) { languageMap.takeIf { it.size > 1 }?.let { languageMap ->
div { div {
languages.forEach { (key, meta) -> languageMap.entries.forEachIndexed { index, (key, meta) ->
a(classes = "button primary small") { if (index != 0) {
href = resolvePageRef(meta["target"].string ?: "#") a {
+"/"
}
}
a {
href = page.resolvePageRef(meta.string ?: "#", site.parent!!)
+key +key
} }
} }

View File

@ -1,20 +1,21 @@
package center.sciprog package center.sciprog
import space.kscience.dataforge.data.* import space.kscience.dataforge.data.DataTree
import space.kscience.dataforge.misc.DFExperimental import space.kscience.dataforge.data.branch
import space.kscience.dataforge.data.putAll
import space.kscience.dataforge.names.Name import space.kscience.dataforge.names.Name
import space.kscience.snark.html.SiteBuilder import space.kscience.snark.html.HtmlSite
import space.kscience.snark.html.site
@OptIn(DFExperimental::class) private inline fun <reified T> DataTree<T>.contentFor(branchName: String): DataTree<T> = DataTree{
private fun <T : Any> DataSet<T>.siteData(branchName: String): DataTree<T> = DataTree(dataType) { putAll(branch(Name.of(branchName, "content")) ?: DataTree.EMPTY)
populateFrom(branch(Name.of(branchName, "content"))) branch("common", branch("common") ?: DataTree.EMPTY)
node("common", branch("common")) branch("assets", branch(Name.of(branchName, "assets")) ?: DataTree.EMPTY)
node("assets", branch(Name.of(branchName, "assets"))) branch("images", branch(Name.of(branchName, "images")) ?: DataTree.EMPTY)
node("images", branch(Name.of(branchName, "images")))
} }
fun SiteBuilder.spcSite() { val spcSite = HtmlSite {
spcHome(data.siteData("home")) route(Name.EMPTY, siteData.contentFor("home"), content = spcHome)
spcMasters(data.siteData("magprog")) site("education.masters", siteData.contentFor("magprog"), content = spcMasters)
// bmk(data.branch("bmk").withBranch("common", commonData)) // bmk(data.branch("bmk").withBranch("common", commonData))
} }

View File

@ -1,18 +1,25 @@
package center.sciprog package center.sciprog
import space.kscience.dataforge.context.Global import kotlinx.coroutines.coroutineScope
import space.kscience.dataforge.context.Context
import space.kscience.dataforge.context.request import space.kscience.dataforge.context.request
import space.kscience.snark.html.SiteBuilder import space.kscience.dataforge.workspace.resources
import space.kscience.snark.html.SnarkHtmlPlugin import space.kscience.snark.html.SnarkHtml
import space.kscience.snark.html.readResources import space.kscience.snark.html.readSiteData
import space.kscience.snark.html.static import space.kscience.snark.html.static.staticSite
import java.nio.file.Path import java.nio.file.Path
fun main(args: Array<String>) { suspend fun main(args: Array<String>) = coroutineScope {
val context = Context {
plugin(SnarkHtml)
}
val destinationPath = args.firstOrNull() ?: "build/public" val destinationPath = args.firstOrNull() ?: "build/public"
val snark = Global.request(SnarkHtmlPlugin) val snark = context.request(SnarkHtml)
val siteData = snark.readResources("common", "home", "magprog") val siteData = snark.readSiteData(context) {
resources(snark.io,"common", "home", "magprog")
}
snark.static(siteData, Path.of(destinationPath), block = SiteBuilder::spcSite) snark.staticSite(siteData, Path.of(destinationPath), content = spcSite)
} }

View File

@ -1,7 +1,7 @@
package html5up.forty package html5up.forty
import kotlinx.html.* import kotlinx.html.*
import space.kscience.snark.html.WebPage import space.kscience.snark.html.PageContext
internal fun FlowContent.fortyMenu() { internal fun FlowContent.fortyMenu() {
@ -200,7 +200,8 @@ internal fun FlowContent.fortyFooter() {
} }
} }
context(WebPage) internal fun BODY.fortyScripts() { context(PageContext)
internal fun BODY.fortyScripts() {
script { script {
src = resolveRef("assets/js/jquery.min.js") src = resolveRef("assets/js/jquery.min.js")
} }

View File

@ -1,9 +1,10 @@
package html5up.forty package html5up.forty
import kotlinx.html.* import kotlinx.html.*
import space.kscience.snark.html.WebPage import space.kscience.snark.html.PageContext
context(WebPage) internal fun HTML.landing(){ context(PageContext)
internal fun HTML.landing() {
head { head {
title { title {
} }

View File

@ -1,9 +1,10 @@
package html5up.forty package html5up.forty
import kotlinx.html.* import kotlinx.html.*
import space.kscience.snark.html.WebPage import space.kscience.snark.html.PageContext
context(WebPage) internal fun HTML.fortyPage(){ context(PageContext)
internal fun HTML.fortyPage() {
head { head {
title { title {
} }