Separate updating logic from calculations
Author: Kasper B. Graversen
[Introduction] [All categories] [All articles] [Edit article ]
Code Readability
Coding Guideline
Refactoring
Functional core Imperative shell
The readability of code dramatically improves, when the logic for updating state is separated from the calculations that provide the state changes. We show how both the updating and the calculation code is simplified when. While the principles of separation are generally applicable, we focus on methods updating state.
Please show your support by sharing and voting:
Table of Content
- 1. Introduction
- 2. A typical updating method
- 3. The updating method after refactoring
- 4. The extracted calculations
- 5. Perspective
- 6. Summary
1. Introduction
Generally, methods with many responsibilities benefit from being split up in smaller parts. For this article, though, we focus on methods that update state. Update state? Yes. In methods that update state, I often see a mixture of simple assignments and computation whose results are used in assignments. It is very easy to persuade oneself, that a bit of computation does not hurt. In programming books, classes and flow is always made to look easy. Small examples that caters for easy overview. In the real world, we operate with classes containing many fields. 20 or 30 are not uncommon. And when updating fields in that number, we surpass the 5-9 number of things that our minds are capable of holding focus on concurrently. Needles to say, we are loading work onto the brain and we easily loose overview.
2. A typical updating method
Let's have a look at an example from real life. Although the code is in English, it seems more like Chinese if you don't have business knowledge! Don't get bogged down on the details of the code, just glance over it. A concrete understanding matters not for our discussion. The main take-away of the code is that state is updated based on some values.
The code in all its glory.
public void Replace(Product productData, ProductReplacementInfo replacement)
{
var target = replacement.Product;
var replacer = replacement.ReplacedByProduct;
target.ReplacedCoverage = target.Coverage;
target.ReplacedIsAdditionalPremium = target.IsAdditionalPremium;
target.ReplacedBenefitCalculationMethod = target.BenefitCalculationMethod;
target.ReplacedExternalPolicyNumber = null;
decimal benefitFixed = replacer.Benefit.FixedAmount.IsDefined
? replacer.Benefit.FixedAmount.Value
: 0;
decimal benefitPct = replacer.Benefit.PercentOfSalary.IsDefined
? replacer.Benefit.PercentOfSalary.Value
: 0;
if (target.ReplacedBenefitCalculationMethod == replacer.Benefit.CalculationMethod)
{
target.TargetBenefitFixedAmount = benefitFixed;
target.TargetBenefitPercentOfSalary = benefitPct;
}
else
{
// from fixed to %
if (target.ReplacedBenefitCalculationMethod == BenefitCalculationMethod.FixedAmount
&& target.BenefitCalculationMethod == BenefitCalculationMethod.PercentageOfSalary)
{
target.TargetBenefitFixedAmount = 0;
target.TargetBenefitPercentOfSalary =
(int)(100 * target.TargetBenefitFixedAmount / productData.BeneficialSalary);
}
else
{
// from % to fixed
if (target.ReplacedBenefitCalculationMethod == BenefitCalculationMethod.PercentageOfSalary
&& target.BenefitCalculationMethod == BenefitCalculationMethod.FixedAmount)
{
target.TargetBenefitFixedAmount = (int)(productData.BeneficialSalary * (benefitPct / 100));
target.TargetBenefitPercentOfSalary = 0;
}
else
{
throw new Exception($"Cannot convert {target.BenefitCalculationMethod} -> {target.ReplacedBenefitCalculationMethod}"));
}
}
}
reasonRepository.AddChangeReason(RiskCoverageChangeReason.PensionSchemeChange);
target.Coverage = replacer.Info.CoverageId;
target.IsAdditionalPremium = replacer.Info.IsAdditionalPremium;
replacement.Product.ExtraInfo.PresenceInPensionScheme = CoveragePresenceInPensionScheme.Replaced;
}
Here are the problems I have with the code
- Assignment of state is a mix of values and complex calculations.
- It is not clear that all fields are set, e.g.
TargetBenefitFixedAmount
andTargetBenefitPercentOfSalary
- The many if-else branching inhibits readability to the extend that comments were used as a separator.
- Some values must be rounded to whole numbers (they are stored in
int
's). This rounding logic is intermixed with the assignments. - The helper variables
benefitFixed
andbenefitPct
are unnecessarily visible.
3. The updating method after refactoring
Let's have a look at the code after having extracted away the calculation bits into a separate method.
Notice the overview of the code that was achieved. We can easily follow which fields are updated, and all the clutter with regards to rounding etc. is hidden away.
public void Replace(Product productData, ProductReplacementInfo replacement)
{
var target = replacement.Product;
var replacer = replacement.ReplacedByProduct;
target.ReplacedCoverage = target.Coverage;
target.ReplacedIsAdditionalPremium = target.IsAdditionalPremium;
target.ReplacedBenefitCalculationMethod = target.BenefitCalculationMethod;
target.ReplacedExternalPolicyNumber = null;
var benefits = CalculateBenefits(target, productData, replacer.Benefit.Value);
target.TargetBenefitFixedAmount = benefits.FixedAmount;
target.TargetBenefitPercentOfSalary = benefits.PercentOfSalary;
reasonRepository.AddChangeReason(RiskCoverageChangeReasonEnum.PensionSchemeChange);
target.Coverage = replacer.Info.CoverageId;
target.IsAdditionalPremium = replacer.Info.IsAdditionalPremium;
replacement.Product.ExtraInfo.PresenceInPensionScheme = CoveragePresenceInPensionScheme.Replaced;
}
The "magic" lies in the introduction of the CalculateBenefits()
, which is a simple "extract method" refactoring. I'm not sure I'd leave the helper method inside the Replace()
for long. In a future iteration of the code, I'd move it out and add a benefits
parameter instead. That way Replace()
has one less responsibility.
4. The extracted calculations
Now that was a very happy story. But how about the extracted bits?  That is a good question. Let's have a look.
4.1 The Benefits class
Our CalculateBenefits()
returns two results, which we wrap in a class of its own. We could have used a tuple instead, but I feel it quickly gets confusing due to the anonymous field names. A third approach is to use out
parameters, but they often have a clumsy feel to them, especially if when the number of out
parameters exceeds 2 or 3.
class Benefits
{
public readonly decimal FixedAmount, PercentOfSalary;
public Benefits(decimal fixedAmount, decimal percentOfSalary)
{
FixedAmount = fixedAmount;
PercentOfSalary = percentOfSalary;
}
}
It can be tempting to place the rounding logic inside this class. For now it is a simple cast to int
, but in the future it could get more involved. Personally, though, I think I prefer placing the rounding logic with the calculation logic. This way the data class acts as a simple vessel for values. It also does not require any testing.
I've also made the class immutable. Perhaps its a bit overkill compared to the use cases of the class, but it was easy to do.
4.2 The extracted CalculateBenefits
Here is the extracted code for the calculation.
public Benefits CalculateBenefits(
RiskCoverageInfo origin,
Product productData
IRiskCoverageBenefitAggregator replacer)
{
decimal benefitFixed = replacer.FixedAmount.IsDefined
? replacer.FixedAmount.Value
: 0;
decimal benefitPct = replacer.PercentOfSalary.IsDefined
? replacer.PercentOfSalary.Value
: 0;
if (origin.BenefitCalculationMethod == replacer.CalculationMethod)
return new Benefits((int) benefitFixed, (int) benefitPct);
if (origin.BenefitCalculationMethod == BenefitCalculationMethod.FixedAmount
&& replacer.CalculationMethod == BenefitCalculationMethod.PercentageOfSalary)
{
return new Benefits(0, (int) 100 * origin.TargetBenefitFixedAmount/productData.BeneficialSalary);
}
if (origin.BenefitCalculationMethod == BenefitCalculationMethod.PercentageOfSalary
&& replacer.CalculationMethod == BenefitCalculationMethod.FixedAmount)
{
return new Benefits((int) productData.BeneficialSalary * (benefitPct / 100), 0);
}
throw new Exception($"Cannot convert {target.BenefitCalculationMethod} -> {target.ReplacedBenefitCalculationMethod}"));
}
It is worth noticing how much cleaner this code also has become.
- Although the code still fairly long-winded, we now know all it does it return two simple values.
- Nesting is reduced by using
return
statements. - A large lump of code has been assigned a name and is nicely tugged away.
- The variables
benefitFixed
andbenefitPct
are no longer available withinReplace()
.
5. Perspective
We have shown the power of extracting methods. It is much more than a simple textural reshuffling of the code. We ended up with two pieces of code both of which were significantly simpler. We could end the story here, but I think there is more to the story.
I think the great difference in readability was achieved by what we extracted. We did not simply cut the method in half. We extracted the updating logic from the calculation logic. It is this kind of separation that packs a punch. As we suggested above, the updating method should not invoke the calculation method, rather the updating method should take the values object as an argument. In turn, what we are implementing is a pattern known as "functional core, imperative shell".
Finally, I've made the CalculateBenefits
method public
. Hopefully this is a bit thought-provoking. Ordinarily one should think such a method is private to the replace implementation. But it really doesn't hurt that it is more visible so long the method does not change any state (it's simply returning new values). Anyone is free to call the method without breaking anything. We could stress this further by making it static
if we wanted to. By making it more public we are making it easy to test the calculating (i.e. the difficult) bits of the updating separately. It is a light-weight alternative to wrapping the CalculateBenefits-method in a class which implement an interface ICalculateBenefits
, and injecting that interface into the Replace()
method.
6. Summary
- We have shown that the refactoring using "Extract method" may have a huge impact on readability.
- We have given the perspective that helper methods may be public if it is beneficial and when they do not change state.
For more related articles, see Code Readability Coding Guideline Refactoring Functional core Imperative shell
Please show your support by sharing and voting:
Congratulations! You've come all the way to the bottom of the article! Please help me make this site better for everyone by commenting below. Or how about making editorial changes? Feel free to fix spelling mistakes, weird sentences, or correct what is plain wrong. All the material is on GitHub so don't be shy. Just go to Github, press the edit button and fire away.
Read the Introduction or browse the rest of the site


Human Models for Analysis of Pathways (H-MAPs) Center
EPA Grant Number: R835737Center: Human Models for Analysis of Pathways (H–MAPs) Center
Center Director: Murphy, William L
Title: Human Models for Analysis of Pathways (H-MAPs) Center
Investigators: Murphy, William L , Ashton, Randolph , Beebe, David , McIntosh, Brian , Roy, Sushmita , Sheibani, Nader , Thomson, James , Vickerman-Kelley, Vernella
Current Investigators: Murphy, William L , Ashton, Randolph , Beebe, David , Roy, Sushmita , Sheibani, Nader , Thomson, James
Institution: University of Wisconsin - Madison
EPA Project Officer: Klieforth, Barbara I
Project Period: December 1, 2014 through November 30, 2018
Project Amount: $5,999,600
RFA: Organotypic Culture Models for Predictive Toxicology Center (2013) RFA Text | Recipients Lists
Research Category: Human Health , Health , Safer Chemicals
Objective:
The need for human, organotypic culture models coupled with the requirements of contemporary toxin screening (i.e. reproducibility, high throughput, transferability of data, clear mechanisms of action, defined adverse outcomes) frame an opportunity for a paradigm shift. We propose to establish the Human Models for Analysis of Pathways (H-MAPs) Center to advance the next generation of toxicity testing formats, and to develop a broadly applicable set of tools for toxin screening.
The H-MAPs Center Objectives are to:
- Generate pluripotent stem cell-derived cells that properly represent the diverse phenotypic characteristics of developing or mature human somatic cells;
- Generate organotypic cell culture models that are robust and reproducible;
- Translate organotypic cell culture models to microscale systems for HTS;
- Combine genomic/epigenomic analyses with bioinformatics to gain molecular level insights into organotypic model assembly and the pathways influenced by toxins.
The H-MAPs Center will bring together leading experts in human pluripotent stem cell biology, human development, and microscale tissue engineering to develop organotypic human models. The Center will also form organotypic human models in robust, innovative high throughput screening systems and identify mechanisms of action associated with toxicity using bioinformatics-based pathway analysis.
Journal Articles: 10 Displayed | Download in RIS Format
| Other center views: | All 11 publications | 10 publications in selected types | All 10 journal articles |
|---|
| Type | Citation | ||
|---|---|---|---|
|
|
Belair DG, Miller MJ, Wang S, Darjatmoko SR, Binder BY, Sheibani N, Murphy WL. Differential regulation of angiogenesis using degradable VEGF-binding microspheres. Biomaterials 2016;93:27-37. |
R835737C004 (2015) |
Exit |
|
|
Belair DG, Le NN, Murphy WL. Regulating VEGF signaling in platelet concentrates via specific VEGF sequestering. Biomaterials Science 2016;4(5):819-825. |
R835737C004 (2015) |
Exit |
|
|
Knight GT, Sha J, Ashton RS. Micropatterned, clickable culture substrates enable in situ spatiotemporal control of human PSC-derived neural tissue morphology. Chemical Communications 2015;51(25):5238-5241. |
R835737 (2015) R835737C002 (2015) |
Exit Exit Exit |
|
|
Lippmann E, Estevez-Silva M, Ashton R. Chemically defined differentiation of human pluripotent stem cells to hindbrain and spinal cord neural stem cells with defined regional identities. Protocol Exchange 2015;doi:10.1038/protex.2015.076. |
R835737 (2015) |
Exit |
|
|
Zanotelli MR, Ardalani H, Zhang J, Hou Z, Nguyen EH, Swanson S, Nguyen BK, Bolin J, Elwell A, Bischel LL, Xie AW, Stewart R, Beebe DJ, Thomson JA, Schwartz MP, Murphy WL. Stable engineered vascular networks from human induced pluripotent stem cell-derived endothelial cells cultured in synthetic hydrogels. Acta Biomaterialia 2016;35:32-41. |
R835737C004 (2015) |
Exit |
|
|
Belair DG, Schwartz MP, Knudsen T, Murphy WL. Human iPSC-derived endothelial cell sprouting assay in synthetic hydogel arrays. Acta Biomaterialia 2016;39:12-24. |
R835737C004 (2015) |
Exit |
|
|
Zanotelli, H., Ardalani, J., Zhang, Z. Hou, E.H. Nguyen, S. Swanson, B.K. Nguyen, J. Bolin, Elwell, A., L. Bischel, A.W. Xie, Stewart, R., Beebe, D.J., Thomson, J.A., Schwartz, M.R. W.L. Murphy. Stable engineered vascular networks from human induced pluripotent stem cell-derived endothelial cells cultured in synthetic hydrogels. Acta Biomaterialia 35 (2016) 32–41. |
R835737 (2015) |
not available |
|
|
D. Chasman, K.B. Walters, T.J.S. Lopes, D. Pozorski, A.J. Eisfeld, Y. Kawaoka, S. Roy. Integrating transcriptomic and proteomic data with predictive regulatory network models of host response to pathogens. PLOS Computational Biology, DOI:10.1371/journal.pcbi.1005013 July 12, 2016. |
R835737 (2015) |
not available |
|
|
3. D.G. Belair, N.N. Le, W.L. Murphy. Regulating VEGF signaling in platelet concentrates via specific VEGF sequestering. Biomaterials Science, 2016, 4, 819. |
R835737 (2015) |
not available |
|
|
D.G. Belair, M.J. Miller, S. Wang, N. Sheibani, W.L. Murphy. Differential regulation of angiogenesis using degradable VEGF-binding microspheres. Biomaterials 93 (2016) 27e37. |
R835737 (2015) |
not available |
Supplemental Keywords:
Biomaterials; Microfluidics; Self-Assembly; Genomics; High Throughput Screening; High Content Microscopy; Bioinformatics; Machine LearningProgress and Final Reports:
2015 Progress Report Subprojects under this Center: (EPA does not fund or establish subprojects; EPA awards and manages the overall grant for this center).
R835737C001 Liver MAPs
R835737C002 Brain MAPs
R835737C003 Cancer MAPs: A 3D Organotypic Microfluidic Culture System to Identify Chemicals that Impact Progression and Development of Breast Cancer
R835737C004 Vascular MAPs: Vascular and Neurovascular Tissue Models
R835737C005 Pathway Analysis Core


Addon Doc allows you to create documentation like this page
You can install it for your demo project:
npm install @taiga-ui/addon-doc
And use with project README.md instructions.
You can also see a community made guide in Russian.


view data extracted from microdata markup
{% if 'sort_by' in request.args %}
{% endif %}
{% for movie_id, movie in movielist %}
{{ movie.title }}
rating: {{movie.rating }} licence: {{ movie.licence }}
{% endfor %}
title
rating
licence
duration
Showtime(s)
Description


|
GPGPU-Sim
|
#include <gpu-cache.h>
Public Member Functions | |
| cache_stats () | |
| void | clear () |
| void | inc_stats (int access_type, int access_outcome) |
| enum cache_request_status | select_stats_status (enum cache_request_status probe, enum cache_request_status access) const |
| unsigned & | operator() (int access_type, int access_outcome) |
| unsigned | operator() (int access_type, int access_outcome) const |
| cache_stats | operator+ (const cache_stats &cs) |
| cache_stats & | operator+= (const cache_stats &cs) |
| void | print_stats (FILE *fout, const char *cache_name="Cache_stats") const |
| unsigned | get_stats (enum mem_access_type *access_type, unsigned num_access_type, enum cache_request_status *access_status, unsigned num_access_status) const |
| void | get_sub_stats (struct cache_sub_stats &css) const |
| void | sample_cache_port_utility (bool data_port_busy, bool fill_port_busy) |
Private Member Functions | |
| bool | check_valid (int type, int status) const |
Private Attributes | |
| std::vector< std::vector< unsigned > > | m_stats |
| unsigned long long | m_cache_port_available_cycles |
| unsigned long long | m_cache_data_port_busy_cycles |
| unsigned long long | m_cache_fill_port_busy_cycles |
Cache_stats Used to record statistics for each cache. Maintains a record of every 'mem_access_type' and its resulting 'cache_request_status' : [mem_access_type][cache_request_status]
Definition at line 508 of file gpu-cache.h.
| cache_stats::cache_stats | ( | ) |
Definition at line 418 of file gpu-cache.cc.
Verify a valid access_type/access_status
Definition at line 594 of file gpu-cache.cc.
| void cache_stats::clear | ( | ) |
Zero out all current cache statistics
Definition at line 428 of file gpu-cache.cc.
| unsigned cache_stats::get_stats | ( | enum mem_access_type * | access_type, |
| unsigned | num_access_type, | ||
| enum cache_request_status * | access_status, | ||
| unsigned | num_access_status | ||
| ) | const |
Returns a sum of the stats corresponding to each "access_type" and "access_status" pair. "access_type" is an array of "num_access_type" mem_access_types. "access_status" is an array of "num_access_status" cache_request_statuses.
Definition at line 548 of file gpu-cache.cc.
| void cache_stats::get_sub_stats | ( | struct cache_sub_stats & | css | ) | const |
Overwrites "css" with the appropriate statistics from this cache.
Definition at line 564 of file gpu-cache.cc.
Increment the stat corresponding to (access_type, access_outcome) by 1.
Definition at line 440 of file gpu-cache.cc.
Simple method to read/modify the stat corresponding to (access_type, access_outcome) Used overloaded () to avoid the need for separate read/write member functions
Definition at line 461 of file gpu-cache.cc.
Const accessor into m_stats.
Definition at line 472 of file gpu-cache.cc.
| cache_stats cache_stats::operator+ | ( | const cache_stats & | cs | ) |
Overloaded + operator to allow for simple stat accumulation
Definition at line 482 of file gpu-cache.cc.
| cache_stats & cache_stats::operator+= | ( | const cache_stats & | cs | ) |
Overloaded += operator to allow for simple stat accumulation
Definition at line 498 of file gpu-cache.cc.
| void cache_stats::print_stats | ( | FILE * | fout, |
| const char * | cache_name = "Cache_stats" |
||
| ) | const |
Print out each non-zero cache statistic for every memory access type and status "cache_name" defaults to "Cache_stats" when no argument is provided, otherwise the provided name is used. The printed format is "<cache_name>[<request_type>][<request_status>] = <stat_value>"
Definition at line 513 of file gpu-cache.cc.
| void cache_stats::sample_cache_port_utility | ( | bool | data_port_busy, |
| bool | fill_port_busy | ||
| ) |
Definition at line 604 of file gpu-cache.cc.
| enum cache_request_status cache_stats::select_stats_status | ( | enum cache_request_status | probe, |
| enum cache_request_status | access | ||
| ) | const |
This function selects how the cache access outcome should be counted. HIT_RESERVED is considered as a MISS in the cores, however, it should be counted as a HIT_RESERVED in the caches.
Definition at line 450 of file gpu-cache.cc.
|
private |
Definition at line 530 of file gpu-cache.h.
|
private |
Definition at line 531 of file gpu-cache.h.
|
private |
Definition at line 529 of file gpu-cache.h.
|
private |
Definition at line 527 of file gpu-cache.h.


Ever since I was young I wanted to work with computers. After watching films like War Games and Flight of the Navigator have had the passion to work in Information Technology. But the love of coding didn't come until I got a Commodore 64 which I would learn to write code for fun and enjoyed.
More About Me


We make "using API" much simpler than ever.
Through simply dragging and dropping, you can create your own application within 30 seconds.
Use your imagination and make the world a better place.


Getting Started with Jekyll Academic
Required Software
In order to edit your Jekyll Academic website you will need the following pieces of software:
1) A text editor. Any text editor will do, our favorite is Atom
2) GitHub Desktop. This is used to sync files between your local computer and the GitHub repository that is acting as your website host.
Quickstart Guide
This quickstart guide is geared to getting you up and running quickly. Following the directions below will result in you having a Jekyll Academic website hosted on GitHub pages live on the web. Before you begin working through the quickstart guide you may want to familiarize yourself with the following technologies that will be used to create your Jekyll Academic website:
1) Register for a GitHub Account
Skip this step if you have already setup your GitHub account
- In a web browser, navigate to GitHub.com
- Fill Out Username, Email Address and Password
- Click Sign up for GitHub button
- Click the Finish Sign Up button
- Navigate to the email account you used to sign up
- Verify your email address by clicking on the “Verify email address” button in the email you received from GitHub
2) Setting Up your Jekyll Academic Repository:
- After signing in to GitHub click on New Repository
- Give your repository the following name [username].github.io (username is the username of your account)
- Click on Create Repository
- Click on Import Code
- Paste the following URL in the “Your old repository’s clone URL - https://github.com/NCSU-Libraries/jekyll-academic
- Click on Begin Import
- Once import is complete navigate to [username.github.io] in your web browser
3) Connect your GitHub Repository to GitHub Desktop
- Download GitHub Desktop from https://desktop.github.com/ (skip this step if you already have GitHub Desktop installed)
- Double-click on downloaded file to begin the installation
- While on the Welcome screen click on Continue
- Sign in using the username you created in step one of this activity
- Click Sign In
- Click Continue
- Click Continue one more time
- Click on the plus sign in the upper left-hand corner of the screen to add a repository to Github Desktop
- Click Clone
- Find the ‘[username].github.io’ repository you created earlier and click Clone Repository
- Select the location where you would like to save the repository (e.g. Documents)
- Once the clone is finished you can click on the name of the repository on the left-hand side of Github Desktop to see any uncommitted changes (there shouldn’t be any yet)
4) Update Website _config.yml File and Sync Changes
- See your live Website by opening your web browser and going to [username].github.io
- Open _config.yml using Atom
- Edit the following entries of the _config.yml file
- Title
- Name
- Bio
- GitHub
- Save the _config.yml file
- Commit Changes to GitHub Repo
- Open GitHub Desktop
- Click to see Uncommitted Changes (at the top center portion of the screen)
- Add commit message to the summary field that says what changes you made
- Click Commit to Master
- Click Sync
- Refresh the browser window with your website and note the changes
Important Files and Folders
In order to better understand how everything in your site works, there are a few files and folders that you need to be aware of. These files control the main elements of your site, including your logo, bio photo and navigation. Full documentation of the directory structure can be found here.
-
_config.yml - This is your websites main configuration file. It allows you to set a site title, links to your social media accounts as well as a logo and bio photo image.
-
accent.scss - This file is used to set the colors of your site. The site is set up to accept two colors (highlight, lowlight). The main impact of the color choice
-
_posts - This folder holds all of the posts for your website. It includes both blog posts as well as presentation posts. There are two sample posts in this directory to get your started. One for a blog post and one for a presentation post.
-
images/bio-photo.jpg - This is the photo that appears on the home page of the website. The recommended image size is 200px x 200px.
-
images/logo.png - If you wish to use a logo for your site, include logo.png in the images folder. You will also need to add logo.png under the 'Logo:' section of the _config.yml file.
-
_data/navigation.yml -This is the file that allows you to manage your navigation elements. By default all available navigation items are shown. If you wish to hide any items, simply delete them from this file.
Adding Blog posts
To add a new blog post to your site you simply create a new Markdown file. Jekyll requires that you follow the yyyy-mm-dd-title.md naming convention. Once you have the blank Markdown file you will need to add the header information so that Jekyll knows it is a blog file. Add the following to the top of your Markdown file: --- layout: post title: Add Your Title Here excerpt: "Add an excerpt here, the excerpt will appear underneath the blog title" modified: 2016-01-13 20:41:38 tags: [intro, beginner, jekyll, tutorial] comments: true category: blog --- # Start your content here The important thing to note is that you need to make sure that the category is set to 'blog'. This ensures that this post will appear on the blog page. You can then add your blog content using Markdown as your markup language for the rest of the file.
Adding Presentations
In Jekyll Academic presentations are actually set up as posts, just with a few different settings in the header. This means that your presentation files live in the same _posts folder as your blog posts. The only differences between presentations and posts is the layout and category section in the header.
Adding Reveal.js Presentations
To add a Reveal.js presentation to your site you first will need to create a new Markdown file in your _posts folder. At the top of your new file you will want to add the following header. Notice that you need to set the layout to 'slide' and the category to 'presentation'
---
layout: slide
title: Add Your Title Here
excerpt: "Add an excerpt here, the excerpt will appear underneath the blog title"
modified: 2016-01-13 20:41:38
tags: [intro, beginner, jekyll, tutorial]
comments: true
category: presentation
---
<section data-markdown>
# Add reveal.js slide content here, following the reveal.js format
</section>
Linking to External Presentations
To add a presentation post that appears on the presentation page, but is not a reveal.js slide deck you follow similar instructions as above. You will create a new Markdown file in your _posts folder and add the following header to it. Notice that you keep 'post' as the layout and 'presentation' as the category. This will create a blog post style post where you can link to external presentations.
---
layout: post
title: Add Your Title Here
excerpt: "Add an excerpt here, the excerpt will appear underneath the blog title"
modified: 2016-01-13 20:41:38
tags: [intro, beginner, jekyll, tutorial]
comments: true
category: presentation
---


Code Share: Share your codes!
Home
{% if uid %}
View only code: {{ uid }}
URL:
{% endif %}
{{ code }}
HTML
PHP
JAVASCRIPT
PYTHON
C
JAVA
Save
Save & View


Dani is an anthropologist whose ethnographies of orks, witches, elves, and chimera are the go-to sources for all things magical. She specializes in Elvish translation and chimera-unicorn relations. Her work has spawned a number of copycat works, including: To Live & Die in the Forbidden Forest, Unicorn Envy, and, of course, The Ork Trial of 1572: Ork Lord's Revenge.
Elise is a writing and rhetoric scholar whose work illuminates the feminist underpinnings of lore around magic women. She is mainly interested in the ways in which female figures have made the lives of men more difficult, because they deserve it. Her scholarship has been published in The Harpy Review, Ides Aglæwif, and the prestigious Womanfilth and Bitchery.
Titi is a bar chart witch who barely survived Halloween and seriously has no idea how to make this bar chart work.


The snake is controlled by the arrow keys
You can pause the game pressing the "P" key
The snake moves at a constant speed
The snake moves only north, south, east, or west
The snake starts at the center of the board, moving north
"Apples" appear at random locations
There is always exactly one apple visible
When the snake eats an apple, it gets (1 square) longer
The snake dies if it runs to the edge of the board
The snake also dies if it runs into its own tail
If the snake dies the game is ended
For each apple eated you win 10 points
If the snake fills the entire window you win!


All systems are copyright. You can contact me for help on fabrication.
I am providing a small writeup for easy understanding below:
Making of a Virtual Smart Fence
(By Chetan Dewan)
It is imperative to augment any physical barrier with smart electronics such that advanced warning of attempts to infiltrate are available in all kinds of environments. I have developed a system which is a Virtual Smart Fence. This fence uses both wired and wireless sensors suitably integrated through a Universal Customised Control unit which is fully configurable as per requirements both in hardware and software. The system can be put in Layers. All sensors and sensing systems are battery powered, Mains/Genr charged and integrate solar charger as an option. They give both Audio and Visual alarm on detection and also remotely. These systems can operate 24x7, are all weather (IP55, 66, 67, 68 compliant based on type of enclosure selected), have CE, ROHS ratings and are about 500% cheaper than similar commercial systems.
There are basically
three genre of system. All system can use any of the sensors
provided on this website integrated to a Customised Universal
Control Unit. The Architecture is based on a Guard Room which
receives all sensors and then wirelessly Re-transmit status and
video to the Incident
Command Post unit that can then receive
multiple Guard Rooms Wirelessly for say a very large setup.
Some of the sensors which have been very successful are:-
(aa) Infrared Beam Barriers which can cover up to 250m per pair
and can be put in tandem. These are both wired and wireless.
(ab) Proximity sensors based on Magnetic anomaly detection
(ac) Short range radars
(ad) PIR and Magnetic
Anomaly detector combination sensor to mitigate false alarm.
(ae) Wireless PIR sensor nodes with repeaters
(af) Multi
point detection trip wires
(ag) Fence Tilt and Cut Alarm
(ah) Fence Vibration sensor
(aj) Proximity sensing Anti Climb
Sensor
(ak) Touch sensor as anti-tamper device
(al)
Electro Fence with Alarm and Cameras
(al) Pressure sensor
based on Strain gauge
(ii) All of the above sensors are low
cost, have very low rate of false alarms, failure rate is also
low.


| Interface | Description |
|---|---|
| CustomizableItemEvent |
Used to provide update informations to the calls to the customizeUpdate
method of MetadataProvider.
|
| ItemEvent |
Used to provide update informations to the calls to the isSelected method
of MetadataProvider.
|
| MetadataProvider |
Provides an interface to be implemented by a Metadata Adapter in order
to attach a Metadata Provider to Lightstreamer Kernel.
|
| Class | Description |
|---|---|
| MetadataProviderAdapter |
Provides a default implementation of all the MetadataProvider interface
methods.
|
| Mode |
Encapsulates a publishing Mode.
|
| TableInfo |
Used to provide value objects to the calls to methods notifyNewTables
and notifyTablesClose of MetadataProvider.
|
| Exception | Description |
|---|---|
| AccessException |
Thrown by the notify* methods in MetadataProvider if the supplied User
is not recognized or a functionality is not implemented for this User.
|
| ConflictingSessionException |
Thrown by the
MetadataProvider.notifyNewSession(String, String, Map)
method if a User is not
enabled to open a new Session but he would be enabled as soon as another
Session were closed. |
| CreditsException |
Thrown by the notify* methods in MetadataProvider if some functionality
cannot be allowed to the supplied User.
|
| ItemsException |
Thrown by the getItems and getSchema methods in MetadataProvider if the
supplied Item Group name (or Item List specification) is not recognized or cannot be resolved.
|
| MetadataProviderException |
Thrown by the init method in MetadataProvider if there is some problem
that prevents the correct behavior of the Metadata Adapter.
|
| NotificationException |
Thrown by the notify* methods in MetadataProvider if there is some
inconsistency in the supplied parameters.
|
| SchemaException |
Thrown by the getSchema method in MetadataProvider if the supplied
Field Schema name (or Field List specification) is not recognized or cannot be resolved.
|


The Grey Cup parade will get underway at noon Tuesday in Winnipeg
by Megan Benedictson, Supervising Digital News ProducerWINNIPEG -- It will be a party 29 years in the making.
A Grey Cup celebration will take place in Winnipeg Tuesday to mark the Blue Bombers 33-12 win over the Hamilton Tiger-Cats. It was a matchup dubbed the ‘Drought Bowl’ because both teams had gone decades without a championship win.
“There will be a parade, and it will be on Tuesday afternoon,” Wade Miller, president and CEO of the Winnipeg Blue Bombers, told CTV Morning Live Winnipeg’s Rahim Ladhani on Monday morning.
The parade will get underway at 12 p.m. on Portage Avenue at Hargrave Street, before making its way to The Forks.
The parade route goes east down Portage Avenue, then turns south onto Main Street before veering onto William Stephenson Way.
Once at The Forks, a celebration will get underway that’s expected to wind down at 3 p.m.
Attendees can expect a flyover from RCAF at around 1:30 p.m.
Players, coaches and staff will be there along with Winnipeg Football Club officials, Premier Brian Pallister, Mayor Brian Bowman.
Team mascots Buzz and Boomer will also be there with the team’s cheer and dance team, the Blue Bombers Drum Band and Dancing Gabe.
Organizers shared this Google map image of the parade route.
An official with the football club told CTV News they chose to hold the festivities Tuesday, so Bomber players from the U.S. could attend and still have time to travel home for American Thanksgiving on Thursday.
REFLECTING ON A WIN
The team arrived at Winnipeg’s airport at around 3 p.m. Monday to a massive crowd of supporters.
Speaking over the phone from Calgary, Miller, who first joined the team as player in 1995, called the win great for the team and the city.
“It felt really good all game,” said Miller of the team’s dominant performance.
He said even though the Bombers led the scoreboard throughout the game, he wasn’t counting on the win until the end.
“Not until the clock ticked zero on the fourth quarter, because it’s the CFL so you never know what can happen,” he said. “Never take anything for granted.”
He described the winning team as a “great locker room.”
“They play for each other,” he said. “And when you play for each other, special things can happen, and that’s what you saw last night.”


--- layout: page title: C / C++ header: Posts By Tag C group: navigation --- {% for tag in site.tags %} {% if tag[0] == 'C' %}


Week 9 - Jekyll
A powerful blogging framework
29 Feb 2016
Jekyll is a really powerfull blogging framework, where you can build your own framework and then reuse it everytime so that you don't have to actually type all the code all over again. Every time you do a blog post you can just focus on the content
This week I have learned how to set up my website using Jekyll. I also tried to use one of the Jekyll templates out there and played around it in order to get familiar with the Jekyll documentation. It was so tempting to use those well-designed ready-to-use templates, but I ended up redesigning my CSS again and I really had fun with it.
After looking at different templates, I have better idea on how I want my site to look like, I am looking forward to starting phase 1 tomorrow as I can't wait to further improve my site!


The string:
49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d
Should produce:
SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t
So go ahead and make that happen. You'll need to use this code for the rest of the exercises.
Always operate on raw bytes, never on encoded strings. Only use hex and base64 for pretty-printing.


The Word Association application shows a very simple example of a realistic application architecture. The intention is that it can be coded up from scratch in front of a live audience, rather than that it demonstrate best practices or more complex patterns. A reference copy of the finished application is included with these instructions.
The word association application is so trivial that it may seem like a pretty contrived example. After all, no one would actually bother write a word association web app, would they?
Apparently, if it can be done, someone's already done it:
Things can go wrong in unexpected ways in live demos, so do have a practice run before trying to write the words application in front of other people. I've known of people who practice the live coding parts of their demos twenty times before a presentation, although that might be a bit too much preparation for most of us! The troubleshooting tips may help debug common problems. A working copy of the application is provided for reference, so you can refer to it if things go slightly wrong, or swap in pre-built bundles for broken bundles if things go very wrong.
Italicized text is instructions to the person giving the demo. Most of the rest of the text of this document is a sample script for a demo.
The instructions assume the free version of the IBM Rational Tools for OSGi Applications are being used. The demo will work fine without them, but some of the steps for project creation and project export will be different. Follow these instructions for installing the tools (or use Eclipse marketplace). Try to get comfortable with using the ctrl-space content assist for almost all your typing - it will speed the process of producing the code and xml up considerably.
You'll need to add a variable called java_home. Go to Window→Preferences→Run/debug→String substitution and add a variable called java_home which points to your java home.
The database will be automatically created when the words-assembly build is run. It can be found in the target directory of the words-assembly project after it has been built.
The words-assembly includes a datasource bundle already.
You can make some changes in your workspace beforehand which will make the demo faster. What works well is deleting the created projects at the end of a demo but keeping the actual workspace so that the templates and builders can be re-used.
You'll need to be using the JEE perspective or some of the instructions won't make sense, so switch to that perspective before the demo.
The application has the minimum necessary amount of code, but it's possibly still more than you'll want to type in front of an audience. There are two strategies for avoiding the typing. One is to dual-head the laptop and keep a file on the non-projected screen from which you can cute and paste. The other is to set up some eclipse templates.
Navigate to Preferences→Java→Editor→Templates. Select Import, and choose java-templates.xml. You should get three new templates, dopost, doget, and webform.
Navigate to Preferences→XML→XMLFiles→Editor→Templates. Select Import, and choose xml-templates.xml. You should get three new templates, recorder, lister, and jpans.
We need some plugins which don't ship with the Eclipse WTP platform by default, and want to ensure we don't introduce dependencies on bundles which aren't in our assembly. We do this by defining a new target platform.
Navigate to
and then navigate to . Select the button, accept the Initialize with 'nothing' option on the next panel. Choose again on the Target Content panel, accept the 'Directory' default in the list, and browse to the words-assembly/target directory. Choose . The words-assembly should show in the list, with around 40 plugins. Make sure all the plugins are selected. (If the list of plugins is empty, build the words-assembly and then choose . Click , and you should now have a list of target platforms which includes your new platform. Select it so that it is checked as the default target platform.If you're running in a JEE-5-application server, JPA entities will be automatically enhanced. We're just running in a little OSGi container, so we need to do that ourselves.Normally an ant task would be used to enhance the entities when building, but it can also be done using an eclipse builder. Most of the work to set up the builder can be done in advance.
In your workspace, select External Tools from the toolbar. (It's the play icon with what looks like a little red suitcase on it.) Select External tool configurations ... from the menu, highlight Program in the panel on the left of the wizard, and then click the new icon from the toolbar within the wizard (it's the white rectangle with the little yellow cross in the corner).
Fill in JPA_enhancer for the name. Move to the Location field and fill in the full path to the java executable, as follows:
${java_home}/jre/bin/java
Fill in the following in the Arguments box:
-cp ${target_home}/openjpa-all-2.0.0.jar:${build_project}/src org.apache.openjpa.enhance.PCEnhancer ${build_files}
(The variables will be filled in by eclipse when the enhancer builder run.)Eclipse needs to be told where to find the JPA implementation. The easiest way to do this is create a new OSGI project. (We'll delete it at the end.)
Create a new OSGi bundle project by bringing up a context menu in the package explorer and selecting New→Other→OSGi→OSGi Bundle Project., and choose a JPA facet. Type 'eraseme' for the name, and accept the defaults for everything else. Click next and keep clicking next until you get to the panel called JPA facet (about three panels in).
The platform should be Generic 2.0 and the type should be User Library. Create a library by clicking on the little book icon to the right of the list of libraries. Click New, fill in jpa_library for the name, and click OK. With the new jpa_library library highlighted, click the Add jars button, and navigate to the geronimo-jpa_2.0_spec-1.0.jar (it will be in your words-assembly). Accept the defaults for the other parameters and finish. Even after deleting the eraseme project, the library will be saved in your workspace for re-use. (Don't delete the eraseme project until you've set up the launch configuration.)
The words jars can be run in two ways, either by exporting them and adding them to the assembly and launching an OSGi framework from the command line, or by running the projects within Eclipse. Running within eclipse is faster and usually looks better for the demo.
Copy the "Words launch configuration.launch" file into the eraseme project and refresh.
Navigate to the Run icon (the large green arrow on the toolbar), bring up the dropdown menu, and select Run configurations.... The Words launch configuration should be listed in under OSGi Frameworks. Verify that all the plugins in the target platform are selected. Navigate to the Arguments tab, and confirm that the arguments include:
-Dorg.osgi.framework.system.packages.extra=javax.transaction;version=1.1.0,javax.transaction.xa;version=1.1.0 -Xbootclasspath/p:${target_home}/geronimo-jta_1.1_spec-1.1.1.jarThis ensures the OSGi framework exported the JTA packages at version 1.1, which is the version expected by Apache Aries, and the second thing it does is add the extra classes onto the JVM boot classpath.
On the same tab, the working directory should be ${target_home}.Finally, you need to ensure the launch configuration survives when you delete the eraseme project. To do this, navigate to the Common tab and change the radio button from Shared file to Local file.
Delete the eraseme project (including its contents on disk) and make sure that the Words launch configuration is still available in the Run configurations menu.
This demo involves a lot of live coding, so there is a possibility of things going wrong. In the event of demo accidents, it may be best to swap in the 'official' version of the problem jar or project. Of course, you'll want to confirm the official versions will work before starting. The official versions can be used in two ways, either on the command line, or as eclipse projects launched within eclipse.
Copy all the words bundles - except for the datasource jar - into the load directory of the words-assembly directory.
cd words-assembly/target mkdir load cp ../../words-api/target/*.jar load cp ../../words-web/target/*.jar load cp ../../words-jpa/target/*.jar load
Launch the OSGi container (from words-assembly/target).
java -jar osgi-3.5.0.v20090520.jar -clean -console
Confirm that http://localhost:8080/words-web/AssociateWord URL works.
Don't forget to remove the official jars before the demo starts - but do keep them somewhere handy for emergencies. A directory called backup in the target directory is a good place.
Within Eclipse, right click to bring up the context menu and chose Import→Import→General→Existing projects into workspace. Make sure the Select root directory radio button is selected and browse to the words-sample directory. Select all the projects except the the words-datasource project. Make sure that the Copy projects into workspace option is selected and import.
You can also import the eclipse projects into your workspace, which will add them to the launch configuration.
The first time you practice the demo, it may take an long time. It may seem like you'll never manage to write a whole web application in a short enough time. However, with a few practice runs you should get pretty quick at it. It should be possible to do the whole demo in around half an hour, or less if you pre-can some parts of some of the bundles.
Do remember to print out a copy of these instructions to take with you during the demo.
We're going to write a web application which plays a game of word association with a user. The application has three components - there's a web front end, a back end which handles the data and persistence using JPA. We want the front end and back end to be loosely coupled, so there's a third component which is a set of shared APIs.
It can be helpful to show the following architecture diagram:
What we're going to be running the application on is a little OSGi container embedded in Eclipse. Aries can also sit on top of a full JEE server, like Geronimo, and that's probably a more typical way of using it.
It should be possible to do the whole of the demo without restarting the OSGi console.
What we need to do now is create the bundles which make up our application. A bundle is a jar which some extra-metadata, and so it's easy to create using your favourite IDE. Eclipse has lots of OSGi support, and there's also a set of free tools which have extra support for Aries, so I'll be using those, but all of this can easily be done in another IDE, with base eclipse, or on the command line for the very hardcore.
We start off with a shared API. We want everything to be loosely coupled, so we'll have a bundle with interfaces.
Right click, New→Other→OSGi→OSGi Bundle project (or type OSG in the box to filter). Fill in the name words.api and click Finish.
We're going to play a game of word assocation, so we need a service that gives us a word to associate with.
Right click on the newly created project, do New→Interface, and
Package: org.apache.words Name: WordGetterService.
Add the following method:String getRandomWord();
We'll also want to do some sort of analysis on what associations people make, so we'll add an association recorder service.
Right click on the newly created project, do New→Interface, and
Package: org.apache.words Name: AssociationRecorderService.
Add the following method:
void recordAssociation(String word, String association);
It's no use making a note of what associations have been made if we can't access that data, so we'll add one more method:
String getLastAssociation(String word);
The default in OSGi is for classes to be private to a bundle, but this is an API, so we declare that everyone can use these interfaces.
Double-click on the manifest, click on the runtime tab, and click Add. Select the words package. Select manifest tab to show the change which has been made.
Making that package visible externally is just a question of adding a line in the bundle manifest.
Finish off by exporting the bundle. Right click on the project, choose Export, and then navigate to OSGi→OSGi Bundle. Choose the load directory of your assembly for the export location and click Finish. Go back to the OSGi console and type ss again. The new bundle should have appeared in the framework. The GOAT tool could also be used to show the bundle appearing.
Now that we have our interfaces for our services, we're going to create our web front-end.
Make the project for the web front end. Right click, New→Other→OSGi→OSGi Bundle project. Fill in the name words-web Select 'OSGi Web Configuration' from the configuration drop-down. Click Finish.
Expand the Deployment Descriptor twistie. (If it's not there, make sure you're in the JEE perspective.)
Right-click on Servlets to create a new servlet.
Enter the following.
package name: org.apache.words.web
class name: AssociateWord
Click Finish. It will auto-create the servlet.
There will be compile errors. This is the first point at which we're starting to see it's OSGi. Normally, we'd have to change the eclipse classpath to add the javax.servlet jar. Well, that's actually the second step. First of all we'd have to work out what jar the HttpServlet class is in. How many of you have got good at doing 'grep -r' on your system to figure out what jar a class is in?
In this case, we just declare that we're have a dependency on the javax.servlet and javax.servlet.http packages. To do that, we open our manifest and enter it as a dependency. Eclipse will even give us content completion, but we can also enter it by hand on the manifest
Expand WebContent→META-INF→MANIFEST.MF and double click. Add the package to the top-right box on the dependencies tab.
We're also going to want to use our api, so we'll add that dependency now too.
Click Add, enter *word* and select the words package. Switch tabs to show the change which has been made to the manifest. Then navigate back to the AssociateWord class
We need to fill in some html boilerplate in the doGet() method so that our servlet sends back some html.
Type 'dog', hit ctrl-space, and select the doget template from the content assist. You should now have the following code:
PrintWriter out = response.getWriter(); out.println(""); out.println("");
What our servlet will do is prompt the user with a random word which it gets from the word getter service.
Navigate to between the two lines for the html element creation and fill in the html to print out the random word:
WordGetterService getter = null; String randomWord = getter.getRandomWord(); out.println("The word is " + randomWord);
So do you think this is going to work? I don't think so either - we're using a service, but we haven't written any implementation for it. We better put some failsafes in.
Add guards around the getter dereference:
if (getter != null) {
and} else { out.println("Oh dear. Our dependencies haven't been found."); }
Now we've given the user a word, and we want them to give us back a word they associate with it. We do this with html input.
Move the cursor back to below the out.println which prints the random word and add the following using the webform content assist template.
out.println("
);
out.println("<form action=\"AssociateWord\" method=\"post\">");
out.println("What do you associate with "
+ randomWord
+ "? <input type=\"text\" name=\"association\" />
 ");
out.println("<input type=\"hidden\" name=\"word\" value=\""
+ randomWord + "\"/>");
out.println("<input type=\"submit\" name=\"Submit\"/>");
out.println("</form>");
When the user submits the form, we want to tell them what other things have been associated with that word.
Add the following content to the doPost() method using the dopost template:
String word = request.getParameter("word"); String association = request.getParameter("association"); AssociationRecorder recorder = null; String previousAssociation = null; if (recorder != null) { previousAssociation = recorder.getLastAssociation(word); recorder.recordAssociation(word, association); } PrintWriter out = response.getWriter(); out.println("The last person associated " + word + " with " + previousAssociation);
You can now try it out using the launch configuration. If you navigate to http://localhost:8080/words-web/AssociateWord and there should be a message about missing dependencies.
Now we've got a basic web front end. However, we're relying on services and we haven't done anything to get those services. There are three ways we can get our services. One is the normal OSGi way of looking them up in a bundle context. Aries adds the possibility of dependency injection, and also a JEE-integration which allows looking them up in JNDI. Blueprint dependencies can't be injected into a servlet, because a servlet is a JEE kind of artefact and we don't control its lifecycle - this is the same as you get with spring, dependency injection doesn't work with spring. Instead we'll look them up in JNDI. This is the first thing we're doing which is specific to Aries. Normally you can have a JEE bundle, or you can have an OSGi bundle, but there's not much integration between the two. Here Aries is providing a compatibility layer between the servlet, which is managed by the JEE container, and all the great OSGi services we're going to want to use.
This is an OSGi bundle, and InitialContext isn't shipped as an OSGi bundle, so we need to add Import-Package: javax.naming. We could also use @Resource here.
Navigate back to the manifest and add a dependency on javax.naming.
Add the following code to the beginning of the doGet() method (after declaring the getter variable). You'll also need to set the getter to be null when you declare it. It may be easier to not type the try-catch and add it in by using ctrl-1 while hovering over the compile-error:
try { getter = (WordGetterService) new InitialContext() .lookup("aries:services/" + WordGetterService.class.getName()); } catch (NamingException e) { e.printStackTrace(); }
AssociationRecorder recorder = null; try { recorder = (AssociationRecorderService) new InitialContext() .lookup("aries:services/" + AssociationRecorderService.class.getName()); } catch (NamingException e) { e.printStackTrace(); }
(It may be worth defining a template for these pieces of code as well - there's more argument for typing them out in full since they're conceptually quite important.)
Launching the launch configuration and navigating to http://localhost:8080/words-web/AssociateWordwords should bring up a web page that's blank. There will be lots of stack traces about the missing dependencies since that's how we chose to handle our missing dependencies - perhaps not the best technique!
The JPA project is the most complex project and you may wish to pre-create part of the project - for example, the base project, the manifest, and the persistence.xml definitions.
Create another OSGi bundle project, call it words-jpa, and choose a JPA facet. The Finish button should be enabled.
(If the finish button isn't enabled, click through until prompted to choose a library on the JPA facet panel. Select the jpa_library library you created earlier. Accept the defaults for the other parameters and finish.)
This new project is going to implement the words services, so We need to add a dependency on the words API.
Navigate to the manifest, and add the package which comes up if you type *word* into the filter box.
Note that *word* doesn't show any code from our web bundle, because we wanted to keep that private.
If you're running in a JEE-5-application server, JPA entities will be automatically enhanced. We're just running in a little OSGi container, so we need to do that ourselves. Normally you'd use an ant task to enhance the entities, but we're running in Eclipse, so we'll add an eclipse builder.
Right-click on the project, select Properties, choose Builders, then Import. Choose the JPA launcher you defined earlier. You should see the following message in the console following each build:
132 words-jpa INFO [main] openjpa.Tool - No targets were given. Running on all classes in your persistent classes list, or all metadata files in classpath directories if you have not listed your persistent classes. Use -help to display tool usage information.
You will also need to add some package dependencies. Add depencies on javax.persistence, org.apache.openjpa.enhance, and org.apache.openjpa.util.
Import-Package: javax.persistence, org.apache.openjpa.enhance, org.apache.openjpa.util, org.apache.words
Right-click on the words-jpa project and choose New→Entity. Fill in org.apache.words.jpa for the package and Association for the class name. Choose Next and add 'word' and 'associated' entity fields. Use 'String' as the type and 'word' and 'associated' as the names. (Make sure to use associated and not association as the field name!)
There will be a compile error because there is no primary key, so add a primary key for the word field:
@Id private String word;
Now we get a compilation error, because we have a dependency on org.apache.openjpa.enhance. Normally we'd have to work out which jar this came from and add it to the classpath, and if we're sharing the project adding the jar to the classpath in a portable way is a bit of a nuisance. Instead we can just add the org.apache.openjpa.enhance package to our dependencies.
Navigate to the manifest and add an import-package for org.apache.openjpa.enhance.
Expand the newly created project, expand JPA content, and
open persistence.xml. On the general tab, make sure the Association
class is on the list of managed classes, and
aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/wordsdb)
Here we're again making use of the JNDI integration Aries provides to point JPA at the JNDI mapping of a datasource we've defined as an OSGi service.
We want to declare the services, and we do this by creating an xml file with the service definitions in it.
Create a blueprint.xml by New→Other→OSGi→blueprint.xml or right-clicking on the project and choosing OSGi→Create a new blueprint file
We now need to fill in some namespaces manually, to indicate that we're not just going to be using this blueprint.xml for dependency injection - we're going to use to get integration with our transaction and persistence providers so that they get injected too. We do this by adding the following namespace to our blueprint xml.
Navigate to the blueprint element and use ctrl-space to bring up the content assist, and choose the jpans template. It should fill in the following:
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
The blueprint.xml file is one of the most important files in an Aries application. It's where we declare dependency injections, container-managed persistence, and container-managed transactions. It also allows us to create services declaratively. Normally an OSGi service would be registered at runtime, by Java code, but that doesn't have a very enterprise feel to it. What Aries allows us to do is register services declaratively in XML instead.
Add a bean and service definition for the association recorder using the recorder template. You should end up with the following:
<service interface="org.apache.words.AssociationRecorderService" ref="recorder" /> <bean class="org.apache.words.jpa.Recorder" id="recorder"> <jpa:context property="entityManager" unitname="words-jpa" /> <tx:transaction method="*" value="Required" /> </bean> <service>
The unit name should match the one defined in persistence.xml.
Define a new class org.apache.words.jpa.Recorder which implements the AssociationRecorderService. Use the new class wizard to fill in stubs for the interface methods.
Create a field for the entity manager and right click, choose Source→Generate getters and setters and generate a setter (but no getter).
private EntityManager entityManager;
public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; }
The cool thing here is that we didn't have to do anything to initialize the JPA entity manager - it gets injected for us. Now we just need to fill in the logic to handle persisting our data.
Fill in the following contents for recordAssociation() using the recordAssociation template.
Association found = entityManager.find(Association.class, word); if (found != null) { found.setAssociated(association); } else { Association a = new Association(); a.setWord(word); a.setAssociated(association); entityManager.persist(a); }
and getLastAssociation() using the getLastAssociation template
Association found = entityManager.find(Association.class, word); if (found != null) { return found.getAssociated(); } else { return "nothing"; }
Finally, we need to provide a service which returns words to make the associations with. We could have this service backed by a database, but it would look pretty similar to the recorder service, so for testing we'll just use a static list instead.
Navigate back to the blueprint.xml and add a declaration for the service using the lister template. You should end up with the following:
<service interface="org.apache.words.WordGetterService"> <bean class="org.apache.words.jpa.WordLister" /> </service>
Create a WordLister class, have it implement WordGetterService in the class creation wizard and fill in the following content around the boiler-plate. You can ask the audience to supply the three words to keep them awake.
public class WordLister implements WordGetterService { String[] words = { "computers", "Java", "coffee" }; public WordLister() { } @Override public String getRandomWord() { return words[new Random().nextInt(words.length)]; }
Launch the launch configuration. Revisiting the web application URL should bring up a web application which handles both prompting for a word association and telling users what previous users came up with. Making the associations should provide another opportunity for people in the audience to get involved by calling out word associations.
For a longer demo, consider some of the following.
If there's time, we can assemble our bundles into an application. The free tools provide support for this. Create a new project of type OSGi Enterprise Application, provide a name and choose Next, and then add the words bundles to it as a contained bundles and export.
We can add a second bundle with a different lister service and show how we can switch between the two bundles using the OSGi console.
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<openjpa-2.0.0-r422266:935683 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Error extracting class information from "bundleresource://42.fwk1060257586/". at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:208) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
If importing the existing projects into an Eclipse WTP/OSGi Application Tools installation, it's necessary to create an OpenJPA user library by navigating to Window→Preferences→Java→Build Path→User libraries and creating a new library called OpenJPA which includes the geronimo-jpa and org.apache.aries.jpa.container jars.


azLeaflet
az.leaflet
Instantiate a new leaflet map on the element, with options, which are not watched for changes
A class azavea-ng-leaflet-map is added to the root Leaflet map element
This directive does not handle addition of any basemaps, etc. This must all be done in
child directives. See ./examples
directory of the source for a detailed example.
<az-leaflet [width="{String}"] [height="{String}"] [options="{Object}"]> </az-leaflet>
| Param | Type | Details |
|---|---|---|
| width (optional) | String |
|
| height (optional) | String |
|
| options (optional) | Object |
|
Trigger 'az.leaflet.invalidatesize'
in your application code to trigger a L.map.invalidateSize()
call on the next $digest cycle


Hey {{ name }}, thanks for trying out absolut-loader! 🙌
⬅ Type your name on the left input (pretty please).


What can this bot do?
Shows OPEN token info and count of the open-chain nodes.
Tracks the wallets. Notifies about low and high network fees.
Monitors the volume (24h) of OPEN token.
O P E N M O N I T O R
OPEN Token: ${{prusd}} convert to
{{Math.round(rat[convert]*prusd*1e8)/1e8}}
O P E N W A L L E T
OPEN Mainet Network is now under development. Do not transfer any asset to this wallet!
O P E N I N V E S T
The Investor Challenge - Be the best investor and get dividends!
PRIZE POOL ETH: {{ether}}
PRIZE POOL OPEN: {{openc}}Awaiting result

#
NAME
INVEST
DIVIDENDS ETH
DIVIDENDS OPEN
{{t.num}}
{{t.invest}}
{{t.deth}}
Awaiting{{t.dopen}}
RULES INVESTMENT COMPETITION
Total Prize Pool (TPP) is 92% of all investments plus 3% Reward of
OPEN DApp Competition in case this project will win.
Developers reward is 8% of all investments. All dividends will be paid after announcing OPEN DApp Competition winners.
The best investors and one lucky will divide the prize pool among themselves. The place on leaderboard depends on the total amount and time your payments.
GOLD Zone - 1 investor get 50% of TPP. SILVER Zone - 2 investors get 20% of TPP each. BRONZE Zone - 1 lottery winner get 10% of TPP.
Lottery winner is the one who has the largest hash of the payment transaction. In case multiple payments, only the last hash is valid.
Telegram username and email are required to contact and confirm payout address.
The Investment Competition will end at 23:59:59 GMT, on September 25, 2019. Developer reserves the right to change timeline.
Timeline: {{timer}}
Absolutely fair decentralized lottery
NEXT DRAWING {{nextdr}}
COUNTDOWN TO DRAWING {{timerdr}}
ESTIMATED JACKPOT {{pot}} ETH {{pott}} OPENC

#
NAME|ADDR
HASH
PAYED
{{t.num}}
{{t.hash}}
{{t.payed}}
WINNERS HISTORY
DRAWING
NAME
HASH
JACKPOT ETH
JACKPOT OPEN
PAYOUT ETH
PAYOUT OPEN
{{t.draw}}
{{t.hash}}
{{t.pot}}
{{t.pott}}
{{t.payout}}
{{t.payoutt}}
LOTTERY RULES
The lottery draws take place every 7 days (each 7 day cycle is a “draw period”).
The estimated jackpot is amount of all payments during the draw period, minus 10%.
Winner is one who has the largest hash of the payment transaction at the end of the draw period.
OPENC tokens and Ethereum are accepted for payments (use OPENC for discount).


My name is Thomas Hansen, I have graduated from the University of Waterloo, with a degree in Mathematics with a minor in Psychology in April 2019. During my time here I was a part of their amazing Co-op program to where I worked at the international bank NN Group, worked at Nissan's Canadian HQ and currently working at ATS, a global engineering firm.
After university, I got a job at Uber ATG and we recently got acquired by Aurora. In my spare time I enjoy playing sports and am in the process of creating a web game. I have captained and coached the University of Waterloo's club frisbee team where we went on to finish 7th in the country. Growing up, I played hockey, soccer, and frisbee all competitively. While also enjoying to rock climb, curl, and play basketball in my spare time.
I worked at the Government of Canada for my first co-op. Here I worked for Agriculture Canada where I worked with Powershell and Microsoft Sharepoint mainly. With Powershell, I used it to create scripts and reports that helped the team. Also during this co-op term, I also created several Microsoft Sharepoint sites.
CloseIn my second co-op position, I worked at CGI a global financial company. I was tasked at testing their financial programs that they use at the banks. I worked on and tested the new and improved Financial Wealth platforms that they were rolling out.
CloseThis co-op position was an 8 month job in the Netherlands. NN Group is Netherlands biggest bank, and there I worked in their Reinsurance department. I helped work on, create and test their in-house financial hedging tool.
CloseIn my 4th co-op position, I worked at Nissan's Financial Headquarters of Canada. I was brought in to help fix their workbooks and create new reports using mainly VBA.
CloseMy last co-op position and current job is at ATS Automation. They are a global engineering firm and I work in their finance department to fix their workbooks and create new reports using VBA and MQuery.
CloseI started working at Uber as a Triage Operations Analyst where I would problem solve and assess how the Autonomous Vehicle's performance. In February, I started working in a Software Engineer role where I worked on building a Reporting Tool for the Triage team. After that was complete, I transitioned to improving our Workflow Manager tool. I implemented bulk edit, nesting of tables and overall UI and UX improvements
Close


Linda Senn
Website Administrator
Linda is 32 years old and works at Bank Mador in Zug. She studied computer science in Zürich and worked at different companies where she used to be a C++ and Java developer. By that time she really missed the interaction with other people and so she decided to move to a more consultant type of job.
At Bank Mador she is responsible to support decision makers on technologies in regard of their website and intranet. She is involved in almost any development on the website and she leads the setup and does also some minor coding when needed (and she really likes to code from time to time!). Her biggest concern is making complex things easy for Users and especially for Content Managers.
Linda knows a lot about technologies and is also a good talker. She can explain things very easy understandable. That is why she also teaches some computer science in her free time.
She is very friendly and nice but you don’t see her laughing a lot. She smiles sometimes and that’s always a very good sign!  She likes to go out in nature and do some hiking or running and takes Bruno always with her.
Age: 32
Nationality: Swiss
Gender: Female
Status: Singke
Location: Zug
Occupation: Website Administrator
Archetype: The Consul
I want a CMS to be intuitive and really easy to feed with content.
Introvert
Extrovert
Sensing
Intuition
Thinking
Feeling
Judging
Perceiving
IT & Internet 90%
Software 96%
Mobile Apps 92%
Social Network 75%


--- layout: default title: winter semester 15/16 ---
These are the results from the winter semester 2015/2016. The seminar was split into 3 projects.
You can find all the results, videos, links, source code and images below.Take a closer look at the projects from:
{% for student in site.data.wise-1516.students %}{% if forloop.last == false %} {{ student.author }}{% if forloop.rindex0 != 1 %},{% endif %}{% else %} and {{ student.author }}. {% endif %} {% endfor %}
It will be fun. We promise .
The task was to create an algorithm for humans and execute it several times. Iterate through the results and refine the pseudo-code. Afterwards the algorithm was ported to the P5.js programming framework and improved. Finally the students needed to find a use case for their algorithms.
{% for student in site.data.wise-1516.students %} {% for thumb in student.algorithm.thumb %} {% endfor %} {% endfor %}TRANSL8R is a chain of multilingual machines to play the Chinese whispers game with, meant to be shown in an exhibition context.
It consists of four boxes. The first box listens to the visitor's message and repeats it out loud. The second box listens to the first one and translates that message into a different language. The third and fourth one each do the same (every box speaks a different language). Finally, the first box translates the message back into the original language. In an ideal case, that message would be the same as the original one, but the little mistakes of the translation engine make for a funny ending, just as in the Chinese whispers game.
Read the full story and get the source code here.


PIZZA time!
Please select size:
Small ($8)
Medium ($11)
Large ($16)
Choose toppings:
Ham ($3)
Mozarella ($2)
Submit order
Your total is:


[gecode-users] doing multiple minimising searches with the same space
Guido Tack
tack at ps.uni-sb.de
Tue Jul 21 13:19:01 CEST 2009
Christian Schulte wrote:
> There is special support for specialized "constrain" functions which
> just
> return a cost variable, you might want to check that in "Modeling with
> Gecode". Rather than fixing a particular cost variable you can use a
> cost
> function that then decides which variable to return depending on
> which cost
> variable you want use now. Remember: any problem can be solved with
> one
> additional level of indirection ;-)
Exactly! You can even use actual assignment instead of an equality
constraint. I.e., your space has a member "IntVar cost" that the cost
function returns. When you initialize optimization for variable x,
you execute "space.cost = x" instead of posting the constraint
"rel(space, cost, IRT_EQ, x)". That way, you can change that
assignment later when you start the next search! You just have to
make sure that you actually do make such an assignment before you
start search, and that you update cost (as usual) in the copy
constructor.
Cheers,
Guido
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On
> Behalf
> Of Kish Shen
> Sent: Tuesday, July 21, 2009 12:54 PM
> Cc: users at gecode.org
> Subject: Re: [gecode-users] doing multiple minimising searches with
> the same
> space
>
> Guido Tack wrote:
>> Hi Kish,
>>
>> do I understand you correctly, you want to first minimize one cost
>> variable, and then (independently) minimize another? I.e., when the
>> first one is minimized, there's potentially still variables left that
>> are not assigned, and then you branch over them, minimizing the
>> other?
>> Or is the actual cost a function of more than one variable (say, a
>> weighted sum or something like that)?
>> If it is the latter, you can (of course) just use a single cost
>> variable
>> and post constraints that implement the cost function.
>> But I assume it is more like the former. In this case, I'm not
>> sure it
>> can be done with the current Gecode search engines. You'd probably
>> have
>> to split the search, first minimizing the first cost, then setting
>> up a
>> new problem and minimizing the second variable.
>> Actually, the new problem might even use the same space (the one
>> returned as the optimal solution), as long as you install a new
>> branching for the remaining variables and tell the cost method to
>> return
>> the new cost variable.
>>
>> Cheers,
>> Guido
>>
> Hi Guido,
>
> Thanks for your reply!
>
> I am thinking of the first case. The idea is that you may want to
> subdivide the problem into different set of variables, and perform an
> optimising search on them separately.
>
> If I understood the documentation correctly, the cost/constrain member
> function is part of the space, rather than part of the search (or
> branching), and that I need to define this member function in my code.
> This is why I was thinking of defining a Cost variable as part of the
> space, and at runtime linking this to a specific problem variable --
> this is to allow me to specify the actual cost function at run-time. I
> expect that the programmer will define the cost function as a
> constraint
> using the problem variable, say
>
> vInt[i] = vInt[j] + vInt[k]
>
> where i is the problem variable I am using as the cost variable. In
> the
> above case, the search will probably not branch on i, but will
> branch on
> j and k (and possibly other variables, of course).
>
> I do expect that the new search will use a new branching, and I expect
> it to use a different cost variable (and cost function). I am not
> sure I
> see how I could use the same space, since I would have already linked
> the space's cost variable to my previous problem variable, i.e. I
> would
> have posted a constraint like
>
> Cost = vInt[i]
>
> for the previous search. This constraint is no longer valid for the
> new
> search.
>
> To do the equivalent in the existing ECLiPSe branch-and-bound library
> code, I will call branch-and-bound with a new cost variable, but as
> the
> cost variable is part of the space, I am not sure how I can do this
> with
> Gecode. I can of course restrict the problem to have one optimising
> search (during forward execution) only, and most problem will probably
> need more, but it is difficult to explain this restriction.
>
> Cheers,
>
> Kish
> --
> This e-mail may contain confidential and privileged material for the
> sole use of the intended recipient. Any review, use, distribution or
> disclosure by others is strictly prohibited. If you are not the
> intended
> recipient (or authorized to receive for the recipient), please contact
> the sender by reply e-mail and delete all copies of this message.
> Cisco Systems Limited (Company Number: 02558939), is registered in
> England and Wales with its registered office at 1 Callaghan Square,
> Cardiff, South Glamorgan CF10 5BT.
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list


• Web developer
• In his 30s
• Extremely punctual
• 7:25 am to 9:30 am
• Include taking public transport and light walking
• Bagel
• Sliced cheese
• 1 tomato
• Arugula
• 1 chocolate bar
• Some nuts
• Set your alarm to 7:25am!


A: If you are seeing a gray area on the map, then estimated walking times are available for your current location. The non-shaded area with the green border indicates geographic areas that accessible within a 20 minute walk or train ride. The closest search results that are within this region will be displayed.
Areas that are shaded are further away than a 20 minute walk.
If you do not see any shaded regions, then we were not able to calculate walk/train transit times for your current location. If this is the case, you will still see search results, but the results will be measured by mileage instead of travel time. If there is no walkable time available, then destinations within 2.5 miles of your current location will be displayed.


This distribution is version RC_5 and therefore not recommended for production. It is released only to allow our users learn the new features, test it, and report any bugs or questions to http://hsqldb.org/support . Please read the file betaVersion.html in this directory for details.
HSQLDB (HyperSQL DataBase) is a relational database engine written in Java. Version 1.9.0 is the result of 4 years development since the last major version. It offers many features and adheres closely to the latest SQL and JDBC 4 standards.
This download contains the following files and directories:
bin
This directory contains some Windows utility wrapper scripts, and some HTML pages with HSQLDB embedded as an applet.
This directory contains the ant build.xml script plus MSDOS CMD files for build. See the Building HyperSQL Jars appendix of the HyperSQL User Guide for details.
When the jar is rebuilt, this directory contains the *.class files generated by the ANT build tool. It does not exist in the distribution zip.
A set of HTML, PDF and text documents covering different aspects of HSQLDB and some of its utilities.
HyperSQL
User Guide in HTML format.
HyperSQL User Guide in PDF format.
HyperSQL
Utilities Guide in HTML format.
HyperSQL Utilities Guide in PDF
format.
The JavaDoc for public classes, including the JDBC documentation.
(in future) Chronological list of minor changes and bug fixes since the release of version 1.9.0 changelist_1_9_0.txt
The license texts for the source and binaries, based on the BSD license. hsqldb_lic.txt is for sources developed entirely by the HSQL Development Group. hypersonic_lic.txt is for sources that contain code from the closed HypersonicSQL project.
The jar needed for running HyperSQL and its utilities (hsqldb.jar) has been pre-built in this directory. The jar is compatible with Java version 1.6. The extra zip file is needed only for recompiling hsqldb and is not required for deployment.
All source code is in this directory.
Contains test scripts for the database engine and SqlTool. These scripts are run by separate test utilities for the engine and SqlTool
Support for HyperSQL is available from http://hsqldb.org/support in various forms, including a mailing list and user forums. The web site features the latest bugfix versions of the software, FAQ and other useful resources.
Fred Toussi (fredt (at)
users.sourceforge.net)
Blaine Simpson (blaine dot simpson (at) admc dot com)


{% extends "base.html" %} {% block content %}
Here are the episodes in the plex-utills database. Clicking on a poster will re-upload that poster.
Clicking on the title will reprocess that film.
If you have changed a poster but it has not updated here, perform a full refresh (usually ctrl+Shift+R or ctrl+Shift+f5) of the page or clear your browser image cache.
| Film | Resolution | HDR Version | Audio Track | Poster | Bannered Poster | Checked | Re-Run | Delete |
|---|


Robotic Arts Intro Fall 2017 (IA277.01)
- Instructor: Lucas Haroldsen<EMAIL_ADDRESS>- Class Site: yasunaga.work/raif17
- syllabus: syllabus.pdf
- Resources: links.html
08/29: Speculations --- [Introductions]
Welcome to class for Robotic Arts Introduction!
This class is an introduction class. If you have never worked with electronics don’t worry, you are in the right place. We will speculate, learn, and experiment with electronics and you will make mistakes! So here are some rules.
- Don’t be afraid to make mistakes! The sole purpose of this class is experimentation, and experimentation is risky.
- Take a risk! Try something you are not sure would work. You might discover something you weren’t looking for
- Don’t worry about making a masterpiece. Again, this is an intro class which surveys various ways of working. Think of this class as an idea exercise class. If you learn something in 10 mistakes, it is better than not learning anything from one success.
- Work economically! Start small and build it up
- Make notes and sketches. Document your discoveries before you forget about them
- Pay attention! Often when you are working with electronics, small changes make big differences
- Take breaks. when you stare at your project to close and too long, you cant see anything any more. Go look at the sky
- Avoid hooking battery in backwards
- Don’t drink and solder
- Don’t take anything apart that plugs directly into the wall
Syllabus and Schedule
- Focus, Goals, Learning Objectives
- Grading
- Student responsibilities
- Schedule
Some Inspirations
Here are some things to get thinking about robots and electronics around us...
Relationships
Zaven Paré
Interactive experiment with robot (Geminoid - Robotic clone of human) A robot trying to act normal by perceiving human who is reacting to the robot trying to act “normal”
Hroshi Ishigro Laboratories
Conpanion Robot Paro
Therapudic companion robot project "paro"
Norman White - The Helpless Robot
Interfacing
Ranjit Bhatnagar - 28 Instruments, 28 Days
Oscar Lhermitte Seeing in circles
materiality
when thousands of cable crowded the skies
trans-Pacific Cable Landing station
Dan Wilson
littleBits
littleBits is a modular and physical programing platform that affords quick electronic experimentation
github repository for little bits schimatics and documentationMaterials and Tools for this class
here are list of materials you will need to get for the first half of the semester. Second half of the semester there will be minimal required purchases.
- Arduino Uno R3 (25 ~ $30)
- USB cord A to B (one that is commonly used on printers)(3 ~ $5)
- 400+ pin Breadboard (prototyping board) (5 ~ $8)
- Jumper wire kit(preformed or flexible)
- Small storage container for your projects
There are many clones of Arduino and they might be a little cheaper, but for the sake of ease and consistency let's make sure we all get Arduino Uno R3.
Here are some places to buy Arduino:
- Amazon prime is free for 6 months for students
- Arduino.ccArduino official website.
- Adafruit Close in NYC, generally fast shipping
- Sparkfun shipping can be slow
Be sure to get the USB A-B cable!
HOMEWORK
Order Arduino!
- Please order Arduino, USB cable, Breadboard, jumper wire kit ASAP. We will be using these right away.
- Complete introductory survey that is shared with you on Google Drive


--- layout: install ---
We have build and tested DeepInfer on the following 64-bit desktop and laptop operating systems:
The available machine learning models (check model store) can be used in command line mode or through the medical imaging software 3D Slicer.
3D Slicer provides a rich graphic user interface (GUI) for loading different types of medical imaging formats
such as DICOM, NIFTI, NRRD, and so on with several tools for annotating images, analysis tools and several processing modules.
If you want to use DeepInfer through 3D slicer follow steps 1 to 4. Otherwise, if you do not need the GUI and want to use the
models through command line, after installing Docker, jump to step 4.
DeepInfer models are Docker images. Docker installation is required to run the models.
Docker Installation Guide ›3D Slicer must be installed in order to use DeepInfer with Slicer.
3D Slicer Installation Guide ›DeepInfer supports a standard JSON descriptor fomrat which descibes model attributes, inputs, and outputs.
Get DeepInfer App ›DeepInfer supports a standard JSON descriptor fomrat which descibes model attributes, inputs, and outputs.
DeepInfer Usage Guide ›If you have any questions do not hesitate to contact us. Fill this form and we will reach out to you soon.
* steps 2 and 3 are required only for using DeepInfer through the 3D Slicer.


Here is the course book for the course in data structures and algorithms, given at Chalmers University and University of Gothenburg, Sweden.
We also have a smaller book containing some repetition of background knowledge:
These books are constantly evolving, and originally based on the OpenDSA course books. If you find any errors, or have other suggestions, please open an issue in our GitHub repository!


Be one of the first user of IpfsCloud Mobile App. Click to Join our Beta Testing Programme and help us to improve this platform
Check out our new Website Hosting Service for Free. Click to check it out!
A premium & modern Bootstrap 4 admin dashboard template pack.


Toggle navigation
Anya Melnyk
Skills
Portfolio
Resume
Blog
Drop Me A Line
What I've worked with:
Projects I've built and contributed to:
My Career Path
Open Resume in
PDF
Let's Stay in Touch!
Reach out to me if you have questions or suggestions!
Send Message
or
send direct email


Defines the default set of levels recognized by the system.
For a list of all members of this type, see Level Members.
System.Object
log4net.Core.Level
This type is not safe for multithreaded operations.
Each LoggingEvent has an associated Level.
Levels have a numeric Value that defines the relative ordering between levels. Two Levels with the same Value are deemed to be equivalent.
The levels that are recognized by log4net are set for each ILoggerRepository and each repository can have different levels defined. The levels are stored in the LevelMap on the repository. Levels are looked up by name from the LevelMap.
When logging at level INFO the actual level used is not Info but the value of LoggerRepository.LevelMap["INFO"]
. The default value for this is Info, but this can be changed by reconfiguring the level map.
Each level has a DisplayName in addition to its Name. The DisplayName is the string that is written into the output log. By default the display name is the same as the level name, but this can be used to alias levels or to localize the log output.
Some of the predefined levels recognized by the system are:
Namespace: log4net.Core
Assembly: log4net (in log4net.dll)
Level Members | log4net.Core Namespace


Yuki
Event
of Twitter
Toggle navigation
Poster on IGTF Conference
Old Project
User Guide
Main Map
Monthly Temporal Distribution
Spatial Pattern of Cluster
Temporal Pattern of Cluster
Word Frequency
Text Info
Dynamic Map
Play
1
2
5
10
15
20
30
60
Minutes / map
Topics Clustering
Run
Clear
2
3
4
5
6
Topics


Display a map with labels in a foreign language
This example displays a movable map initially centered over Hong Kong (22.2917°N, 114.1872°E) with map labels in simplified Chinese.
A reference to the base map tile service is obtained using the H.service.Platform
.
Alternate languages can be requested by adding the lg
parameter to the tile requests.
That is done by calling createTileLayer method. 5th argument is list of key/value parameters which are
passed to the map tile service when requesting each tile.
A list of all supported map languages can be found in the API References of the underlying service used: HERE Map Tile API
and HERE Vector Tile API
It is possible to specify map language for all layers at once when using H.service.Platform.createDefaultLayers
method.
Language of the UI controls can be specified when calling H.ui.UI.createDefault
method.
3rd argument is either a supported language code or a custom H.ui.i18n.Localization object
.


Inversion of Control
Seems like Inversion of Control is all the rage these days. The Apache Excalibur project is completely based around it. Excalibur uses detailed assembly descriptions to tie services together ... there's no way an Excalibur component can "look up" another component; in Excalibur you explicitly connect services together.
That's the basic concept of Inversion of Control; you don't create your objects, you describe how they should be created. You don't directly connect your components and services together in code, you describe which services are needed by which components, and the container is responsible for hooking it all together. The container creates all the objects, wires them together by setting the necessary properties, and determines when methods are invoked.
More recently, this concept has been renamed Dependency Injection.
There are three different implementation pattern types for IoC:
| type-1 | Services need to implement a dedicated interface through which they are provided with an object from which they can look up dependencies (other services). This is the pattern used by the earlier containers provided by Excalibur. |
| type-2 | Services dependencies upon are assigned via JavaBeans properties (setter methods). Both HiveMind and Spring use this approach. |
| type-3 | Services dependencies are provided as constructor parameters (and are not exposed as JavaBeans properties). This is the exclusive approach used by PicoContainer, and is also used in HiveMind and Spring. |
HiveMind is a much looser system than Excalibur. HiveMind doesn't have an explicit assembly stage; it wires together all the modules it can find at runtime. HiveMind is responsible for creating services (including core implementations and interceptors). It is quite possible to create service factories that do very container-like things, including connecting services together. hivemind.BuilderFactory does just that, instantiating an object to act as the core service implementation, then setting properties of the object, some of which are references to services and configuration point element data.
In HiveMind, you are free to mix and match type-2 (property injection) and type-3 (constructor injection), setting some (or all) dependencies via a constructor and some (or all) via JavaBeans properties.
In addition, JavaBeans properties (for dependencies) can be write-only. You only need to provide a setter method. The properties are properties of the core service implementation, there is no need for the accessor methods to be part of the service interface.
HiveMind's lifecycle support is much more rudimentary than Excalibur's. Your service implementations can get hivemindcallbacks when they are first created, and when they are discarded, by implementing certain interfaces.
Purist inversion of control, as in Excalibur, may be more appropriate in well-constrained systems containing untrusted code. HiveMind is a layer below that, not an application server, but a microkernel. Although I can see using HiveMind as the infrastructure of an application server, even an Excalibur application server, it doesn't directly overlap otherwise.


Altus Knowledge is an autonomous private coaching and tutorial centre that prepares and counsels students to pursue right careers in the field of Engineering and Medicine. Altus Knowledge faculties are alumni of IIT/ NIT or SMEs only, which gives students unsurpassed learning experience.
Our Objective is to equip our students with the right skill sets to bring about a transformation in their analytical, critical and logical thinking.The most important qualities imparted through our academic approach are the abilities to think independently and holistically. We promote the idea of innovation and to learn through creative exploration and experimentation.
We, at Altus Knowledge, have created a vision. We articulate it, passionately own it and will relentlessly drive it to completion.
Our vision is to emerge as a pre-eminent educational organisation that aims to work for the holistic enhancement of society by enabling the young and bright minds of the country. To help the students achieve their aspirations of becoming doctors and engineers thereby pushing India into the comity of developed nation.
Outstanding Organisations have one thing in common An absolute sense of mission.We are in the business of fostering human potential in creative ways. Our mission at Altus Knowledge is:


Connect to 8
Random People
Disclaimer:
You are about to video chat with other deepstream enthusiats... so please be nice and wear a shirt, or at the very least some clothes :)
OK I get it
*
also we are totally not responsible for anything
Change Room
Exit


Your name
Your E-mail
About project
Project budget?
option 1
option 2
When would you like start
option 1
option 2
Are you human? 6*6*6*4*1*2*3=?
Submid form
To best serve you, we kindly ask you to fill in all the form fields. The more we know, the more we are able to help.


In the amusement park
There we standed
In all heights
Sounds, tremors, colors
Rollercoasters
Rapid loops
Pendulum boats
They screamed as they should
Planted by the engineers
The fear of non-existing
In the blink of a second
But the fear was just that
Engineered
As a delusion, a barrier, a fantasy
The fear
It might've blurried the eyes
Shaken our necks
Our heads
Our spirits
But if we looked inside us
Inside our golden hearts
We knew the answer
We knew the reality
There was no danger
No threat, and no fear
Tonight
We'd be home
Scratchless
Safely
Together
As deep in our spirits
There it lays
The hands of the God
That makes blessed our hearts.


<% include view/sidebar.html %>
New Project
Name:
Author:
Date Time:
URL:
Status:
Draft
Public
Archived
Cover Image:
Reset
Submit