| DOSE: T+ 0:00 |
50 mg |
smoked |
DMT |
(powder / crystals) |
| T+ 0:01 |
2 repeated |
inhaled |
Nitrous Oxide |
(gas) |
This report deals specifically with the smoked DMT/nitrous oxide combo and doesn’t get into discussion on the effects of each material taken alone. I’m going to assume the reader is duly experienced in that regard.
I was speaking to a friend who informed me that he had been mixing DMT with nitrous. He said that now he had tried the combo, he may never want to do DMT without nitrous again - it is simply, that, good. Naturally it ended up on the top of my “must try” list.
Being a bit nervous my first time, I had decided to take it slowly. However, my friend held the lighter up to the DMT pipe, and as I’m inhaling he’s saying, “Go! Go! Take it, take it! More, more, more, TAAAAKE IT!” I’m feeling unreasonably pressured, but respond by sucking in the largest lungful of DMT that I can manage and hold it in as my world slowly begins to dissolve.  I breathe in the nitrous as I feel the warm, oceanic shroud of DMT envelop me. I’m fighting off my nervous anxiety, but it quickly melts away as I slip into a thoroughly abstract psychedelic wonderland of indescribable complexity.
I was completely disembodied and flying through hyperspace in what amounted to a sort of mental orgasmic bliss. I sat upright, eyes closed, rocking back and forth with a smile from ear to ear, mumbling only the words “thank you” to my friend for encouraging me (pushing me?) to go in so far. There was no sense of fear, anxiety, discomfort … just an insane melee of colours and flashing lights. There is almost no point in trying to describe it … it’s like trying to describe the shape of a colour and the colour of a sound. As an alternative, I will try to highlight the differences over my experiences with DMT alone.
For lack of a better description, I find the nitrous smooths out the DMT experience considerably. Some of the more intense physical effects of the DMT are tempered, like the heaviness in the chest, the sometimes overwhelming rushy feel, the shortness of breath. These all seem to be rendered rather inconsequential with the addition of the nitrous. It’s hard to feel the body load when there is no real sense of having a body.
Visually it is more intense than DMT alone. The usual kaleidoscoping fractals, clown images and flashing lights explode in a fury of incomprehensible madness, as if moving into a fourth dimension. Sound, colour and shape become almost indistinguishable, blending together in perfect synethesia. If there are sounds in the room, I may hear them, but I may not be aware of what they are. While I like either silence or music with smoked DMT and find talking to be disruptive, I found the ambient noise to be less important with the nitrous. My giggling and chattering companions actually sounded (sounded?) fascinating to me.
Finally one of the more interesting effects from this combination is the tendency for the nitrous to prolong the effects of the DMT. The linear curve of the comedown was much longer, with visuals still being present up to a half hour later.
I’ve since tried this combo many times and find the materials to be remarkably synergistic. My experiments with others have resulted in fully positive results, with not a single person finding the experience to be anything short of wondrous.  I’m always very careful with my set and setting, and have a great deal of respect for these materials.
Yes … I just may never want to smoke DMT without nitrous again - it is simply, that, good.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


@* * Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0 * See accompanying LICENSE file. *@ @import scalaz.{\/} @(theMenu: Html, crumbs: IndexedSeq[models.navigation.BreadCrumbs.BreadCrumbRendered], errorOrSuccess: kafka.manager.ApiError \/ Any, actionTitle: String, successLink: models.FollowLink, errorLink: models.FollowLink) @link(followLink: FollowLink) = {


Use iterative hashing to protect stored passwords. The default configuration of the hashing process used with the latest versions of SAP is CODEVN H
, an iterative, salted hashing (SHA-1).
Storing hashes instead of plain-text passwords ensures that an attacker cannot easily recover the passwords if the storage tables are accessed. Adding salt to hashed files makes hashes much harder to break with dictionary attacks. Hashing should be applied multiple times (iteratively) to make hashing take longer and thus increase the computational resources required to attack the hashes. Iterative hashing applies a hashing function multiple times to a password and a salt, drastically increasing the time required to perform dictionary attacks.
If iterative hashing is not used for stored passwords, and the stored tables are compromised, the passwords can be easily broken with well-known tools. The result would be loss of customer and client trust, as well as the possible compromise or theft of other secret data.
So long as sufficient resources are available to the server systems, you should use the strongest settings for salt and iterations. In other words, go beyond the default algorithm settings for deeper security. As more computing power becomes available, however, it is necessary to use newer, stronger algorithms to mitigate brute force attacks. When a newer hashing algorithm becomes available, consider backward-compatibility, and implement the strongest method possible.
Review the referenced additional sources for additional background on SAP password hashing algorithms. The following steps describe the CODEVN H
hash and additional configuration which will affect its use.
Use the system-provided iterative hashing algorithm. The default algorithm is CODEVN H
. It supports these features:
iterations=1024
. Can be configured with any value in the range [1-4294967294].saltsize=96
. Length can be configured in the range [32-128] bits.Generate a random salt value. Each bit of salt doubles the memory and computational requirements for dictionary attacks. The default setting (saltsize=96
) can be increased. The system generates the random_salt
.
Combine the password and the salt. The system concatenates the password and the salt.
Hash the password and salt using multiple iterations. The system uses the specified iterative hashing algorithm to hash the password and salt as many times as specified by the setting for iterations
.
Store the hash and the salt. The system stores the hash in column PWDSALTEDHASH
in table USR02
. When comparing user-entered passwords to the hashed value, the system uses the stored salt and hashed value. The system also tracks the number of iterations used by the hashing algorithm.
Adjust profile parameters. The following have an impact on the hash algorithm:
login/password_charset
and login/password_downwards_compatibility
Implement password verification. During authentication the system checks the password entered by the user against the hashed and salted value. The system retrieves the hash value and the salt from password storage. User input is concatenated with the stored salt. The resulting string is hashed iteratively using the same amount of rounds as was used to calculate the stored hash. The system compares the resulting string against the stored hash. When these values are the same, the user has entered the correct password.


Theme
Various helper functions for the theming engine.
Summary
| Theme | Various helper functions for the theming engine. |
| Variables | |
| $title | The title for the current page. |
| Functions | |
| __construct | Loads the Twig parser into Theme, and sets up the theme l10n domain. |
| pages_list | Returns a simple array of list items to be used by the theme to generate a recursive array of pages. |
| get_last_linear_child | Gets the last linear child of a page. |
| recurse_pages | Prepares the pages into <Theme.$pages_flat>. |
| archive_list | Generates an array of all of the archives, by month. |
| file_exists | Returns whether the specified Twig file exists or not. |
| stylesheets | Outputs the default stylesheet links. |
| javascripts | Outputs the default JavaScript script references. |
| feeds | Outputs the Feed references. |
| current | Returns a singleton reference to the current class. |
__construct
private function __construct()
Loads the Twig parser into Theme, and sets up the theme l10n domain.


Submission for Global Game Jam 2023
The theme for this game jam was "Roots". As such my team created a infinite runner where you play as a tree with the goal of getting your your root as far into the ground as possible. I was responsible for creating the world generation system and object factories.
You can find the build and source of the project on the global game jam website here


Hack 98 Rotate Your Signature
End your email communications with a short
witticism.
We
all seem to know at least one geek
friend or mailing-list poster whose emails always end with a
different and humourous bit of random nonsense. You may be aware that
this is the work of her ~/.signature file, but
have you ever wondered how she manages to rotate those signatures?
While there are several utilities in the ports collection that will
randomize your signature, it is easy enough to roll your own
signature rotator using the fortune program and a
few lines of shell scripting.
9.11.1 If Your Mail Program Supports a Pipe
Your approach will vary slightly, depending on whether your
particular
mail user agent (MUA) supports
pipes. If it does, it's capable of interpreting the
contents of a file as command output, just like when you use a pipe
(|) on the command line.
I use pine,
which supports both static signature
files and signatures that come from the piped output of a signature
rotation program.
When configuring pine, choose
Setup from the main menu, then
C for the configuration editor. Find the
signature-file option and give it this value:
.signature |
The pipe character tells pine to process that
filename as a program instead of inserting its contents literally.
Also enable the
signature-at-bottom
option found in the Reply Preferences to ensure
your signature is placed at the bottom of your emails, even when
replying to an email.
Next, create a file called ~/.signature
containing these lines:
echo "Your random fortune:"
/usr/games/fortune -s
This isn't quite a shell script: I
don't have to include the
#!/bin/sh line or use chmod +x
to set the file as executable. However, pine will
execute those two lines whenever I compose or reply to an email,
adding something like this to the bottom of the email:
Your random fortune:
"Right now I'm having amnesia and deja vu at the same time."
-- Steven Wright
I also included the short switch (-s) to
fortune, as it's bad Netiquette
to end an email with a long signature.
If you try a few test messages, you'll see that
every email receives a different, random signature.
Depending upon your audience, you may wish to filter further the
fortunes to use as signatures. You'll find the
available fortunes in /usr/share/games/fortune.
If your friends are Trekkies, modify the fortune
line in your ~/.signature like so:
/usr/games/fortune -s startrek
If they tend to be cynical, try murphy instead.
9.11.2 Pipeless Signature Rotation
Some MUAs, such as Mozilla's mailer,
don't support pipes. You'll know
yours doesn't if your test message produces no
fortune. Fortunately, there's another option.
Create a file as before, but this time make it a Bourne script.
I'll save mine in ~/bin and
make it executable using chmod +x:
#!/bin/sh
echo "Your random fortune:" > $HOME/.signature
/usr/games/fortune -s >> $HOME/.signature
This script does two things. It echoes the first
line to the ~/.signature file, then appends the
results of the fortune program to the same file.
To configure
Mozilla to use this signature
file, open the Mail & Newsgroups window, and choose Mail &
Newsgroups Account Settings from the Edit menu. Select the
"Attach this signature" option from
the main menu, and use the Choose button to give the location of
~/.signature.
What do you think will happen when I compose an email? Since Mozilla
only understands literal signature files, it will faithfully
reproduce the current contents of ~/.signature.
If I haven't run my script yet, that file
doesn't exist. If I have run the script, the
resulting file remains the same until the script runs again.
This is different from pine, which has the
capability of executing the commands found in my signature file.
Since Mozilla can't, you'll have to
remember to run the script manually before you compose an email or
schedule its periodic execution using cron. This
may be a little disappointing if you want every recipient to receive
a unique signature, or not a big deal if you send only one or two
emails a day and aren't a stickler for randomness.
9.11.3 Hacking the Hack
Hmm, what would happen if .signature were a
named pipe connected to a program that provided a random signature on
every read? There are many possibilities
here.
9.11.4 See Also
|


HAE {border-style px;} #ffffff;} children patients C-INH-HAE edema C-INH age pediatric diagnosis inhibitor patient hereditary Clin Croatia angioedema treatment Hereditary abdominal University acute angioedema. Bork clinical px; {font-family Hospital family font-size procedures study testing type Allergy Immunol. Zagreb angioedema: disease double; facial laryngeal pain positive Acta Asympt Farkas affected body border-color border-width diagnosis, general management solid; swelling symptoms upper weight {font-style {font-weight (normal (type Abdominal Centre Complement Croatia. Plasma-derived Split airway attacks bold common consensus courier; deficiency em; established licensed normal onset order patients. performed precipitate pt;} recommended short-term subcutaneous triggering Šibenik


Your submitted form has been received.
I will try to respond as soon as possible.
This page will redirect in 5 seconds to my social profile.


In the JavaScript language, describe all the use cases for each of: parentheses ()
1. Execute a function e.g. var result = doSomething()
2. List the parameters specific to a function e.g. function(p1, ..., pN)
3. Control the structure for the following: if, for, and while loops.
Parentheses are used for grouping and containing expressions and parameters. Parentheses have multiple functions relating to functions and structures. They are used to contain a list of parameters passed to functions and control structures and they are used to group expressions to control the order of execution. Some functions have no parameters and in this case, the space between parentheses is blank.
brackets []
1. Used to specify a location within an array e.g. board.cells[2]
2. Used to create the contents of an array e.g. var myArray = ['goose', 'chicken', 'parrot'];
braces {}
1. Used when defining an object e.g. var myObject = {name: goose, age: 23};
2. Used to define the contents of a function e.g. function alpha () {}
single quotes ''
Can be used in the same cases as double quotes
1. Identify strings e.g. name = 'goose'
double quotes ""
Can be used in the same cases as single quotes
1. Identify strings e.g. var name = "goose"
semicolon ;
A statement terminator which separates elements of the program. A statement is a complete instruction to the computer and the semicolon is used to separate instructions (this is similar to the period "." in written English). Semicolons are also used to separate the different elements of a for structure.
1. Identify strings e.g. var name = "goose" example include -
int a; // Declaration statement
a = 30; // Assignment statement
println(i); // Function statement


Overview of the Criteria and Metamodel APIs
Similar to JPQL, the Criteria API is based on the abstract schema of persistent entities, their relationships, and embedded objects. The Criteria API operates on this abstract schema to allow developers to find, modify, and delete persistent entities by invoking Java Persistence API entity operations. The Metamodel API works in concert with the Criteria API to model persistent entity classes for Criteria queries.
The Criteria API and JPQL are closely related and are designed to allow similar operations in their queries. Developers familiar with JPQL syntax will find equivalent object-level operations in the Criteria API.
The following simple Criteria query returns all instances of the Pet entity in the data source:
EntityManager em = ...; CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<Pet> cq = cb.createQuery(Pet.class); Root<Pet> pet = cq.from(Pet.class); cq.select(pet); TypedQuery<Pet> q = em.createQuery(cq); List<Pet> allPets = q.getResultList();
The equivalent JPQL query is:
SELECT p FROM Pet p
This query demonstrates the basic steps to create a Criteria query:
Use an EntityManager instance to create a CriteriaBuilder object.
Create a query object by creating an instance of the CriteriaQuery interface. This query object's attributes will be modified with the details of the query.
Set the query root by calling the from method on the CriteriaQuery object.
Specify what the type of the query result will be by calling the select method of the CriteriaQuery object.
Prepare the query for execution by creating a TypedQuery<T> instance, specifying the type of the query result.
Execute the query by calling the getResultList method on the TypedQuery<T> object. Because this query returns a collection of entities, the result is stored in a List.
The tasks associated with each step are discussed in detail in this chapter.
To create a CriteriaBuilder instance, call the getCriteriaBuilder method on the EntityManager instance:
CriteriaBuilder cb = em.getCriteriaBuilder();
The query object is created by using the CriteriaBuilder instance:
CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
The query will return instances of the Pet entity, so the type of the query is specified when the CriteriaQuery object is created to create a typesafe query.
The FROM clause of the query is set, and the root of the query specified, by calling the from method of the query object:
Root<Pet> pet = cq.from(Pet.class);
The SELECT clause of the query is set by calling the select method of the query object and passing in the query root:
cq.select(pet);
The query object is now used to create a TypedQuery<T> object that can be executed against the data source. The modifications to the query object are captured to create a ready-to-execute query:
TypedQuery<Pet> q = em.createQuery(cq);
This typed query object is executed by calling its getResultList method, because this query will return multiple entity instances. The results are stored in a List<Pet> collection-valued object.
List<Pet> allPets = q.getResultList();


Liam is just a poor boy who used to be young, skinny and have a thick head of hair...
Now he has to scrape the barrel of life accepting jobs in Hollywood sequels.
17th June
Some say the date doesnt exist as im not sure anyone has ever attended liams bithday before!
Sunny Kent!
The very same Kent which shot to fame in late 2001 for pool partys at the Barrymores.
Remember to bring your pool towel!


Lexend is a collection of seven font families intended to improve reading proficiency. As prescription eyeglasses achieve proficiency for persons with short-sightedness, Lexend's families were developed using Shaver-Troup Formulations.
To contribute, see github.com/ThomasJockin/lexend. For more information, see thomasjockin.github.io/lexend


Paul Vines
Peter Henry
CSE512
This visualization allows you to explore the relationships between the artists in the
Million Song Dataset. Enter an artist name to begin.
- The visualization shows the artist selected and a selection of other artists categorized as similar by the Million Song Dataset creators, according to the EchoNest API. These artists are grouped into different decades based on when they made their music. The thin lines extending from the boxes represent the span of the artists career.
- By clicking on an artist you can remake the visualization for that artist.
- By hovering over an artist you can see more details, including links to songs selected from different times in their career.
- By default, the artists are retrieved and sorted according to EchoNext artist familiarity. You may alternately retrieve and sort artists according to EchoNest artist "hotttnesss" instead.


A heap is a binary tree in which every node is larger than the values associated with either child. A heap and a binary tree, for that matter, can be very efficiently stored in a vector, by placing the children of node i in positions 2 * i + 1 and 2 * i + 2.
Using this encoding, the largest value in the heap is always located in the initial position, and can therefore be very efficiently retrieved. In addition, efficient logarithmic algorithms exist that permit a new element to be added to a heap and the largest element removed from a heap. For these reasons, a heap is a natural representation for the priority queue datatype, described in Chapter 11.
The default operator is the less-than operator < appropriate to the element type. If desired, an alternative operator can be specified. For example, by using the greater-than operator >, one can construct a heap that locates the smallest element in the first location, instead of the largest.
The algorithm std::make_heap() takes a range, specified by random access iterators, and converts it into a heap. The number of steps required is a linear function of the number of elements in the range.
namespace std { void make_heap(RandomAccessIterator first, RandomAccessIterator last [, Compare ]); }
To add a new element to a heap, insert it at the end of a range using the std::push_back() member function of a vector or deque, for example, and invoke the algorithm std::push_heap(). The std::push_heap() algorithm restores the heap property, performing at most a logarithmic number of operations.
namespace std { void push_heap(RandomAccessIterator first, RandomAccessIterator last [, Compare ]); }
The algorithm std::pop_heap() swaps the first and final elements in a range, and restores to a heap the collection without the final element. The largest value of the original collection is therefore still available as the last element in the range. It can be accessed using the back() member function in a vector, for example, and removed using the pop_back() member function. At the same time, the remainder of the collection continues to have the heap property. The std::pop_heap() algorithm performs at most a logarithmic number of operations.
namespace std { void pop_heap(RandomAccessIterator first, RandomAccessIterator last [, Compare ]); }
Finally, the algorithm std::sort_heap() converts a heap into an ordered or sorted collection. Note that a sorted collection is still a heap, although the reverse is not the case.
NOTE -- An ordered collection is a heap, but a heap need not necessarily be an ordered collection. In fact, a heap can be constructed in a sequence much more quickly than the sequence can be sorted.
The sort is performed using approximately N log N operations, where N represents the number of elements in the range. The std::sort_heap() algorithm is not stable. Equal elements are not guaranteed to retain their relative pre-sort order.
namespace std { void sort_heap(RandomAccessIterator first, RandomAccessIterator last [, Compare ]); }
Here is an example program that illustrates the use of these functions:
void heap_example() // illustrates the use of the heap algorithms // see alg7.cpp for complete source code { // make a heap of 15 random integers std::vector<int> aVec(15); std::generate(aVec.begin(), aVec.end(), randomValue); std::make_heap(aVec.begin(), aVec.end()); std::cout << "Largest value " << aVec.front() << std::endl; // remove largest and reheap std::pop_heap(aVec.begin(), aVec.end()); aVec.pop_back(); // add a 97 to the heap aVec.push_back (97); std::push_heap(aVec.begin(), aVec.end()); // finally, make into a sorted collection std::sort_heap(aVec.begin(), aVec.end()); }


Q: My NcML aggregation sometimes gives me one result, and sometimes another. I run the same test twice in a row and get different results.
Many NcML aggregations pick a dataset, more or less at random, to be the prototype dataset for the aggregation, and assumes that all the other datasets have the same structural metadata. We call this the homogeneity requirement. So its likely that your datasets are failing that requirement.
Q: My datasets are homogeneous, but the time coordinate on my joinExisting aggregation is not correct.
Are the units of the time coordinate the same in each file? If not, you must add timeUnitsChange="true" on the aggregation element:
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
<aggregation dimName="time" type="joinExisting" timeUnitsChange="true">
<scan location="D:/test/aggExisting/" suffix=".grb2" />
</aggregation>
</netcdf>


Transforms your uncalibrated Machine Learning scores to well-calibrated prediction estimates that can be interpreted as probability estimates. The implemented BBQ (Bayes Binning in Quantiles) model is taken from Naeini (2015, ISBN:0-262-51129-0).
| Version: | 0.1.1 |
| Depends: | R (≥ 2.10.0) |
| Imports: | ggplot2, pROC, reshape2, parallel, foreach, stats, fitdistrplus, doParallel |
| Published: | 2018-08-27 |
| Author: | Johanna Schwarz |
| Maintainer: | Dominik Heider <heiderd at mathematik.uni-marburg.de> |
| License: | LGPL-3 |
| NeedsCompilation: | no |
| CRAN checks: | CalibratR results |
| Reference manual: | CalibratR.pdf |
| Package source: | CalibratR_0.1.1.tar.gz |
| Windows binaries: | r-devel: CalibratR_0.1.1.zip, r-release: CalibratR_0.1.1.zip, r-oldrel: CalibratR_0.1.1.zip |
| OS X binaries: | r-release: CalibratR_0.1.1.tgz, r-oldrel: CalibratR_0.1.1.tgz |
| Old sources: | CalibratR archive |
Please use the canonical form https://CRAN.R-project.org/package=CalibratR to link to this page.


Wed Dec 7, 2016
About that MacBook Pro I had my eye on. I couldn’t wait. As much as I appreciate all my iMac has done for me, I just couldn’t listen to the endless spinning and chirping of that dreadful hard drive for another year without going insane.
I’ll admit, I was hoodwinked at first by the narrative spun by a few entitled tech journalists. It had been two years since the MacBook Pro was last updated in early 2015. People were hungry for a new mac. That is why the general disappointment was all the more compounded when the new MacBook Pros were released recently.
Professionals bemoaned the lack of bleeding edge CPUs and a limit of 16GB of RAM, because they all of course need at least 32GB (dude, please). And recreational users (like me) winced hard at the sky-high price increase. An increase, no doubt, resulting from the addition of a questionable touch bar added to replace the function keys.
But I came to another realization. A realization that perhaps did not enter the minds of most tech pundits who begrudge the steep price for being an early adopter, but then pay it anyway.
 And arguably a better laptop for the present. So that is the one that I got. Not the new one, but the “old” 2015 one that costs almost $1000 less than the touch-bar model.
Let’s face it - the 2015 MacBook Pro has all the ports you need today, including the awesome MagSafe adapter which got turfed in the new version. Early adopters are cursing the “dongle life” they have to endure with the new MacBook Pro, but instead it is “future me” who will be cursing at the late onset of dongle life. “Present me” is quite okay with that because I’ve got an SD card reader for easily importing photos, an HDMI port for connecting to the TV, USB ports that work with everything in the world right now (including every iPhone in existence), and a Mini DisplayPort that lets me use my iMac as a monitor.
Guess which laptop doesn’t connect to the iPhone without a dongle? That’s right - the “new” MacBook Pro. Chuckle at the irony if you want to but you won’t be laughing when you shell out almost $3000 for an Apple computer that doesn’t connect with Apple’s most popular product. You could argue that the new MacBook Pro is more future-proof than the old one, but think on this:
The future has not been written. There is no fate but what we make for ourselves. John Connor in Terminator 2: Judgement Day
I’d like to say that Apple has become so big that they have the weight to foist new I/O standards on people without caring about a backlash, but that’s not true because they’ve always been that way. Even when they were smaller and scrappier they killed the floppy drive without looking back. Change is not a bad thing, but all I’m saying is that we are free to accept change at our own pace. You can change today or you can change tomorrow. Like RRSPs - you can pay your income taxes now or you can save your money and defer your taxes until you retire.
The MacBook Pro is an altogether different product from the iMac, but the 2015 MacBook is an extremely nice upgrade for me. The retina screen is bright and crisp (the new Verge re-design in particular looks gorgeous on it). The keyboard and trackpad are as buttery as you’d expect from a best-in-class laptop. But the sheer speed of the thing is what has me most excited. As I’ve mentioned many times before, a solid state drive makes all the difference when it comes to the user experience, moreso I believe than processing power.
The only caveat to this laptop is that the base model only has a 128GB hard drive. Upgrading to one terabyte costs an extra $1000, which is obviously ridiculous. Since pictures make up the bulk of our data (my wife has a particularly large library), I solved this problem by going external. I bought two 2TB external hard drives. One of the drives is purely a Time Machine backup of the first drive. Each drive cost me $90, so this comparatively cheap “outsourcing” more than makes up for the inconvenience of plugging in an external drive to look at photos.
My plan is to never back up the internal drive at all. All my documents, music, and movies all exist in the cloud at this point. Heck, even this blog is synced up to iCloud now. There should never be a need to save any data on the internal drive.
I could go on, but I’m not trying to write a review here. I don’t think casual consumers can go wrong with this 2015 model though, especially if your computer is more than five years old, like mine.
However, if you’re going to read a review of the new MacBook Pro, read Joanna Stern’s. She has the good sense not to take it all so seriously.
She includes a picture, for example, of how the wider trackpad can fit at least four pieces of sushi - a facetious metric which underscores the ridiculousness of such “advances” in technology. She then says that you’ll “get used to the spring of the keys in the new flat keyboard” just as you “get used to sleeping on a rock when camping.”
She had a lot of trouble trying to decide whether to recommend the 2016 model over the 2015 model. In the end, her advice is to “see where the new MacBook Pro is better, the same and, yes, worse than the old MacBook Pro, then decide what matters to you.”
That is solid advice, and that is exactly what I’ve done.


Include JavaScript and CSS resources in the head.
-- attrs.components = comma separated list of ui components to include
-- attrs.effects = comma separated list of effects to include
-- attrs.theme = css theme to use, defaults to 'base'
-- attrs.mode = javascript packing to use.
Simple tag to make an element toggleable
sourceId -> link-element which fires the toggle action
targetId -> id of the element to toggle
event -> event to fire the toggle action on (OPTIONAL)
speed -> effect-speed (OPTIONAL)


| 028:079 Khan | : |
So he went forth before his people in his pomp. Those who were desirous of the life of the world, said: "Ah, would that we had the like of what Qarun (Korah) has been given? Verily! He is the owner of a great fortune." |
| 028:079 Maulana | : |
So he went forth to his people in his finery. Those who desired this world's life said: O would that we had the like of what Korah is given! Surely he is possessed of mighty good fortune! |
| 028:079 Pickthal | : |
Then went he forth before his people in his pomp. Those who were desirous of the life of the world said: Ah, would that we had the like of what hath been given unto Korah! Lo! he is lord of rare good fortune. |
| 028:079 Rashad | : |
One day, he came out to his people in full splendor. Those who preferred this worldly life said, "Oh, we wish that we possessed what Qaaroon has attained. Indeed, he is very fortunate." |
| 028:079 Sarwar | : |
Korah would bedeck himself to show off his wealth. Those who wanted worldly gains would say, "Would that we were given that which Korah has received. He has certainly received a great share." |
| 028:079 Shakir | : |
So he went forth to his people in his finery. Those who desire this world's life said: O would that we had the like of what Qaroun is given; most surely he is possessed of mighty good fortune. |
| 028:079 Sherali | : |
So he went forth before his people in all his pomp. Those who were desirous of the life of this world said, 'Would that we had the like of what Korah has been given ! Truly, he is the master of great fortune.' |
| 028:079 Yusufali | : |
So he went forth among his people in the (pride of his wordly) glitter. Said those whose aim is the Life of this World: "Oh! that we had the like of what Qarun has got! for he is truly a lord of mighty good fortune!" |
Concepts/Themes Covered: الإيمان > اليوم الآخر > تفضيل الآخرة على الدنيا Faith> The Hereafter> Prefering the World to the Hereafter الإنسان والعلاقات الأخلاقية > الأخلاق الحميدة > الصبر Man and The Moral Relations> Good Morals>Patience تنظيم العلاقات المالية > الغنى > فتنة المال Organizing Financial Relationships>Richness>Wealth Attractiveness القصص والتاريخ > قارون The Stories and the History>Qaroun
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


| Up | TOC | Index | |||||
| << 7 Included Tools | < 8.4 Date and Time | Up: 8 API Reference | 8.6 I/O > | 9 Release Notes >> |
8.5 File System
Cross platform file operations for Euphoria
8.5.1 Constants
<IP_ADDRESS> SLASH
public constant SLASH
Current platform's path separator character
Comments:
When on Windows, '\\'. When on Unix, '/'.
<IP_ADDRESS> SLASHES
public constant SLASHES
Current platform's possible path separators. This is slightly different in that on Windows the path separators variable contains \\ as well as : and / as newer Windows versions support / as a path separator. On Unix systems, it only contains /.
<IP_ADDRESS> EOLSEP
public constant EOLSEP
Current platform's newline string: "\n" on Unix, else "\r\n".
<IP_ADDRESS> EOL
public constant EOL
All platform's newline character: '\n'. When text lines are read the native platform's EOLSEP string is replaced by a single character EOL.
<IP_ADDRESS> PATHSEP
public constant PATHSEP
Current platform's path separator character: : on Unix, else ;.
<IP_ADDRESS> NULLDEVICE
public constant NULLDEVICE
Current platform's null device path: /dev/null on Unix, else NUL:.
<IP_ADDRESS> SHARED_LIB_EXT
public constant SHARED_LIB_EXT
Current platform's shared library extension. For instance it can be dll, so or dylib depending on the platform.
8.5.2 Directory Handling
<IP_ADDRESS> D_NAME
include std/filesys.e namespace filesys public enum D_NAME
<IP_ADDRESS> D_ATTRIBUTES
include std/filesys.e namespace filesys public enum D_ATTRIBUTES
<IP_ADDRESS> D_SIZE
include std/filesys.e namespace filesys public enum D_SIZE
<IP_ADDRESS> D_YEAR
include std/filesys.e namespace filesys public enum D_YEAR
<IP_ADDRESS> D_MONTH
include std/filesys.e namespace filesys public enum D_MONTH
<IP_ADDRESS> D_DAY
include std/filesys.e namespace filesys public enum D_DAY
<IP_ADDRESS> D_HOUR
include std/filesys.e namespace filesys public enum D_HOUR
<IP_ADDRESS> D_MINUTE
include std/filesys.e namespace filesys public enum D_MINUTE
<IP_ADDRESS> D_SECOND
include std/filesys.e namespace filesys public enum D_SECOND
<IP_ADDRESS> D_MILLISECOND
include std/filesys.e namespace filesys public enum D_MILLISECOND
<IP_ADDRESS> D_ALTNAME
include std/filesys.e namespace filesys public enum D_ALTNAME
<IP_ADDRESS> W_BAD_PATH
public constant W_BAD_PATH
Bad path error code. See walk_dir
<IP_ADDRESS> W_SKIP_DIRECTORY
public constant W_SKIP_DIRECTORY
<IP_ADDRESS> dir
include std/filesys.e namespace filesys public function dir(sequence name)
returns directory information for the specified file or directory.
Parameters:
- name : a sequence, the name to be looked up in the file system.
Returns:
An object, -1 if no match found, else a sequence of sequence entries
Errors:
The length of name should not exceed 1_024 characters.
Comments:
name can also contain * and ? wildcards to select multiple files.
The returned information is similar to what you would get from the DIR command. A sequence is returned where each element is a sequence that describes one file or subdirectory.
If name refers to a directory you may have entries for "." and "..", just as with the DIR command. If it refers to an existing file, and has no wildcards, then the returned sequence will have just one entry (that is its length will be 1). If name contains wildcards you may have multiple entries.
Each entry contains the name, attributes and file size as well as the time of the last modification.
You can refer to the elements of an entry with the following constants:
public constant -- File Attributes D_NAME = 1, D_ATTRIBUTES = 2, D_SIZE = 3, D_YEAR = 4, D_MONTH = 5, D_DAY = 6, D_HOUR = 7, D_MINUTE = 8, D_SECOND = 9, D_MILLISECOND = 10, D_ALTNAME = 11
The attributes element is a string sequence containing characters chosen from:
| Attribute | Description |
|---|---|
| 'd' | directory |
| 'r' | read only file |
| 'h' | hidden file |
| 's' | system file |
| 'v' | volume-id entry |
| 'a' | archive file |
| 'c' | compressed file |
| 'e' | encrypted file |
| 'N' | not indexed |
| 'D' | a device name |
| 'O' | offline |
| 'R' | reparse point or symbolic link |
| 'S' | sparse file |
| 'T' | temporary file |
| 'V' | virtual file |
A normal file without special attributes would just have an empty string, "", in this field.
The top level directory ( therefore c:\ does not have "." or ".." entries).
This function is often used just to test if a file or directory exists.
Under Windows, the argument can have a long file or directory name anywhere in the path.
Under Unix, the only attribute currently available is 'd' and the milliseconds are always zero.
Windows: The file name returned in [D_NAME] will be a long file name. If [D_ALTNAME] is not zero, it contains the 'short' name of the file.
Example 1:
d = dir(current_dir()) -- d might have: -- { -- {".", "d", 0 1994, 1, 18, 9, 30, 02}, -- {"..", "d", 0 1994, 1, 18, 9, 20, 14}, -- {"fred", "ra", 2350, 1994, 1, 22, 17, 22, 40}, -- {"sub", "d" , 0, 1993, 9, 20, 8, 50, 12} -- } d[3][D_NAME] would be "fred"
See Also:
<IP_ADDRESS> current_dir
include std/filesys.e namespace filesys public function current_dir()
Return the name of the current working directory.
Returns:
A sequence, the name of the current working directory
Comments:
There will be no slash or backslash on the end of the current directory, except under Windows, at the top-level of a drive (such as C:\).
Example 1:
sequence s s = current_dir() -- s would have "C:\EUPHORIA\DOC" if you were in that directory
See Also:
<IP_ADDRESS> chdir
include std/filesys.e namespace filesys public function chdir(sequence newdir)
sets a new value for the current directory.
Parameters:
newdir : a sequence, the name for the new working directory.
Returns:
An integer, 0 on failure, 1 on success.
Comments:
By setting the current directory, you can refer to files in that directory using just the file name.
The current_dir function will return the name of the current directory.
On Windows the current directory is a public property shared by all the processes running under one shell. On Unix a subprocess can change the current directory for itself, but this will not affect the current directory of its parent process.
Example 1:
if chdir("c:\\euphoria") then f = open("readme.doc", "r") else puts(STDERR, "Error: No euphoria directory?\n") end if
See Also:
<IP_ADDRESS> my_dir
include std/filesys.e namespace filesys public integer my_dir
Deprecated, so therefore not documented.
<IP_ADDRESS> walk_dir
include std/filesys.e namespace filesys public function walk_dir(sequence path_name, object your_function, integer scan_subdirs = types :FALSE, object dir_source = types :NO_ROUTINE_ID)
Generalized Directory Walker
Parameters:
- path_name : a sequence, the name of the directory to walk through
- your_function : the routine id of a function that will receive each path returned from the result of dir_source, one at a time. Optionally, to include extra data for your function, your_function can be a 2 element sequence, with the routine_id as the first element and other data as the second element.
- scan_subdirs : an optional integer, 1 to also walk though subfolders, 0 (the default) to skip them all.
- dir_source : an optional integer. A routine_id of a user-defined routine that returns the list of paths to pass to your_function. If omitted, the dir() function is used. If your routine requires an extra parameter, dir_source may be a 2 element sequence where the first element is the routine id and the second is the extra data to be passed as the second parameter to your function.
Returns:
An object,
- 0 on success
- W_BAD_PATH an error occurred
- anything else the custom function returned something to stop walk_dir.
Comments:
This routine will "walk" through a directory named path_name. For each entry in the directory, it will call a function, whose routine_id is your_function. If scan_subdirs is non-zero (TRUE), then the subdirectories in path_name will be walked through recursively in the very same way.
The routine that you supply should accept two sequences, the path name and dir entry for each file and subdirectory. It should return 0 to keep going, W_SKIP_DIRECTORY to avoid scan the contents of the supplied path name (if a directory), or non-zero to stop walk_dir. Returning W_BAD_PATH is taken as denoting some error.
This mechanism allows you to write a simple function that handles one file at a time, while walk_dir handles the process of walking through all the files and subdirectories.
By default, the files and subdirectories will be visited in alphabetical order. To use a different order, use the dir_source to pass the routine_id of your own modified dir function that sorts the directory entries differently.
The path that you supply to walk_dir must not contain wildcards (* or ?). Only a single directory (and its subdirectories) can be searched at one time.
For Windows systems, any '/' characters in path_name are replaced with '\'.
All trailing slash and whitespace characters are removed from path_name.
Example 1:
function look_at(sequence path_name, sequence item) -- this function accepts two sequences as arguments -- it displays all C/C++ source files and their sizes if find('d', item[D_ATTRIBUTES]) then -- Ignore directories if find('s', item[D_ATTRIBUTES]) then return W_SKIP_DIRECTORY -- Don't recurse a system directory else return 0 -- Keep processing as normal end if end if if not find(fileext(item[D_NAME]), {"c","h","cpp","hpp","cp"}) then return 0 -- ignore non-C/C++ files end if printf(STDOUT, "%s%s%s: %d\n", {path_name, {SLASH}, item[D_NAME], item[D_SIZE]}) return 0 -- keep going end function function mysort(sequence path) object d d = dir(path) if atom(d) then return d end if -- Sort in descending file size. return sort_columns(d, {-D_SIZE}) end function exit_code = walk_dir("C:\\MYFILES\\", routine_id("look_at"), TRUE, routine_id("mysort"))
See Also:
<IP_ADDRESS> create_directory
include std/filesys.e namespace filesys public function create_directory(sequence name, integer mode = 448, integer mkparent = 1)
creates a new directory.
Parameters:
- name : a sequence, the name of the new directory to create
- mode : on Unix systems, permissions for the new directory. Default is 448 (all rights for owner, none for others).
- mkparent : If true (default) the parent directories are also created if needed.
Returns:
An integer, 0 on failure, 1 on success.
Comments:
mode is ignored on Windows platforms.
Example 1:
if not create_directory("the_new_folder") then crash("Filesystem problem - could not create the new folder") end if -- This example will also create "myapp/" and "myapp/interface/" -- if they don't exist. if not create_directory("myapp/interface/letters") then crash("Filesystem problem - could not create the new folder") end if -- This example will NOT create "myapp/" and "myapp/interface/" -- if they don't exist. if not create_directory("myapp/interface/letters",,0) then crash("Filesystem problem - could not create the new folder") end if
See Also:
<IP_ADDRESS> create_file
include std/filesys.e namespace filesys public function create_file(sequence name)
Create a new file.
Parameters:
- name : a sequence, the name of the new file to create
Returns:
An integer, 0 on failure, 1 on success.
Comments:
- The created file will be empty, that is it has a length of zero.
- The created file will not be open when this returns.
Example 1:
if not create_file("the_new_file") then crash("Filesystem problem - could not create the new file") end if
See Also:
<IP_ADDRESS> delete_file
include std/filesys.e namespace filesys public function delete_file(sequence name)
deletes a file.
Parameters:
- name : a sequence, the name of the file to delete.
Returns:
An integer, 0 on failure, 1 on success.
<IP_ADDRESS> curdir
include std/filesys.e namespace filesys public function curdir(integer drive_id = 0)
Returns the current directory, with a trailing SLASH
Parameters:
- drive_id : For Windows systems only. This is the Drive letter to to get the current directory of. If omitted, the current drive is used.
Returns:
A sequence, the current directory.
Comments:
Windows maintains a current directory for each disk drive. You would use this routine if you wanted the current directory for a drive that may not be the current drive.
For Unix systems, this is simply ignored because there is only one current directory at any time on Unix.
Note:
This always ensures that the returned value has a trailing SLASH character.
Example 1:
res = curdir('D') -- Find the current directory on the D: drive. -- res might be "D:\backup\music\" res = curdir() -- Find the current directory on the current drive. -- res might be "C:\myapp\work\"
<IP_ADDRESS> init_curdir
include std/filesys.e namespace filesys public function init_curdir()
returns the original current directory.
Parameters:
- None.
Returns:
A sequence, the current directory at the time the program started running.
Comments:
You would use this if the program might change the current directory during its processing and you wanted to return to the original directory.
Note:
This always ensures that the returned value has a trailing SLASH character.
Example 1:
res = init_curdir() -- Find the original current directory.
<IP_ADDRESS> clear_directory
include std/filesys.e namespace filesys public function clear_directory(sequence path, integer recurse = 1)
clears (deletes) a directory of all files, but retaining sub-directories.
Parameters:
- name : a sequence, the name of the directory whose files you want to remove.
- recurse : an integer, whether or not to remove files in the directory's sub-directories. If 0 then this function is identical to remove_directory. If 1, then we recursively delete the directory and its contents. Defaults to 1 .
Returns:
An integer, 0 on failure, otherwise the number of files plus 1 .
Comments:
This never removes a directory. It only ever removes files. It is used to clear a directory structure of all existing files, leaving the structure intact.
Example 1:
integer cnt = clear_directory("the_old_folder") if cnt = 0 then crash("Filesystem problem - could not remove one or more of the files.") end if printf(1, "Number of files removed: %d\n", cnt - 1)
See Also:
<IP_ADDRESS> remove_directory
include std/filesys.e namespace filesys public function remove_directory(sequence dir_name, integer force = 0)
removes a directory.
Parameters:
- name : a sequence, the name of the directory to remove.
- force : an integer, if 1 this will also remove files and sub-directories in the directory. The default is 0, which means that it will only remove the directory if it is already empty.
Returns:
An integer, 0 on failure, 1 on success.
Example 1:
if not remove_directory("the_old_folder") then crash("Filesystem problem - could not remove the old folder") end if
See Also:
create_directory, chdir, clear_directory
8.5.3 File Name Parsing
<IP_ADDRESS> PATH_DIR
include std/filesys.e namespace filesys public enum PATH_DIR
<IP_ADDRESS> PATH_FILENAME
include std/filesys.e namespace filesys public enum PATH_FILENAME
<IP_ADDRESS> PATH_BASENAME
include std/filesys.e namespace filesys public enum PATH_BASENAME
<IP_ADDRESS> PATH_FILEEXT
include std/filesys.e namespace filesys public enum PATH_FILEEXT
<IP_ADDRESS> PATH_DRIVEID
include std/filesys.e namespace filesys public enum PATH_DRIVEID
<IP_ADDRESS> pathinfo
include std/filesys.e namespace filesys public function pathinfo(sequence path, integer std_slash = 0)
parses a fully qualified pathname.
Parameters:
- path : a sequence, the path to parse
Returns:
A sequence, of length five. Each of these elements is a string:
- The path name. For Windows this excludes the drive id.
- The full unqualified file name
- the file name, without extension
- the file extension
- the drive id
Comments:
The host operating system path separator is used in the parsing.
Example 1:
-- WINDOWS info = pathinfo("C:\\euphoria\\docs\\readme.txt") -- info is {"C:\\euphoria\\docs", "readme.txt", "readme", "txt", "C"}
Example 2:
-- Unix variants info = pathinfo("/opt/euphoria/docs/readme.txt") -- info is {"/opt/euphoria/docs", "readme.txt", "readme", "txt", ""}
Example 3:
-- no extension info = pathinfo("/opt/euphoria/docs/readme") -- info is {"/opt/euphoria/docs", "readme", "readme", "", ""}
See Also:
driveid, dirname, filename, fileext, PATH_BASENAME, PATH_DIR, PATH_DRIVEID, PATH_FILEEXT, PATH_FILENAME
<IP_ADDRESS> dirname
include std/filesys.e namespace filesys public function dirname(sequence path, integer pcd = 0)
returns the directory name of a fully qualified filename.
Parameters:
- path : the path from which to extract information
- pcd : If not zero and there is no directory name in path then "." is returned. The default (0) will just return any directory name in path.
Returns:
A sequence, the full file name part of path.
Comments:
The host operating system path separator is used.
Example 1:
fname = dirname("/opt/euphoria/docs/readme.txt") -- fname is "/opt/euphoria/docs"
See Also:
<IP_ADDRESS> pathname
include std/filesys.e namespace filesys public function pathname(sequence path)
returns the directory name of a fully qualified filename.
Parameters:
- path : the path from which to extract information
- pcd : If not zero and there is no directory name in path then "." is returned. The default (0) will just return any directory name in path.
Returns:
A sequence, the full file name part of path.
Comments:
The host operating system path separator is used.
Example 1:
fname = dirname("/opt/euphoria/docs/readme.txt") -- fname is "/opt/euphoria/docs"
See Also:
<IP_ADDRESS> filename
include std/filesys.e namespace filesys public function filename(sequence path)
returns the file name portion of a fully qualified filename.
Parameters:
- path : the path from which to extract information
Returns:
A sequence, the file name part of path.
Comments:
The host operating system path separator is used.
Example 1:
fname = filename("/opt/euphoria/docs/readme.txt") -- fname is "readme.txt"
See Also:
<IP_ADDRESS> filebase
include std/filesys.e namespace filesys public function filebase(sequence path)
returns the base filename of path.
Parameters:
- path : the path from which to extract information
Returns:
A sequence, the base file name part of path.
TODO: Test
Example 1:
base = filebase("/opt/euphoria/readme.txt") -- base is "readme"
See Also:
<IP_ADDRESS> fileext
include std/filesys.e namespace filesys public function fileext(sequence path)
returns the file extension of a fully qualified filename.
Parameters:
- path : the path from which to extract information
Returns:
A sequence, the file extension part of path.
Comments:
The host operating system path separator is used.
Example 1:
fname = fileext("/opt/euphoria/docs/readme.txt") -- fname is "txt"
See Also:
<IP_ADDRESS> driveid
include std/filesys.e namespace filesys public function driveid(sequence path)
returns the drive letter of the path on Windows platforms.
Parameters:
- path : the path from which to extract information
Returns:
A sequence, the file extension part of path.
TODO: Test
Example 1:
letter = driveid("C:\\EUPHORIA\\Readme.txt") -- letter is "C"
See Also:
<IP_ADDRESS> defaultext
include std/filesys.e namespace filesys public function defaultext(sequence path, sequence defext)
returns the supplied filepath with the supplied extension, if the filepath does not have an extension already.
Parameters:
- path : the path to check for an extension.
- defext : the extension to add if path does not have one.
Returns:
A sequence, the path with an extension.
Example 1:
-- ensure that the supplied path has an extension, -- but if it doesn't use "tmp". theFile = defaultext(UserFileName, "tmp")
See Also:
<IP_ADDRESS> absolute_path
include std/filesys.e namespace filesys public function absolute_path(sequence filename)
determines if the supplied string is an absolute path or a relative path.
Parameters:
- filename : a sequence, the name of the file path
Returns:
An integer, 0 if filename is a relative path or 1 otherwise.
Comments:
A relative path is one which is relative to the current directory and an absolute path is one that doesn't need to know the current directory to find the file.
Example 1:
? absolute_path("") -- returns 0 ? absolute_path("/usr/bin/abc") -- returns 1 ? absolute_path("\\temp\\somefile.doc") -- returns 1 ? absolute_path("../abc") -- returns 0 ? absolute_path("local/abc.txt") -- returns 0 ? absolute_path("abc.txt") -- returns 0 ? absolute_path("c:..\\abc") -- returns 0 -- The next two examples return -- 0 on Unix platforms and -- 1 on Microsoft platforms ? absolute_path("c:\\windows\\system32\\abc") ? absolute_path("c:/windows/system32/abc")
<IP_ADDRESS> AS_IS
include std/filesys.e namespace filesys public enum AS_IS
<IP_ADDRESS> TO_LOWER
include std/filesys.e namespace filesys public enum TO_LOWER
<IP_ADDRESS> CORRECT
include std/filesys.e namespace filesys public enum CORRECT
<IP_ADDRESS> TO_SHORT
include std/filesys.e namespace filesys public enum TO_SHORT
<IP_ADDRESS> case_flagset_type
include std/filesys.e namespace filesys public type case_flagset_type(integer x)
<IP_ADDRESS> canonical_path
include std/filesys.e namespace filesys public function canonical_path(sequence path_in, integer directory_given = 0, case_flagset_type case_flags = AS_IS)
returns the full path and file name of the supplied file name.
Parameters:
- path_in : A sequence. This is the file name whose full path you want.
- directory_given : An integer. This is zero if path_in is to be interpreted as a file specification otherwise it is assumed to be a directory specification. The default is zero.
- case_flags : An integer. This is a combination of flags. AS_IS = Includes no flags TO_LOWER = If passed will convert the part of the path not affected by other case flags to lowercase. CORRECT = If passed will correct the parts of the filepath that exist in the current filesystem in parts of the filesystem that is case insensitive. This should work on Windows or SMB mounted volumes on Unix and all OS X filesystems.
TO_LOWER = If passed alone the entire path is converted to lowercase. or_bits(TO_LOWER,CORRECT) = If these flags are passed together the the part that exists has the case of that of the filesystem. The part that does not is converted to lower case. TO_SHORT = If passed the elements of the path that exist are also converted to their Windows short names if avaliable.
Returns:
A sequence, the full path and file name.
Comments:
- The supplied file/directory does not have to actually exist.
- path_in can be enclosed in quotes, which will be stripped off.
- If path_in begins with a tilde '~' then that is replaced by the contents of $HOME in Unix platforms and %HOMEDRIVE%%HOMEPATH% in Windows.
- In Windows all '/' characters are replaced by '\' characters.
- Does not (yet) handle UNC paths or Unix links.
Example 1:
-- Assuming the current directory is "/usr/foo/bar" res = canonical_path("../abc.def") -- res is now "/usr/foo/abc.def"
Example 2:
-- res is "C:\Program Files" on systems that have that directory. res = canonical_path("c:\pRoGrAm FiLeS", CORRECT) -- on Windows Vista this would be "c:\Program Files" for Vista uses lowercase for its drives.
<IP_ADDRESS> abbreviate_path
include std/filesys.e namespace filesys public function abbreviate_path(sequence orig_path, sequence base_paths = {})
returns a path string to the supplied file which is shorter than the given path string.
Parameters:
- orig_path : A sequence. This is the path to a file.
- base_paths : A sequence. This is an optional list of paths that may prefix the original path. The default is an empty list.
Returns:
A sequence, an equivalent path to orig_path which is shorter than the supplied path. If a shorter one cannot be formed, then the original path is returned.
Comments:
- This function is primarily used to get the shortest form of a file path for output to a file or screen.
- It works by first trying to find if the orig_path begins with any of the base_paths. If so it returns the parameter minus the base path prefix.
- Next it checks if the orig_path begins with the current directory path. If so it returns the parameter minus the current directory path.
- Next it checks if it can form a relative path from the current directory to the supplied file which is shorter than the parameter string.
- Failing all of that, it returns the original parameter.
- In Windows the shorter result has all '/' characters are replaced by '\' characters.
- The supplied path does not have to actually exist.
- orig_path can be enclosed in quotes, which will be stripped off.
- If orig_path begins with a tilde '~' then that is replaced by the contents of $HOME in Unix platforms and %HOMEDRIVE%%HOMEPATH% in Windows.
Example 1:
-- Assuming the current directory is "/usr/foo/bar" res = abbreviate_path("/usr/foo/abc.def") -- res is now "../abc.def" res = abbreviate_path("/usr/foo/bar/inc/abc.def") -- res is now "inc/abc.def" res = abbreviate_path("abc.def", {"/usr/foo"}) -- res is now "bar/abc.def"
<IP_ADDRESS> split_path
include std/filesys.e namespace filesys public function split_path(sequence fname)
split a filename into path segments.
Parameters:
- fname -- Filename to split
Returns:
A sequence of strings representing each path element found in fname.
Example 1:
sequence path_elements = split_path("/usr/home/john/hello.txt") -- path_elements would be { "usr", "home", "john", "hello.txt" }
Versioning:
- Added in 4.0.1
See Also:
<IP_ADDRESS> join_path
include std/filesys.e namespace filesys public function join_path(sequence path_elements)
Join multiple path segments into a single path/filename
Parameters:
- path_elements -- Sequence of path elements
Returns:
A string representing the path elements on the given platform
Example 1:
sequence fname = join_path({ "usr", "home", "john", "hello.txt" }) -- fname would be "/usr/home/john/hello.txt" on Unix -- fname would be "\\usr\\home\\john\\hello.txt" on Windows
Versioning:
- Added in 4.0.1
See Also:
8.5.4 File Types
<IP_ADDRESS> FILETYPE_UNDEFINED
include std/filesys.e namespace filesys public enum FILETYPE_UNDEFINED
<IP_ADDRESS> FILETYPE_NOT_FOUND
include std/filesys.e namespace filesys public enum FILETYPE_NOT_FOUND
<IP_ADDRESS> FILETYPE_FILE
include std/filesys.e namespace filesys public enum FILETYPE_FILE
<IP_ADDRESS> FILETYPE_DIRECTORY
include std/filesys.e namespace filesys public enum FILETYPE_DIRECTORY
<IP_ADDRESS> file_type
include std/filesys.e namespace filesys public function file_type(sequence filename)
gets the type of a file.
Parameters:
- filename : the name of the file to query. It must not have wildcards.
Returns:
An integer,
- FILETYPE_UNDEFINED (-1) if file could be multiply defined (i.e., contains any wildcards - '*' or '?')
- FILETYPE_NOT_FOUND (0) if filename does not exist
- FILETYPE_FILE (1) if filename is a file
- FILETYPE_DIRECTORY (2) if filename is a directory
See Also:
dir, FILETYPE_DIRECTORY, FILETYPE_FILE, FILETYPE_NOT_FOUND, FILETYPE_UNDEFINED
8.5.5 File Handling
<IP_ADDRESS> SECTORS_PER_CLUSTER
include std/filesys.e namespace filesys public enum SECTORS_PER_CLUSTER
<IP_ADDRESS> BYTES_PER_SECTOR
include std/filesys.e namespace filesys public enum BYTES_PER_SECTOR
<IP_ADDRESS> NUMBER_OF_FREE_CLUSTERS
include std/filesys.e namespace filesys public enum NUMBER_OF_FREE_CLUSTERS
<IP_ADDRESS> TOTAL_NUMBER_OF_CLUSTERS
include std/filesys.e namespace filesys public enum TOTAL_NUMBER_OF_CLUSTERS
<IP_ADDRESS> TOTAL_BYTES
include std/filesys.e namespace filesys public enum TOTAL_BYTES
<IP_ADDRESS> FREE_BYTES
include std/filesys.e namespace filesys public enum FREE_BYTES
<IP_ADDRESS> USED_BYTES
include std/filesys.e namespace filesys public enum USED_BYTES
<IP_ADDRESS> COUNT_DIRS
include std/filesys.e namespace filesys public enum COUNT_DIRS
<IP_ADDRESS> COUNT_FILES
include std/filesys.e namespace filesys public enum COUNT_FILES
<IP_ADDRESS> COUNT_SIZE
include std/filesys.e namespace filesys public enum COUNT_SIZE
<IP_ADDRESS> COUNT_TYPES
include std/filesys.e namespace filesys public enum COUNT_TYPES
<IP_ADDRESS> EXT_NAME
include std/filesys.e namespace filesys public enum EXT_NAME
<IP_ADDRESS> EXT_COUNT
include std/filesys.e namespace filesys public enum EXT_COUNT
<IP_ADDRESS> EXT_SIZE
include std/filesys.e namespace filesys public enum EXT_SIZE
<IP_ADDRESS> file_exists
include std/filesys.e namespace filesys public function file_exists(object name)
checks to see if a file exists.
Parameters:
- name : filename to check existence of
Returns:
An integer, 1 on yes, 0 on no.
Example 1:
if file_exists("abc.e") then puts(1, "abc.e exists already\n") end if
<IP_ADDRESS> file_timestamp
include std/filesys.e namespace filesys public function file_timestamp(sequence fname)
gets the timestamp of the file.
Parameters:
- name : the filename to get the date of
Returns:
A valid datetime type, representing the files date and time or -1 if the file's date and time could not be read.
<IP_ADDRESS> copy_file
include std/filesys.e namespace filesys public function copy_file(sequence src, sequence dest, integer overwrite = 0)
copies a file.
Parameters:
- src : a sequence, the name of the file or directory to copy
- dest : a sequence, the new name or location of the file
- overwrite : an integer; 0 (the default) will prevent an existing destination file from being overwritten. Non-zero will overwrite the destination file.
Returns:
An integer, 0 on failure, 1 on success.
Comments:
If overwrite is true, and if dest file already exists, the function overwrites the existing file and succeeds.
See Also:
<IP_ADDRESS> rename_file
include std/filesys.e namespace filesys public function rename_file(sequence old_name, sequence new_name, integer overwrite = 0)
rename a file.
Parameters:
- old_name : a sequence, the name of the file or directory to rename.
- new_name : a sequence, the new name for the renamed file
- overwrite : an integer, 0 (the default) to prevent renaming if destination file exists, 1 to delete existing destination file first
Returns:
An integer, 0 on failure, 1 on success.
Comments:
- If new_name contains a path specification, this is equivalent to moving the file, as well as possibly changing its name. However, the path must be on the same drive for this to work.
- If overwrite was requested but the rename fails, any existing destination file is preserved.
See Also:
<IP_ADDRESS> move_file
include std/filesys.e namespace filesys public function move_file(sequence src, sequence dest, integer overwrite = 0)
moves a file to another location.
Parameters:
- src : a sequence, the name of the file or directory to move
- dest : a sequence, the new location for the file
- overwrite : an integer, 0 (the default) to prevent overwriting an existing destination file, 1 to overwrite existing destination file
Returns:
An integer, 0 on failure, 1 on success.
Comments:
If overwrite was requested but the move fails, any existing destination file is preserved.
See Also:
<IP_ADDRESS> file_length
include std/filesys.e namespace filesys public function file_length(sequence filename)
returns the size of a file.
Parameters:
- filename : the name of the queried file
Returns:
An atom, the file size, or -1 if file is not found.
Comments:
This function does not compute the total size for a directory, and returns 0 instead.
See Also:
<IP_ADDRESS> locate_file
include std/filesys.e namespace filesys public function locate_file(sequence filename, sequence search_list = {}, sequence subdir = {})
locates a file by looking in a set of directories for it.
Parameters:
- filename : a sequence, the name of the file to search for.
- search_list : a sequence, the list of directories to look in. By default this is "", meaning that a predefined set of directories is scanned. See comments below.
- subdir : a sequence, the sub directory within the search directories to check. This is optional.
Returns:
A sequence, the located file path if found, else the original file name.
Comments:
If filename is an absolute path, it is just returned and no searching takes place.
If filename is located, the full path of the file is returned.
If search_list is supplied, it can be either a sequence of directory names, of a string of directory names delimited by ':' in Unix and ';' in Windows.
If the search_list is omitted or "", this will look in the following places:
- The current directory
- The directory that the program is run from.
- The directory in $HOME ($HOMEDRIVE & $HOMEPATH in Windows)
- The parent directory of the current directory
- The directories returned by include_paths
- $EUDIR/bin
- $EUDIR/docs
- $EUDIST/
- $EUDIST/etc
- $EUDIST/data
- The directories listed in $USERPATH
- The directories listed in $PATH
If the subdir is supplied, the function looks in this sub directory for each of the directories in the search list.
Example 1:
res = locate_file("abc.def", {"/usr/bin", "/u2/someapp", "/etc"}) res = locate_file("abc.def", "/usr/bin:/u2/someapp:/etc") res = locate_file("abc.def") -- Scan default locations. res = locate_file("abc.def", , "app") -- Scan the 'app' sub directory in the default locations.
<IP_ADDRESS> disk_metrics
include std/filesys.e namespace filesys public function disk_metrics(object disk_path)
returns some information about a disk drive.
Parameters:
- disk_path : A sequence. This is the path that identifies the disk to inquire upon.
Returns:
A sequence, containing SECTORS_PER_CLUSTER, BYTES_PER_SECTOR, NUMBER_OF_FREE_CLUSTERS, and TOTAL_NUMBER_OF_CLUSTERS
Example 1:
res = disk_metrics("C:\\") min_file_size = res[SECTORS_PER_CLUSTER] * res[BYTES_PER_SECTOR]
<IP_ADDRESS> disk_size
include std/filesys.e namespace filesys public function disk_size(object disk_path)
returns the amount of space for a disk drive.
Parameters:
- disk_path : A sequence. This is the path that identifies the disk to inquire upon.
Returns:
A sequence, containing TOTAL_BYTES, USED_BYTES, FREE_BYTES, and a string which represents the filesystem name
Example 1:
res = disk_size("C:\\") printf(1, "Drive %s has %3.2f%% free space\n", { "C:", res[FREE_BYTES] / res[TOTAL_BYTES] })
<IP_ADDRESS> dir_size
include std/filesys.e namespace filesys public function dir_size(sequence dir_path, integer count_all = 0)
returns the amount of space used by a directory.
Parameters:
- dir_path : A sequence. This is the path that identifies the directory to inquire upon.
- count_all : An integer. Used by Windows systems. If zero (the default) it will not include system or hidden files in the count, otherwise they are included.
Returns:
A sequence, containing four elements; the number of sub-directories [COUNT_DIRS], the number of files [COUNT_FILES], the total space used by the directory [COUNT_SIZE], and breakdown of the file contents by file extension [COUNT_TYPES].
Comments:
- The total space used by the directory does not include space used by any sub-directories.
- The file breakdown is a sequence of three-element sub-sequences. Each sub-sequence contains the extension [EXT_NAME], the number of files of this extension [EXT_COUNT], and the space used by these files [EXT_SIZE]. The sub-sequences are presented in extension name order. On Windows the extensions are all in lowercase.
Example 1:
res = dir_size("/usr/localbin") printf(1, "Directory %s contains %d files\n", { "/usr/localbin", res[COUNT_FILES] }) for i = 1 to length(res[COUNT_TYPES]) do printf(1, "Type: %s (%d files %d bytes)\n", { res[COUNT_TYPES][i][EXT_NAME], res[COUNT_TYPES][i][EXT_COUNT], res[COUNT_TYPES][i][EXT_SIZE] }) end for
<IP_ADDRESS> temp_file
include std/filesys.e namespace filesys public function temp_file(sequence temp_location = "", sequence temp_prefix = "", sequence temp_extn = "_T_", integer reserve_temp = 0)
returns a file name that can be used as a temporary file.
Parameters:
- temp_location : A sequence. A directory where the temporary file is expected to be created.
- If omitted (the default) the 'temporary' directory will be used. The temporary directory is defined in the "TEMP" environment symbol, or failing that the "TMP" symbol and failing that "C:\TEMP\" is used on Windows systems and "/tmp/" is used on Unix systems.
- If temp_location was supplied,
- If it is an existing file, that file's directory is used.
- If it is an existing directory, it is used.
- If it doesn't exist, the directory name portion is used.
- temp_prefix : A sequence: The is prepended to the start of the generated file name. The default is "" .
- temp_extn : A sequence: The is a file extention used in the generated file. The default is "_T_" .
- reserve_temp : An integer: If not zero an empty file is created using the generated name. The default is not to reserve (create) the file.
Returns:
A sequence, A generated file name.
Example 1:
temp_file("/usr/space", "myapp", "tmp") --> /usr/space/myapp736321.tmp temp_file() --> /tmp/277382._T_ temp_file("/users/me/abc.exw") --> /users/me/992831._T_
<IP_ADDRESS> checksum
include std/filesys.e namespace filesys public function checksum(sequence filename, integer size = 4, integer usename = 0, integer return_text = 0)
returns a checksum value for the specified file.
Parameters:
- filename : A sequence. The name of the file whose checksum you want.
- size : An integer. The number of atoms to return. Default is 4
- usename: An integer. If not zero then the actual text of filename will affect the resulting checksum. The default (0) will not use the name of the file.
- return_text: An integer. If not zero, the check sum is returned as a text string of hexadecimal digits otherwise (the default) the check sum is returned as a sequence of size atoms.
Returns:
A sequence containing size atoms.
Comments:
- The larger the size value, the more unique will the checksum be. For most files and uses, a single atom will be sufficient as this gives a 32-bit file signature. However, if you require better proof that the content of two files are different then use higher values for size. For example, size = 8 gives you 256 bits of file signature.
- If size is zero or negative, an empty sequence is returned.
- All files of zero length will return the same checksum value when usename is zero.
Example 1:
-- Example values. The exact values depend on the contents of the file. include std/console.e display( checksum("myfile", 1) ) --> {92837498} display( checksum("myfile", 2) ) --> {1238176, 87192873} display( checksum("myfile", 2,,1)) --> "0012E480 05327529" display( checksum("myfile", 4) ) --> {23448, 239807, 79283749, 427370} display( checksum("myfile") ) --> {23448, 239807, 79283749, 427370} -- default
| Up | TOC | Index | |||||
| << 7 Included Tools | < 8.4 Date and Time | Up: 8 API Reference | 8.6 I/O > | 9 Release Notes >> |


Family meals are an important time for our teams to get together before serving you, it's important to nourish our bodies and bond with one another over a shared meal and now we're inviting you to be part of our family. These menus feature mamnoon's most loved dishes. As always our nutritious and fresh ingredients are the stars and we want to share them with you. "mama family meal" is $40 and is ample for 2 people! You have a selection of a meat or vegetarian entrée, a seasonal salad & rotating side, and to complete your meal an order of our rich and tangy labneh. It's easy to add extra orders for bigger families. We're offering $15 & $ 25 bottles of paired red or white wine, cocktail kits & beer. We're also featuring our special tahini chocolate chip cookies (3 for $9) with all proceeds going to support our mama family.


{% extends 'base_email.html' %} {% block body %}
Congratulations {{ object.created_by.first_name }}!
{% if is_first_client %}
Your first client {{ object.client.name }} has verified your relationship with them.
{% else %}
Your first client {{ object.client.name }} has verified your relationship with them.
{% endif %}
{% if is_first_client %} This means your profile is now eligible to be listed on Proven. To continue your growth and status in the Proven community, please get other clients of yours to verify their relationship with you. Click here to request verification from more clients. {% else %} Your profile will be better ranked the more clients you have verified, so keep requesting verifications from more clients. Click here to go there now {% endif %}
Thanks for being part of the Proven community,
Suzanne Jordan
Founder and COO, Proven
suzanne@proven.cc


MorseBot is a simple discord bot that decodes and encodes Morse code.
Sauli pyrämidi, it's just a picture of the finnish president Sauli Niinistö mapped on a 3d pyramid.
I made the fridaysforfuturefinland.fi website witch has info and a blog about the finnish FridaysForFuture school strikes.


The green and mountainous island of Lefkas is also known as Nisos Levkas and Levkada.
The town of Lefkas is at the northern end of the island, by the bridge connecting it to the mainland. It is a popular port in which to spend the winter months.
Position 38°49.8’ N, 20°42.8’ E (Lefkas marina)
Other Harbours on Lefkas
Nikiana
A small harbour about 7NM S of Lefkas port on the east coast of the island. Noisy as directly next to main road from mainland.
Nidri
This harbour is a busy watersports centre sitting at the entrance to a large bay just over halfway down the east coast of the island. Several berthing options may be available, in addition to anchoring. Chandlery, mechanical repairs and a sailmaker are available here, as well as provisions, bank, ATM and internet cafe.
Vliho
Just south of Nidri, and further into the same enclosed bay which provides good protection. There are a number of good anchorages in addition to berthing at the quay. The average depth in the harbour is 5 to 6m. Good shopping, chandlery, boatyard and repairs. Showers and laundry at the yacht club.
Sivota
Delightful waterfront settlement situated in an almost landlocked bay at the southern end of the island. The approach to the bay is difficult to see until you are almost upon it. Very busy quay with local traffic and flotillas and highly likely your anchor will be fouled. Big cat population. A number of tavernas offer services and pontoon mooring in return for dinner. Is possible to anchor a distance off the quay, however depths drop quickly.
Vasiliki
This harbour is on the southern coast of the island and its harbour is liable to silting up, so care should be taken with depths here. A sleepy little place now enlivened by the arrival of many watersport activities and extremely popular with wind surfers.
This is a Port of Entry and Customs, Port Police and Immigration are all based here.
Last updated June 2016
Lefkas Canal
The Lefkas canal, separating the island from the mainland, has existed since ancient times. It is used mainly by local craft as a short cut to nearby Ionian islands. It has been dredged to a minimum depth of 15 ft (4.5 m). There is no toll.
There is a floating swing bridge (for pedestrians) on the Northern part of the canal which opens between 0800 and 2100 on the hour.
Note: For any temporary changes to normal opening times for the Lefkas bridge see comments below.
Improvements have been made to the northern entrance and there is now a waiting dock for yachts coming down from the north. Dredging also means there is now much more depth at this entrance.
It has been reported that it is likely that any Navonics electronic chart is inaccurate at the northern entrance to the canal, due to the shifting sand bank there. In the past, a dredger has been present here most of the time to stop the entrance from silting up. Whether this is still on station now that the depth improvements have been made, is yet to be confirmed.
The port of Lefkas is situated where the canal bends NE/SE. Take particular note of the buoys marking the channel as you are sure to go aground if you stray outside these limits.
Anchoring
Anchoring has always been prohibited in the harbour, since the harbour is part of the channel and as such is considered a fairway. In the past however, a limited number of yachts did anchor causing an obstruction to through traffic. Therefore as of summer 2009 the Port Authority have become much stricter on prohibiting anchoring. However this may be a seasonal rule as cruisers in September 2009 reported anchoring in available space for a week with no problems.
There may be space to berth on the town quay or otherwise use the marina.
www.lefkas.gr is a useful source of information.
Last updated June 2016.


{% extends 'base.html' %} {% block title %}About{% endblock %} {% block content %}
For a full list of contributors and additional information please visit: Athina Github Organisation
Contributions to the project are more than welcome! Also, feel free to share your assignment tests and configuration with others


Address Book
Add a Contact:
First Name
Last Name
Home phone
Work Number
Personal Mobile
Work Mobile
Home Address
Work Address
Email
Post Address
Add
Contacts:
First Name:
Last Name:


The Week 6
This week we focus on two aspects.
First is the selection of the method for calculating the semantic vectors similarity.
Second is the experiment of doing benchmark evaluation in GERBIL-QA.
1. The Calculation Of Vectors Similarity
1.1 The Methods for Measuring the Vectors
Method 1: Cosine Similarity
def cosine_distance(v1, v2):
if v1.all() and v2.all():
return np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2))
else:
return 0
Method 2: Manhattan distance
Taxi geometry or Manhattan distance or grid line distance is a vocabulary created by Herman Minkowski, which is the geometric term used in the Euclidean geometric metric space to indicate two points. The sum of the absolute wheelbases on the standard coordinate system.
def manhattan_distance(v1, v2): #
return np.sum(np.abs(v1 - v2))
Method 3: Euclidean distance
Defined on two vectors (two points): the Euclidean distance between the points is:
def euclidean_distance(v1, v2): #
return np.sqrt(np.sum(np.square(v1 - v2)))
Method 4: Euclidean distance standardized
def euclidean_standardized_distance(v1, v2): #
v1_v2 = np.vstack([v1, v2])
sk_v1_v2 = np.var(v1_v2, axis=0, ddof=1)
zero_bit = 0.000000001
distance = np.sqrt(((v1 - v2) ** 2 / (sk_v1_v2 + zero_bit * np.ones_like(sk_v1_v2))).sum())
return distance
Method 5: Hamming Distance
In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different.
def hamming_distance(v1, v2):
n = int(v1, 2) ^ int(v2, 2)
return bin(n & 0xffffffff).count('1')
Method 6: Chebyshev distance
In mathematics, Chebyshev distance (or Tchebychev distance), maximum metric, or L∞ metric is a metric defined on a vector space where the distance between two vectors is the greatest of their differences along any coordinate dimension. It is named after Pafnuty Chebyshev.
def chebyshev_distance(v1, v2): #
return np.max(np.abs(v1 - v2))
Method 7: Minkowski distance
The Minkowski distance is a metric in a normed vector space which can be considered as a generalization of both the Euclidean distance and the Manhattan distance.
def minkowski_distance(v1, v2): #
return np.sqrt(np.sum(np.square(v1 - v2)))
Method 8: Mahalanobis distance
Defined on two vectors (two points), the two points are in the same distribution. The Mahalanobis distance between the points is:
def mahalanobis_distance(v1, v2): #
X = np.vstack([v1, v2])
XT = X.T # numpy.ndarray.T
S = np.cov(X) # Covariance matrix between two dimensions
try:
SI = np.linalg.inv(S) # Inverse matrix of covariance matrix
except:
SI = np.zeros_like(S)
# The Mahalanobis distance calculates the distance between two samples. There are 10 samples in total, and there are a total of 45 distances.
n = XT.shape[0]
distance_all = []
for i in range(0, n):
for j in range(i + 1, n):
delta = XT[i] - XT[j]
distance_1 = np.sqrt(np.dot(np.dot(delta, SI), delta.T))
distance_all.append(distance_1)
return np.sum(np.abs(distance_all))
Method 9: Bray Curtis distance
In ecology and biology, the Bray–Curtis dissimilarity is a statistic used to quantify the compositional dissimilarity between two different sites, based on counts at each site.
def bray_curtis_distance(v1, v2): # Biological ecological distance
up_v1_v2 = np.sum(np.abs(v2 - v1))
down_v1_v2 = np.sum(v1) + np.sum(v2)
zero_bit = 0.000000001
return up_v1_v2 / (down_v1_v2 + zero_bit)
Method 10: Pearson correlation
A Pearson correlation is a number between -1 and 1 that indicates the extent to which two variables are linearly related. The Pearson correlation is also known as the “product moment correlation coefficient” (PMCC) or simply “correlation”.
def pearson_correlation_distance(v1, v2): #
v1_v2 = np.vstack([v1, v2])
return np.corrcoef(v1_v2)[0][1]
Method 11: Jaccard similarity coefficient
The Jaccard index, also known as Intersection over Union and the Jaccard similarity coefficient (originally given the French name coefficient de communauté by Paul Jaccard), is a statistic used for gauging the similarity and diversity of sample sets. If A and B are both empty, we define J(A,B) = 1.
def jaccard_similarity_coefficient_distance(v1, v2):
v1 = np.asarray(v1)
v2 = np.asarray(v2)
up = np.double(np.bitwise_and((v1 != v2), np.bitwise_or(v1 != 0, v2 != 0)).sum())
zero_bit = 0.000000001
down = np.double(np.bitwise_or(v1 != 0, v2 != 0).sum() + zero_bit)
jaccard = up/down
return jaccard
Method 12: Word Mover Distance
This is the method for comparing the sentences similarity.
The WMD model is based on the EMD (Earth Mover Distance) model. EMD is the same as Euclidean distance. They are definitions of distance metrics that can be used to measure the distance between two distributions. Its main application in the field of image processing and speech signal processing, WMD model is based on EMD, the scope of the model extends to the field of natural language processing. The detailed principle of EMD is not repeated here.
Matt et al. associate word embedding with EMD to measure document distance. The WMD (word mover’s distance) algorithm and WCD (word centroid distance) and RWMD (relaxed word mover’s distance) algorithms are proposed.
(1) The WMD algorithm uses NBOW (normalized bag-of-words, the normalized word bag model) to represent the distribution P. Where P1 represents the word itself, used to calculate the weight of the word in the current document, wherein the word i appears several times in the associated document, and the feature quantity of P1 is represented by the word vector of the word.
(2) The WMD algorithm uses a Word travel cost to calculate the similarity of the word i to the word j, that is, the Euclidean distance of the word vector of the word i and the word j, and the distance value is
C(i,j)=|(vecI -vecJ)|. Here, C(i,j) is seen as the price paid for converting the word i into the word j.
(3) The WMD algorithm uses the Document distance to represent the distance between documents.
Define the matrix T here. Where Tij (Tij > = 0) indicates how much of the word i in the d document is converted into the word j in the d’ document. In order to ensure that the document d can be converted into the document d’, it is necessary to ensure that the sum of the quantities of all the words in the word d converted to d’ is di, that is, the same reason, it should also satisfy the word j converted into the d’ document in the d document. The total amount is dj, ie. We can define the distance between document d and d’ as the minimum cost of converting all words in d into words in d’.
def word_move_distance(model, sentence1_split, sentence2_split): # WORD MOVER DISTANCE, it's the important one
# model = gensim.models.KeyedVectors.load_word2vec_format(word2_vec_path, unicode_errors='ignore', limit=None) # ,binary=True)
# model.init_sims(replace=True)
distance = model.wmdistance(sentence1_split, sentence2_split)
return distance
1.2 Choose Which Method:
First, we must liook at the constraints of what we want.
Second, it should be for what purpose.
To answer the first question, we must also keep in mind that we are using the metho on the word vectors.
To the second, we should focus on the distinguishability of the semantic meanings of two phrases in the form of GloVe vectors.
The Method 2(Manhattan distance) is not pertinent to our vector calculation, because we are not mearsuring a path.
The Method 3(Euclidean distance) is for measuring the spatial distance between two points, which might not reflect the similarity between two words.
The Method 5(Hamming Distance) is major in comparing the partial differences of two long string or documents, which might be not suitable for our phrases comparison.
The Method 7(Minkowski distance) is rather closer to the combination of Method 2 and Mehod 1, but is still more pertinent to the calculation of spatial distance.
Method 8(Mahalanobis distance), Method 9(Bray Curtis distance) and Method 10(Pearson correlation) are the metric based on statistic distribution, which might not be suitable for the GloVe vectors’ design ideas to represent the semantic meaning.
Then, the final candidate pool leaves only the method of cosine similarity and the method of jaccard similarity coefficient distance,
Let’s have the experiments:
- we randomly select a list of one hundred entities with related predicates from the generated training data, to see the precision that the two different mathod works
| Method | Accuracy |
|---|---|
| Cosine Similarity | 53% |
| Jaccard Similarity | 4% |
- Analyses of The Result Let’s take an example: we used the natural language pair <”wife”, “Obama”> with expectation to get the entity pair <dbo:spouse, dbr:Barack_Obama>. So, did they succeed to get the dbo:spouse from “wife”?
| Method | Prediction Result |
|---|---|
| Cosine Similarity | dbo:spouse, dbp:parents |
| Jaccard Similarity | dbo:speaker |
The Cosine method can catch more information in the vectors, while the Jaccard catches the distinguished 0-1 binary differences in each bit.
When looking into the two lists of scores that compared the similarity between the target phrase “wife” and the list of candidate strings, we found that: the scores of Jaccard method are mostly greater than 0.99, or otherwise 0; the scores of Jaccard method have an average approximate to 0.5.
And, according to a tutorial from Stanford [1],
When utilities are more detailed ratings, the Jaccard distance loses important information.
Because Jaccard is mainly used to judge the similarity between sets, he can’t reflect more information like a matrix. A simple example might be, when I make a movie recommendation, I use the data of the user to calculate the similarity between the movies. With Jaccard, I can only use a single feature of the score that a watcher feedbacked, but in Cosine’s calculation, it can add every feature of the watcher’s rating information for the movie.
To sum up,
The Cosine similarity could be used to identify plagiarism, but will not be a good index to identify mirror sites on the internet. Whereas the Jaccard similarity will be a good index to identify mirror sites, but not so great at catching copy pasta plagiarism (within a larger document). [2]
References
[1] Jeffrey D. Ullman (2017) http://infolab.stanford.edu/~ullman/mmds/ch9.pdf
[2] OluwaYetty (2018) http://techinpink.com/2017/08/04/implementing-similarity-measures-cosine-similarity-versus-jaccard-similarity/


| Home | Libraries | People | FAQ | More |
boost::range_run_storage::difference1 —
template<typename Base> struct difference1 { // types typedef iterator_difference< Base >::type difference_type; typedef unit_run< difference_type > result_type; // construct/copy/destruct difference1(Base); // public member functions result_type operator()(Base const &) const; };
| Copyright © 2006 Eric Niebler |


--- layout: oregon-2017/camp-detail title: Offline Camp Schedule tab: schedule root_path: ../../ ---
First things first. When booking your travel, please be careful to allow sufficient travel time to our somewhat remote destination. Hop over to our FAQ for more info.
Offline Camp is a mix of formal discussion and informal networking and relaxation, and we sometimes make schedule adjustments on site to adapt to whatever awesomeness ensues. That said, here's a sneak peek at our schedule for the weekend. (Don't worry, there are also breaks mixed in between these activities!)
3:00 pm - 6:00 pm - Arrive at Cascade Mountain Ranch
7:00 pm - Dinner and welcome
Evening - Campfire & relaxation
8:30 am - Breakfast
9:30 am - Standup
10:30 am - Voting for unconference sessions
11:15 am - Unconference sessions & recaps (round 1)
1:00 pm - Lunch
2:00 pm - Passion Talks
3:15 pm - Unconference sessions & recaps (round 2)
5:00 pm - Unconference sessions & recaps (round 3)
7:00 pm - Dinner
Evening - Campfire & relaxation
8:30 am - Breakfast
9:30 am - Standup
10:15 am - Voting for unconference sessions
10:45 am - Unconference sessions & recaps (round 4)
1:00 pm - Lunch
2:00 pm - Unconference sessions & recaps (round 5)
3:30 pm - Passion Talks
4:30 pm - Family photo
4:45 pm - Socialize and follow up on discussions
7:00 pm - Dinner
Evening - Campfire & relaxation
8:30 am - Breakfast
9:30 am - Standup
10:15 am - Camp clean-up
11:00 am - Depart


Articles to Read
Article Title 1: Just a sample article for placeholder..
Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed? Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true ...
Read MoreArticle Title 2: Just a sample article for placeholder..
Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed? Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true ...
Read MoreArticle Title 3: Just a sample article for placeholder..
Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed? Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true ...
Read MoreArticle Title 4: Just a sample article for placeholder..
Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed? Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true ...
Read MoreArticle Title 5: Just a sample article for placeholder..
Come and listen to a story about a man named Jed - a poor mountaineer barely kept his family fed? Just two good ol' boys Wouldn't change if they could. Fightin' the system like a true ...
Read MoreWhy Thinking Right to Left?
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget sem et velit finibus finibus. Fusce vel orci in justo ullamcorper pellentesque varius sit amet dui. In a velit non est egestas consequat eget eu tortor. Aliquam luctus, tellus vitae ornare dignissim, odio metus sodales quam, non elementum tellus nisl sit amet dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ullamcorper, massa at dignissim aliquet, urna enim accumsan justo, at placerat lectus enim ut dolor.
Read More..Why Thinking Right to Left?
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget sem et velit finibus finibus. Fusce vel orci in justo ullamcorper pellentesque varius sit amet dui. In a velit non est egestas consequat eget eu tortor. Aliquam luctus, tellus vitae ornare dignissim, odio metus sodales quam, non elementum tellus nisl sit amet dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ullamcorper, massa at dignissim aliquet, urna enim accumsan justo, at placerat lectus enim ut dolor.
Read More..


Dr. Damian Hills
• No large IDE required for development, just a browser and text editor
• Use tools web developers know - javascript, HTML
• Desktop/Mobile Progressive Web Apps (PWA)
• Cross platform
XR: The term XR has been referred as Cross Reality or eXtended Reality but the X has been mostly used as a flexible placeholder for different types of immersive technologies.
WebXR was created to target a wider range of immersive devices beyond just VR. Including AR devices such as phones, Microsoft HoloLens and Oculus Quest (or any device that supports the standard)
...is a design philosophy that centers around providing a baseline of essential content and functionality to as many users as possible, while at the same time going further and delivering the best possible experience only to users of the most modern browsers that can run all the required code.
..using its inbuilt Edge browser and now Firefox Reality Browser
..also has strong support for WebXR (Go, Quest)
spiderman link
spiderman video
..developed in aframe, WebXR beat saber
Share a virtual room with friends.
...open sourced game engine developed by Microsoft
...webGL game engine
three.js - GPU shaders
•Learn some aframe
•Learn to use glitch.me to edit aframe
• Learn how to prepare 3D files for web (GLTF/GLB)
• Develop an online portfolio (for your 360,sketchfab and terrain)
...good source of GLTF files


Indian Navy Entrance Test 2019: Notification released, check details here
Indian Navy recruitment 2019: Notification has been released for Indian Navy Entrance Test (INET) for January 2021 course. The registration link to open on November 29 at the official website-joinindiannavy.gov.in.
by Education DeskIndian Navy recruitment 2019: The Indian Navy has released a notification inviting applications for the recruitment of Short Service Commission Officer through Indian Navy Entrance Test (INET) for January 2021 course. The interested candidates should apply online from November 29 at the official website-joinindiannavy.gov.in
The total number of vacant posts is 144 and the last date to submit online applications is December 19, 2019.
Indian Navy recruitment 2019: Vacancy Details
-SSC Naval Armament Inspection Cadre: 6 posts
-SSC ATC: 4 posts
-SSC Observer: 6 posts
-SSC Pilot (MR): 3 posts
-SSC Pilot (Other than MR): 6 posts
-SSC Logistics: 11 posts
-SSC X (IT): 10 posts
-SSC General Service (GS/X)/Hydro Cadre: 30 posts
-SSC Engineering Branch [General Service (GS)]: 26 posts
-SSC Electrical Branch [General Service (GS)]: 27 posts
-SSC Education: 15 posts
Indian Navy recruitment 2019: Application fee
-General/OBC category candidates: Rs 215
-SC/ST/Women candidates are exempted from paying the application fee.
Indian Navy recruitment 2019: Selection Procedure
-The candidates will be shortlisted on the basis of INET. The time duration of INET will be of two hours.
-It will consist of 100 multiple choice questions on English, Reasoning & Numerical Ability, General Science, Mathematical Aptitude and General Knowledge.
-Each section will comprise of 100 marks and there will be negative marking of one mark for every incorrect answer.
Indian Navy recruitment 2019: Important documents
-The candidates should have a relevant e-mail ID and a working mobile number.
-The candidates should have marksheet up to fifth and seventh semester for regular B.E./B.Tech courses and other dregree exams, date of birth proof (according to the 10 and 12 certificates) and recent passport size coloured photograph.
Indian Navy recruitment 2019: How to apply
-All the interested candidates will be able to apply online on the official website-joinindiannavy.gov.in from November 29 to December 19, 2019.