summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Projects/generic_gui.markdown125
-rw-r--r--Projects/index.html6
-rw-r--r--Projects/leakindexer.markdown15
-rw-r--r--_config.yml11
-rw-r--r--_data/projects.yml12
-rw-r--r--_includes/header.html14
-rw-r--r--_layouts/post.html2
-rw-r--r--_plugins/ProjectGenerator.rb2
-rw-r--r--_posts/2014-10-26-learning-how-to-jekyll.markdown6
-rw-r--r--_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown11
-rw-r--r--assets/generic_gui.pngbin0 -> 24460 bytes
-rw-r--r--assets/generic_gui_full.pngbin0 -> 40418 bytes
-rw-r--r--index.html3
-rwxr-xr-xpublic/css/main.css15
14 files changed, 186 insertions, 36 deletions
diff --git a/Projects/generic_gui.markdown b/Projects/generic_gui.markdown
new file mode 100644
index 0000000..40bf652
--- /dev/null
+++ b/Projects/generic_gui.markdown
@@ -0,0 +1,125 @@
+
+This project is a generalization of the generic gui implementation used in DMP.
+I use boost fusion to implement a Qt model adapter that can show data from standard c++ classes.
+You can than create a gui type, either a QTableWidget type or a custom form class.
+These classes will inspect the your custom fusion adapted data type and create all the neccesary boiler plate such as header names and function that enable to set and get the underlying data.
+This means that when you edit the gui you edit the underlying datastructures directly.
+But I can better show you all a simple main that you can write using this system.
+I hope it shows of the expressive power more than a couple paragraphs of text would.
+
+```
+#include "main_window.hpp"
+#include "fusion_model.hpp"
+#include "qt_adapter.hpp"
+#include "meta_types.hpp"
+#include "fusion_outputter.hpp"
+#include "form.hpp"
+
+#include <boost/fusion/adapted.hpp>
+
+#include <iostream>
+
+struct Data {
+ const std::string name;
+ std::string gender;
+ uint32_t number;
+ const double ratio1;
+ double ratio2;
+ bool boolean;
+};
+
+BOOST_FUSION_ADAPT_STRUCT(
+ Data,
+ (const std::string, name)
+ (std::string, gender)
+ (uint32_t, number)
+ (const double, ratio1)
+ (double,ratio2)
+ (bool, boolean)
+)
+
+struct DataModel : public FusionModel<std::vector<Data>> {
+
+ std::vector<Data> model;
+
+ DataModel()
+ : FusionModel(model)
+ {}
+
+ void add_data(Data d) {
+ call_on_observers(&FusionModelObserver::append_row_begin);
+ model.push_back(d);
+ call_on_observers(&FusionModelObserver::append_row_end);
+ }
+};
+
+struct DataMapping : public FusionModel<std::map<std::string, Data>> {
+
+ std::map<std::string, Data> model;
+
+ DataMapping()
+ : FusionModel(model)
+ {}
+
+ void add_data(std::string key, Data value)
+ {
+ call_on_observers(&FusionModelObserver::append_row_begin);
+ data.emplace(key, value);
+ call_on_observers(&FusionModelObserver::append_row_end);
+ }
+};
+
+struct CustomDataModelWidget : public WidgetType<DataModel>::type
+{
+ CustomDataModelWidget(std::shared_ptr<DataModel> model)
+ : WidgetType<DataModel>::type(model)
+ {}
+};
+
+int main()
+{
+ Data d1{"Jan", "Male", 1, 3.333, 0.333, true};
+ Data d2{"Piet", "Male",2, 1.5, 0.5, false};
+ Data d3{"Klaas", "Confused", 3, 0.1337, 0.0337, false};23
+
+ auto model = std::make_shared<DataModel>();
+
+ model->add_data(d1);
+ model->add_data(d2);
+ model->add_data(d3);
+
+ auto mapping = std::make_shared<DataMapping>();
+
+ mapping->add_data("nummer1", d1);
+ mapping->add_data("nummer2", d2);
+ mapping->add_data("nummer3", d3);
+
+ MainWindow w;
+
+ auto widget1 = make_qt_widget<CustomDataModelWidget>(model);
+ auto widget2 = make_qt_widget<Gui::Table>(model);
+ auto widget3 = make_qt_widget<Gui::Table>(mapping);
+ auto widget4 = make_qt_widget<Gui::Form>(model);
+
+ w.add_widget(widget1.get());
+ w.add_widget(widget2.get());
+ w.add_widget(widget3.get());
+ w.add_widget(widget4.get());
+
+ int ret = w.show_and_run();
+
+ std::cout << "model: " << std::endl << model->data << std::endl;
+ std::cout << "mapping: " << std::endl << mapping->data << std::endl;
+
+ return ret;
+}
+
+```
+
+when executed this will generate the following gui, which if you update will be reflected in the datastructures used.
+
+![generic gui](/assets/generic_gui_full.png)
+
+Its not very pretty, but it's a nice testcase for the generic gui system and its a nice small sample to show you what it can do.
+
+You can find the project on my github page: [generic_gui](https://github.com/Roflincopter/generic_gui)
diff --git a/Projects/index.html b/Projects/index.html
index 60a88e9..8461e82 100644
--- a/Projects/index.html
+++ b/Projects/index.html
@@ -2,10 +2,10 @@
layout: default
---
-{% for project in site.projects %}
- <div class="col-sm-4 col-xs-6">
+{% for project in site.data['projects'] %}
+ <div class="col-xl-2 col-md-3 col-sm-4 col-xs-6">
<div align="center">
- <h6 class="h6">{{project.name}}</h1>
+ <h6 class="h6 ellipsis">{{project.name}}</h6>
</div>
<a href="/Projects/{{project.name}}.html">
<img src="{{project.thumbnail}}" width=100% height=100% />
diff --git a/Projects/leakindexer.markdown b/Projects/leakindexer.markdown
index da2b2fc..090c84b 100644
--- a/Projects/leakindexer.markdown
+++ b/Projects/leakindexer.markdown
@@ -27,16 +27,13 @@ This was decided by Huub Jasper in the beginning of our project.
Although other public search engines did exists it was a matter of principle to not disclose possibly dangerous information.
Also the added capabilities to search for dates and geo-coordinates made him decide to make it publicly available.
-But looking back at this project we could have done things differently.
-All things considered we used standard search engine techniques like reversed indexes.
-We were able to do full text search, search for dates and date ranges and even tried our hand on geo-coordinates.
-The search engine tailored to the needs of these particular researchers.
-The problem though is that we had no idea how to process these relatively large datasets.
-We kept everything in memory which was barely possible.
-So the system stopped scaling after the Iraqi and Afghanistan war-logs were added.
+Looking back at this project we could have done things differently.
+Although we did use standard search engine techniques like reversed indexes and smart merging of result vectors.
+We could have implemented the search engine in a standard search engine package like Xapian.
+But as we didn't find Xapian when we started this project we implemented everything on our own and this was a good learning experience for all of us.
+We were able to do full text search, search for dates and date ranges and even tried our hand on geo-coordinates. But the most important thing; the search engine is tailored to the needs of the research journalists.
-Nowadays we should be able to solve these problems or even use and extend a standard search engine system like Xapian.
-Something we didn't find when looking for standard solution when we begun with this project.
+The downside of our 'roll your own' searchengine was it's scalability after indexing the afghan and iraqi warlogs and all the released cables we used up all of our 16GB ram. We little to no idea how to reduce the ram usage without dramatically impacting the performance. Nowadays we have some ideas how to this mostly due to experience in software constructure/architecture that we now have, for which this project was a great kickstarter.
The logo was created by Erik Boss
diff --git a/_config.yml b/_config.yml
index 40694e4..646a0bd 100644
--- a/_config.yml
+++ b/_config.yml
@@ -4,14 +4,3 @@ highlighter: pygments
paginate: 5
paginate_path: "Blog/page:num"
-
-projects:
- - name: Wikileaks leak indexer
- file: leakindexer.markdown
- thumbnail: /assets/leak.png
- - name: DMP
- file: dmp.markdown
- thumbnail: /assets/dmp.png
- - name: HS Soundboard
- file: hssb.markdown
- thumbnail: /assets/hssb.png
diff --git a/_data/projects.yml b/_data/projects.yml
new file mode 100644
index 0000000..57a0df4
--- /dev/null
+++ b/_data/projects.yml
@@ -0,0 +1,12 @@
+- name: Wikileaks leak indexer
+ file: leakindexer.markdown
+ thumbnail: /assets/leak.png
+- name: DMP
+ file: dmp.markdown
+ thumbnail: /assets/dmp.png
+- name: HS Soundboard
+ file: hssb.markdown
+ thumbnail: /assets/hssb.png
+- name: Generic Qt gui
+ file: generic_gui.markdown
+ thumbnail: /assets/generic_gui.png
diff --git a/_includes/header.html b/_includes/header.html
index 2c0e631..caa495f 100644
--- a/_includes/header.html
+++ b/_includes/header.html
@@ -1,6 +1,6 @@
-<div class="header col-sm-12 vspace1em">
+<div id=header class="header col-sm-12 vspace1em">
<!-- For small and up displays -->
- <div class="col-sm-12 hidden-xs">
+ <div class="hidden-xs">
<h4 class="title h4"><a href="/">{{ site.name }}</a></h1>
<a class="extra" href="/Blog/">Blog</a>
<a class="extra" href="/Projects/">Projects</a>
@@ -8,17 +8,17 @@
</div>
<!-- For xs displays -->
- <div class="hidden-sm hidden-md hidden-lg">
- <div class="col-xs-12">
+ <div id=header class="vspace1em hidden-sm hidden-md hidden-lg">
+ <div>
<h4 class="title h4"><a href="/">{{ site.name }}</a></h1>
</div>
- <div class="col-xs-12">
+ <div>
<a class="extra" href="/Blog/">Blog</a>
</div>
- <div class="col-xs-12">
+ <div >
<a class="extra" href="/Projects/">Projects</a>
</div>
- <div class="vspace1em col-xs-12">
+ <div >
<a class="extra" href="/CV/">CV</a>
</div>
</div>
diff --git a/_layouts/post.html b/_layouts/post.html
index 50191fa..8e307dc 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -1,7 +1,7 @@
---
layout: default
---
-<h2>{{ page.title }}</h2>
+<h3 class="h3">{{ page.title }}</h2>
<p class="meta">{{ page.date | date_to_string }}</p>
<div class="post">
diff --git a/_plugins/ProjectGenerator.rb b/_plugins/ProjectGenerator.rb
index 2e57f8e..4505eb6 100644
--- a/_plugins/ProjectGenerator.rb
+++ b/_plugins/ProjectGenerator.rb
@@ -20,7 +20,7 @@ module Jekyll
def generate(site)
dir = site.config['projects_dir'] || 'Projects'
- site.config['projects'].each do |project|
+ site.data['projects'].each do |project|
site.pages << ProjectPage.new(site, site.source, dir, project)
end
end
diff --git a/_posts/2014-10-26-learning-how-to-jekyll.markdown b/_posts/2014-10-26-learning-how-to-jekyll.markdown
index a76cb0e..377774c 100644
--- a/_posts/2014-10-26-learning-how-to-jekyll.markdown
+++ b/_posts/2014-10-26-learning-how-to-jekyll.markdown
@@ -1,6 +1,6 @@
---
layout: post
-title: "Learning how to Jekyll: the projects page."
+title: "Learning how to Jekyll: the projects page"
date: "2014-10-26"
---
@@ -8,7 +8,7 @@ So I wanted to create a better projects page. One that generates itself and gene
I first was a bit put off by the prospect of diving into ruby. But I really wanted a way to generate new project pages based on content and not handcraft each page. I also wanted to use markdown for this because It would then be similar to the posts.
-So first I define a list of associative arrays in my main config that define my projects. These associative arrays contain a name, a markdown file and a thumbnail to be used on the main projects page. This is all information I need to add in the config.
+So first I define a list of associative arrays in my main config that define my projects. These associative arrays contain a name, a markdown file and a thumbnail to be used on the main projects page. This is all information that I need to add in the config.
But then I need to generate the project page itself. This is where the Jekyll plug-in system comes into play. This is my project page generator.
@@ -80,4 +80,4 @@ end
Liquid::Template.register_tag('include_project', Jekyll::InputProjectTag)
```
-The only downside of this is that with jekyll --watch new projects will not appear on the webpage, It seems the global config file is not watched, or maybe its something entirely different. I will look into this later down the line but for now I just wanted to share these modules.
+The only downside of this is that with Jekyll --watch new projects will not appear on the web page, It seems the global config file is not watched, or maybe its something entirely different. I will look into this later down the line but for now I just wanted to share these modules.
diff --git a/_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown b/_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown
new file mode 100644
index 0000000..121b569
--- /dev/null
+++ b/_posts/2014-10-27-learned-how-to-jekyll-the-projects-page.markdown
@@ -0,0 +1,11 @@
+---
+layout: post
+title: "Learned how to jekyll: the projects page"
+date: "2014-10-27"
+---
+
+After a quick question in the Jekyll IRC chat room i was told to use the _data folder instead of using the main site config. The main site config is only read on startup while the data you store under the \_data folder is watched.
+
+You can create a `filename.yml` file in the \_data folder and it will then be accessible in liquid and any ruby plugins you might have as `site.data['filename']`
+
+Now my projects page is fully automated to complement my automatic deployment system.
diff --git a/assets/generic_gui.png b/assets/generic_gui.png
new file mode 100644
index 0000000..45c5797
--- /dev/null
+++ b/assets/generic_gui.png
Binary files differ
diff --git a/assets/generic_gui_full.png b/assets/generic_gui_full.png
new file mode 100644
index 0000000..2e2eac8
--- /dev/null
+++ b/assets/generic_gui_full.png
Binary files differ
diff --git a/index.html b/index.html
index afd12ea..c0c4839 100644
--- a/index.html
+++ b/index.html
@@ -4,4 +4,7 @@ layout: default
<div id="home">
Welcome to the site of Dennis Brentjes.
+Here I will be posting blog posts about my current and past projects aswell as some personal things I am willing to share.
+Feel free to contact me about anything concerning this site or any of my projects.
+
</div>
diff --git a/public/css/main.css b/public/css/main.css
index fb78744..7985af8 100755
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -45,6 +45,15 @@ a:visited {
color: #a0a;
}
+.ellipsis {
+ text-overflow: ellipsis;
+
+ /* Required for text-overflow to do anything */
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+
/*****************************************************************************/
/*
/* Home
@@ -96,8 +105,12 @@ a:visited {
color: #000;
}
+.header {
+ border-bottom: 4px solid #eee;
+}
+
.header a.extra {
- color: #aaa;
+ color: #999;
margin-left: 1em;
}