Farmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second bucket is filled or the first bucket is empty. Once begun, a pour must be completed, of course. Being thrifty, no milk may be tossed out.
Write a program to help FJ determine what amounts of milk he can leave in bucket C when he begins with three buckets as above, pours milk among the buckets for a while, and then notes that bucket A is empty.
A single line with the three integers A, B, and C.
8 9 10
A single line with a sorted list of all the possible amounts of milk that can be in bucket C when bucket A is empty.
1 2 8 9 10
2 5 10
5 6 7 8 9 10


GBDI Arboretum
Version Release 1
stInstanceCache< ClassType, AllocatorType > Class Template Reference
[Utilities]
#include <stUtil.h>
List of all members.
Detailed Description
template<class ClassType, class AllocatorType>
class stInstanceCache< ClassType, AllocatorType >
This class template implements a generic instance cache. The idea behind this class is to create a replacement to new and delete operations (Get() and Put()). The creation of a new instance is avoided if there is a non-used instance available otherwise a new instance is created. The same principle is valid to deletion but in a reverse way. In other words, it ca be used to cache instances of a given class to be used later.
To manage the class creations and deletions, there is an interface called stInstanceAllocator that can manage class creations and deletions. This interface defines only two methods:
- ClassType * Create(): Creates a new instance.
- void Dispose(ClassType * instance): Disposes a given instance. There is a default implementation called stInstanceAllocator (a template with the same name of the interface) which supports the creation using a constructor with no parameters.
This class template was designet to work with stPage instances but may be used in any other situations where an existing instance can be reused. This can make some operations faster because the new and delete operations are usually slow.
- Author:
- Fabio Jun Takada Chino<EMAIL_ADDRESS>Marcos Rodrigues Vieira<EMAIL_ADDRESS>- Version:
- 1.0
- Warning:
- There are classes which this concept is not suitable.
- See also:
- stInstanceAllocator
Definition at line 1056 of file stUtil.h.
Constructor & Destructor Documentation
|
template<class ClassType, class AllocatorType> |
| stInstanceCache< ClassType, AllocatorType >::stInstanceCache |
( |
int |
capacity, |
|
|
AllocatorType * |
allocator |
|
) |
[inline] |
|
|
|
Creates a new instance of this instance cache. This method will claim the owneship of the allocator.
- Parameters:
-
| capacity | Maximum number of entries in the cache. |
| allocator | The allocator of the ClassType. |
Definition at line 1065 of file stUtil.h. |
|
|
Disposes this cache and all cached instances. The allocator is also disposed. |
Member Function Documentation
|
template<class ClassType, class AllocatorType> |
| ClassType* stInstanceCache< ClassType, AllocatorType >::Get |
( |
|
) |
[inline] |
|
|
|
Gets ans instance from the cache.
Definition at line 1080 of file stUtil.h. |
|
template<class ClassType, class AllocatorType> |
| void stInstanceCache< ClassType, AllocatorType >::Put |
( |
ClassType * |
instance |
) |
[inline] |
|
|
|
Puts an instance back into this cache.
- Parameters:
-
| instance | The instance to be put back in the cache. |
Definition at line 1094 of file stUtil.h. |
The documentation for this class was generated from the following file:
Generated on Mon Mar 21 16:12:07 2005 for GBDI Arboretum by Doxygen 1.3.4
Copyright © 2002-2003 GBDI-ICMC-USP


BACKGROUND
The ion interactive platform relies on over 100 templates to create data-driven experiences without tech-savvy resources or developer code. The platform shifted to this templated approach in 2014 when I joined, and a major part of my role was developing these templates.
GOAL
Creating headache-free templates for web experiences that typically would require intensive front-end and back-end development, such as calculators or assessments. The templates needed to to be user-friendly to both the end-user and the customer utilizing the platform.
TIMELINE
The Quick Start Cloud has been a growing, iterative process that has been ongoing with myself and my team since 2014.


Welcome To Salmon Cookies Shops
This list of our shops:
Seattle Shop
Tokyo Shop
Dubai Shop
Paris Shop
Lima Shop
Sales For each shop


Ask questions or make suggestions about marketing, business development, or anything else relevant. This is the channel to discuss topics with Komodo team.
"The increasing gap between the ability of law enforcement to lawfully access data and their ability to acquire and use the content of that data is a pressing international concern that requires urgent, sustained attention..."
In other words...
https://t.co/mmZOy9eNEn #c...
2
my response lol, sorry not KMD marketing related
Gordon Komodo01-Sep-18 01:15 AM
The Simpsons has every memes for every occasions LOL(edited)
1
Regnar01-Sep-18 01:16 AM
back then they weren't memes, they were called comics...
Gordon Komodo01-Sep-18 01:20 AM
I hear you, I am just starting to get used to the word memes myself.
1
Deleted User01-Sep-18 01:28 AM
Anyone know just how secure apps like wickr are?
I know the heavies use thousand$/month blackberry subscription services for messaging, but the general population thinks apps like wik are 100% private(edited)
We need a privacy messaging dapp
Pretty sure I saw jl mention yes and that vrsc was doing just that for komodo but dont mark my words
I personally think it would be a great feature in Agama. A little mail box in the corner, and it's really just a wallet that views all the messages that were sent to your address.
Gordon Komodo01-Sep-18 01:56 AM
It would be great for all projects , I'll say , The main issue is I think to make it easy to use.(edited)
Regnar01-Sep-18 01:59 AM
yea a great feature of KMD AC too, seeing as they all have shared addresses, you could easily send messages to whales and ask if they want to be liquidity providers, warn addresses that accidentally fork off, make a community game like smart contract locked riddles posted on a message board, the right answer is the key to the wallet lol
^Copyrighted!
lol
1
hmm
I'm going to do that right now
screw it, it's a Friday night, what else would I do but start a community contest for fun
Gordon Komodo01-Sep-18 02:03 AM
I plan to do "did you know?" twitter post once a day or a week, just to educate the public,(edited)
Regnar01-Sep-18 02:03 AM
I'll create a seed that is the answer to a riddle, I'll send some KMD to the address and post the wallet address, and the riddle on twitter, and see who can take the funds
1
hmm this could be fun
Gordon, lets go to private channel and think of a riddle haha
Gordon Komodo01-Sep-18 02:05 AM
I am bad at making riddle
1
Regnar01-Sep-18 02:05 AM
hmm. The riddle should be something that forces people to look into Komodo tech
Gordon Komodo01-Sep-18 02:06 AM
yeah, it will be educational and rewarding as well(edited)
Regnar01-Sep-18 02:06 AM
yes!
Gordon Komodo01-Sep-18 02:06 AM
depending on the size of the pot of course (edited)
Regnar01-Sep-18 02:06 AM
I was going to put 10 KMD so it gains rewards. But I'm not by any means a wealthy doge
Gordon Komodo01-Sep-18 02:07 AM
we can always raise it from the community
Regnar01-Sep-18 02:07 AM
worth a shot haha
Regnar01-Sep-18 05:39 AM
Just to give everyone in here the heads up, Gordon Komodo and I just spent the past 3 hours creating a completely custom Seed phrase. We've been contacting various KMD AC projects and searching their pages/documents/information to find a word to use for part of the seed. Each word doesn't have to be/or isn't at all related to crypto or even Komodo (this was so normal words could be used and not easily guessed/brute forced with Komodo key words). and we have some directions to find the word in the resources. something like "Bitcoin/bible/48th word" which could be interpreted as the 48th word of the Bitcoin White Paper. easy. But not all will be that easy.
We've also gotten commitments from two projects so far to donate coins to the seed wallet which should really up the pot. We are waiting on a few other projects as well and because there is some decent coinage here we did NOT want to make this TOO easy. We are still working out the clues/directions to see if they are too easy/hard but that will be determined later.
The words locations are picked strategically to get as many eyes on Komodo tech, resources, the AC's, channels, etc.
Ideally we think that before this goes live we can create some simple posters, and tease the wallet balance on twitter as a "Seed Scavenger Hunt" or something. We were going to do riddles, But this seems like a better way because the winner just needs to be able to interpret the clues, find the location, and find the word. It would probably be much better to have the official twitter blast this out when it's time so that we get it out to as many people as possible as fast as possible. Another criteria we were thinking was to release the first 6 clues immediately, and when retweets hit a certain point, we release the rest. this way we create an incentive for contestants to actually spread the word.
Thoughts?(edited)
Deleted User01-Sep-18 05:41 AM
Fuckyeah that’s my thoughts mentioned a similar idea on that Komodo influencers webpage a while ago.
1
How bigs the pool in usd by the end of it you reckon? Not that I’m smart enough to crack it HAHA but might donate some in if it’s not too big
Regnar01-Sep-18 05:43 AM
Another thought was to add a 13th word/string as a safety so that the first person to show the correct seed gets the 13th word to get into the wallet, that way when there isn't a bunch of people snagging coins with the same seed when they are trying to move them out. OR we just let it be a free for all lol
No idea right now tbh. we have two commitments which is much more than I thought we'd get just asking, especially because a lot of people are sleeping haha
but it is looking good so far
blackjok3r01-Sep-18 05:46 AM
I will put some STAKED and PIRATE towards that.
2
Regnar01-Sep-18 05:47 AM
This is going to be a diverse prize haha
Deleted User01-Sep-18 05:47 AM
I’ll put some beer and pizza
1
Regnar01-Sep-18 05:48 AM
lol honestly, why not
It might be a good idea to have a much longer seed phrase, like the true seed be 24-36 words, and we just give out the first 12 as clues
just so if the person decides they don't feel like moving all these coins haha they will be safe in the wallet
idk, up for debate
Deleted User01-Sep-18 05:49 AM
Would be cool to have a bit of every asset chain coin in the reward
Regnar01-Sep-18 05:50 AM
yea it would
Sharing the same wallet address helps!
makes moving the coins for the winner easier.
not sure if Verus, STAKED, or PIRATE have same addresses. Pirate is I think all Z address(edited)
Deleted User01-Sep-18 05:51 AM
Verus is same can confirm
Sent kmd to vrsc address thought I lost it all LOL(edited)
Regnar01-Sep-18 05:51 AM
really? hmm
cool
Okay I'm going to go to sleep. I'll be gone most of tomorrow, but maybe early in the morning I'll be on to work on this, I see no reason to try and rush this, if we have a proper competition it could drum up some nice joint community support and awareness
Komodo coin itself is not only a cryptocurrency for use in commerce, it contains extras that you won't find in many, if any, other crypto coins or tokens.
Regnar01-Sep-18 02:08 PM
not sure where to find it if there is one, but where can someone go to see notarizations? like to see if a block has been notarized or not yet?
So if I'm reading this right, I should be looking for the "notarized hash" in the "btc_txid"?
Regnar01-Sep-18 03:15 PM
So looks like we have commits for 6 different types of coins to be in the custom seed! should be a lot of fun :D
I think because of the variability in the wallets required (PIRATE needs z address and full node, and Verus isn't in KMD agama, but only Verus Agama) it will be very difficult for the first person to solve all the clues to move all the coins to a safe wallet before someone snatches part of the prize.
This could be part of the game, or we go with a winner takes all style. And this would have us build an actual 24-36 word seed, and only release the first 12 words. the person who finds the first 12 words of the seed and tells us, will receive the rest of the seed and can take their time removing coins or w.e.
Thoughts?
jspook1601-Sep-18 03:57 PM
i would think that a person that believes they have solved it would keep the "seed" private (to themselves), try to login and see if it is the correct one without it going public. Or am i missing something
we would know the riddle was solved when the funds move
Regnar01-Sep-18 03:58 PM
Yea that was the original idea
I think the problem is that there are a lot of different coins, and they aren't all supported in Agama. So it would be hard to move all the coins out of the exposed address quickly. so for example PIRATE has been chipped in, but that coin ONLY works in Z addresses and needs a full blockchain download. Which makes it not easy to access that wallet. So while multiple people may solve the seed, and the fastest starts removing coins, they may not get all the coins because someone else might take PIRATE, or Verus (which is in a different version of Agama)
Then again that could be the point. that there can be multiple winners and the fastest wins
or we do winner takes all
It's included as part of the fun. Not because it has any value
jspook1601-Sep-18 04:04 PM
I think having multiple winners can be good for the following reasons. If person A solves the riddle, he is now on time crunch to move the different coins using the different wallets. So solving it does not gaurantee all (or any for that matter) coins and the urgency usually leads to quickly learning to do something that you might not be familiar with
Regnar01-Sep-18 04:04 PM
yea I kinda agree jspook
plus it is less effort on our part, I don't have to monitor my twitter and find the first person to send me a message, verify the seed, etc
@Gordon Komodo what do you think?
jspook1601-Sep-18 04:07 PM
yeah its "less" controlled by you guys too. If a person is serious about it, when the address goes public, they would get familiar with the different wallets needed based on the coins in the address. Just my thoughts
Gordon Komodo01-Sep-18 04:07 PM
that will be easier on our part
jspook1601-Sep-18 04:08 PM
I think thats where the real value is, getting people to interact with the different wallets and actually make z transactions if they have to.
Either way its a really good idea
Maybe in the future, a cc contract and some AI can take the human factor out of creating the seed. (Basically an AI created riddle)
1
Regnar01-Sep-18 04:11 PM
haha yea you'd be surprised how tedious it is
at least this way.
jspook1601-Sep-18 04:11 PM
yeah you have to put it together then test to make sure it can be solved im guessing
Regnar01-Sep-18 04:12 PM
We are picking words that force people to look through information about komodo, apps, AC, whitepapers, blogs, pretty much anything. and are really creative in picking the words. It's not as easy as "Komodo uses what mining algo" or anything. There is some effort, which is why I think fastest wins
and then having to make directions to find what is oftentimes a normal word, and then figure out how to make it a bit trickier while still solveable
jspook1601-Sep-18 04:13 PM
lol yeah i can imagine. I hope something related to jumblr makes it in


On January ( Two months ago ) , I decided to learn Vim after watching screencast from Destroy All Software. In one of the screencast, the guy shows how fast you can program when using Vim and use plugin to make it even better.
I have known Vim for 4 years now but never actually keen to learn all the shortcuts. I remember I been to one of the PHP meetup in my city and one guy was presenting some of his code using Vim. One of the audience commented “Why you need to use Vim if you have IDE and all of the GUI ?”. At that time, I couldn’t agree more with that guy.
I had always thought Vim’s user are just trying to show off that they are different and superior. Using Vim basically separate them from GUI’s group and put them one level above. At least, that’s what I was thinking and apparently I am wrong.
After started using Vim, I can feel that I am more productive and less stressful when programming. All the shortcuts definitively help you to avoid redundancy and remove your reliance on mouse. You can navigate through the source code by only using keyboard.
The book that I am using to learn VIM is “Practical Vim : Edit Text at the Speed of Thought” by Drew Neil. If you are new with Vim, I’ll strongly recommend to start with this book. This book has collection of tips on how to use Vim in real situation and you going to feel you learn Vim faster.
However, before deciding to learn Vim, you need to know that Vim is not for everyone. You know that you are not suitable for Vim when you :
Still looking at your keyboard when typing.
Have problem or hate remembering shortcuts.
Don’t have any curiosity to find another way to achieve something.
If you are an IDE fan such as Eclipse, Netbeans or Visual Studio. There are some plugins that you can download to unleash the Vim power in your IDE. At the moment, I am using VsVim to use all the Vim shortcuts when programming in C#. If you want to become better programmer, I’ll say start using Vim and you won’t regret it.


About
I am Jason Scheirer, a completely unremarkable software developer in the Bay Area initially from the Inland Empire. A rough timeline of my life as a software engineer:
- Start programming BASIC in elementary school, escalating to pirated QuickBasic and Turbo Pascal, as well as legal but squirrely DJGPP/RHIDE/Allegro
- Get a part-time job in late high school writing “web applications”
- Get bored in intro CS classes and change majors to Linguistics
- Decide that taking a mere full courseload is for suckers who like sleep and good grades and work 30 hrs/wk to pay tuition and take night classes to teach English at the same time
- Backpedal and get as much CS coursework done as possible before hitting the unit limit for graduation, managing to squeeze in the minor just in time
- List about from company to company in SoCal writing software for 10 years, mostly Python/C, mostly geospatial adjacent
- Move to Bay Area and list about from startup to startup writing software, mostly Python
A rough timeline of my entire life, including the future:
- Born
- Childhood
- Early adulthood
- Adulthood
- Writing bullet points in a text editor
- (Speculative) Dead
The theme for this weblog is a fork of smol, built in Hugo, and hosted on Github Pages through the magic of a CNAME. I’m using Inter and Berkeley Mono (hosted here and not on Google Fonts) so my indulgence of picking custom type shouldn’t hurt the load times of the pages as much as it could (or spy on you).
For diagrams and artwork I use Monodraw and an older version of Xara Photo and Graphic Designer. Sometimes The Gimp and Graphviz come along for the party, too.
I do not have any sort of analytics on this page. I have no idea what my traffic or “engagement” stats look like. I could be getting 1 hit a month, I could be getting 100000 hits a day on some single blog post. I honestly have no idea and it’s not something I want to think about.
There’s also no Javascript on this page.
(Late 2022 update: Javascript exists, where necessary, for “functional” pages like to display games but not for content load or navigation UI trickery.)
If I can ask you but one favor, it is this: if you like the site, tell immediate friends and subscribe to it in your favorite RSS reader. I do not write to provide Internet Brain Geniuses with material to fractally complain about to feel better about themselves on Social Media. I would rather those people not know I exist. Please only share these posts on places where the comments section do not devolve into utter idiocy.
If this site provides you with value, great. If not, keep in mind I owe you nothing.


The story of one man's "salvation" after losing everything.
Childhood
Growing up in Oxford
The War
A Soldier at 20
Immigration
To Melbourne with 10£
Work
Off to the Snowy Mountains
Family
First comes love...
Death
Goodbye at 80
An Interview with Ron's daughter Ann
Childhood
1919 - The Great War was over, the Titanic had sunk, and the Warner Brothers had opened their first film studio. Ronald Bevis Spencer was born into a time of change, almost 1,000,000 British citizens had lost their lives in the war and the country was slowly rebuilding.
Son of Rose Spencer, Ronald never knew his father and was kicked out of home at a young age. He lived with a friend’s family, before enlisting for the army when the Second World War broke out.
War
1939 - The Second World War broke out when Ronald was just 20 years old. After not having a solid family growing up he said that the army was the closest thing to a family that he had.
Ron spent three years in Africa as a Desert Rat in the artillery division. During this period he fought in the Second Battle of El Alamein, as well as in the Doomsday Battle.
Immigration
1949 - Ron left South Hampton for Australia under the Australian Government's Ten Pound Pom scheme. A passenger on the Largs Bay ship, it took him five weeks to complete the journey, arriving in Fremantle in October.
Work
1949 - When he first arrived in Australia, Ron was placed at the Snowy Mountain scheme, building the hydroelectricity and irrigation complex. He stayed here for a few years, before moving back to Melbourne in 1953.
Family
1955 - Whilst in hospital recovering from an eye injury, Ron met Joan Elizabeth Leigh, a 26 year old nursing sister from Oakleigh. He was ten years older than her and working as an Instrument maker. A year later they married.
1962: Ron and Joan welcomed their only child, Ann Marie at Mercy hospital, Brighton.
1993: Ron had two grandchildren, his eldest Alice Claire Smith was born in 1993, and his youngest (and favourite) was born three years later.
Death
1999 - At the age of 80 Ronald Bevis Spencer died of Bowel Cancer, at Knox Private Hospital in Melbourne. His wife and family were by his side.


I've always been interested in technology. I've liked the idea of technology allowing the regular populace to take control of their own lives. Take control and build things like... weather stations?
I've been coding on and off since high school, only doing it more consistently once I got my first real job. That was over 10 years ago<EMAIL_ADDRESS>I like Open Source software. Beyond the fact that it's 'free'.


public class VectorSMath
extends java.lang.Object
| Constructor and Description |
|---|
VectorSMath() |
| Modifier and Type | Method and Description |
|---|---|
static VecS3 |
cross(VecS3 u,
VecS3 v)
Helper method to calculate the cross product of two vectors
|
static VecS4 |
cross(VecS4 u,
VecS4 v)
Helper method to calculate the cross product of two vectors
|
static short |
dot(VecS2 u,
VecS2 v)
Helper method to calculate the dot product of two vectors
|
static short |
dot(VecS3 u,
VecS3 v)
Helper method to calculate the dot product of two vectors
|
static short |
dot(VecS4 u,
VecS4 v)
Helper method to calculate the dot product of two vectors
|
static short |
length(VecS2 v)
Helper method to calculate the length of a vector.
|
static short |
length(VecS3 v)
Helper method to calculate the length of a vector.
|
static short |
length(VecS4 v)
Helper method to calculate the length of a vector.
|
static java.nio.ShortBuffer |
listToBuffer(java.util.List<java.lang.Short> list)
Helper method to create a ShortBuffer from a list of vectors.
|
static VecS2 |
normalize(VecS2 v)
Helper method to normalize a vector.
|
static VecS3 |
normalize(VecS3 v)
Helper method to normalize a vector.
|
static VecS4 |
normalize(VecS4 v)
Helper method to normalize a vector.
|
static java.nio.ShortBuffer |
toBuffer(short[] array)
Helper method to create a ShortBuffer from an array of vectors.
|
static java.nio.ShortBuffer |
toBuffer(VecS2[] array)
Helper method to create a ShortBuffer from an array of vectors.
|
static java.nio.ShortBuffer |
toBuffer(VecS3[] array)
Helper method to create a ShortBuffer from an array of vectors.
|
static java.nio.ShortBuffer |
toBuffer(VecS4[] array)
Helper method to create a ShortBuffer from an array of vectors.
|
static java.nio.ShortBuffer |
vec2ListToBuffer(java.util.List<VecS2> list)
Helper method to create a ShortBuffer from a list of vectors.
|
static java.nio.ShortBuffer |
vec3ListToBuffer(java.util.List<VecS3> list)
Helper method to create a ShortBuffer from a list of vectors.
|
static java.nio.ShortBuffer |
vec4ListToBuffer(java.util.List<VecS4> list)
Helper method to create a ShortBuffer from a list of vectors.
|
public static short dot(VecS2 u, VecS2 v)
u
- The first vector.v
- The second vector.public static short dot(VecS3 u, VecS3 v)
u
- The first vector.v
- The second vector.public static short dot(VecS4 u, VecS4 v)
u
- The first vector.v
- The second vector.public static short length(VecS2 v)
v
- The vector.public static short length(VecS3 v)
v
- The vector.public static short length(VecS4 v)
v
- The vector.public static VecS2 normalize(VecS2 v)
v
- The vector.public static VecS3 normalize(VecS3 v)
v
- The vector.public static VecS4 normalize(VecS4 v)
v
- The vector.public static VecS3 cross(VecS3 u, VecS3 v)
u
- The first vector.v
- The second vector.public static VecS4 cross(VecS4 u, VecS4 v)
u
- The first vector.v
- The second vector.public static java.nio.ShortBuffer toBuffer(short[] array)
array
- The array of vectors.public static java.nio.ShortBuffer toBuffer(VecS2[] array)
array
- The array of vectors.public static java.nio.ShortBuffer toBuffer(VecS3[] array)
array
- The array of vectors.public static java.nio.ShortBuffer toBuffer(VecS4[] array)
array
- The array of vectors.public static java.nio.ShortBuffer listToBuffer(java.util.List<java.lang.Short> list)
list
- The List of vectors.public static java.nio.ShortBuffer vec2ListToBuffer(java.util.List<VecS2> list)
list
- The List of vectors.public static java.nio.ShortBuffer vec3ListToBuffer(java.util.List<VecS3> list)
list
- The List of vectors.public static java.nio.ShortBuffer vec4ListToBuffer(java.util.List<VecS4> list)
list
- The List of vectors.


{% extends "defindex.html" %} {% block tables %}
Parts of the documentation:
|
Tutorial Waf tools Configuration methods |
Core modules Feature reference |
Indices and tables:
|
Global Module Index General Index |
Search page |
Meta information:
|
Copyright Reporting bugs |
About |


--- layout: post title: A nice shiny new website for HeadWest Software tags: - Business - ego - Software Configuration Management - Web status: private type: post published: false meta: _edit_last: '451289' --- HeadWest have a nice shiny new website and we are very proud of it. Head over to HeadWest Software - Making softare development manageable and tell us what you think.
powered by performancing firefox


Aweutist Chatting!
Chatting using Node.js and Socket.io ...
Learn more
Welcome to Aweutist Application Chatting
Login
Send


--- title: colon sidebar: function_reference_sidebar permalink: tensor.colon.html folder: function_reference toc: false ---
double dot A:B between two tensors
\[ (A:B)_{i_1,\ldots,j_n,j_1,\ldots,j_m} = \sum_{k,l} A_{i_1,\ldots,i_n,k,l} B_{k,l,j_1,\ldots,j_m} \]


Three unannounced Nokia phones (TA-1205/1212/1234) certified by EEC
by StipeIt wasn’t long ago that Nokia Mobile announced the Nokia 6.2 and Nokia 7.2, as well as attractive feature phones like the Nokia 2720 and 800 Tough. It was 2 months ago, and while it seems like yesterday, at least to me, that’s a relatively long period in the smartphone market and we might soon see something new.
Three unknown Nokia phones under the model numbers TA-1205, TA-1212 and TA-1234 were certified by the Eurasian Economic Commission and approved for the Russian market. All three of them appeared yesterday, on 15th November, on EEC’s website, without any other meaningful details revealed.
The recent speculations mentioned Nokia 5.2, Nokia 8.2 and Nokia 2.3. Considering we have been hearing about a 5.2 for quite some time, that model might’ve been cancelled. Nokia 8.2 is at the moment developed in 2 versions – a 4G and a 5G version. No one can guarantee that the 4G version will appear at all, but Nokia Mobile might push it out before the Christmas season. Some of the certified devices might also be feature phones.


Clean, FP, Gofer, Hope and Hope+, Id, ISWIM, KRC, Lisp, Miranda, ML and Standard ML, Orwell, SASL, Scheme, SISAL
Agda, Bluespec, C++11/Concepts, C#/LINQ, CAL, Cayenne, Clean, Clojure, CoffeeScript, Curry, Elm, Epigram, Escher, F#, Frege, Hack, Idris, Isabelle, Java/Generics, LiveScript, Mercury, Ωmega, Perl 6, Python, Rust, Scala, Swift, Timber, Visual Basic 9.0
$ git --version
git version 2.16.1
$ ghc --version ⏎ dktn@DktnMBP 2:48:57AM
The Glorious Glasgow Haskell Compilation System, version 8.2.2
$ stack --version
Version 1.6.3 x86_64 hpack-0.20.0
$ stack ghc -- --version dktn@DktnMBP 2:49:28AM
The Glorious Glasgow Haskell Compilation System, version 8.2.2
$ ghci
λ :t "abc"
"abc" :: [Char]
λ :t \x -> x
\x -> x :: p -> p
λ :t \x y -> x + y
\x y -> x + y :: Num a => a -> a -> a
λ let f x = x + 5
λ :t f
f :: Num a => a -> a
λ :i String
type String = [Char] -- Defined in ‘GHC.Base’
λ :k String
String :: *
:load (:l)
:reload (:r)
:type (:t)
:kind (:k)
:info (:i)
:quit (:q)
:help (:h, :?)
:browse
:show bindings
λ :i Int
data Int = GHC.Types.I# GHC.Prim.Int# -- Defined in ‘GHC.Types’
instance Eq Int -- Defined in ‘GHC.Classes’
instance Ord Int -- Defined in ‘GHC.Classes’
instance Show Int -- Defined in ‘GHC.Show’
instance Read Int -- Defined in ‘GHC.Read’
instance Enum Int -- Defined in ‘GHC.Enum’
instance Num Int -- Defined in ‘GHC.Num’
instance Real Int -- Defined in ‘GHC.Real’
instance Bounded Int -- Defined in ‘GHC.Enum’
instance Integral Int -- Defined in ‘GHC.Real’
λ :i Num
class Num a where
(+) :: a -> a -> a
(-) :: a -> a -> a
(*) :: a -> a -> a
negate :: a -> a
abs :: a -> a
signum :: a -> a
fromInteger :: Integer -> a
{-# MINIMAL (+), (*), abs, signum, fromInteger, (negate | (-)) #-}
-- Defined in ‘GHC.Num’
instance Num Word -- Defined in ‘GHC.Num’
instance Num Integer -- Defined in ‘GHC.Num’
instance Num Int -- Defined in ‘GHC.Num’
instance Num Float -- Defined in ‘GHC.Float’
instance Num Double -- Defined in ‘GHC.Float’
class Monoid a where
mempty :: a
mappend :: a -> a -> a
mconcat :: [a] -> a
{-# MINIMAL mempty, mappend #-}
-- Defined in ‘GHC.Base’
instance Monoid [a] -- Defined in ‘GHC.Base’
instance Monoid Ordering -- Defined in ‘GHC.Base’
instance Monoid a => Monoid (Maybe a) -- Defined in ‘GHC.Base’
instance Monoid a => Monoid (IO a) -- Defined in ‘GHC.Base’
instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
-- ...
instance Monoid () -- Defined in ‘GHC.Base’
instance Monoid [a] where
{-# INLINE mempty #-}
mempty = []
{-# INLINE mappend #-}
mappend = (++)
{-# INLINE mconcat #-}
mconcat xss = [x | xs <- xss, x <- xs]
data Bool = True | False
data Ordering = LT | EQ | GT
data Maybe a = Nothing | Just a -- parametric polymorphism
data Either a b = Left a | Right b
data List a = Nil | Cons a (List a) -- recursion
data Tree a = Empty
| Node a (Tree a) (Tree a)
λ let a = Just 7
λ let b = Cons "a" (Cons "b" Nil)
λ let c = Node 'a' (Node 'b' Nil (Node 'c')) Nil
λ 7 /= 3
?
λ :t 7 /= 3
?
λ compare 7 3
?
λ :t compare 7 3
?
data Bool = True | False
deriving (Bounded, Enum, Eq, Ord, Read, Show)
-- automatic instances deriving
data Month = January | February | March
| April | May | June
| July | August | September
| October | November | December
deriving (Show, Eq, Ord)
data Person = Person { firstName :: String
, lastName :: String
, age :: Int
} deriving (Show, Eq, Ord)
λ :t firstName
firstName :: Person -> String
λ :t age
age :: Person -> Int
newtype Age = Age Int
newtype Money = MkMoney Int
newtype Size = Size { size :: Int }
-- another convention: "fromSize"
type IntList = [Int]
type StringTree = Tree String
$ ghci 0646519 dktn@DktnMBP 10:44:49pm
λ let a = Age 7
λ let b = MkMoney 8
λ :t a
?
λ :t b
?
λ a == b
?
a :: Age
b :: Money
• Couldn't match expected type ‘Age’ with actual type ‘Money’
-- save in HelloWorld.hs
module HelloWorld where
main :: IO ()
main = putStrLn "Hello World!"
$ ghci 0646519 dktn@DktnMBP 10:44:49pm
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /Users/dktn/.dot/.ghci
λ :l HelloWorld.hs
[1 of 1] Compiling Main ( HelloWorld.hs, interpreted )
Ok, one module loaded.
λ main
Hello World!
$ cat ~/.dot/.ghci 0646519 dktn@DktnMBP 10:45:23pm
:set prompt "\ESC[36mλ \ESC[m"
$ runghc HelloWorld.hs 0646519 dktn@DktnMBP 10:54:41pm
Hello World!
$ stack runghc HelloWorld.hs 0646519 dktn@DktnMBP 10:54:45pm
Hello World!
module HelloWorld where
main :: IO ()
main = do
putStrLn "Hello World!"
putStrLn "Bye."
λ :l HelloWorld.hs
[1 of 1] Compiling HelloWorld ( HelloWorld.hs, interpreted )
Ok, one module loaded.
λ :r
[1 of 1] Compiling HelloWorld ( HelloWorld.hs, interpreted )
Ok, one module loaded.
-- using let ... in
quicksort :: Ord a => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smaller = quicksort [a | a <- xs, a <= x]
larger = quicksort [a | a <- xs, a > x]
in smaller ++ [x] ++ larger
-- using where
quicksort :: Ord a => [a] -> [a]
quicksort [] = []
quicksort (x:xs) = smaller ++ [x] ++ larger
where
smaller = quicksort [a | a <- xs, a <= x]
larger = quicksort [a | a <- xs, a > x]
λ quicksort [ 1, 4, 2, 3, 8 ]
[1,2,3,4,8]
λ quicksort [ "c", "a", "b" ]
["a","b","c"]
Task
max' :: Ord a => a -> a -> a
max' a b -- TODO
if condition -- if expression
then expressionIfTrue
else expressionIfFalse
fun arg1 arg2 -- guards
| cond1 = expr1
| cond2 = expr2
| otherwise = expr3 -- otherwise is a synonym to True
max' :: Ord a => a -> a -> a
max' a b =
if a >= b
then a
else b
max'' :: Ord a => a -> a -> a
max'' a b
| a >= b = a
| otherwise = b
Maximum
(guards, if expression, order of patterns, totality)
maximum' :: Ord a => [a] -> a
maximum' [] = error "why?"
maximum' [x] = x
maximum' (x:xs)
| x > tailMaximum = x
| otherwise = tailMaximum
where tailMaximum = maximum' xs
maximum'' :: Ord a => [a] -> a
maximum'' [] = error "Empty list!"
maximum'' [x] = x
maximum'' (x:xs) =
if x > tailMaximum
then x
else tailMaximum
where tailMaximum = maximum'' xs
maximumTotal :: Ord a => [a] -> Maybe a
maximumTotal [] = undefined
maximumTotal [x] = undefined
maximumTotal (x:xs)
| ???? > tailMaximum = undefined
| otherwise = undefined
where tailMaximum = maximumTotal xs
data Maybe a = Nothing | Just a
maximumTotal :: Ord a => [a] -> Maybe a
maximumTotal [] = Nothing
maximumTotal [x] = Just x
maximumTotal (x:xs)
| Just x > tailMaximum = Just x
| otherwise = tailMaximum
where tailMaximum = maximumTotal xs
λ 3 * 4
12
λ 3 + 4
7
λ True && False
False
λ True && True
True
λ False || True
True
λ not False
True
λ "Hello " ++ "world!"
"Hello world!"
λ import Data.Monoid
λ :i Monoid
class Monoid a where
mempty :: a
mappend :: a -> a -> a
mconcat :: [a] -> a
infixr 6 <>
-- | An infix synonym for 'mappend'.
--
-- @since <IP_ADDRESS>
(<>) :: Monoid m => m -> m -> m
(<>) = mappend
λ "Hello " ++ "world!"
"Hello world!"
λ "Hello " <> "world!"
"Hello world!"
λ (<>) "Hello " "world!"
"Hello world!"
λ "Hello " `mappend` "world!"
"Hello world!"
λ :i (<>)
(<>) :: Monoid m => m -> m -> m -- Defined in ‘Data.Monoid’
infixr 6 <>
λ :i (++)
(++) :: [a] -> [a] -> [a] -- Defined in ‘GHC.Base’
infixr 5 ++
λ True <> False
• No instance for (Monoid Bool) arising from a use of ‘<>’
Why?
instance Num a => Monoid (Sum a) -- Defined in ‘Data.Monoid’
instance Num a => Monoid (Product a) -- Defined in ‘Data.Monoid’
instance Monoid Any -- Defined in ‘Data.Monoid’
instance Monoid All -- Defined in ‘Data.Monoid’
instance Monoid [a] -- Defined in ‘GHC.Base’
instance Monoid Ordering -- Defined in ‘GHC.Base’
instance Monoid a => Monoid (Maybe a) -- Defined in ‘GHC.Base’
λ let boolList = [ True, True, False ] λ mconcat boolList
:53:1: error: • No instance for (Monoid Bool) arising from a use of ‘mconcat’ • In the expression: mconcat boolList In an equation for ‘it’: it = mconcat boolList λ :i Any newtype Any = Any {getAny :: Bool} -- Defined in ‘Data.Monoid’ -- Boolean monoid under disjunction (||) λ :i All newtype All = All {getAll :: Bool} -- Defined in ‘Data.Monoid’ -- Boolean monoid under conjunction (&&) λ :t map map :: (a -> b) -> [a] -> [b]
λ map Any l
[Any {getAny = True},Any {getAny = True},Any {getAny = False}]
λ mconcat $ map Any boolList
Any {getAny = True}
λ mconcat $ map All boolList
All {getAll = False}
λ Sum 5 <> Sum 6 <> Sum 8
Sum {getSum = 19}
λ mconcat $ map Sum [5, 6, 8]
Sum {getSum = 19}
λ Product 5 <> Product 6 <> Product 8
Product {getProduct = 240}
λ mconcat $ map Product [5, 6, 8]
Product {getProduct = 240}
λ mempty :: Any
Any {getAny = False}
λ mempty :: All
All {getAll = True}
λ mempty :: Num a => Product a
Product {getProduct = 1}
λ mempty :: Num a => Sum a
Sum {getSum = 0}
λ mconcat [ EQ, EQ, LT, EQ ]
LT
λ Sum 5 <> Sum 6 <> Sum 8
Sum {getSum = 19}
λ getSum $ Sum 5 <> Sum 6 <> Sum 8
19
λ getSum . mconcat $ map Sum [5, 6, 8]
19
λ :i ($)
($) :: (a -> b) -> a -> b
infixr 0 $
λ :i (.)
(.) :: (b -> c) -> (a -> b) -> a -> c
infixr 9 .
($) :: (a -> b) -> (a -> b)
(.) :: (b -> c) -> (a -> b) -> (a -> c)
λ appEndo (Endo (+ 2) <> Endo (* 3) <> Endo (+ (-1))) 8
23
λ import Data.Function
λ 8 & appEndo (mconcat $ map Endo [(+ 2), (* 3), (+ (-1))])
23
-- | Monoid under addition.
newtype Sum a = Sum { getSum :: a }
-- | Monoid under multiplication.
newtype Product a = Product { getProduct :: a }
instance Num a => Monoid (Sum a) where
mempty = Sum 0
Sum x `mappend` Sum y = Sum (x + y)
instance Num a => Monoid (Product a) where
mempty = Product 1
Product x `mappend` Product y = Product (x * y)
In programming language design, a first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, and assigned to a variable.
Functions are first class citizens in Haskell.
Currying is implicit. Curried functions are more natural.
Currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument. Currying is related to, but not the same as, partial application.
f :: (a, b) -> c
g :: a -> b -> c
λ :t curry
curry :: ((a, b) -> c) -> a -> b -> c
λ :t uncurry
uncurry :: (a -> b -> c) -> (a, b) -> c
curry :: ((a, b) -> c) -> (a -> b -> c)
uncurry :: (a -> b -> c) -> ((a, b) -> c)
λ :t curry
curry :: ((a, b) -> c) -> a -> b -> c
λ :t uncurry
uncurry :: (a -> b -> c) -> (a, b) -> c
λ take 3 [1,2,3,4,5]
[1,2,3]
λ :t take
take :: Int -> [a] -> [a]
λ :t take 3
?
λ :t take 3
take 3 :: [a] -> [a]
λ :t take 3 [1,2,3,4,5]
take 3 [1,2,3,4,5] :: Num a => [a]
newtype Name = Name String
newtype Identity a = Identity a
newtype State s a = State { runState :: s -> (s, a) }
λ :t Name
Name :: String -> Name
λ :k Name
Name :: *
λ :t Identity
Identity :: a -> Identity a
λ :k Identity
Identity :: * -> *
newtype Name = Name String
newtype Identity a = Identity a
newtype State s a = State { runState :: s -> (s, a) }
λ :t State
State :: (s -> (s, a)) -> State s a
λ :k State
State :: * -> * -> *
λ :i (->)
data (->) t1 t2
λ :k (->)
(->) :: * -> * -> *
In computer programming, more so functional programming and type theory, an algebraic data type is a kind of composite type, i.e., a type formed by combining other types.
Two common classes of algebraic types are product types (i.e., tuples and records) and sum types, also called tagged or disjoint unions or variant types.
data [] a = [] | a : [a] -- built-in
data List a = Nil | Cons a (List a) -- note recursion!
data Tree = Empty
| Leaf Int
| Node Tree Tree
deriving (Show, Eq)
data Tree a = Empty
| Leaf a
| Node Tree Tree
deriving (Show, Eq)
tree :: Tree Int
tree = Node
(Node
(Leaf 3)
(Leaf 8)
)
(Node
(Node
(Leaf 1)
(Node
(Leaf 4)
(Leaf 2)
)
)
(Leaf 9)
)
data Tree = Leaf
| Node Tree Tree
deriving (Show, Eq)
longestBranch :: Tree -> Int
longestBranch Leaf = 0
longestBranch (Node b1 b2) =
1 + max (longestBranch b1) (longestBranch b2)
shortestBranch :: Tree -> Int
shortestBranch Leaf = 0
shortestBranch (Node b1 b2) =
1 + min (shortestBranch b1) (shortestBranch b2)
isSubtree :: Tree -> Tree -> Bool
isSubtree Leaf Leaf = True
isSubtree (Node _ _) Leaf = False
isSubtree t1 t2@(Node b1 b2) =
t1 == t2 || isSubtree t1 b1 || isSubtree t1 b2
λ const (+) 1 2 3
λ const 1 (+)
-- what are the results?
λ :t const
const :: a -> b -> a
λ const (+) 1 2 3
5
λ const 1 (+)
1
λ :t id
id :: a -> a
λ id 8
8
λ :t ($) -- what does it do?
($) :: (a -> b) -> a -> b
λ ($) (++ "!") "Hello" -- what is the result?
λ :t (++ "!")
(++ "!") :: [Char] -> [Char]
λ :t (.) -- what does it do?
(.) :: (b -> c) -> (a -> b) -> a -> c
λ (+ 2) . (* 2) $ 3 -- what is the result?
f :: (a -> b -> c) -> b -> a -> c
g :: Int -> a -> [a]
h :: a -> [a]
i :: (a -> b) -> [a] -> [b]
j :: (a -> b -> c) -> [a] -> [b] -> [c]
k :: [a] -> [b] -> [(a, b)]
l :: a -> b -> (a, b)
m :: (b -> a -> b) -> b -> [a] -> b
λ :t flip
flip :: (a -> b -> c) -> b -> a -> c
λ :t replicate
replicate :: Int -> a -> [a]
λ :t repeat
repeat :: a -> [a]
λ :t map
map :: (a -> b) -> [a] -> [b]
f :: (a -> b -> c) -> b -> a -> c
g :: Int -> a -> [a]
h :: a -> [a]
i :: (a -> b) -> [a] -> [b]
j :: (a -> b -> c) -> [a] -> [b] -> [c]
k :: [a] -> [b] -> [(a, b)]
l :: a -> b -> (a, b)
m :: (b -> a -> b) -> b -> [a] -> b
λ :t zipWith
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
λ :t zip
zip :: [a] -> [b] -> [(a, b)]
λ zip [1,2] ["a", "b"]
[(1,"a"),(2,"b")]
λ :t (,)
(,) :: a -> b -> (a, b)
λ let myZip = zipWith (,)
λ :t map
map :: (a -> b) -> [a] -> [b]
λ :t fmap
fmap :: Functor f => (a -> b) -> f a -> f b
λ :t foldl
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
-- task: write functions all, any, sum, product...
λ :t foldr
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
λ :set -XDeriveFunctor
λ data Tree a = Leaf a | Node (Tree a) (Tree a)
deriving (Show, Eq, Functor)
λ let tree = Node (Leaf 1) (Leaf 3)
λ fmap (flip replicate '!') tree -- what it will do?

  >>
getLine >>=
\n -> putStrLn ("Hello, " ++ n)
main = do
putStrLn "Your name?"
 f . g -- pointfree
λ :t h
h :: (b -> b) -> (a -> b) -> a -> b
λ h (+7) (*3) 4
26
-- Test.hs
test x y = do
let z = x + y
print z
return z
-- do -> syntactic sugar for monadic binding: (>>=) and (>>)
λ let f x y = x + y
λ :t f
f :: Num a => a -> a -> a
λ :l Test.hs
λ :t test
test :: (Show t, Num t) => t -> t -> IO t
test :: Int -> Int -> IO Int -- narrow down the type
test x y = do
let z = x + y
print z -- can't use it outside IO!
return z
λ :i IO -- Defined in ‘GHC.Types’
newtype IO a =
GHC.Types.IO
(GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, a #))
instance Monad IO -- Defined in ‘GHC.Base’
instance Functor IO -- Defined in ‘GHC.Base’
instance Applicative IO -- Defined in ‘GHC.Base’
instance Monoid a => Monoid (IO a) -- Defined in ‘GHC.Base’
import Data.Char
main :: IO ()
main = do
putStrLn "Enter your first name"
firstName <- getLine
putStrLn "Enter your last name"
lastName <- getLine
let capitalFirstName = map toUpper firstName
capitalLastName = map toUpper lastName
putStrLn $ "Hello " ++ capitalFirstName ++ " "
++ capitalLastName ++ "!"
λ :i (->) -- ?
data (->) t1 t2 -- Defined in ‘GHC.Prim’
infixr 0 `(->)`
instance Monad ((->) r) -- Defined in ‘GHC.Base’
instance Functor ((->) r) -- Defined in ‘GHC.Base’
instance Applicative ((->) a) -- Defined in ‘GHC.Base’
instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
System F, aka second order lambda calculus (λ2)
Simply typed lambda calculus with type operators (λω with underline)
Edwin Brady (Idris author)
$ stack new exercises
$ cd exercises
$ ls -la
$ stack setup
$ stack clean
$ stack build
$ stack run exercises-exe
$ stack exec exercises-exe
$ stack ghci
λ import Control.Monad.State
λ :t get
λ :t put
λ :t evalState
λ :t runState
λ :t execState
λ :i MonadState
λ :i StateT
newtype StateT s (m :: * -> *) a
= StateT {runStateT :: s -> m (a, s)}
λ :i WriterT
newtype WriterT w (m :: * -> *) a
= WriterT {runWriterT :: m (a, w)}
λ :i ReaderT
newtype ReaderT r (m :: k -> *) (a :: k)
= ReaderT {runReaderT :: r -> m a}
λ import Control.Monad.State
λ :i MonadState
class Monad m => MonadState s (m :: * -> *) | m -> s where
get :: m s
put :: s -> m ()
state :: (s -> (a, s)) -> m a
λ :i MonadWriter
class (Monoid w, Monad m) =>
MonadWriter w (m :: * -> *) | m -> w where
writer :: (a, w) -> m a
tell :: w -> m ()
listen :: m a -> m (a, w)
pass :: m (a, w -> w) -> m a
λ import Control.Monad.Reader
λ :i MonadReader
class Monad m => MonadReader r (m :: * -> *) | m -> r where
ask :: m r
local :: (r -> r) -> m a -> m a
reader :: (r -> a) -> m a
evalState :: State s a -> s -> a
evalState act = fst . runState act
execState :: State s a -> s -> s
execState act = snd . runState act
newtype StateT s m a = StateT { runStateT :: s -> m (a,s) }
type State s = StateT s Identity
-- it's like
newtype State s m a = State { runState :: s -> (a,s) }
-- Return leaves the state unchanged and sets the result:
-- ie: (return 5) 1 -> (5,1)
return :: a -> State s a
return x s = (x,s)
-- Get leaves state unchanged and sets the result to the state:
-- ie: get 1 -> (1,1)
get :: State s s
get s = (s,s)
-- Put sets the result to () and sets the state:
-- ie: (put 5) 1 -> ((),5)
put :: s -> State s ()
put x s = ((),x)
newtype State s a = State { runState :: s -> (a, s) }
return :: a -> State s a
return x s = (x,s)
(>>=) :: State s a -> (a -> State s b) -> State s b
p >>= k = State $ \ s0 ->
let (x, s1) = runState p s0 -- Running the first processor on s0.
in runState (k x) s1 -- Running the second processor on s1.
instance (Functor m) => Functor (StateT s m) where
fmap f m = StateT $ \ s ->
fmap (\ ~(a, s') -> (f a, s')) $ runStateT m s
{-# INLINE fmap #-}
instance (Functor m, Monad m) => Applicative (StateT s m) where
pure a = StateT $ \ s -> return (a, s)
{-# INLINE pure #-}
StateT mf <*> StateT mx = StateT $ \ s -> do
~(f, s') <- mf s
~(x, s'') <- mx s'
return (f x, s'')
{-# INLINE (<*>) #-}
m *> k = m >>= \_ -> k
-- simplified
(>>=) :: State s a -> (a -> State s b) -> State s b
p >>= k = State $ \ s0 ->
let (x, s1) = runState p s0 -- Running the first processor on s0.
in runState (k x) s1 -- Running the second processor on s1.
instance (Monad m) => Monad (StateT s m) where
return a = StateT $ \ s -> return (a, s)
{-# INLINE return #-}
m >>= k = StateT $ \ s -> do
~(a, s') <- runStateT m s
runStateT (k a) s'
{-# INLINE (>>=) #-}
fail str = StateT $ \ _ -> fail str
{-# INLINE fail #-}
(a -> a) -> a
fix :: (a -> a) -> a
fix f = let x = f x in x
Prelude> :m Control.Monad.Fix
Prelude Control.Monad.Fix> fix (2+)
*** Exception: stack overflow
Prelude Control.Monad.Fix> fix (const "hello")
"hello"
Prelude Control.Monad.Fix> fix (1:)
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,...
-- fix f = let {x = f x} in x
fix (\next guess tol val -> if abs(guess^2-val) < tol
then guess
else next ((guess + val / guess) / 2.0) tol val)
2.0 0.0001 25.0
= (let {next = (\next guess tol val -> if abs(guess^2-val) < tol
then guess
else next ((guess + val / guess) / 2.0) tol val) next}
in next) 2.0 0.0001 25.0
= let {next guess tol val = if abs(guess^2-val) < tol
then guess
else next ((guess + val / guess) / 2.0) tol val}
in next 2.0 0.0001 25.0
= 5.000000000016778
> let fact n = if n == 0 then 1 else n * fact (n-1) in fact 5
120
> fix (\rec n -> if n == 0 then 1 else n * rec (n-1)) 5
120
fact' rec n = if n == 0 then 1 else n * rec (n-1)
-- fixed point
f == fact' f
f = fact' f
= \n -> if n == 0 then 1 else n * f (n-1)
{-# LANGUAGE KindSignatures #-}
-- https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/other-type-extensions.html
data Set (cxt :: * -> *) a = Set [a]
type T (f :: * -> *) = f Int
class (Eq a) => C (f :: * -> *) a where ...
f :: forall (cxt :: * -> *). Set cxt Int
f :: (Int :: *) -> Int
g :: forall a. a -> (a :: *)
{-# LANGUAGE DataKinds #-}
-- https://downloads.haskell.org/~ghc/7.4.1/docs/html/users_guide/kind-polymorphism-and-promotion.html
-- without
data Ze
data Su n
data Vec :: * -> * -> * where
Nil :: Vec a Ze
Cons :: a -> Vec a n -> Vec a (Su n)
-- with
data Nat = Ze | Su Nat
data Vec :: * -> Nat -> * where
Nil :: Vec a Ze
Cons :: a -> Vec a n -> Vec a (Su n)
{-# LANGUAGE PolyKinds #-}
data App f a = MkApp (f a)
-- infers the kind:
forall k. (k -> *) -> k -> *
Proxy Int
Proxy []
Proxy Either
-- allows polymorphic types
{-# LANGUAGE DeriveGeneric #-}
-- https://wiki.haskell.org/GHC.Generics
-- https://hackage.haskell.org/package/base-<IP_ADDRESS>/docs/GHC-Generics.html
-- https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/generic-programming.html
{-# LANGUAGE TypeApplications #-}
-- https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/glasgow_exts.html#visible-type-application
pair :: forall a. a -> forall b. b -> (a, b)
pair @Bool True @Char
Char -> (Bool, Char).
{-# LANGUAGE ImplicitParams #-}
-- https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/glasgow_exts.html#implicit-parameters
sortBy :: (a -> a -> Bool) -> [a] -> [a]
sort :: (?cmp :: a -> a -> Bool) => [a] -> [a]
sort = sortBy ?cmp
least :: (?cmp :: a -> a -> Bool) => [a] -> a
least xs = head (sort xs)
min :: Ord a => [a] -> a
min = let ?cmp = (<=) in least
{-# LANGUAGE PartialTypeSignatures #-}
-- https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/glasgow_exts.html#partial-type-signatures
maybools :: _
maybools = Just [True]
-- Inferred: Maybe [Bool]
{-# LANGUAGE DuplicateRecordFields #-}
-- https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/glasgow_exts.html#duplicate-record-fields
data S = MkS { x :: Int }
data T = MkT { x :: Bool }
ok1 = x :: S -> Int
ok2 :: S -> Int
ok2 = x
ok3 = k x -- assuming we already have k :: (S -> Int) -> _
ok4 s = x (s :: S)
bad :: S -> Int
bad s = x s
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DefaultSignatures #-}
-- https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/glasgow_exts.html#derive-any-class
-- http://stackoverflow.com/questions/17416575/using-generic-deriving-with-a-record-haskell
-- https://www.reddit.com/r/haskell/comments/2pirdg/24_days_of_ghc_extensions_derivegeneric/
class SPretty a where
sPpr :: a -> String
default sPpr :: Show a => a -> String
sPpr = show
data Foo = Foo deriving (Show, SPretty)
-- equivalent to:
data Foo = Foo deriving Show
instance SPretty Foo
{-# LANGUAGE NamedWildCards #-}
somethingShowable :: Show _x => _x -> _
somethingShowable x = show x
-- Inferred type: Show w_x => w_x -> String
{-# LANGUAGE PatternSynonyms #-}
data Type = App String [Type]
-- without
collectArgs :: Type -> [Type]
collectArgs (App "->" [t1, t2]) = t1 : collectArgs t2
collectArgs _ = []
isInt :: Type -> Bool
isInt (App "Int" []) = True
isInt _ = False
isIntEndo :: Type -> Bool
isIntEndo (App "->" [App "Int" [], App "Int" []]) = True
isIntEndo _ = False
-- with
pattern Arrow t1 t2 = App "->" [t1, t2]
pattern Int = App "Int" []
pattern Maybe t = App "Maybe" [t]
collectArgs :: Type -> [Type]
collectArgs (Arrow t1 t2) = t1 : collectArgs t2
collectArgs _ = []
isInt :: Type -> Bool
isInt Int = True
isInt _ = False
isIntEndo :: Type -> Bool
isIntEndo (Arrow Int Int) = True
isIntEndo _ = False
-- construct
intEndo :: Type
intEndo = Arrow Int Int
-- unidirectional
pattern Head x <- x:xs
-- explicitly bidirectional
pattern HeadC x <- x:xs where
HeadC x = [x]
-- pattern P :: CReq => CProv => t1 -> t2 -> ... -> tN -> t
pattern ExNumPat :: (Num a, Eq a) => (Show b) => b -> T a
pattern ExNumPat x = MkT 42 x
{-# LANGUAGE FlexibleContexts #-}
eval :: (MonadState EvalState m, MonadWriter [EvalLog] m, MonadReader Env m, MonadError EvalError m)
=> Exp -> m Value -- ^ the parameters don't have to be variables
{-# LANGUAGE ConstraintKinds #-}
type EvalContext m = (MonadState EvalState m, MonadWriter [EvalLog] m, MonadReader Env m, MonadError EvalError m)
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
import GHC.Exts (Constraint)
import Data.Hashable
import Data.HashSet
type family Con a :: Constraint
type instance Con [a] = (Ord a, Eq a)
type instance Con (HashSet a) = (Hashable a)
class Sized a where
gsize :: Con a => a -> Int
instance Sized [a] where
gsize = length
instance Sized (HashSet a) where
gsize = size
{-# LANGUAGE ScopedTypeVariables #-}
sortImage f :: [a] -> [a] = sortBy cmp
where cmp :: a -> a -> Ordering
cmp x y = compare (f x) (f y)
{-# LANGUAGE ScopedTypeVariables #-} -- type of lamda expression argument
import Control.Exception
main :: IO ()
main = do
error "bad" `catch` \(e :: SomeException) -> do
putStrLn $ "Got an exception: " ++ show e
return ()
class Category cat where
-- | the identity morphism
id :: cat a a
-- | morphism composition
(.) :: cat b c -> cat a b -> cat a c
instance Category (->) where
id = GHC.Base.id
(.) = (GHC.Base..)
-- | Right-to-left composition
(<<<) :: Category cat => cat b c -> cat a b -> cat a c
(<<<) = (.)
-- | Left-to-right composition
(>>>) :: Category cat => cat a b -> cat b c -> cat a c
f >>> g = g . f
class Category a => Arrow a where
{-# MINIMAL arr, (first | (***)) #-}
arr :: (b -> c) -> a b c -- | Lift a function to an arrow.
-- | Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
first :: a b c -> a (b,d) (c,d)
first = (*** id)
second :: a b c -> a (d,b) (d,c)
second = (id ***)
-- | Split the input between the two argument arrows and combine their output.  (Kleisli g) = Kleisli (\b -> g b >>= f)
instance Monad m => Arrow (Kleisli m) where
arr f = Kleisli (return . f)
first (Kleisli f) = Kleisli (\ ~(b,d) -> f b >>= \c -> return (c,d))
second (Kleisli f) = Kleisli (\ ~(d,b) -> f b >>= \c -> return (d,c))
split :: (Arrow a) => a b (b, b)
split = arr (\x -> (x,x))
unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
unsplit = arr . uncurry
newtype SimpleFunc a b = SimpleFunc {
runF :: (a -> b)
}
instance Arrow SimpleFunc where
arr f = SimpleFunc f
first (SimpleFunc f) = SimpleFunc (mapFst f)
where mapFst g (a,b) = (g a, b)
second (SimpleFunc f) = SimpleFunc (mapSnd f)
where mapSnd g (a,b) = (a, g b)
instance Category SimpleFunc where
(SimpleFunc g) . (SimpleFunc f) = SimpleFunc (g . f)
id = arr id
f, g :: SimpleFunc Int Int
f = arr (`div` 2)
g = arr (\x -> x*3 + 1)
h :: SimpleFunc Int Int
h = liftA2 (+) f g
hOutput :: Int
hOutput = runF h 8
8 -> (8, 8) split
(8, 8) -> (4, 8) first f (x `div` 2 of the first element)
(4, 8) -> (4, 25) second g (3*x + 1 of the second element)
(4, 25) -> 29 applies (+) to tuple elements.
+------> f ---------+
| v
8 ---> (split) (unsplit (+)) ----> 29
| ^
+------> g ---------+
h' :: SimpleFunc Int Int
h' = proc x -> do
fx <- f -< x
gx <- g -< x
returnA -< (fx + gx)
hOutput' :: Int
hOutput' = runF h' 8


|
Raytracer
1.0.0
|
#include <RGBColor.h>
Public Member Functions | |
| RGBColor () | |
| RGBColor (const float new_r, const float new_g, const float new_b) | |
| RGBColor (const float color) | |
| bool | operator== (const RGBColor &rhs) const |
| RGBColor | operator+ (const RGBColor &rhs) const |
| RGBColor | operator- (const RGBColor &rhs) const |
| RGBColor | operator* (const RGBColor &rhs) const |
| RGBColor | operator* (const float rhs) const |
| RGBColor | operator/ (const float rhs) const |
| RGBColor | operator+= (const RGBColor &rhs) |
| RGBColor | operator-= (const RGBColor &rhs) |
| RGBColor | operator*= (const RGBColor &rhs) |
| RGBColor | operator*= (const float rhs) |
| RGBColor | operator/= (const float rhs) |
| RGBColor | Pow (const float exponent) const |
| float | Average () const |
Static Public Member Functions | |
| static RGBColor | MaxToOne (const RGBColor &raw_color) |
| static RGBColor | ClampToColor (const RGBColor &raw_color, const RGBColor &target_color) |
Public Attributes | |
| float | r |
| float | g |
| float | b |
Static Public Attributes | |
| static const RGBColor | Black |
| static const RGBColor | White |
| static const RGBColor | Red |
| static const RGBColor | Green |
| static const RGBColor | Blue |
Handles color channels and operations.
| RGBColor::RGBColor | ( | ) |
Standard constructor.
| RGBColor::RGBColor | ( | const float | new_r, |
| const float | new_g, | ||
| const float | new_b | ||
| ) |
Constructs an RGBColor with the target components.
| new_r | Target red component. |
| new_g | Target green component. |
| new_b | Target blue component. |
| RGBColor::RGBColor | ( | const float | color | ) |
Constructs an RGBColor with the target in all components.
| color | Target component. |
|
static |
Handles overflow of the color channel by mapping the out-of-gamut component to a target color.
| raw_color | Out-of-gamut color. |
| target_color | Target color. |
Handles overflow of the color channel by dividing all the components by the out-of-gamut component.
| raw_color | Out-of-gamut color. |
Multiplies two colors componentwise and assigns the result to the left operand.
| rhs | Right hand side operand. |
| RGBColor RGBColor::Pow | ( | const float | exponent | ) | const |
Raises the components of the color to a power.
| exponent | Target power. |
| float RGBColor::b |
Blue component.
|
static |
Black color.
|
static |
Blue color.
| float RGBColor::g |
Green component.
|
static |
Green color.
| float RGBColor::r |
Red component.
|
static |
Red color.
|
static |
White color.


ngMultiTranscludeReplace
ng-directives-utils.multiTransclude
register cloneLinking(clone)
to the manager.
This will replace the current element with the passing transclude element.
If there is no transclude passing, current element will be removed.
<ng-multi-transclude-replace [ng-multi-transclude-replace="{string}"]> </ng-multi-transclude-replace>as attribute
<ANY ng-multi-transclude-replace [ng-multi-transclude-replace="{string}"]> ... </ANY>
| Param | Type | Details |
|---|---|---|
| ng-multi-transclude-replace (optional) | string | ng-multi-transclude directive name, if not passing will treat as the default one |


1ST REPORT OF THE
Audit Committee
meeting held on December 7, 2011, commencing at 3:00 PM, in Committee Room #3, Second Floor, London City Hall.
PRESENT: Councillor P. Hubert (Chair), Councillors M. Brown, N. Branscombe and J. Swan, and W. DeShane and B. Westlake-Power (Secretary).
ALSO PRESENT: M. Hayward, P. McNally, J. Barber, J. Braam, B. Brock, D. Dhair (PwC), J. Edward, B. Edwards (PwC), J. Freeman, A. Gilliam, S. Houde, D. Ikeno, C. Shah (PwC), T. Thompson, R. Welker, B. Whitelaw and B. Winther.
|
I. |
1. None are disclosed.
|
II. |
2. Election of Chair and Vice Chair for the term ending November 30, 2012
Recommendation: That Councillor Paul Hubert BE ELECTED Chair and Councillor Matt Brown BE ELECTED Vice Chair of the Audit Committee for the term ending November 30, 2012.
|
III. |
|
3. |
Recommendation: That the 4th Report of the Audit Committee from its meeting held on September 29, 2011 BE RECEIVED.
|
IV. |
|
4. |
PricewaterhouseCoopers, Internal Auditors - Quarterly Report on Internal Audit Results |
Recommendation: That the following actions be taken with respect to the attached Quarterly Report on Internal Audit Results from PricewaterhouseCoopers:
|
a) |
Procurement Bid Process Internal Audit Project –
i) the current policies and practices with respect to approved suppliers and potential blocking of suppliers from bidding on projects BE REVIEWED; and
ii) the Observations and Action Plans included in the above-noted report from PricewaterhouseCoopers BE IMPLEMENTED; it being noted that the recently-adopted Procurement Policy incorporates some of these recommendations; |
|
b) |
Brownsfield Site Development –
i) the Civic Administration BE DIRECTED to provide an update to the Audit Committee with respect to the previous confidential reports related to an ethics hotline; and
ii) the Action Plan included in the above-noted report from PricewaterhouseCoopers BE IMPLEMENTED; |
|
c) |
TSD IT Governance - the Action Plan included in the above-noted report from PricewaterhouseCoopers BE IMPLEMENTED; it being noted that a further report back to the Audit Committee with respect to implementation of this Action Plan was requested; |
|
|
|
|
d) |
JD Edwards IT General Controls - the Action Plan included in the above-noted report from PricewaterhouseCoopers BE IMPLEMENTED; and |
|
|
|
|
e) |
the proposed Internal Audit Schedule for 2012, as outlined by PricewaterhouseCoopers BE APPROVED. |
|
V. |
None
|
VI. |
The meeting adjourned at 4:40 p.m.


Frequently asked Questions (FAQs) |
Here we provide answers to frequently asked questions. These may help you to solve problems quickly.
java.lang.UnsatisfiedLinkError: no pkcs11wrapper in java.library.path or jar file
?iaik.pkcs.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID
. What is wrong?iaik.pkcs.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_VALUE_INVALID
. What is wrong?iaik.pkcs.pkcs11.wrapper.PKCS11Exception: CKR_TEMPLATE_INCOMPLETE
. What is wrong?java.lang.UnsatisfiedLinkError: no pkcs11wrapper in java.library.path or jar file
?Either your operating system may not be supported and therefore no binaries are included in the wrapper jar file or
the binaries from the jar file can't be copied to your local temporary directory.
Build the native library on your system if necessary and add it to your search path.
You can provide such a path directly to the Java VM setting the java.library.path
system property like:
java -Djava.library.path==../bin/wrapper/lib;.
-cp classes;../bin/iaikPkcs11Wrapper.jar
demo.pkcs.pkcs11.GetInfo libcryptoki.so
You can also place the file in the folder for binary files of your Java Runtime Environment; e.g. the jre/bin
folder.
Some PKCS#11 modules do not support certain attributes or modifying certain attributes (e.g. object class or key type).
As workaround you can try to set the class and key-type
attributes as not present. This may look like this:
secretEnrcyptionKeyTemplate.getObjectClass().setPresent(false);
secretEnrcyptionKeyTemplate.getKeyType().setPresent(false);
maybe the driver accepts the key template if you try this.
Some PKCS#11 modules restrict changing of certain attributes or setting of certain combinations (e.g. key value and key length). Please consult your module's documentation for further details.
Your specified key template seems to miss some attributes. For example an AES template must have set the attribute valueLen (cka_value_length).
There is a demo included to do that. It is called UploadPrivateKey
.
Extract the DER encoding (value attribute) of the certificate with
certificate.getValue().getByteArrayValue();
and write this bytes to a file like this:
FileOutputStream certificateDumpStream = new FileOutputStream(certificateDumpFilename);
certificateDumpStream.write(value);
certificateDumpStream.flush();
certificateDumpStream.close();


Version 3.01
·introduces as new authors people who have done so much for DF Specs
·matches the HTML Specs 3.01 exactly
·corrects some minor errors in 3.00
File Formats
·Made some important corrections to the JEDI.LVL description.
·Made a very minor note about Walk: in the Adjoin/Mirror/Walk Mechanism description.
·Made some additions and corrections to Sector flags and Wall flags
·Updated Object Sequences and Logics, Generators, and the Full Logics list
·Made an addition to MSG files
·Completely overhauled the INF section
·Made additions and changes to BM, WAXand 3DOdescriptions.
·Added a CUTMUSE.TXT section.
·Changed and added to the GOL file description.
·Updated the DFBRIEF.LFD contents list.
·Alex Novikov gave us some extra info for the GMD description.
·Added a VOC file format.
Reference
·Made some additions and corrections to Limitations on objects.
·Added the Metrics topic.
·Added Textures.gob (A-N) file list.
·Added Textures.gob (R-Z) file list.
·Added the Resources Cross Reference lists.


Sign up
Name
Email
Password
Confirm Password
Sign up
-------------------Or connect with-------------------
Already have an account?
Login


Welcome to infra.link!
This website is a work in progress
Realsmart Theme is currently offline.
ICT IGCSE (0417) Past Papers
Web Authoring
Paper 1
Questions
Mark Scheme
Paper 2
Tutorials (secure link)
Questions
Files for Task
Mark Scheme
Bookmarklets
Drag these to your bookmarks bar (
Ctrl
+
Shift
+
B
on Chrome) to use them.
Colours
Comic Sans MS
Realsmart Theme


author: bocianu<EMAIL_ADDRESS>Set of useful procedures to simplify common tasks in Atari 8-bit programming.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs
| name: | description: |
|---|---|
| CountBits | function CountBits(b: byte):byte;assembler;Counts number of ones in bits of any byte value.
parameters:returns: |
| WriteLnCentered | procedure WriteLnCentered(s: string);Outputs string aligned to center of screen width. Length of string should not exceed screen width (40).
parameters: |
| WriteRightAligned | procedure WriteRightAligned(w: byte; s: TString);Outputs string aligned to right of provided width. Length of string should not exceed provided width of field.
parameters: |
| NullTermToString | function NullTermToString(ptr: word): string;Parses null terminated string into regular pascal string variable.
parameters:returns: |
| FFTermToString | function FFTermToString(ptr: word): string;Parses string terminated with $FF into regular pascal string variable.
parameters:returns: |
| ExpandRLE | procedure ExpandRLE(src: word; dest: word);Expands RLE compressed data from source memory location and writes expanded data at destination memory address.
parameters: |
| ExpandLZ4 | procedure ExpandLZ4(source: word; dest: word):assembler;Expands LZ4 compressed data from source memory location and writes expanded data at destination memory address. Based on xxl & fox routine from here: https://xxl.atari.pl/lz4-decompressor/
parameters: |


Bangladeshi worker dies after crane accident at Sengkang construction site
SINGAPORE: A Bangladeshi worker died on Friday (Nov 22) after a crane accident at a construction site in Sengkang.
The Ministry of Manpower (MOM) said in a statement that the 37-year-old worker "was caught between metal barricades and the counterweight of a crawler crane when the crane rotated".
READ: Novena crane accident: MWC working with employers, contractors to help Indian worker's family
Housing and Development Board (HDB) is the developer of the site at 339 Anchorvale Road and the occupier is Ken Pal, the spokesperson said.
The worker was employed by construction company He Zhan.
“MOM is investigating and has stopped all lifting operations at the worksite,” the spokesperson said.
The police said they were alerted to the industrial accident at about 9am.
READ: 17 workplace deaths in first half of 2019, rise in non-fatal injuries
The man was unconscious when taken to Sengkang General Hospital, where he died from his injuries.
Police investigations are ongoing.


| Version: | 3.0 |
|---|---|
| Date: | 2013-09-29 |
| Author: | Stefan Schwarzer<EMAIL_ADDRESS>|
Contents
This ftputil release adds support for Python 3.0 and up.
Python 2 and 3 are supported with the same source code. Also, the API including the semantics is the same. As for Python 3 code, in ftputil 3.0 unicode is somewhat preferred over byte strings. On the other hand, in line with the file system APIs of both Python 2 and 3, methods take either byte strings or unicode strings. Methods that take and return strings (for example, FTPHost.path.abspath or FTPHost.listdir), return the same string type they get.
Note
Both Python 2 and 3 have two "string" types where one type represents a sequence of bytes and the other type character (text) data.
| Python version | Binary type | Text type | Default string literal type |
|---|---|---|---|
| 2 | str | unicode | str (= binary type) |
| 3 | bytes | str | str (= text type) |
So both lines of Python have an str type, but in Python 2 it's the byte type and in Python 3 the text type. The str type is also what you get when you write a literal string without any prefixes. For example "Python" is a binary string in Python 2 and a text (unicode) string in Python 3.
If this seems confusing, please read this description in the Python documentation for more details.
To make it easier to use the same code for Python 2 and 3, I decided to use the Python 3 features backported to Python 2.6. As a consequence, ftputil 3.0 doesn't work with Python 2.4 and 2.5.
Traditionally, "text mode" for FTP transfers meant translation to \r\n newlines, even between transfers of Unix clients and Unix servers. Since this presumably most of the time is neither the expected nor the desired behavior, the FTPHost.open method now has the API and semantics of the built-in open function in Python 3. If you want the same API for local files in Python 2.6 and 2.7, you can use the open function from the io module.
Thus, when opening remote files in binary mode, the new API does not accept an encoding argument. On the other hand, opening a file in text mode always implies an encoding step when writing and decoding step when reading files. If the encoding argument isn't specified, it defaults to the value of locale.getpreferredencoding(False).
Also as with Python 3's open builtin, opening a file in binary mode for reading will give you byte string data. If you write to a file opened in binary mode, you must write byte strings. Along the same lines, files opened in text mode will give you unicode strings when read, and require unicode strings to be passed to write operations.
In earlier ftputil versions, most module names had a redundant ftp_ prefix. In ftputil 3.0, these prefixes are removed. Of the module names that are part of the public ftputil API, this affects only ftputil.error and ftputil.stat.
In Python 2.2, file became an alias for open, and previous ftputil versions also had an FTPHost.file besides the FTPHost.open method. In Python 3.0, the file builtin was removed and the return values from the built-in open methods are no longer file instances. Along the same lines, ftputil 3.0 also drops the FTPHost.file alias and requires FTPHost.open.
The FTPHost methods for downloading and uploading files (download, download_if_newer, upload and upload_if_newer) now always use binary mode; a mode argument is no longer needed or even allowed. Although this behavior makes downloads and uploads slightly less flexible, it should cover almost all use cases.
If you really want to do a transfer involving files opened in text mode, you can still do:
import ftputil.file_transfer ... with FTPHost.open("source.txt", "r", encoding="UTF-8") as source, \ FTPHost.open("target.txt", "w", encoding="latin1") as target: ftputil.file_transfer.copyfileobj(source, target)
Note that it's not possible anymore to open one file in binary mode and the other file in text mode and transfer data between them with copyfileobj. For example, opening the source in binary mode will read byte strings, but a target file opened in text mode will only allow writing of unicode strings. Then again, I assume that the cases where you want a mixed binary/text mode transfer should be very rare.
Custom parsers, as described in the documentation, receive a text line for each directory entry in the methods ignores_line and parse_line. In previous ftputil versions, the line arguments were byte strings; now they're unicode strings.
If you aren't sure what this is about, this may help: If you never used the FTPHost.set_parser method, you can ignore this section. :-)
Note
In the root directory of the installed ftputil package is a script find_invalid_code.py which, given a start directory as argument, will scan that directory tree for code that may need to be fixed. However, this script uses very simple heuristics, so it may miss some problematic code or list perfectly valid code.
In particular, you may want to change the regular expression string HOST_REGEX for the names you usually use for FTPHost objects.
It's difficult to be more specific without knowing your application.
That said, best practices nowadays are:
Yes, I know that's not much more specific.
(What's meant here is, for example, that if you opened a remote file as text, the read data could be of byte string type in Python 2 and of unicode type in Python 3. Similarly, under Python 2 a text file opened for writing could accept both byte strings and unicode strings in the write* methods.)
Actually, I had at first thought of implementing this but dropped the idea because it has several problems:
For these reasons, I ended up choosing the same API semantics for Python 2 and 3.
There are two reasons:
I had considered this when I started adapting the ftputil source code for Python 3. On the other hand, although using 2to3 used to be the recommended approach for Python 3 support, even rather large projects have chosen the route of having one code base and using it unmodified for Python 2 and 3.
When I looked into this approach for ftputil 3.0, it became quickly obvious that it would be easier and I found it worked out very well.


Tank¶
Tank costs are calculated as a function of the volume of storage required. The storage required is calculated as:
\[storage capacity = flow in * storage duration * (1 + surge capacity)\]
flow in = inlet flow to the tank (m3/h)
storage duration = hours of storage required
surge capacity = percentage of additional capacity required (provided as a fraction)
Once the capacity is calculated, the cost data below is used to calculate the FCI. The cost data is based on figure X from DOE/NETL-2002/1169 - Process Equipment Cost Estimation. The assumed data points from the curve are provided below and an adapted cost curve is generated using the scipy curve fit function.
Cost ($MM) = 0.15, 0.20, 0.37, 0.78, 1.75, 2.64, 4.66, 6.88 Storage capacity (m3) = 191.2, 375.6, 1101.1, 3030, 8806, 16908, 29610, 37854.1 Cost curve equation in WaterTAP3:
\[Cost($MM) = 1.48e-4 * Storage capacity ^ 1.014\]
The tank unit model does not include any electricity costs or other unit-specific O&M costs.


A way for the user to select items from a list.
When users need to select several options from a list they can do it by selecting one option at a time and get an overview of what that has been selected. All users do not understand the standard HTML multiple select where keyboard combinations are required to do multiple select and it is hard to get an overview. When users use a longer list for single or multi select they need to be able to search in the list for quicker and easier interaction. To avoid different appearances across applications it is recommended to use the component for every single or multiple select.
It is recommended to use deselect on all single selects. This allows the users to easily deselect the option that they have chosen.
The recommended threshold to get a search field in the select box is 10 items.
If there are less than 5 items in the list a radio button group is preferred.
If more than one row of items are selected the box should grow vertically.
If there are less than 5 items in the list a check box group is preferred.
When following this pattern you should also follow the Limits on fields pattern.
Select2 is a component meant to be used for searching in large amount of data with the use of dropdowns. The component makes it possible to search for result either by group or by the name of the content. If a search would return no result this would be displayed in the view and an appropriate text should be visible.
Select2 should be used instead of regular dropdowns and multi selects. If you have a specific use case where users don’t need a typical search result page this is an option.
jQuery code examples and documentation| dropdown | dropdown | dropdown | dropdown | dropdown | dropdown | dropdown | dropdown |
|---|---|---|---|---|---|---|---|
|
|
|||||||
| Jill | Smith | 50 | 50 | 50 | 50 | 50 | 50 |
| Eve | Jackson | 94 | 94 | 94 | 94 | 94 | 94 |
Small select in thead > tr > td |
Small select in thead > tr > th |
|---|---|


{% extends "templates/nav.html" %}
{% block title %} - {{ _('About the Site') }}{% endblock %}
{% block description %}{{ _('Photos and descriptions of the team members involved in the creation of The Observatory.') }}{% endblock %}
{% block head %}
{% endblock %}
{% block body %}
In our Economic Complexity measures (RCA, ECI, ECI+, PCI and PCI+ explained below) we considered simultaneously:
The idea here being to avoid distortions.
When associating countries to products it is important to take into account the size of the export volume of countries and that of the world trade of products. This is because, even for the same product, we expect the volume of exports of a large country like China, to be larger than the volume of exports of a small country like Uruguay. By the same token, we expect the export volume of products that represent a large fraction of world trade, such as cars or footwear, to represent a larger share of a country's exports than products that account for a small fraction of world trade, like cotton seed oil or potato flour.
To make countries and products comparable we use Balassa's definition of Revealed Comparative Advantage or RCA. Balassa's definition says that a country has Revealed Comparative Advantage in a product if it exports more than its "fair" share, that is, a share that is equal to the share of total world trade that the product represents. For example, in 2008, with exports of $42 billion, soybeans represented 0.35% of world trade. Of this total, Brazil exported nearly $11 billion, and since Brazil's total exports for that year were $140 billion, soybeans accounted for 7.8% of Brazil's exports. This represents around 22 times Brazil's “fair share” of soybean exports (7.8% divided by 0.35%), so we can say that Brazil has revealed comparative advantage in soybeans.
Let:
Methodology
{{ _('Revealed Compared Advantage (RCA)') }}
Which countries make which products?
How can we express this mathematically?
Define as:
We use this measure to construct a matrix, that connects each country to the products that it makes.
With entries:
In our research we have played around with cutoff values other than 1 to construct the matrix and found that our results are robust to these changes.
We owe to Adam Smith the idea that the division (specialization) of labor is the secret of the wealth of nations. In a modern interpretation, the division of labor into markets and organizations is what allows the knowledge held by few to reach many, making us collectively wiser.
The complexity of an economy is related to the multiplicity of useful knowledge embedded in it. Because individuals are limited in what they know, the only way societies can expand their knowledge base is by facilitating the interaction of individuals in increasingly complex networks in order to make products. We can measure economic complexity by the mix of these products that countries are able to make.
Some products, like medical imaging devices or jet engines, embed large amounts of knowledge and are the results of very large networks of people and organizations. These products cannot be made in simpler economies that are missing parts of this network’s capability set. Economic complexity, therefore, is expressed in the composition of a country’s productive output and reflects the structures that emerge to hold and combine knowledge.
We can measure diversity and ubiquity simply by summing over the rows or columns of the matrix . Formally, we define:
To generate a more accurate measure of the number of capabilities available in a country, or required by a product, we need to correct the information that diversity and ubiquity carry by using each one to correct the other. For countries, this requires us to calculate the average ubiquity of the products that it exports, the average diversity of the countries that make those products and so forth. For products, this requires us to calculate the average diversity of the countries that make them and the average ubiquity of the other products that these countries make. This can be expressed by the recursion:
We then insert (4) into (3) to obtain
and rewrite this as:
where
We note (7) is satisfied when .This is the eigenvector of which is associated with the largest eigenvalue. Since this eigenvector is a vector of ones, it is not informative. We look, instead, for the eigenvector associated with the second largest eigenvalue. This is the eigenvector that captures the largest amount of variance in the system and is our measure of economic complexity. Hence, we define the Economic Complexity Index (ECI) as:
where < > represents an average, stdev stands for the standard deviation and
Analogously, we define a Product Complexity Index (PCI). Because of the symmetry of the problem, this can be done simply by exchanging the index of countries (c) with that for products (p) in the definitions above. Hence, we define PCI as:


Namaste! I’m Manisha. I am a multidisciplinary designer, currently a Master of Design student at PDPM Indian Institute of Information Technology, Design and Manufacturing, Jabalpur. My projects span from UX research, UX design, service design to product design. Please connect on mail for a full portfolio. Besides work, I write about design, user behaviour and digital marketing.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla.


Cleanup notes
All notes that are not linked to an existing content node and an existing property will be removed from the database.
*This can happen when you remove a property from a document type.
*If you remove a content node the notes will automatically be removed.


--- layout: default ---
Twitter Political Sentiment Tracker For Presidential Candidates
Doubles connects local sport enthusiasts using a Tinder-like interface
Fan site for OKOREN -- Park City, Utah based music producer


{% extends "base.html" %} {% block title %} AraPheno - General FAQ{% endblock title %} {% block content %}
AraPheno is a central repository for population scale phenotype data for the model plant Arabidopsis thaliana
Data on AraPheno is public. Please cite the phenotype, original study of the phenotype as well as AraPheno if you use any data from this database.
This database contains public phenotype data from different studies. RNASeq data was also added recently.
AraPheno supports a variety of different data formats, including CSV, JSON, PLINK and ISA-TAB format.
Yes phenotype data can be download at the individual phenotype views. You can choose if you like to download the phenotypic meta-information, or the actual phenotype values. For this purpose, you can choose different formats, including CSV, JSON and PLINK.
Yes, if you click on the download database link in the home page. This will generate a zip file containing a csv file with a list of the studies (and their details) as well as one folder per study, with the study id as the folder name. Each folder contains information about the study's phenotypes as well as the values both in csv and plink format.
Whenever replicate values are available, you should upload the replicate values and not the averages/means. Both submission formats (ISA-TAB and PLINK) support uploading replicate values.
Yes, it is possible to preserve the specific value of each replicate across multiple phenotypes.
In case of PLINK or CSV just repeat the FID (accession_id) multiple times and add a an arbitary number into the IID (replicate_id) column or alternatively leave it empty (it is not used by AraPheno).
For PLINK this should look as follows:
FID IID pheno1 pheno2 6909 1 24.5 100.2 6909 2 23.2 101.5 6909 3 25.2 99.4 6414 4 5.4 10.4 6414 5 11.2 6414 6 4.2 9.8 ...
For CSV this should look as follows:
accession_id,replicate_id,pheno1,pheno2 6909, 1, 24.5, 100.2 6909, 2, 23.2, 101.5 6909, 3, 25.2, 99.4 6414, 4, 5.4, 10.4 6414, 5, , 11.2 6414, 6, 4.2, 9.8 ...
The main difference between PLINK and CSV is that PLINK uses a space as a delimiter and CSV uses a comma. Addtionally the headers are different.
Empty values are encoded as empty cells in both CSV and PLINK (see pheno1 for accession_id/FID: 6414 and replicate_id/IID: 5)
AraPheno will create separate replicate values for each accession and make sure that for example replicate 1 of 6909 has 24.6 for pheno1 and 100.2 for pheno2.
This also works for the ISA-TAB format.
RNASeq experiments usually generate a lot of data, hence treating each gene in an RNASeq experiment as a separate phenotype on AraPheno would completely overshadow the other reported phenotypes. Therefore, we report RNASeq data separately, but in a similar way.


1 write to _closureArray
System.Management.Automation (1)
engine\interpreter\LightLambdaClosureVisitor.cs (1)
58
_closureArray
= closureArray;
1 reference to _closureArray
System.Management.Automation (1)
engine\interpreter\LightLambdaClosureVisitor.cs (1)
237
var result = loc.LoadFromArray(null,
_closureArray
);


Labels are fancy visual components that let you easily grab the attention of your users, while presenting
essential bits of information in as an abstract a way as possible.
Example
No typeDefaultPrimarySuccessInformationWarningDanger Danger
Take a look at the icon
directive, which goes nicely with buttons.


{% extends 'layout.html' %} {% block content %}
HTTP API documentation
You can also add people to your Dodo list by sending an HTTP request. Note that you must authorize your Twitter account with Dodo in order to use this API.
https://dodo-twitter.herokuapp.com/api/dodo
The userId
is your Twitter userId.
The dodoId
is the Twitter userId of the account you want to add to your Dodo list.
The content-type must be application/x-www-form-urlencoded
.
{
userId: 123413414
dodoId:<PHONE_NUMBER>5
}
OK
This code in the dotjs script initiates the POST request to the endpoint. This is how the server processes that request.


We at "Sevarth-serve on the go" offer clean up and cooking services along with medication which is linked through an online pharmacy. One unique aspect of our start-up is, we provide post-hangover services too. We clean up the mess, cook a healthy, nutritious breakfast for our customers, right from buying thee groceries to serving it hot and ready. We also help them freshen up, provide them with buttermilk for hydration and a cure for headache if needed.
One unique aspect of our start-up is, we provide post-hangover services too. We clean up the mess, cook a healthy, nutritious breakfast for our customers, right from buying thee groceries to serving it hot and ready. We also help them freshen up, provide them with buttermilk for hydration and a cure for headache if needed.
Our satisfied customer says
It's just magic. Daily life became a heck of a lot easier. They are really the best in the field
It's just magic. Daily life became a heck of a lot easier. They are really the best in the field
It's just magic. Daily life became a heck of a lot easier. They are really the best in the field


WITNESS LIST Civil Practices Committee June 22, 2000-2:00P Interim Charges On: Grigsby, Anthony (Texas Civil Justice League) Registering, but not testifying: On: Davis, David (Texas Assoc. of Defense Counsel) Rules and Structured Settlements On: Jamail, Joe (Self) Rules and Summary Judgments On: Duncan, Justice Sarah (Fourth Court of Appeals) Structured Settlements On: Nesbitt, Earl S. (Self and National Assoc. of Settlement Purchasers and Settlement Capitol Corp.) Summary Judgment On: Brister, Judge Scott (Self) Supreme Court's Rules On: Babcock, Charles L. (Self and Supreme Court Advisory Committee) Hecht, Justice Nathan L. (Supreme Court of Texas) Soules, III, Luke (Self) Registering, but not testifying: On: Hardberger, Chief Justice Phil (Fourth Court of Appeals)


Time Machine Tuesday: November 19, 2019
Here's all the most interesting stuff from the week of November 19.
by CarAdvice- shares
Darcy Foster • People often say “don’t forget where you came from”. Although we’re focused on every new car, every last detail here at CarAdvice, we have an extensive back-catalogue of news stories, lifestyle yarns and reviews.
PT Cruiser axed amid Daimler's pullout from Chrysler - 19 November 2007
Now doesn’t this just warm you heart? On this day twelve years ago, Chrysler finally killed the hot-rod inspired PT Cruiser, following the Pacifica and Crossfire. We hope its grave was deep.
Daniel Ricciardo tops the timesheets in testing, beating Sebastian Vettel - 19 November 2010
Before Danny Ric made his formal Formula 1 debut in 2011, he was beating the then reigning World Champion on level pegging. Back then, Sebstian Vettel and Lewis Hamilton only had one title apiece….
Nissan’s fire-breathing GT-R Nismo breaks cover - 19 November 2013
Hours out from its debut at the Tokyo Motor Show, the Nissan GT-R Nismo was leaked, showcasing the aggressive design and aerodynamics that would ultimately help it record a time of 7:08.679 at the Nurburgring.
Lamborghini Urus let loose in snowy forest ahead of launch - 19 November 2017
Before the Lamborghini Urus’s unveiling on December 4th 2017, we were teased with a clip showcasing its ‘Neve’ driving mode - Italian for snow.
Enjoy 30 seconds of alpine Lamborghini goodness
1
6
nextprevious
Time Machine Tuesday: November 19, 2019


Double dating couple decides that wife swapping woul...

Old Woman and Young Stud Get Nice and Messy Together
Wild cowgirl ride of a skinny girl with a beautiful ...

Horny Hot Blonde Sheena Shaw Having Fun Getting Fuck...
Beautiful Britney is once again getting drilled on t...

One of the most arousing MILFs ever getting bonked f...
This wonderful 18 year old teen enjoys her first tim...

Kagney Linn Karter gives a guy an oil massage before...


Arsene Wenger claims Aaron Ramsey wanted Arsenal stay - but club withdrew contract
Wales international Aaron Ramsey left Arsenal for Juventus when his contract expired at the end of last season
by Jake Polden, https://www.mirror.co.uk/authors/jake-polden/Arsene Wenger says Aaron Ramsey wanted to stay at Arsenal and had an agreement to do so before the club "came back on that".
Wales international Ramsey left Arsenal for Juventus on a free when his contract expired at the end of last season.
Wenger had already left Arsenal at this point, and it was new boss Unai Emery who was in charge when the midfielder departed after nine years.
Ramsey wanted big money to remain at Arsenal, and Juventus were willing to pay up.
But despite this, Wenger is adamant Ramsey's heart was set on remaining in north London.
"Yep. In the end I met him once, he wanted to stay at Arsenal," said Wenger on beIN SPORTS.
"They had an agreement and the club came back on that, from what I understood. I tried a long time to extend his contract but sometimes you have influences of agents as well.
"Every case is different and you have to understand in decision makings always who is influential – or not – when you make transfers. What I know from him, he was keen to stay."
Ramsey has made eight appearances for Juventus this season, and has netted twice.
The Welshman was on target last time out for the Old Lady in a 2-1 win over Lokomotiv Moscow in the Champions League.


| 006:155 Khan | : |
And this is a blessed Book (the Qur'an) which We have sent down, so follow it and fear Allah (i.e. do not disobey His Orders), that you may receive mercy (i.e. saved from the torment of Hell). |
| 006:155 Maulana | : |
And this is a Book We have revealed, full of blessings; so follow it and keep your duty that mercy may be shown to you, |
| 006:155 Pickthal | : |
And this is a blessed Scripture which We have revealed. So follow it and ward off (evil), that ye may find mercy. |
| 006:155 Rashad | : |
This too is a blessed scripture that we have revealed; you shall follow it and lead a righteous life, that you may attain mercy. |
| 006:155 Sarwar | : |
This Book (Quran) which We have revealed is a blessed one. Follow its guidance and have piety so that you perhaps may receive mercy |
| 006:155 Shakir | : |
And this is a Book We have revealed, blessed; therefore follow it and guard (against evil) that mercy may be shown to you. |
| 006:155 Sherali | : |
And this is a Book which WE have sent down; full of blessings. So follow it, and guard against evils that you may be shown mercy, |
| 006:155 Yusufali | : |
And this is a Book which We have revealed as a blessing: so follow it and be righteous, that ye may receive mercy: |
Concepts/Themes Covered: القرآن الكريم > حقيقته وتصديقه للكتب الأوائل The Holy Quran> The Quran's Reality and its confirmation of the Previous Books القرآن الكريم > وصفه ووجوب الإيمان به The Holy Quran> The Description and the Necessity to Believe it العمل > العمل الصالح > العمل المفضي إلى النجاح Action(Work)> The Good Deeds>Achtion which Leads to Success
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.


Search by ingredient
Name
Submit
Thank you! Your message has been sent.
Unable to send your message. Please fix errors then try again.
CSS Templates
created with
Website Builder Software
.


Toggle navigation
Tripwire
Dashboard
Statistics Overview
Dashboard
(Loading)
Critical Errors
(loading)
Warning
(Loading)
Ok
(Loading)
Suspended
Name
Updated
Expires
Description
Category
Customer
Status
Comment
Action


This is the default 404 (not found) handler.
If a request is made that has no matching routes, Sails will respond using this handler:
module.exports[404] = function pageNotFound(req, res, defaultNotFoundBehavior) {
// If the user-agent wants a JSON response,
// the views hook is disabled,
// or the 404 view doesn't exist,
// send JSON
if (req.wantsJSON || !sails.config.hooks.views || !res.view || !sails.hooks.views.middleware[404]) {
return res.json({
status: 404
}, 404);
}
// Otherwise, serve the `views/404.*` page
res.view('404');
};
For more information on 404/notfound handling in Sails/Express, check out: http://expressjs.com/faq.html#404-handling