--- title: The Initial Notebook keywords: fastai sidebar: home_sidebar nb_path: "mle-2020/00_project_internship_mle.ipynb" ---
Notes
The main bulk of the material comes from https://developers.google.com/machine-learning/recommendation/overview/candidate-generation. If you want to go further later, you can take a look at http://nicolas-hug.com/blog/matrix_facto_3. It is absolutely not expected to look at these two links for the interviews or to complete the test.
Context:
We want to build a movies' recommender in order to get new movies to watch during the lock down. We will base our work on a variation of the MovieLens dataset. The data consists of movies seen by the users, some informations about the movies, and some informations about the users. The problem consists in predicting which movies a given user might like.
We are presenting you here first a naive approach in order to familarize yourself with the problem and show you how it might be solved.
Task:
The code presented is a first implementation but has a number of shortcomings in its structure (more on that in the conclusion). Your main task is to refactor the code from the notebook to python files. The goal of this refactoring is to solve the shortcomings listed above. Optionally, if you have the time and some ideas of features to introduce, feel free to do so.
Evaluation:
Our goal here is two fold:
The projects will be evaluated on the quality of the source code produced. The closer to "clean code", the better.
import pandas as pd
try :
users = pd.read_csv("data/users.csv")
movies = pd.read_csv("data/movies.csv")
ratings = pd.read_csv("data/ratings.csv")
except :
users = pd.read_csv("/Users/pierre-yvesthumerel/Desktop/kaggle/_interview/mle-2020/mle-2020/data/users.csv")
movies = pd.read_csv("/Users/pierre-yvesthumerel/Desktop/kaggle/_interview/mle-2020/mle-2020/data/movies.csv")
ratings = pd.read_csv("/Users/pierre-yvesthumerel/Desktop/kaggle/_interview/mle-2020/mle-2020/data/ratings.csv")
print(users.shape)
users.head()
movies.head()
ratings.head()
%%html
<img src='https://miro.medium.com/max/1642/1*BME1JjIlBEAI9BV5pOO5Mg.png' height="300" width="250"/>
What are similar movies ? In order to answer to this question we need to build a similiarity measure.
This measure will operate on the characteristics (features) of the movies to determine which are close. In our case, we have access to the genres of the movies. For example, the genres of Toy Story
are: Animation
, Children's
and Comedy
. This is represented as follow in our dataset:
genre_cols = ["Animation", "Children's",
'Comedy', 'Adventure', 'Fantasy', 'Romance', 'Drama',
'Action', 'Crime', 'Thriller', 'Horror', 'Sci-Fi', 'Documentary', 'War',
'Musical', 'Mystery', 'Film-Noir', 'Western']
genre_and_title_cols = ['title'] + genre_cols
movies[genre_and_title_cols].head()
Now that we have some features, we will try to find a function that performs a similiarity measure. The Similarity function will take two items (two list of features) and return a number proportional to their similarity.
For the following we will consider that the Similarity between two movies is the number of genres they have in common.
Here is an example with Toy Story
and E.T
toy_story_genres = movies[genre_and_title_cols].loc[movies.title == 'Toy Story'][genre_cols].iloc[0]
toy_story_genres
et_genres = movies[genre_and_title_cols].loc[movies.title == 'E.T. the Extra-Terrestrial'][genre_cols].iloc[0]
et_genres
et_genres.values * toy_story_genres
(et_genres.values * toy_story_genres).sum() # scalar product
So our similarity measure returns 1.0
for these two movies.
Let's see another example where we compare Toy Stories
and Pocahontas
pocahontas_genres = movies[genre_and_title_cols].loc[movies.title == 'Pocahontas'][genre_cols].iloc[0]
(pocahontas_genres.values * toy_story_genres).sum()
This tels us that Pocahontas
is closer to Toy Stories
than E.T.
which makes sense.
Ok, that's a nice measure. Now we are going to scale it up to all movies of our dataset. To do so smartly, let's take a look at the operation we just did, but from a mathematical point of view. To do so, we will think of the list of features of a movie as a vector V
. Then, our similarity measure between Toy Story
and E.T.
becomes:
$ V_{ToyStory} \cdot V_{ET}^{T}$
More generally the similarity measure between a movie i
and another movie j
is : $ V_{i} \cdot V_{j}^{T}$
Now we can think of movies
as a matrix containing all features vectors describing the movies. Here is how our similiarity measure looks in this context:
To obtain the similiarity between all movies of our dataset we have to perform the dot product of the movies
matrix with the transposed of the movies
matrix.
similarity = movies[genre_cols].values.dot(movies[genre_cols].values.T)
similarity.shape
We can now get the similarity between Toy Story
and any other movie of our dataset
similarity_with_toy_story = similarity[0] # 0 is Toy Story
similarity_with_toy_story
for i in range(10):
print(f"Similarity between Toy story and {movies.iloc[i]['title']} (index {i}) is {similarity_with_toy_story[i]}")
from content_based_filtering.helpers.movies import get_movie_id, get_movie_name, get_movie_year
print (get_movie_id(movies, 'Toy Story'))
print (get_movie_id(movies, 'Die Hard'))
print (get_movie_name(movies, 0))
print (get_movie_name(movies, 1000))
print (get_movie_year(movies, 1000))
def get_most_similar(similarity, movie_name, year=None, top=10):
index_movie = get_movie_id(movies, movie_name, year)
best = similarity[index_movie].argsort()[::-1]
return [(ind, get_movie_name(movies, ind), similarity[index_movie, ind]) for ind in best[:top] if ind != index_movie]
get_most_similar(similarity, 'Toy Story')
get_most_similar(similarity, 'Psycho', 1960)
def get_recommendations(user_id):
top_movies = ratings[ratings['user_id'] == user_id].sort_values(by='rating', ascending=False).head(3)['movie_id']
index=['movie_id', 'title', 'similarity']
most_similars = []
for top_movie in top_movies:
most_similars += get_most_similar(similarity, get_movie_name(movies, top_movie), get_movie_year(movies, top_movie))
return pd.DataFrame(most_similars, columns=index).drop_duplicates().sort_values(by='similarity', ascending=False).head(5)
get_recommendations(0)
get_recommendations(999)
The code presented is a first implementation but has a number of shortcomings preventing the collaboration of multiple MLE and Data Scientists:
Your main task is to refactor the code from the notebook to python files. The goal of this refactoring is to solve the shortcomings listed above. Optionally, if you have the time and some ideas of features to introduce, feel free to do so.


Copyright 2018 - All rights reserved
- About
- Governance
- Services & Resources
- Policy
- EOSC in Practice
- Media
- For Providers
Copyright 2018 - All rights reserved
The EOSC Portal is currently operated by the EOSC Enhance (Grant Agreement no. 871160) and EOSC Future (Grant Agreement no. 101017536) projects funded by the European Union’s Horizon 2020 research and innovation programme.


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 4-6
I am a broad church: when I’m not craving a bowl of food that delivers the same soothing taste from mouthful to mouthful, I like the sort of meal that involves a table full of bits and pieces. I certainly think this latter way of eating is one of the most relaxing ways of sitting around a table with friends. These fish tacos are a case in point, and rest assured that the actual preparation is much more low-effort than you might think.
Preheat the oven to 220C/200C Fan/Gas 7 for the fish, and begin by preparing the sides for your tacos. Put the red onion slices into a bowl and cover with the lime juice. Stir with a fork to mix the onion well in the juice. Actually, if you can get this done ahead of time (up to 1 day), so much the better, but even 20 minutes is fine.
Make the hot sauce by mixing together the mayonnaise and the gochujang paste (or other hot sauce) in a small bowl. Set aside.
For the corn relish, put the canned sweetcorn into a bowl. Add the chilli to the sweetcorn, along with the chopped coriander and some salt to taste. Give it all a good stir, and set aside.
Cut the fish fillets in half lengthways, so you have long fingers, and arrange in a shallow roasting tin. Mix together the cumin, paprika and salt, and sprinkle over the fish fillets. Mix the garlic and the oil in a small bowl. Drizzle the fish with the garlicky oil, and roast in the oven for 8–10 minutes, depending on the thickness of your fillets. Check to see if the fish is cooked through (though only just) before taking out of the oven.
Once you’ve taken the fish out (though don’t let it get cold) turn off the oven and warm the tortillas in the fading heat. Meanwhile, peel, stone and slice the avocados, then spritz with the juice of the lime, ready to serve with the other accompaniments.
Arrange the fish on a plate (lined with salad leaves, if so desired), sprinkle with some chopped fresh coriander, and take to the table along with the warmed tortillas. If you don’t want to add any salad to the fish directly, you may want to put a bowl of shredded iceberg or some other crisp leaves nearby.
Put the bowls of soused, but drained, red onions, the corn relish, hot sauce and a plate of sliced avocados on the table so that everyone can load their tortillas. A plate of lime wedges and a pile of napkins are both good ideas, too.


Laters Norwich - Friday 6th March
The Forrest, the York, the Ghost Face and the mattrad. Made it up for the last hurrah of the latter.
And lo, it was large
A fine piss up was had in the bar, followed by further wastedness at the Swan House. Good venue as usual. And I think Al was feeling a bit tender the next day (tough shit, stokie!)
Also cheers to all the posse who came out for the farewell meal at Bella Pasta the next day. It was superb, and a fine way to round off the weekend.
Though going to retro would have been better! I have a feeling that much drunkeness was had, and many damsels were abused by the Stoke Two. Nice one fellas.
Back to the main page


Ocala events
-
mens 3 inseam very short shorts
Laughlin Weddings | Chapels, Resorts, Marriage License Bureau Info.
Plan an unforgettable wedding in Laughlin, Nevada. View all available . NOTE: Weddings aboard cruise boats require an Arizona marriage license. Please .
http://www.visitlaughlin.com/things-to-do/weddings/St. Croix Weddings: Virgin Islands Marriage License Requirements
. make your St. Croix wedding legal. Find the Virgin Islands Marriage License Requirements here. . WHERE TO STAYaccommodations. ACCOMMODATIONS .
http://www.gotostcroix.com/marriage-license-requirements
fire a 50 caliber Upcoming events in Ocala
carolyn pray bank of america Hottest Tickets
-
Apr 11hot anime and manga girls
Amway Center -
Apr 28live opps home business
Amway Center -
Jun 25projector lamp<PHONE_NUMBER>
Bob Carr Performing Arts Center -
Mar 30us military award citations
Amway Center -
Aug 27acoustically transparent theater screen
Amway Center -
Jun 21dicks sporting goods department store
Amway Center -
Sep 13montgomery co al genweb
Francis Field -
Mar 17kona luau combination activitis
St Augustine Amphitheatre -
Oct 8minooka community high school yearbooks
Amway Center -
May 4petsafe rf 67 dog collar battery
Bob Carr Performing Arts Center
Ocala's best venues
-
Destination Wedding - Destination Wedding Locations - Planning a ...
Destination Wedding - Get information on planning a destination wedding along with . Select your location to find marriage license requirements for destinations all over the world. . Destination Wedding Basics: How to Stay Sane When Planning a Destination Wedding . Destination Weddings: Hotel or Airline Blocks ?
http://wedding.theknot.com/wedding-planning/destination-weddings.aspx -
Las Vegas weddings at the Luxor: Wedding "How To"
Promotions Hotel Entertainment Restaurants Nightlife Weddings Amenities Casino Meetings . The Marriage License application expires one year after issuance. The age requirement is 18 years of age or older; both parties must appear at .
http://www.luxor.com/weddings/weddings_chapel.aspx -
Barbados Wedding Requirements & Marriage License Information at ...
Wedding requirements now permit you to arrive and have your Barbados . Our exclusive lifestyle hotel experience, designed to fulfill the needs of the . Whether on an epic journey or a weekend getaway, we make every child's stay magical.
http://www.fairmont.com/barbados/activities-services/weddings/getting-married-in-barbados/does peppermint extract repel flies
98 people's favorite
-
Hot Wedding Offers - Bahamas | The Bahamas
Nassau/Paradise Island Hotel Offers: Atlantis . Marriage License, Certificate Copy of Marriage License . Requirement - 6 nights stay in any room category .
http://www.bahamas.com/bahamas/hot-wedding-offers -
Destination Weddings - Wedding Etiquette
Research the legalities for travel and marriage license requirements. Arrange accommodations for the guests at a local hotel.  Be sure to provide the guests with travel and accommodation information. Do we need to .
http://www.netplaces.com/wedding-etiquette/foundations-of-planning/destination-weddings.htm


This course provides a general introduction to cartography, broadly defined as the art, science, and ethics of mapmaking and map use. It – and the UW Cartography curriculum in general – focuses upon the design of maps, drawing from research and practice on graphic design, information visualization, and semiotics, perspectives that students are unlikely to receive in other GIS courses. Specifically, the course emphasizes mapmaking over map use (compared to 170) and print mapping over web-based or interactive mapping (compared to 572 and 575, respectively). The course is divided into two components: lectures and labs.
Check out past syllabi and finals projects below!
Instructor: Meghan Kelly
TA: Zihan Song
Abigail Alvarez
Laura Aprill
Jamie Badams
Dawson Bancroft-Short
Andrei Barjoveanu
Michael Braun
Casey Cooney
Allen Druckrey
Shamohn Ellis
Cavan Faucett
Lily Hansen
Jacob Hrubecky
Kyle Jay
Andrew Kluck
LauraLee Brott
Bradley Meilinger
Margaret Milford
Sanober Mirza
Peter Nielsen
Benjamin Polchowski
Emily Rose
Joey Sarow
Cody Schmitt
Sarah Tate
Ana Wells
John Wise
Daniel Wolski
Adelina Yankova
Kate Zellmer


Search for users
Select from list
FREQUENTLY CALLED
AUTHOR
PARTICIPANTS
Your call has started. Please click below to return to the call display.


1.0.0-beta.1-nightly-1820 (changes since 1.0.0-beta.1) (2014-04-24)
Bug Fixes
- $ionicActionSheet: provide default functions for options (ba39fb00, closes #1013)
- $ionicLoading: stop race condition with show and hide (eb1dee93, closes #1100)
- $ionicModal: make it use jqLite#remove() (104c6420, closes #1138)
- $ionicPopup:
- stop race condition with show then hide (698c93fc)
- make it work if jquery is included (21ff7547, closes #1027)
- active: Taps/clicks now use .activated instead of .active, closes #913 (870dcd6f)
- checkbox:
- Remove tap highlight and fix checkbox appearance in Firefox, closes #496 (b0b446d5)
- stretch checkbox's clickable area to full width (5238f8f3)
- Entire row of an .item w/ a checkbox is now tappable, closes #995 (ac94bb23)
- header: Header input too long on Android 4.2, closes #1081 (b654e02e)
- input: Fix to hide input overlays on old Android (0e9072e4)
- ion-scroll:
- ionContent:
- ionHeaderBar:
- do not tapScrollToTop for inputs (5722900a, closes #1199)
- make it align after elements properly load (d00aaa59)
- ionInfiniteScroll:
- remove listener on $destroy (08da6f75)
- work properly if past horizontal boundaries (d58fff72, closes #1073)
- ionList: show reorder/delete on item creation if list is showing (09a77299, closes #1181)
- ionNavBar: adjust has-header if ionNavBar is hidden (41b73abf, closes #927)
- ionNavButtons: multiple ionNavButtons elements align correctly (58de2671, closes #930)
- ionRefresher: do not animate pulling-text (5c893ab8, closes #909)
- ionTab: make sure all tab-nav attributes are re-interpolated on change (757f1819, closes #955, #1071)
- ionView: do not set navbar title if no title attr set (d53eab81, closes #915)
- ionicPopup: if input exists, focus it. else, focus first button (93aa16a7, closes #1176)
- ionicTabBar: detect if matches state in all cases (ee2b7686)
- item:
- Vertically align nav icon w/out flexbox to prevent android crashes, #928 (5b0f5d02)
- Fix css overflow overrides for .item-text-wrap (04b4d771)
- Fix delete icon alignment in .item-icon.left, closes #946 (044211de)
- labels: Fix .input-label's width for androids w/out full flex box support, #998 (096a01c1)
- loading: fix not hiding after two shows, always cancel delay (4216266f, closes #1130)
- modal: Increase delay of removing .modal-open to prevent focus under modals (83fd11c5)
- navClear:
- only set viewOptions if click leads to state change (4dffc5f6, closes #1043)
- be sure it runs before ngClick (4f47bf24, closes #1047)
- popup: Backwards compatible remove popup from DOM, closes #851 (441a21c4)
- range: Fix range being able to slide when in a side menu, closes #318 (2fbdebcd)
- refresher: get rid of flickers except on droid-4.4 (ad671848, closes #1014)
- scroll:
- Allow scrolling when touchstart target is an input, #1078 (8af018b1)
- Fix input focus when tapped, do not scroll when target is an input, closes #1020 (66ecec70)
- Do not ignore taps if the target was an input, #997 (e6f56237)
- Fix scroll for devices w/out dataset support, closes #976 (bfcf2650)
- scss: make tabs,header,footer aligned right with statusbar (c2a38a6d)
- tabs: Tab icon align within nested tabs, closes #1093 (2a6f7029)
- tabs-item-hide: only hide tab nav items (a7eb521c)
- tap:
- Do not preventDefault after input focus, #1068 (a977332f)
- Remove 300ms delay when tapping select elements (cf686548)
- Prevent clicks from firing after scrolling, #579 (cb602b58)
- Deactivate elements during scroll at the same time click is ignored, #997 (3ee5ea77)
- Do not simulate a click if it was from a touchcanel event, closes #1015 (78510099)
- Prevent multiple clicks when overriding cordova object, closes #1022 (5f3a1d21)
- Prevent "clicking" when scrolling (f3bd258c)
- Increate isScrolledSinceStart from 2px radius to 15px, #970 (9a49129a)
Features
- $ionicBackdrop: add backdrop show/hide service (730a33b9, closes #1084)
- $ionicModal:
- pass modal instance to modal.shown/modal.hidden events (a19e3b62, closes #1065)
- show/hide/remove return promises for animating (39385008)
- $ionicNavBarDelegate:
- showBackButton returns whether bar is shown (933a555e, closes #1076)
- showBar returns whether navbar is shown (24a415c3)
- $ionicScrollDelegate:
- add getScrollView(), getScrollPosition() (b5ef9313, closes #1117)
- add scrollBy(left,top,animate) to delegate (f847c208, closes #987)
- $ionicSideMenuDelegate:
- avatar: Adding .item-avatar-left and deprecating .item-avatar (9bac6050)
- grid: Added .row-baseline and .row-stretch (e0e7a83b)
- ionCheckbox: allow ng-disabled attribute (d2e54a82, closes #939)
- ionContent: don't wrap in a .scroll element if scroll="false" (73da93d4, closes #841)
- ionNavBar: make back button animated (97257938, closes #1030)
- ionSlideBox: add pager-click attribute (d6c960c2, closes #785)
- loading: Moved loading scss to its own file and added variables, closes #984 (e3491864)
- select: Styled select elements, both inline and as a list item (8a12f2d1)
Breaking Changes
- $ionicPopup.show()'s button onTap function has changed.
When using $ionicPopup.show()
, previously a button's onTap function
would only result in closing the popup and resolving the promise if the
onTap(event)
function returned a truthy value.
Now, a button's onTap event will always close the popup and resolve
the popup's promise, no matter the return value, by default. The only
way to prevent the popup from closing is to call
event.preventDefault()
.
Change your code from this:
$ionicPopup.show({
buttons: [{
onTap: function(event) {
if (!shouldClosePopup) {
return false;
}
}
}]
});
To this:
$ionicPopup.show({
buttons: [{
onTap: function(event) {
if (!shouldClosePopup) {
event.preventDefault();
}
}
}]
});
(cb1a5f62)
- The developer should be stating exactly how an icon
should show, but previously the right nav arrow icon violates this by
automatically showing a right arrow when an item was an anchor or
button. Instead of using the
:after
item selector, which was always
applied by default, it uses the same markup as item-icon-right
, which
is easier to understand, customizable and not a hard coded default.
This change removes the :after
nav icon styling, and creates a new
class, icon-accessory
, based off of similar CSS. The change makes a
nav arrow highly customizable, allows RTL developers to easily control
the arrow direction, and the accessory class is something that's
reusable.
An example of right side arrow using ion-chevron-right
as the icon:

Check mail

(c7e3defc)
- ionic.Platform.isCordova() has been renamed to
ionic.Platform.isWebView()
(5c300dd3)
- ion-list syntax has changed in favor of simplicity &
flexibility.
Relevant documentation:
ionList,
ionItem,
ionOptionButton,
ionReorderButton,
ionDeleteButton,
$ionicListDelegate.
To migrate, change your code from this:
<ion-list option-buttons="[{text:'hello',type:'button-positive',onTap:tap()}]"
on-delete="onDelete(el)"
delete-icon="ion-minus-circled"
can-delete="true"
show-delete="shouldShowDelete"
on-reorder="onReorder(el, startIndex, toIndex)"
reorder-icon="ion-navicon"
can-reorder="true"
show-reorder="shouldShowReorder">
<ion-item ng-repeat="item in items">
{{item}}
</ion-item>
</ion-list>
To this:
<ion-list show-delete="shouldShowDelete"
show-reorder="shouldShowReorder">
<ion-item ng-repeat="item in items">
{{item}}
<ion-delete-button class="ion-minus-circled"
ng-click="onDelete(item)">
</ion-delete-button>
<ion-reorder-button class="ion-navicon"
ng-click="onReorder(item, $fromIndex, $toIndex)">
</ion-reorder-button>
<ion-option-button class="button-positive" ng-click="tap()">
Hello
</ion-option-button>
</ion-item>
</ion-list>
(986dbac8)
- Before, if you did not have a
title
attribute set on your
ion-view, it would transition into that view and erase the navbar's current
title.
Now, if your ion-view does not have a title
attribute set, the new
view will be transitioned in, but there will be no title change.
If you wish to have a blank title on your new view, you must now
explicitly set your ion-view
's title attribute to an empty string.
To migrate your code, change from this:
<ion-view></ion-view>
To this:
<ion-view title=""></ion-view>
(d53eab81)


const builtin = @import("builtin");
/// `explicit_subsystem` is missing when the subsystem is automatically detected,
/// so Zig standard library has the subsystem detection logic here. This should generally be
/// used rather than `explicit_subsystem`.
/// On non-Windows targets, this is `null`.
pub const subsystem: ?std.Target.SubSystem = blk: {
if (@hasDecl(builtin, "explicit_subsystem")) break :blk builtin.explicit_subsystem;
switch (builtin.os.tag) {
.windows => {
if (builtin.is_test) {
break :blk std.Target.SubSystem.Console;
}
if (@hasDecl(root, "main") or
@hasDecl(root, "WinMain") or
@hasDecl(root, "wWinMain") or
@hasDecl(root, "WinMainCRTStartup") or
@hasDecl(root, "wWinMainCRTStartup"))
{
break :blk std.Target.SubSystem.Windows;
} else {
break :blk std.Target.SubSystem.Console;
}
},
else => break :blk null,
}
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const StackTrace = struct {
index: usize,
instruction_addresses: []usize,
pub fn format(
self: StackTrace,
comptime fmt: []const u8,
options: std.fmt.FormatOptions,
writer: anytype,
) !void {
if (fmt.len != 0) std.fmt.invalidFmtError(fmt, self);
// TODO: re-evaluate whether to use format() methods at all.
// Until then, avoid an error when using GeneralPurposeAllocator with WebAssembly
// where it tries to call detectTTYConfig here.
if (builtin.os.tag == .freestanding) return;
_ = options;
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const debug_info = std.debug.getSelfDebugInfo() catch |err| {
return writer.print("\nUnable to print stack trace: Unable to open debug info: {s}\n", .{@errorName(err)});
};
const tty_config = std.io.tty.detectConfig(std.io.getStdErr());
try writer.writeAll("\n");
std.debug.writeStackTrace(self, writer, arena.allocator(), debug_info, tty_config) catch |err| {
try writer.print("Unable to print stack trace: {s}\n", .{@errorName(err)});
};
}
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const GlobalLinkage = enum {
Internal,
Strong,
Weak,
LinkOnce,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const SymbolVisibility = enum {
default,
hidden,
protected,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const AtomicOrder = enum {
Unordered,
Monotonic,
Acquire,
Release,
AcqRel,
SeqCst,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const ReduceOp = enum {
And,
Or,
Xor,
Min,
Max,
Add,
Mul,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const AtomicRmwOp = enum {
Xchg,
Add,
Sub,
And,
Nand,
Or,
Xor,
Max,
Min,
};
/// The code model puts constraints on the location of symbols and the size of code and data.
/// The selection of a code model is a trade off on speed and restrictions that needs to be selected on a per application basis to meet its requirements.
/// A slightly more detailed explanation can be found in (for example) the [System V Application Binary Interface (x86_64)](https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf) 3.5.1.
///
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const CodeModel = enum {
default,
tiny,
small,
kernel,
medium,
large,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const OptimizeMode = enum {
Debug,
ReleaseSafe,
ReleaseFast,
ReleaseSmall,
};
/// Deprecated; use OptimizeMode.
pub const Mode = OptimizeMode;
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const CallingConvention = enum(u8) {
/// This is the default Zig calling convention used when not using `export` on `fn`
/// and no other calling convention is specified.
Unspecified,
/// Matches the C ABI for the target.
/// This is the default calling convention when using `export` on `fn`
/// and no other calling convention is specified.
C,
/// This makes a function not have any function prologue or epilogue,
/// making the function itself uncallable in regular Zig code.
/// This can be useful when integrating with assembly.
Naked,
/// Functions with this calling convention are called asynchronously,
/// as if called as `async function()`.
Async,
/// Functions with this calling convention are inlined at all call sites.
Inline,
/// x86-only.
Interrupt,
Signal,
/// x86-only.
Stdcall,
/// x86-only.
Fastcall,
/// x86-only.
Vectorcall,
/// x86-only.
Thiscall,
/// ARM Procedure Call Standard (obsolete)
/// ARM-only.
APCS,
/// ARM Architecture Procedure Call Standard (current standard)
/// ARM-only.
AAPCS,
/// ARM Architecture Procedure Call Standard Vector Floating-Point
/// ARM-only.
AAPCSVFP,
/// x86-64-only.
SysV,
/// x86-64-only.
Win64,
/// AMD GPU, NVPTX, or SPIR-V kernel
Kernel,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const AddressSpace = enum(u5) {
// CPU address spaces.
generic,
gs,
fs,
ss,
// GPU address spaces.
global,
constant,
param,
shared,
local,
// AVR address spaces.
flash,
flash1,
flash2,
flash3,
flash4,
flash5,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const SourceLocation = struct {
file: [:0]const u8,
fn_name: [:0]const u8,
line: u32,
column: u32,
};
pub const TypeId = std.meta.Tag(Type);
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Type = union(enum) {
Type: void,
Void: void,
Bool: void,
NoReturn: void,
Int: Int,
Float: Float,
Pointer: Pointer,
Array: Array,
Struct: Struct,
ComptimeFloat: void,
ComptimeInt: void,
Undefined: void,
Null: void,
Optional: Optional,
ErrorUnion: ErrorUnion,
ErrorSet: ErrorSet,
Enum: Enum,
Union: Union,
Fn: Fn,
Opaque: Opaque,
Frame: Frame,
AnyFrame: AnyFrame,
Vector: Vector,
EnumLiteral: void,
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Int = struct {
signedness: Signedness,
bits: u16,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Float = struct {
bits: u16,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Pointer = struct {
size: Size,
is_const: bool,
is_volatile: bool,
/// TODO make this u16 instead of comptime_int
alignment: comptime_int,
address_space: AddressSpace,
child: type,
is_allowzero: bool,
/// The type of the sentinel is the element type of the pointer, which is
/// the value of the `child` field in this struct. However there is no way
/// to refer to that type here, so we use pointer to `anyopaque`.
sentinel: ?*const anyopaque,
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Size = enum(u2) {
One,
Many,
Slice,
C,
};
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Array = struct {
len: comptime_int,
child: type,
/// The type of the sentinel is the element type of the array, which is
/// the value of the `child` field in this struct. However there is no way
/// to refer to that type here, so we use pointer to `anyopaque`.
sentinel: ?*const anyopaque,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const ContainerLayout = enum(u2) {
Auto,
Extern,
Packed,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const StructField = struct {
name: []const u8,
type: type,
default_value: ?*const anyopaque,
is_comptime: bool,
alignment: comptime_int,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Struct = struct {
layout: ContainerLayout,
/// Only valid if layout is .Packed
backing_integer: ?type = null,
fields: []const StructField,
decls: []const Declaration,
is_tuple: bool,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Optional = struct {
child: type,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const ErrorUnion = struct {
error_set: type,
payload: type,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Error = struct {
name: []const u8,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const ErrorSet = ?[]const Error;
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const EnumField = struct {
name: []const u8,
value: comptime_int,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Enum = struct {
tag_type: type,
fields: []const EnumField,
decls: []const Declaration,
is_exhaustive: bool,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const UnionField = struct {
name: []const u8,
type: type,
alignment: comptime_int,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Union = struct {
layout: ContainerLayout,
tag_type: ?type,
fields: []const UnionField,
decls: []const Declaration,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Fn = struct {
calling_convention: CallingConvention,
alignment: comptime_int,
is_generic: bool,
is_var_args: bool,
/// TODO change the language spec to make this not optional.
return_type: ?type,
params: []const Param,
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Param = struct {
is_generic: bool,
is_noalias: bool,
type: ?type,
};
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Opaque = struct {
decls: []const Declaration,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Frame = struct {
function: *const anyopaque,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const AnyFrame = struct {
child: ?type,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Vector = struct {
len: comptime_int,
child: type,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Declaration = struct {
name: []const u8,
};
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const FloatMode = enum {
Strict,
Optimized,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Endian = enum {
Big,
Little,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Signedness = enum {
signed,
unsigned,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const OutputMode = enum {
Exe,
Lib,
Obj,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const LinkMode = enum {
Static,
Dynamic,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const WasiExecModel = enum {
command,
reactor,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const CallModifier = enum {
/// Equivalent to function call syntax.
auto,
/// Equivalent to async keyword used with function call syntax.
async_kw,
/// Prevents tail call optimization. This guarantees that the return
/// address will point to the callsite, as opposed to the callsite's
/// callsite. If the call is otherwise required to be tail-called
/// or inlined, a compile error is emitted instead.
never_tail,
/// Guarantees that the call will not be inlined. If the call is
/// otherwise required to be inlined, a compile error is emitted instead.
never_inline,
/// Asserts that the function call will not suspend. This allows a
/// non-async function to call an async function.
no_async,
/// Guarantees that the call will be generated with tail call optimization.
/// If this is not possible, a compile error is emitted instead.
always_tail,
/// Guarantees that the call will be inlined at the callsite.
/// If this is not possible, a compile error is emitted instead.
always_inline,
/// Evaluates the call at compile-time. If the call cannot be completed at
/// compile-time, a compile error is emitted instead.
compile_time,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const VaListAarch64 = extern struct {
__stack: *anyopaque,
__gr_top: *anyopaque,
__vr_top: *anyopaque,
__gr_offs: c_int,
__vr_offs: c_int,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const VaListHexagon = extern struct {
__gpr: c_long,
__fpr: c_long,
__overflow_arg_area: *anyopaque,
__reg_save_area: *anyopaque,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const VaListPowerPc = extern struct {
gpr: u8,
fpr: u8,
reserved: c_ushort,
overflow_arg_area: *anyopaque,
reg_save_area: *anyopaque,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const VaListS390x = extern struct {
__current_saved_reg_area_pointer: *anyopaque,
__saved_reg_area_end_pointer: *anyopaque,
__overflow_area_pointer: *anyopaque,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const VaListX86_64 = extern struct {
gp_offset: c_uint,
fp_offset: c_uint,
overflow_arg_area: *anyopaque,
reg_save_area: *anyopaque,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const VaList = switch (builtin.cpu.arch) {
.aarch64, .aarch64_be => switch (builtin.os.tag) {
.windows => *u8,
.ios, .macos, .tvos, .watchos => *u8,
else => @compileError("disabled due to miscompilations"), // VaListAarch64,
},
.arm => switch (builtin.os.tag) {
.ios, .macos, .tvos, .watchos => *u8,
else => *anyopaque,
},
.amdgcn => *u8,
.avr => *anyopaque,
.bpfel, .bpfeb => *anyopaque,
.hexagon => if (builtin.target.isMusl()) VaListHexagon else *u8,
.mips, .mipsel, .mips64, .mips64el => *anyopaque,
.riscv32, .riscv64 => *anyopaque,
.powerpc, .powerpcle => switch (builtin.os.tag) {
.ios, .macos, .tvos, .watchos, .aix => *u8,
else => VaListPowerPc,
},
.powerpc64, .powerpc64le => *u8,
.sparc, .sparcel, .sparc64 => *anyopaque,
.spirv32, .spirv64 => *anyopaque,
.s390x => VaListS390x,
.wasm32, .wasm64 => *anyopaque,
.x86 => *u8,
.x86_64 => switch (builtin.os.tag) {
.windows => @compileError("disabled due to miscompilations"), // *u8,
else => VaListX86_64,
},
else => @compileError("VaList not supported for this target yet"),
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const PrefetchOptions = struct {
/// Whether the prefetch should prepare for a read or a write.
rw: Rw = .read,
/// The data's locality in an inclusive range from 0 to 3.
///
/// 0 means no temporal locality. That is, the data can be immediately
/// dropped from the cache after it is accessed.
///
/// 3 means high temporal locality. That is, the data should be kept in
/// the cache as it is likely to be accessed again soon.
locality: u2 = 3,
/// The cache that the prefetch should be performed on.
cache: Cache = .data,
pub const Rw = enum(u1) {
read,
write,
};
pub const Cache = enum(u1) {
instruction,
data,
};
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const ExportOptions = struct {
name: []const u8,
linkage: GlobalLinkage = .Strong,
section: ?[]const u8 = null,
visibility: SymbolVisibility = .default,
};
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const ExternOptions = struct {
name: []const u8,
library_name: ?[]const u8 = null,
linkage: GlobalLinkage = .Strong,
is_thread_local: bool = false,
};
/// This enum is set by the compiler and communicates which compiler backend is
/// used to produce machine code.
/// Think carefully before deciding to observe this value. Nearly all code should
/// be agnostic to the backend that implements the language. The use case
/// to use this value is to **work around problems with compiler implementations.**
///
/// Avoid failing the compilation if the compiler backend does not match a
/// whitelist of backends; rather one should detect that a known problem would
/// occur in a blacklist of backends.
///
/// The enum is nonexhaustive so that alternate Zig language implementations may
/// choose a number as their tag (please use a random number generator rather
/// than a "cute" number) and codebases can interact with these values even if
/// this upstream enum does not have a name for the number. Of course, upstream
/// is happy to accept pull requests to add Zig implementations to this enum.
///
/// This data structure is part of the Zig language specification.
pub const CompilerBackend = enum(u64) {
/// It is allowed for a compiler implementation to not reveal its identity,
/// in which case this value is appropriate. Be cool and make sure your
/// code supports `other` Zig compilers!
other = 0,
/// The original Zig compiler created in 2015 by Andrew Kelley. Implemented
/// in C++. Used LLVM. Deleted from the ZSF ziglang/zig codebase on
/// December 6th, 2022.
stage1 = 1,
/// The reference implementation self-hosted compiler of Zig, using the
/// LLVM backend.
stage2_llvm = 2,
/// The reference implementation self-hosted compiler of Zig, using the
/// backend that generates C source code.
/// Note that one can observe whether the compilation will output C code
/// directly with `object_format` value rather than the `compiler_backend` value.
stage2_c = 3,
/// The reference implementation self-hosted compiler of Zig, using the
/// WebAssembly backend.
stage2_wasm = 4,
/// The reference implementation self-hosted compiler of Zig, using the
/// arm backend.
stage2_arm = 5,
/// The reference implementation self-hosted compiler of Zig, using the
/// x86_64 backend.
stage2_x86_64 = 6,
/// The reference implementation self-hosted compiler of Zig, using the
/// aarch64 backend.
stage2_aarch64 = 7,
/// The reference implementation self-hosted compiler of Zig, using the
/// x86 backend.
stage2_x86 = 8,
/// The reference implementation self-hosted compiler of Zig, using the
/// riscv64 backend.
stage2_riscv64 = 9,
/// The reference implementation self-hosted compiler of Zig, using the
/// sparc64 backend.
stage2_sparc64 = 10,
/// The reference implementation self-hosted compiler of Zig, using the
/// spirv backend.
stage2_spirv64 = 11,
_,
};
/// This function type is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const TestFn = struct {
name: []const u8,
func: *const fn () anyerror!void,
async_frame_size: ?usize,
};
/// This function type is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const PanicFn = fn ([]const u8, ?*StackTrace, ?usize) noreturn;
/// This function is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const panic: PanicFn = if (@hasDecl(root, "panic"))
root.panic
else if (@hasDecl(root, "os") and @hasDecl(root.os, "panic"))
root.os.panic
else
default_panic;
/// This function is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr: ?usize) noreturn {
@setCold(true);
// For backends that cannot handle the language features depended on by the
// default panic handler, we have a simpler panic handler:
if (builtin.zig_backend == .stage2_wasm or
builtin.zig_backend == .stage2_arm or
builtin.zig_backend == .stage2_aarch64 or
builtin.zig_backend == .stage2_x86_64 or
builtin.zig_backend == .stage2_x86 or
builtin.zig_backend == .stage2_riscv64 or
builtin.zig_backend == .stage2_sparc64 or
builtin.zig_backend == .stage2_spirv64)
{
while (true) {
@breakpoint();
}
}
switch (builtin.os.tag) {
.freestanding => {
while (true) {
@breakpoint();
}
},
.wasi => {
std.debug.print("{s}", .{msg});
std.os.abort();
},
.uefi => {
const uefi = std.os.uefi;
const ExitData = struct {
pub fn create_exit_data(exit_msg: []const u8, exit_size: *usize) ![*:0]u16 {
// Need boot services for pool allocation
if (uefi.system_table.boot_services == null) {
return error.BootServicesUnavailable;
}
// ExitData buffer must be allocated using boot_services.allocatePool
var utf16: []u16 = try uefi.raw_pool_allocator.alloc(u16, 256);
errdefer uefi.raw_pool_allocator.free(utf16);
if (exit_msg.len > 255) {
return error.MessageTooLong;
}
var fmt: [256]u8 = undefined;
var slice = try std.fmt.bufPrint(&fmt, "\r\nerr: {s}\r\n", .{exit_msg});
var len = try std.unicode.utf8ToUtf16Le(utf16, slice);
utf16[len] = 0;
exit_size.* = 256;
return @as([*:0]u16, @ptrCast(utf16.ptr));
}
};
var exit_size: usize = 0;
var exit_data = ExitData.create_exit_data(msg, &exit_size) catch null;
if (exit_data) |data| {
if (uefi.system_table.std_err) |out| {
_ = out.setAttribute(uefi.protocols.SimpleTextOutputProtocol.red);
_ = out.outputString(data);
_ = out.setAttribute(uefi.protocols.SimpleTextOutputProtocol.white);
}
}
if (uefi.system_table.boot_services) |bs| {
_ = bs.exit(uefi.handle, .Aborted, exit_size, exit_data);
}
// Didn't have boot_services, just fallback to whatever.
std.os.abort();
},
.cuda, .amdhsa => std.os.abort(),
else => {
const first_trace_addr = ret_addr orelse @returnAddress();
std.debug.panicImpl(error_return_trace, first_trace_addr, msg);
},
}
}
pub fn checkNonScalarSentinel(expected: anytype, actual: @TypeOf(expected)) void {
if (!std.meta.eql(expected, actual)) {
panicSentinelMismatch(expected, actual);
}
}
pub fn panicSentinelMismatch(expected: anytype, actual: @TypeOf(expected)) noreturn {
@setCold(true);
std.debug.panicExtra(null, @returnAddress(), "sentinel mismatch: expected {any}, found {any}", .{ expected, actual });
}
pub fn panicUnwrapError(st: ?*StackTrace, err: anyerror) noreturn {
@setCold(true);
std.debug.panicExtra(st, @returnAddress(), "attempt to unwrap error: {s}", .{@errorName(err)});
}
pub fn panicOutOfBounds(index: usize, len: usize) noreturn {
@setCold(true);
std.debug.panicExtra(null, @returnAddress(), "index out of bounds: index {d}, len {d}", .{ index, len });
}
pub fn panicStartGreaterThanEnd(start: usize, end: usize) noreturn {
@setCold(true);
std.debug.panicExtra(null, @returnAddress(), "start index {d} is larger than end index {d}", .{ start, end });
}
pub fn panicInactiveUnionField(active: anytype, wanted: @TypeOf(active)) noreturn {
@setCold(true);
std.debug.panicExtra(null, @returnAddress(), "access of union field '{s}' while field '{s}' is active", .{ @tagName(wanted), @tagName(active) });
}
pub const panic_messages = struct {
pub const unreach = "reached unreachable code";
pub const unwrap_null = "attempt to use null value";
pub const cast_to_null = "cast causes pointer to be null";
pub const incorrect_alignment = "incorrect alignment";
pub const invalid_error_code = "invalid error code";
pub const cast_truncated_data = "integer cast truncated bits";
pub const negative_to_unsigned = "attempt to cast negative value to unsigned integer";
pub const integer_overflow = "integer overflow";
pub const shl_overflow = "left shift overflowed bits";
pub const shr_overflow = "right shift overflowed bits";
pub const divide_by_zero = "division by zero";
pub const exact_division_remainder = "exact division produced remainder";
pub const inactive_union_field = "access of inactive union field";
pub const integer_part_out_of_bounds = "integer part of floating point value out of bounds";
pub const corrupt_switch = "switch on corrupt value";
pub const shift_rhs_too_big = "shift amount is greater than the type size";
pub const invalid_enum_value = "invalid enum value";
pub const sentinel_mismatch = "sentinel mismatch";
pub const unwrap_error = "attempt to unwrap error";
pub const index_out_of_bounds = "index out of bounds";
pub const start_index_greater_than_end = "start index is larger than end index";
pub const for_len_mismatch = "for loop over objects with non-equal lengths";
pub const memcpy_len_mismatch = "@memcpy arguments have non-equal lengths";
pub const memcpy_alias = "@memcpy arguments alias";
pub const noreturn_returned = "'noreturn' function returned";
};
pub noinline fn returnError(st: *StackTrace) void {
@setCold(true);
@setRuntimeSafety(false);
addErrRetTraceAddr(st, @returnAddress());
}
pub inline fn addErrRetTraceAddr(st: *StackTrace, addr: usize) void {
if (st.index < st.instruction_addresses.len)
st.instruction_addresses[st.index] = addr;
st.index += 1;
}
const std = @import("std.zig");
const root = @import("root");


Interstellar and Intra-Galactic Medium, Dust¶
Mily Way dust extinction map¶
Maps¶
-
Schlegel, Finkbeiner & Davis (see 1998 reference below) derived an all-sky map of Galactic reddening, E(B-V), from a composite 100 micron map formed from IRAS/ISSA maps calibrated using DIRBE observations.
3D Dust Mapping with Pan-STARRS 1, 2MASS and Gaia
These dust maps are based on Pan-STARRS 1 photometry of 800 million stars, 2MASS photometry of 200 million stars, and Gaia parallaxes of 500 million stars.
Green et al. 2016 - A Three-Dimensional Map of Milky-Way Dust
Green et al. 2019 - High-Galactic-latitude 2D dust map using Gaussian Processes
Tools¶
-
By Gregory Green. Including multiple dust maps.
mwdust - Dust in 3D in the Milky Way
By Jo Bovy. Including multiple dust maps.
dust_extinction - Astronomical Dust Extinction
This package provides astronomical interstellar dust extinction curves implemented using the astropy.modeling framework.
Interstellar Dust Model¶
THEMIS - The Heterogeneous dust Evolution Model for Interstellar Solids
SHIVA - a numerical tool for evolution of dust in the ISM
SHIVA simulates the dust destruction in warm neutral, warm ionized, and hot ionized media under the influence of photo-processing, sputtering, and shattering. Based on this work


species climate change diversity beta anuran richness CER expected future areas different distribution conservation suitable values baseline scenarios Atlantic climatically high nestedness {border-style area predicted time (e.g., px;} #ffffff;} Brazilian Forest grid occurrence patterns (Figure Climate Vasconcelos, anurans climatic predictions Cerrado (i.e., Haddad, and/or based current generated biodiversity component decrease higher main northeastern range regions replacement ./j.-...x ENMs hotspots mean region CER, Ecology LCBD changes composition impacts present records use Araújo, alpha cell community components considered dissimilarity effects gains geographic loss losses modeling new presumed scenarios, turnover American Brazil Ecological Figure Global Prado, South Vasconcelos amphibians compared data grids hotspot increase model performed px; species, used {font-family Bjac Ecography, Loyola, Silva, available calibration climate, font-size generate gradients index local prediction rates similar suitability variables Biodiversity CER) Legendre, Lemes, Loyola Nascimento, Physalaemus Research Then, Therefore, Thuiller, Universidade cells considering double; gain having metrics niche precipitation predictions, ranges sites southeastern spatial structure total −., (Vasconcelos (a) (b) (see AF, Alexandrino, Cheung, Conservation, Ecology, Evolution, Graham, Legendre Melanophryniscus Molinos Species border-color border-width cause change. documented ensemble evaluate framework given global impact importance levels mainly maps methods models order overlap potential predictive projected random solid; species’ specific using value {font-style {font-weight (Araújo (model ./journal.pone. AF) Biogeography, Bokermannohyla Change Ciências Estadual Geographic Hawkins, Jaccard Letters, Martins, Melo, ONE, Pearson, Peterson, Provete, Rodríguez, Rossa‐Feres, Science, TSV approach baseline, binary bold central communities courier; em; endemic fact hotspot. hotspots, important information led lose lower macroecological map means pattern procedure pt;} regarding representing results scenarios. slice slices southeastern/southwestern southern species. statistic status study taxa temperature tendency threatened wide


Hierarch Kekropus:
You are in the midst of conversing through the Statue of History? Oh my! Why are you here? Hurry back to the Statue!


{% block head-meta %}
{% endblock %}
{% load static %}
{% load render_table from django_tables2 %}
Filter by age: less than
Filter by age: greater than
Filter by Strain
If you have a mice strain that is not listed here please email<EMAIL_ADDRESS>| DOB | Age (days) | Strain | Genotype | Contact information |
|---|---|---|---|---|
| {{ paste.Age }} | {{ paste.Strain }} | {{ paste.Genotype }} | {{ paste.Contact }} | Click here to access entry | {% endfor %}


Field of View (FOV), also known as the View Frustum, is the space that a camera can see.
For example, if something is behind a camera in virtual space, it won't show up on the screen, so trying to render it would be a waste of resources.
View Frustum is esentially the fancy jargon for the pyramid that represents the field of view.
All view frustums have at least 4 planes:
Top, Bottom, Left, and Right.
Most also have a Front and Back plane.
We can implement FOV into a graphics engine by defining it as the angle between the Left and Right view planes.
Then, the angle between the Top and Bottom planes can be extrapolated from the user's monitor resolution.
Using these angles and the location of the camera, we can find the location and orientation of all the view planes.
Jargon again. Frustum Culling is the process of removing things from the rendering queue.
This means that things behind or too far to the side of the camera aren't going to be rendered.
These things won't show up on the screen anyway, so removing them from the render queue speeds up rendering significantly.
Equations are explained below
Essentially, we want to find if an object is completely 'under' one side of the plane.
To do this, we need to find if it's distance to the plane, c, is negative.
However, as shown to the right, some objects may still be in view, but c is negative.
This happens when c is less than 0 and the radius, r, is greater than c.
So in actuallity, whe need to find when: r + c is less than 0.
This next part includes Vector math, if you are not familliar with it please click Here.
For the object, we have p, the position vector of the object and r, the radius (maximum distance of any 'corner' from its center).
For the plane, we have n, the normal (perpendicular) vector to the plane and d, its closest displacement to the origin (0,0,0).
(It is recommended to define planes in this way)
Since n is a unit vector, if we dot product n and p, we get e, the distance of the object to (0,0,0) that is perpendicular to the plane.
e = n * p
e = c - d
Rearrange to: c = e + d | Subsitute: c = n * p + d
Remember that we are checking for: c + r < 0
So the final equation is: n * p + d + c < 0
if(n * p + d + c < 0) cullThisObject();


Footage Of The 1993 Sonic The Hedgehog Macy's Parade Disaster Finally Surfaces Online
Gotta go... into a lamppost
by Ryan CraddockBack in 1993, during that year's annual Macy's Thanksgiving Day Parade, a Sonic the Hedgehog float was damaged thanks to high winds and ended up injuring two people as a result. Strangely, footage of the incident has been practically impossible to come by - until now.
As reported by Kotaku, reports of the crash up until this point have used still photographs of the float or videos of it lying on the ground after the incident. You'd think someone would have captured the event on film though, right?
Well, ABC7NY has now shared archive footage of the 1997 Macy’s Parade, where a Cat in the Hat float also injured four people. It's only shown for the briefest of moments, but tucked away inside the video is a short clip of Sonic's face bursting on a lamppost before falling to the floor in the 1993 parade. Thankfully, the child and police officer who suffered injuries as a result were OK.
You can see it all take place from around the 1:37 mark:
Floats at this year's Macy's Parade survived without too many hiccups, apart from a Ronald McDonald balloon which was blown into a tree before slowly deflating more and more as it was dragged around the streets.
[via kotaku.com]


Use search constraints to find previous and ongoing labor violation cases, along with the accused company, specified labor violation, and the location of the case.
Company name: Case number: State: Region:


Please input your information....
This is your policy number. Please keep it safe, it's very important!
To submit a claim please upload the necessary documentation and enter your key
Your claim is being processed. There is a 30 day verification period before funds will be released into your account.
Your funds have been released. Please check your email.


Burkina Faso leader expresses shock after attack on Montreal-based mining company
by The Associated Press, StaffOUAGADOUGOU, Burkina Faso -- Burkina Faso's prime minister says his county is in shock following the attack by gunmen which killed at least 37 employees travelling to a Canadian-owned mine.
Prime Minister Christophe Dabire, in a tweet Thursday, said the West African country is still reeling from the news of the attack and sent his condolences to the families of those killed.
The attack on Wednesday happened about 25 miles (40 kilometres) from the Boungou mine, owned Canada's Semafo company, in eastern Burkina Faso. The gunmen attacked a convoy of five buses carrying mine employees and which was accompanied by a military escort.
The area has become dangerous for Semafo, which operates two gold mines in Burkina Faso.


Displays a message at the top of current popup.
message(msgOptions);
Description
The popup must exists. There can be only one popup window on the screen at any given time. Occasionally, you need to display
a short message while popup still open. The message method allows you to do just that.
The method will slide an overlay at the top of the current popup.
The second argument msgOptions is a map
of properties as follows:
To display the message
Call it again to close the message


This menu command will allow you to create a resume that will be held on CIX Forums. This resume can contain anything that you would like to share with other users of CIX Forums. Note that this menu command will change to Edit My Resume once your resume has been created.


Let's start by playing a little game:
I'm ready!
You are seated in a circle with three other strangers.
A box of ice-cream sticks will be passed around your group of four players for exactly one round.
When you receive the box of sticks, you can take as little or as many sticks from the box, and pass it on to the next person.
After the box has been passed around to every player once, your sticks will be collected and counted.
As a group, if you have collected 7 sticks or less in total, no one will get a prize.
As a group, if you have collected at least 8 sticks in total, some players will qualify for a prize.
The person(s) with the least number of sticks will get a prize. The rest of the players will get nothing.
After each round, the number of winners from the round will be announced.
The same activity will be repeated for three rounds.
Take your ice cream sticks!
This modification to the mathematical strategic game Nim was designed to model USProvisions, an honour-based provision store selling snacks and drinks in Cinnamon College.
Just as how the system of USProvisions trusts consumers to pay the right amount of money without surveillance, Nim relies on participants contributing fairly in the absence of rule enforcement. There is a mutual understanding of what they can do to contribute to the system for communal benefit, as well as the possibility to ‘cheat’ the system for personal benefit. Participants also have no access to information on others’ actions, and have no explicit incentives to be considerate to others. Both settings are entirely dependent on the integrity of the participants in order to achieve an outcome that is desirable for all or themselves.
Through observing the way a player participates in Nim, our group aims to explore an individual’s motivation in paying in the honour system of USProvisions. The understanding of motivations amongst the residents who are potential consumers in USProvisions may translate to a better understanding of the reasons behind USProvisions’ loss and gains.
The next page presents the results and analysis of the data that we collected by playing the game with 13 groups of 4 players.
This analysis is divided into two sections.
The first section (“An Independent Round”) explores motivations behind participants taking a certain number of sticks in a single round.
The second section (“Responding to Multiple Rounds”) explores how participants react to the information given to them between rounds.
Players who took two sticks gave similar reasons for their decision:
It was common amongst players who took two sticks to admit that they sometimes overpay and sometimes underpay in USProvisions and believe that “it probably all evens out in the end”. These players are less likely to strictly keep track of how much they are taking and paying, but believe that they do not contribute to the loss of system in the end.
People who took less than two sticks are those who attempt to win by relying on others to be altruistic and take more than two sticks.
Most players are motivated by self-interest in making such a decision. Some reasons given were:
Some players who took less than two sticks share that they do not try to take advantage of USProvisions. One player shared that he would never overpay, and would choose to not buy anything at all if he does not have the exact change. Another player shared that he may just overpay if he does not have small change for the snacks, but admits that he may have forgotten to return to pay for snacks that he took from USProvisions.
The players who took more than two sticks willingly sacrifice their opportunity to win and support others in winning. The reasons they gave were:
As we drew parallels between the way players play Nim and pay for USProvisions, we realized that we were unintentionally viewing our game as a research method to better understand how individuals behave in a honour system. This is opposed to our initial idea of the game being an exploratory study that enables us to collect data to build a model for USProvisions.
In its broadest sense, ‘gamification’ refers to the use of game design elements in non-game contexts. [1] Within the context of our academic backgrounds, this was a rather unorthodox claim to make. Even then, we viewed this claim a little differently -- Yui Wei and Tham (from computing and engineering) viewed this project from the angle of how games can be used as a model for reality, while Shermaine (from sociology) was cautious about treating this as a ‘model’, as the equivocal and ambiguous language of sociology makes it difficult (if not impossible) to conceive of a ‘model’ in the sociological sense. We discuss both angles below showing the value of gamification in research from two different angles.
This ‘game’ was initially conceived as a way for us to sieve out factors that affect why people choose to pay (or not pay) in an honour system. These factors will then be translated into data through a quantitative survey, which can be used to build an Agent-Based Model (ABM). ABMs simulate the actions of an individual, and allow the researcher to simulate the impact of actions of an autonomous agent on a larger system, through his/her interactions with other agents.
Thus, when the game was designed, it was viewed as a life-sized computational ‘model’ for reality. A computational ‘model’ does the job of reducing a complex, real-life problem into logical relations that can be evaluated with computers. In this case, the inputs could be the number of players, their relationship with each other, or their belief in the value of an honour system; the output would be the number of sticks they draw in each round.
A simple problem pops up -- the ‘inputs’ cannot be objectively quantified, but only subjectively quantified by the players/researchers. However, from a computational perspective, this experiment can still be treated as a ‘model’, with limitations imposed due to the subjectivity of the quantitative data.
From a sociological research perspective, the difficulty in studying USProvisions lies in the very presence of the researcher being in the same space as the consumer, which postulates an influence of surveillance and peer pressure and thus a change in the way the consumer behaves. The gamification of USProvisions allows the researcher to study a phenomenon that cannot be studied in its natural setting – it alleviates the issue of reflexivity, removing unnecessary external influence on the subjects in an attempt to study and understand them. Using gamification to study USProvisions thus allows the researcher to better understand the genuine intentions of participants in a honour system without creating an impression that they are being monitored, regulated, or judged.
Abstracting this further, gamification allows researchers to study a phenomenon considering both the overall influence of a structure and the autonomy of the individual. It allows for objective observation of the success or failure of an honour system as well as the subjective perspective of the participants given in the interviews, which together give a fuller picture of how agents navigate the imposed structure of an honour system. In this specific study, gamification provides a way to study social actions and intentions that people can be sensitive to and are less likely to be open about. Placing an honour system in the less intense setting of a game removes the researchers’ power in their relationship with the subjects, reducing the presence of the researcher and creates a more comfortable environment for participants to express themselves.
However, considering this study to be a model for consumer behaviour in USProvisions would not be meaningful in a sociological sense, since a natural setting cannot be completely mimicked, and generalizing the study to the rest of the community would be undermining the personal and unique intentions of each individual who has a part to play in the system.
Tham is an Engineering Science major who specializes in Computational Engineering. He loves games and puzzles and spends a considerable chunk of his time designing real-life games to provoke thoughts.
Shermaine is a Sociology major who enjoys understanding the personal experiences and realities of all sorts of people. She is interested in the philosophy and ethics of social research.
Yui Wei is a Computer Science major who loves making things, especially when it comes to interactive media and games, and thinks that communication using models is far more interesting than modelling itself.


[gecode-users] help--trouble on using Gecode in VS2008
Filip Konvička
filip.konvicka at logis.cz
Thu Jul 30 16:07:46 CEST 2009
> definitely nope ;-) Thanks for telling, that's useful. Is that commonly known (this is one of the ugliest things I saw in a while...)?
Well, Microsoft has an article about this
http://support.microsoft.com/kb/143208
But that does not mean it is not ugly :-) But people use it now and
then. I wish there was a universal "#define ADHERE_TO_STANDARDS" flag
instead of this one... or better, if there was no need for one :-)
Cheers,
Filip
> Cheers
> Christian
>
> --
> Christian Schulte, www.ict.kth.se/~cschulte/
>
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Filip Konvicka
> Sent: Thursday, July 30, 2009 12:39 PM
> To: users at gecode.org
> Subject: Re: [gecode-users] help--trouble on using Gecode in VS2008
>
> Hi,
>
> you might not be aware of the NOMINMAX macro, which can be #defined
> before #including windows.h (maybe a good place to do it is in the
> project settings, or on the compiler command line). This prevents
> windows.h defining the min and max macros.
>
> HTH,
> Filip
>
>
>> Hi,
>>
>>
>>
>> I know that problem: unfortunately the windows headers you include
>> define the macros min and max (which is a bug in the windows headers).
>> What you should do is after including the windows headers files, add the
>> following:
>>
>>
>>
>> #ifdef min
>>
>> #undef min
>>
>> #endif
>>
>>
>>
>> #ifdef max
>>
>> #undef max
>>
>> #endif
>>
>>
>>
>> As you don’t tell us which version of Gecode you use (one should ALWAYS
>> do that) I can only suggest to have a look at gecode/support/thread.hh
>> in the latest version of Gecode (3.1.0). There at the very end you’ll
>> find that fix.
>>
>>
>>
>> Cheers
>>
>> Christian
>>
>>
>>
>>
>>
>> *From:* users-bounces at gecode.org
>> [mailto:users-bounces at gecode.org] *On
>> Behalf Of *Sir Yao
>> *Sent:* Tuesday, July 28, 2009 10:43 AM
>> *To:* users at gecode.org
>> *Subject:* [gecode-users] help--trouble on using Gecode in VS2008
>>
>>
>>
>> hello all，
>>
>> As a beginner using Gecode, i faced a problem. i want you do
>> me a favor.
>>
>> My tools are VS2008, and i can succeed to compile and run
>> examples which are supplied by Gecode on VS2008 . These are all Win32
>> console application. But when i develop a MFC application using Gecode,
>> there have many errors facing to me. Even i simply replanted one example
>> of Gecode ,for instance TSP, to MFC . Errors as follows:
>>
>> "
>>
>> d:\program files\gecode\include\gecode\iter\ranges-operations.hpp(94) :
>> warning C4003: not enough actual parameters for macro 'max'
>> d:\program files\gecode\include\gecode\iter\ranges-operations.hpp(94) :
>> warning C4003: not enough actual parameters for macro 'max'
>> d:\program files\gecode\include\gecode\iter\ranges-operations.hpp(109) :
>> warning C4003: not enough actual parameters for macro 'max'
>> d:\program files\gecode\include\gecode\iter\ranges-operations.hpp(109) :
>> warning C4003: not enough actual parameters for macro 'min'
>>
>> ……
>>
>> d:\program files\gecode\include\gecode\iter\ranges-minmax.hpp(79) :
>> error C2062: type 'void' unexpected
>>
>> d:\program files\gecode\include\gecode\iter\ranges-minmax.hpp(77) :
>> error C2062: type 'void' unexpected
>>
>> "
>>
>>
>>
>> I foud places where make into mistakes are
>>
>> " return std::numeric_limits<size_type>::max() / "
>>
>> " int min(void) const; "
>>
>>
>>
>> I make sure that configures in the properties dialog of my
>> solution are set successfully. I have a suspicion that perhaps it need
>> some library for using Gecode in MFC. I found "The Gecode Interactive
>> Search Tool (Gist) is a graphical search engine for Gecode, built on top
>> of the Qt GUI toolkit <http://trolltech.com/products/qt>." in the manual
>> of Gecode. Does it have some relations with my trouble? who know the
>> reason ?
>>
>> Thanks for all the people who look at my email.
>>
>>
>> kayler
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
More information about the gecode-users
mailing list


Documentation:
How to set up SublimeCSS:
You can either click the "Download" link at the top of the page to download SublimeCSS, or you can simply link to it in the head of your document with the link shown at the top of the page. If you do choose to download it, then unzip the download and move the SublimeCSS folder into your current project.
How does SublimeCSS work?
To use SublimeCSS, simply apply the appropriate class to an element, and SublimeCSS will work it's magic!
What classes are available?
Here is a compleate list of classes for V0.1. If you downloaded an older version, please head over to the "README.md" file supplied with your download. Note: SublimeCSS is forward compatible, so all older versions will always be supported, but may have less capability.
Grid system:
sublime-gridRow creates a row for grids that can contain grid elements.
sublime-grid-*-15 creates a column, where * is a number from 1 to 15.
For example, sublime-grid-3-15 is a grid column that is 3/15ths the width of the screen.
Note: all grids must be placed inside a sublime-gridRow div to function. Grids are designed to work with Div elements.
Create responsive grids using media querys: for example, these documentation boxes are 5-15 on screens above md(medium), and 15-15 on smaller screens. The classes used are "sublime-grid-5-15 sublime-grid-md-15-15".
Button system:
Buttons are very simple in SublimeCSS. Simply create an anchor elememt and apply the apropriate class. The options are:
- sublime-greyBtn -- a grey button
- sublime-yesBtn -- an affirmitive button
- sublime-noBtn -- a negitive button
- sublime-warningBtn -- an alarming button


We strongly believe that communication and accurate information
are very important. No matter if there are good or bad news - you're
up-to-date with everything. You can always call us or talk to us via
dedicated Slack room which will be created for your project.
As we work in agile methodologies, our development process is
very simple and well defined - Backlog Refinements, Sprint Review,
Planning, regular meetings.
You have full access to both JIRA (Project Management system)
and GIT Repos all the time. You can measure our progress on a
daily basis - we want to be 100% clear with all we do.


Calendar
Dozens of reusable components built to provide buttons, alerts, popovers, and more.
@@include('./_head.html', { "path": "..", "title": "Volt Bootstrap Dashboard - Calendar" })
@@if (environment === 'production') { @@include('./_analytics_body.html') } @@include('./dashboard/_nav.html', { "path": ".." }) @@include('./dashboard/_sidenav.html', { "path": "..", "page": "calendar" })Dozens of reusable components built to provide buttons, alerts, popovers, and more.


Berlin’s not known to be a disco city. Good disco nights are few and far between. A really good one is Hot Pony at Sameheads, a fantastic little sweatbox in Neukoelln put on by Timmy Lee and Antoni Maiovvi who also run the label, Royal Athlete.
It’s a proper party. An all-out, arms-in-the air, Hi-NRG assault, all sweat and tears. After we’d been living in Berlin a few months and frequenting their parties, we were invited to play. It was our first DJ gig in Berlin and we had a litrle bit of time to prepare, so we ended up making some music for the sole purpose of playing those productions out at the night – Tender was the best of the bunch we made.
Lyrically disarming and full of regret; instrumentally, polished and primal. Pumped with adrenaline and nerves, we arrived early and played it during a soundcheck at the club. Timmy loved it, and snapped it up for his label Royal Athlete there and then. The rest, as they say, is history.


See also
Objects Wand provides are resources to be managed. It has to be closed (destroyed) after using like file or database connection. You can deal with it using with very easily and explicitly:
with Image(filename='') as img:
# deal with img...
Or you can call its destroy() (or close() if it is an Image instance) method manually:
try:
img = Image(filename='')
# deal with img...
finally:
img.destroy()
Note
It also implements the destructor that invokes destroy(), and if your program runs on CPython (which does reference counting instead of ordinary garbage collection) most of resources are automatically deallocated.
However it’s just depending on CPython’s implementation detail of memory management, so it’s not a good idea. If your program runs on PyPy (which implements garbage collector) for example, invocation time of destructors is not determined, so the program would be broken.


JavaScript disabled?
This site will not work without JavaScript. Please disable any extensions blocking JavaScript for this site.
Click here for details of how to turn on JavaScript in your browser.
Use the source Luke
Loading. Please wait...


In this project we looked at cel shading: how it's done and how we can modify it, but we also looked at other graphical effects as well. We chose this topic because all the members in our group liked games and cartoons that used the effect. In this project we first implemented cel shading by modifying part 5 of project 3-2. We performed cel shading by computing the diffuse lightning and then clamped the lightining to cut-offs,resulting in a select number of colors. We then used Unity to create an interactive cel-shaded image with sliders that changed thresholds in the shader, resulting in different images. We also used three.js to implement edge detection and silhouetting, an important component to cel-shading. Silhouetting was achieved using sobel filtering. Edge detection was implemented in three iterations: 1. Silhouetting, 2. Normals-clamping, and 3. Sobel Filter Mapping. We additionally implemented some basic alternatives to shadowing and speculars in cel-shading format, and graftals.
To make the demo we decided to use Unity because we couldn't get custom models to be properly cel shaded. The first major step was to learn how to use Unity. After learning the basics of Unity, we write the shader and apply it to a model in the scene. For the shader we calculate the dot product of the surface normal and the light direction. We then check to see which threshold the dot product falls into and calculate the color with a itensity value that we assign to each bucket.
float _Cut1 = .95; float _Cut2 = .75; float _Cut3 = .25; half4 LightingCel(SurfaceOutput s, half3 lightDir, half atten) { half NdotL = dot(s.Normal, lightDir); float intensity1 = 1.0; // intensity of most intense section float intensity2 = 0.75; float intensity3 = 0.5; float intensity4 = 0.05; // intensity of least intense section float val; if (NdotL > _Cut1) val = intensity1; else if (NdotL > _Cut2) val = intensity2; else if (NdotL > _Cut3) val = intensity3; else val = intensity4; half4 c; c.rgb = s.Albedo * _LightColor0.rgb * (val * atten * 2); c.a = s.Alpha; return c; }
We add sliders to our scene in Unity that allow us to directly mutate values inside
of shaders. In this case, the sliders affect the values _Cut1, _Cut2, _Cut3
.By changing
these variables, the resulting image looks different. We do
this by adding a script component to each game object that we want to see changes on. We then add
the script to each slider so that when a slider's value is changed, the slider's value is passed into
the script and the corresponding cut number is changed.
public class SetCut : MonoBehaviour { public void changeValue1(float newCut1) { this.GetComponent().material.SetFloat("_Cut1", newCut1); } public void changeValue2(float newCut2) { this.GetComponent ().material.SetFloat("_Cut2", newCut2); } public void changeValue3(float newCut3) { this.GetComponent ().material.SetFloat("_Cut3", newCut3); } }
A key component in getting that cartoon feel with cel-shading is outlining. The edge outline we did in Unity
was done with a camera effect that shipped with Unity. To show how edge detection and outlining are done, we used
Sobel Filtering using three.js.
Edge detection was attempted in three iterations:
1. Silhouette shading, in which we simply overlay a slightly-enlarged mesh of the original object, mask it, and then apply a contrasting color. While this proves
effective for an outline, it does not capture internal edges, cross-overs, etc. To overcome this, use other methods:
2. Normal Clamping. Here, the view vector is crossed with the normals of the face in the
fragment shader; and, given a certain threshold, say t=0.95, the magnitude of the cross is calculated to see if
the face is perpendicular to the view. In this sense, if the face is perpendicular, then it is safe to say it will
be viewed as an "edge" in the camera space, and thus should be highlighted a different color. This works for high thresholds, but fails for large planes perpendicular to the view vector, and also has unappealing behavior at lower thresholds to generate thicker lines.
3. Sobel filtering was another alternative, especially for objects with textures. Sobel filtering itself detects gradients, or C1 discontinuities / large changes; as such, it can detect naively a certain degree of edge behavior on textures. The output must also be clamped to preserve cel shading behavior, and also needs to be inverted (sobel filters will output edges as white, and surfaces as black, and is not as useful for making black outlines). Saito and Takahashi also recommend detection of C1 discontinuties to better detect against large changes in C1 as opposed to discontinuities.
As an addendum, many alternative edge detection / stylization mechanisms were not operable in the standard THREE.js method, as they require edge traversal and edge objects themselves; a half-edge mesh would be more appropriate, but necessary accomodations for vertex-fragment shaders would be necessary. Saito and Takahashi also have better protections against mis-detection, but require a buffer as it needs to calculate gradients of all neighboring vertices, which would potentially be expensive without any form of caching, etc.
In our proposal and in our milestone presentation we mentioned that we wanted to apply cel-shading to colloids such as smoke and clouds. Ultimately this was too difficult given the time limitations that we had. Other groups did smoke and cloud simulation as their final projects and didn't even have to consider shading them in a non-photorealistic manner. We did create an alternative to actually cel-shading colloids. We took inspiration from the smoke and cloud effects from Legend of Zelda: Wind Waker where multiple 2D toon cloud and smoke "puffs" are emitted. The 2D puff images are also billboarded so that they always appear "full" without making them look two dimensional.
We start with a particle emitter, a GameObject given to us through base Unity. We then create a smoke puff texture. In this case, we just created a smoke puff .png file with a transparent background using Photoshop. We change the texture of the particles in the emitter to the newly created texture. We set the "Size over Lifetime" property of each the puffs so that they grow over time. This simulates smoke spreading out as it travels away from the source. We also set "Color over Lifetime" so that the smoke starts darkest closest to the source and becomes lighter and eventually transparent.
As greater exploration into Non-photorealistic rendering techniques, two extra concepts were explored: 1) Graftals, which are simply randomly-added mesh patterns onto a base object to produce patterns, and 2) Billboarded Shadows.
Graftals should be akin to feathers or other textures, which have view-dependent behavior, with larger sizes as their faces are perpendicular to the view vector, and shrinking, or diminished behavior when parallel. Thus, it should accentuate the edge texture to emphasize outlines, while not being too busy in the actual object itself.
Billboarded Shadows are a quick way of implementing cast shadows, especially when it is difficult to get shaded materials to receive shadows. They simply calculate expanding quads whose bounding rays originate from the light source and point towards the ends of the bounding box of the mesh, extending backwards into the distance. This can be an excellent approximation for small particles, even with rough edges and constant opacity.
An extension to the idea of view-dependent billboards is view-dependent meshes that interpolate between key meshes. This ties in closely with the animation idea of "staging", in which viewing the scene or object should accentuate the key features, and even if realistically rotating an object, for example, will produce strange silhouettes, it would be necessary to alter the mesh to better highlight all its features. The key challenges would actually be having keys for the mesh, almost like blend-shapes, and having a simple method of interpolation, that goes beyond the abilities of THREE.js.
A cel-shaded Ivysaur in Unity. We have included sliders that affect the cut-off threshold values in the shader file. Changing slider values results in the model looking different ways. This GUI allows for the user to see different artistic results and allows the user to get the proper values for the art style that they were envisioning.
A teapot shaded using three.js. The teapot is cel shaded and also has edge detection and silhouetting. The silhouetting was achieved using sobel filtering using the methods descibed above. On the bottom left, we can see sobel filtering silhouetting. On the bottom right we can see "slimy" effect of using silhouette shading and normal clamping.
As mentioned above, instead of implementing smoke simulation and cel-shading it, we created an alternative. This way we get a toon smoke effect without actually needing to create a cel-shaded smoke simulation.
http://rbwhitaker.wikidot.com/toon-shader
Real-Time Rendering of Cartoon Smoke and Clouds
GOOCH, B., AND GOOCH, A. 2001. Non-photorealistic rendering. AK Peters, Natick, MA
Saito and Takahashi. 1990. Comprehensible Rendering of 3-D Shapes.


--- date: 2012-12-21T00:00:00Z published: true title: It's cool when Clinton proposes it. url: /2012/12/21/it-s-cool-when-clinton-proposes-it-/ ---
"These districts are bringing school nurses and counselors together to respond to warning signs like depression or bullying," Clinton said. "They are improving classroom security and expanding after-school and mentoring programs."
Clinton also unveiled the $60-million fifth round of funding for "COPS in School," a Justice Department program that helps pay the costs of placing police officers in schools to help make them safer for students and teachers. The money will be used to provide 452 officers in schools in more than 220 communities.
"Already, it has placed 2,200 officers in more than 1,000 communities across our nation, where they are heightening school safety as well as coaching sports and acting as mentors and mediators for kids in need," Clinton said.


Player 1: X
Player 2: O
Player 1 goes first.
Player 2 goes first.
Player 1 wins.
Player 2 wins.
It's a draw.


Shcherbakova leads short program at Cup of China
by The Associated PressCHONGQING, China (AP) — Anna Shcherbakova took the lead in the short program at the Cup of China on Friday.
The 15-year-old Russian, who is looking to win her second Grand Prix of the season following victory at last month’s Skate America, landed a triple lutz-triple loop combination for a personal-best 73.51 points.
Satoko Miyahara of Japan was second with 68.91 points, while Amber Glenn of the United States was third with 67.69 ahead of Saturday’s free skate.
Russian ice dancers Victoria Sinitsina and Nikita Katsapalov were first in the rhythm dance with 85.39 points.
Madison Chock and Evan Bates were second for the United States, while Canadian pair Laurence Fournier Beaudry and Nikolaj Sorensen were third.
___
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports
The Associated Press


|
This is a built-in template used for replace string concatenation (e.g. String s = "Hello " + name;)
with internationalized Java code expression,
e.g. String s = MessageFormat.format(myResourceBundle.getString("hello.0"), name);. The template is editable. Along with Java expressions and comments, you can also use the predefined variables that will be then expanded into the corresponding values. |
| Predefined variables will take the following values: | |||
| Expression of type java.util.ResourceBundle, instance of which is available in this context | |||
| Property key name which is specified in the corresponding properties file. Typically it is the value that is used for ResourceBundle.getString() method parameter. | |||
| Property value which is specified in the corresponding properties file. This is an original Java string literal value. |


| Package | Description |
|---|---|
| com.hazelcast.client.nearcache |
Contains classes/interfaces related to com.hazelcast.client.nearcache
|
| com.hazelcast.client.proxy |
This package contains client side proxy implementations of the different Hazelcast data structures
and operation types
|
| com.hazelcast.core |
Provides core API interfaces/classes.
|
| com.hazelcast.executor.impl |
This package contains IExecutorService functionality for Hazelcast.
The IExecutorService extends the ExecutorService and provides all kinds
of additional methods related to distributed systems. |
| com.hazelcast.management |
Contains classes to provide data/operation interface for Management Center.
|
| com.hazelcast.monitor |
Contains Hazelcast statistics interfaces related to map, queue, topic, multimap, executor service etc.
|
| com.hazelcast.monitor.impl |
Contains Hazelcast statistics implementations related to map, queue, topic, multimap, executor service etc.
|
| com.hazelcast.multimap.impl |
Contains classes for Hazelcast MultiMap module.
|
| com.hazelcast.queue.impl |
This package contains the IQueue functionality.
The IQueue is the distributed version of the BlockingQueue . |
| com.hazelcast.queue.impl.proxy |
This package contains the IQueue proxies.
|
| com.hazelcast.replicatedmap.impl |
This package contains the implementation of the replicated map service itself and some connection interfaces only used
internally - No public API!
|
| com.hazelcast.topic.impl |
This package contains ITopic functionality for Hazelcast.
With the ITopic it is possible to create publish subscribe solutions similar to JMS Topics. |
| Class and Description |
|---|
| NearCacheStats |
| Class and Description |
|---|
| LocalExecutorStats |
| LocalMapStats
Local map statistics.
|
| LocalMultiMapStats |
| LocalQueueStats
Local queue statistics.
|
| LocalTopicStats |
| Class and Description |
|---|
| LocalExecutorStats |
| LocalMapStats
Local map statistics.
|
| LocalMultiMapStats |
| LocalQueueStats
Local queue statistics.
|
| LocalTopicStats |
| Class and Description |
|---|
| LocalExecutorStats |
| Class and Description |
|---|
| LocalMemoryStats |
| TimedMemberState |
| Class and Description |
|---|
| LocalCacheStats
Local cache statistics interface to be used
by
MemberState implementations. |
| LocalExecutorStats |
| LocalGCStats |
| LocalInstanceStats |
| LocalMapStats
Local map statistics.
|
| LocalMemoryStats |
| LocalMultiMapStats |
| LocalQueueStats
Local queue statistics.
|
| LocalTopicStats |
| MemberPartitionState
Partition related statistics
|
| NearCacheStats |
| TimedMemberState |
| Class and Description |
|---|
| LocalCacheStats
Local cache statistics interface to be used
by
MemberState implementations. |
| LocalExecutorStats |
| LocalGCStats |
| LocalInstanceStats |
| LocalMapStats
Local map statistics.
|
| LocalMemoryStats |
| LocalMultiMapStats |
| LocalQueueStats
Local queue statistics.
|
| LocalReplicatedMapStats |
| LocalTopicStats |
| MemberPartitionState
Partition related statistics
|
| MemberState |
| NearCacheStats |
| Class and Description |
|---|
| LocalMapStats
Local map statistics.
|
| LocalMultiMapStats |
| Class and Description |
|---|
| LocalQueueStats
Local queue statistics.
|
| Class and Description |
|---|
| LocalQueueStats
Local queue statistics.
|
| Class and Description |
|---|
| LocalReplicatedMapStats |
| Class and Description |
|---|
| LocalTopicStats |
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.


HTML (HyperText Markup Language) is the basic building blocks of the Web. It is how we define and structure web content.
CSS (Cascading Style Sheets) is a language that controls how webpages look. The browser applies CSS style to specified elements, which determines how a webpage is displayed.
If we were to use an analogy, like making a movie. The HTML would be the base script for the film, the CSS would be the costuming, set design and special effects and the director would be JavaScript deciding how the film is shot, performed and edited together.
Control flow and loopsControl flow is the order in which the computer performs and then executes code. Unless it comes across structures that change the flow such as loops. Loops in JavaScript are a simple and quick way to repeat a task until a specified result is reached.
Let’s use another analogy, you are working in a restaurant kitchen and are preparing a meal (steak and veggies). The control flow is the recipe you follow in order to make the dish. One loop would be when you begin cooking the steak. You will keep cooking the steak until it reaches the state the customer has requested, in this case medium rare.
What is the DOM?The DOM (Document Object Model) interacts with any HTML or XML document through your browser. It represents the document as a node tree, so every element, text or attribute are broken down into nodes at the end of a branch, essentially modularising the website. This then allows code running in your browser to easily read and interact with it, letting the user change and manipulate the document's structure, style and content.
What is the difference between accessing data from arrays vs objects?Objects are often used to represent a collection of related data, for example information about a person’s characteristics. These characteristics are called properties that consist of a key and a value i.e. age: 44,
Properties within objects can be accessed and changed by using dot or bracket notation.
Whereas Arrays are often used to store a list of multiple items within a single variable, such as a ordered collection of birthdates in a given month. The collection can then be accessed by their numerical position in the list, however Arrays use zero-based indexing, which means the first item in an array has an index of 0, while the second item has an index of 1, and so on.
What are functions? Why are they useful?A Function is a group of code that can be called on and reused to perform a specific task. When the functions name is called, the specified argument’s will be passed through the code stored between the functions brackets and a value may be returned. Functions are useful because it helps to reduce the need for duplicate code as you can use the same function on multiple value sets.


open class BaseCameraStreamer : EventHandler, IStreamer
Base class of CaptureStreamer: CameraTsFileStreamer or CameraSrtLiveStreamer Use this class, only if you want to implement a custom endpoint. |
|
class CameraSrtLiveStreamer : BaseCameraStreamer, ILiveStreamer
BaseCameraStreamer that sends audio/video frames to a remote device p, Secure Reliable Transport (SRT) Protocol. |
|
class CameraTsFileStreamer : BaseCameraStreamer, IFileStreamer
BaseCameraStreamer that sends audio/video frames to a File. |