THC is the main psychoactive component of the cannabis plant. In other words, THC is the primary agent responsible for creating the 'high' associated with recreational cannabis use.
This compound works, in part, by mimicking the effects of anandamide and 2-AG. These neurotransmitters are produced naturally by the human body and help to modulate sleeping and eating habits, the perception of pain, and countless other bodily functions.
What Are the Natural Benefits of THC?
Cannabidiol is one of the most critical cannabinoids contained in the cannabis plant. It exists both in agricultural hemp, as well as medical cannabis. While cannabinoids are present within several plants in nature, cannabis is the only plant known to contain CBD.
CBD has the same chemical formula as THC, with the atoms in a different arrangement.
This slight variance causes THC to create a psychoactive effect, while CBD does not. This fact means that when you ingest CBD for medical purposes, you will more likely experience a relief of your unwanted discomfort, with little or no noticeable effect on your cognitive abilities.
Research suggests CBD may be better for inflammation and neuropathic pain, while THC may excel with spasticity and cramp-related pain.
Some experts suggest that a combination of THC and CBD is the ideal way to approach pain, giving validity to something known as the entourage effect.
For example, 100mg of isolated CBD may be substantially less effective at alleviating symptoms than 100mgs of a whole-plant, CBD-containing cannabis extract. Many argue that consuming the plant in its whole form provides all the necessary cofactors to facilitate proper absorption.
This argument is at the heart of the debate over CBD oil from hemp vs. CBD oil from cannabis.
While it may be cheaper and more cost-effective to extract CBD from industrial hemp, users may ultimately experience less benefit due to the absence of clinically significant levels of terpenes and other compounds (which occur in abundance in high-CBD marijuana).
While high-CBD cultivars of cannabis do contain much higher levels of various cannabinoids, terpenes, etc., it does not mean that there aren't potential drawbacks to its use.
Agricultural hemp is much closer to the kind of cannabis that one would find growing naturally in the wild, whereas high-CBD marijuana is hybridized and toyed with by growers to produce the highest levels of the desirable compounds.
There is no hard science (yet!) when it comes to the theory of the entourage effect theory. It is up to each individual to decide which option is best for them.
THC is an illegal drug with considerable immediate and long-term cognitive side effects. These include impaired thinking and reasoning, a reduced ability to plan and organize, altered decision-making, and reduced control over impulses.
Also, chronic use of THC correlates with significant abnormalities in the heart and brain.
CBD lacks the harmful cognitive effects of THC. In fact, CBD can counteract the psychoactive effects of THC.
Cannabis plants containing small amounts of CBD and high levels of THC result in a stronger 'stoned' feeling, while plants with more CBD and less THC create a weaker, more relaxed, effect.
Given the increasing popularity of medical cannabis, breeders are currently creating strains with higher CBD to THC ratios to minimize the psychoactive side effects.
Overall, the lower health risks of CBD, combined with its efficacy, make it a better candidate for natural applications than THC.
I've truly enjoyed browsing your blog posts. After all I will be subscribing for your rss feed and I hope you write once more soon!


We scoured the world markets to find the very best peppercorns. Bright in flavor and aromatics, and packing a spicy punch, our sourced Tellicherry Peppercorns the perfect complement to our briny sea salt. Simply fill your favorite pepper mill/grinder and start cooking!


text:
Marjoribanks is a surname and may refer to:

Charles Albany Marjoribanks (1794–), Scottish Liberal MP
David Robertson, 1st Baron Marjoribanks (né Marjoribanks 1797–1893), Scottish stockbroker and politician
Dudley Marjoribanks, 1st Baron Tweedmouth (1820–1894), Scottish businessman and politician
Edward Marjoribanks (disambiguation), several people
George Marjoribanks (died 1931), Scottish polo player and banker
Hugh Marjoribanks (born 1933)
James Marjoribanks (1911–2003), British diplomat and ambassador
Sir John Marjoribanks, 1st Baronet (1763–1833), Scottish MP and Lord Provost of Edinburgh
Norman Marjoribanks (1872–1939), Scottish civil servant

Other uses
Miss Marjoribanks, 1866 novel by Margaret Oliphant

See also
Marjoribanks baronets
Clan Marjoribanks

redpajama_set_name: RedPajamaWikipedia


Chris Foerster resigned from his position as Miami Dolphins offensive line coach on Monday (October 9). It is a direct consequence of a now viral video that surfaced, where he's seen snorting a white powder and professing his love to a woman who is not is wife.
Soon after his alleged girlfriend posted a video of him snorting a white powder, Chris Foerster resigned from his position as Miami Dolphins offensive line coach. He reportedly sent the video to the woman, Kijuana Nige, as a way to show her his love. That raised several questions about Chris Foerster's wife and family. Is Chris Foerster married? He reportedly is. But very little is known about Michelle Foerster and Chris Foerster's relationship. Find out what we know, right here in our Michelle Foerster wiki.
Chris Foerster married Michelle Massey in June 1985, when he was the offensive line coach for the Colorado State Rams. Not much is known about Massey except that she was born in October 1961 and was raised in Maine.
Like many NFL assistants, Foerster worked hard to make himself indispensable to the teams he worked with. In the three decades of his coaching career, he had nine stops. He was willing to uproot his life and move to wherever he was needed for football. According to some reports, his nomadic lifestyle strained his marriage, as he and his wife have reportedly been living separately since 2004.
The coach and his estranged wife are parents to three grown children. Their eldest child and only daughter, Kathleen Foerster, now Kathleen Colby, is 29 years old. According to her LinkedIn, she currently lives in Indianapolis, Indiana, where she works for the Indianapolis Motor Speedway as a Client Services Coordinator.
She graduated from Florida State University with a Bachelor of Arts in Mass Media and Spanish. She worked as an intern and as a special projects assistant in the 2012 Superbowl Host Committee.
Her brother, Jake Christopher Foerster, will be turinigng 26 years old, while the couple' youngest child, Micah's age is unknown.
According to records, Michelle is a registered nurse in St. Petersburg, Florida. She mentions on her LinkedIn page that she graduated from the University of Phoenix with a nursing degree. There, she was part of the Sigma Theta Tau International Honor Society Of Nursing, Omicron Delta Chapter, which provides scholarships to nursing students to help with their education and careers.
She has been working for 5th Avenue Pediatrics for 20 years. The practice, which was founded in 1946, currently boasts a staff of five doctors and 10 nurses. She recently completed a 24-hour credit certification in addiction studies from St. Petersburg College.
After the video of Chris Foerster snorting a white powder broke out, neither Michelle nor any of the Foerster kids have made a statement. They have not spoken out on anything surrounding the scandal, even after Kijuana Nige said she was dating Chris Foerster.


Discussion in 'Help and Rules' started by Jimbo808, Nov 8, 2018.
I never see any banner ads, is it just paid for through donations?
Yes, only by donation. Also, Ian is not out to make profit.
King_Arthur, Albert.Nik, Petike and 4 others like this.
Lord_Vespasian, Leon Trotsky and King_Arthur like this.
Then I support Canadians all the time!
Petike, Ferd42, King_Arthur and 2 others like this.
It's all self-funded by Ian out of his pocket, with donations from some members helping out.
King_Arthur, Leon Trotsky, wcv215 and 1 other person like this.
Until up to the last few years, all funded by Ian, now donations from members are covering all bills so far.
It should be noted Ian has only asked for donations once, last year, and closed them as soon as he'd hit the goal.
Ferd42, King_Arthur, Lord_Vespasian and 8 others like this.
All he would need is $2 per account. That would be more than $1 Million per year!
And it's up to you to stop it Boss!
It's a development fork, started during his time as the Admin of the Hub of the Multiverse.
Right, why are we stopping it...wait, you're from after the Dark Time. Pay no heed young ones. The Purpose shall be clear soon enough.
Dark Time? Young ones? The Purpose? Clear? wcv215?


With spring time weather still going strong here in New York, it's been a welcome change to be able to wear our spring looks (jacket included!) for more than just a few weeks. But, with summer just around the corner, we're loving one specific trend that transitions perfectly between spring and summer—mesh detailing!
Mesh and net details add that unmistakeable warm weather vibe—the cut outs keep you cool when it's hot while also looking incredibly chic when peaking out from under a jacket when it's chilly. Check out some of our favorite ways to style this trend below, and shop the post to add a springtime-ready mesh piece to your own wardrobe.


text:
Turkey participated in the inaugural edition of the European Games in 2015.

Medal Tables

Medals by Games

Medals by sports

List of medallists

See also
 Turkey at the Olympics

References


You've come the Canadian Rockies and you want to see some wildlife! Well, join our daily Winter Wildlife Discovery Tour! Knowledgeable local guides have been trained to seek out all of the park's most iconic creatures. Big or small, there's always a good chance to see wildlife in Jasper! Elk, deer, sheep, goats, coyotes, wolves, and moose are just a sample of Jasper's wild mountain fauna. Learn about the ways the indigenous animals contribute to the rich diversity of the National Park and how they survive the mountain winters. Your Wildlife guide is well versed in the history, geology, and ecology of the area and is happy to answer any questions you may have. Not just a wildlife discovery tour, you will also discover some of the park's most beautiful scenery as your guide will take you to some out of the way places you might not have discovered on your own. Have your camera ready to capture some amazing photos of the highlights of your visit. This tour is a great way to spend your morning and increase your chance of encountering wildlife of Jasper!
The Wildlife Discovery Tour is a van tour with minimal walking. Photos are usually taken from the inside the vehicle or on the ground at a safe distance from the animals. Jasper National Park is not a zoo but a wild, protected area. The types of animals seen on the tour depends on the season, the time of day, and the weather.


Sometimes all a room needs to liven it up is a jolt of color! That's when Chalk Paint® by Annie Sloan comes in handy! It's so easy to use that it's no big deal to repaint a piece on a whim. This adorable little server has great lines and great hardware so we kept it simple and painted it in the color Giverny, then sealed and protected it with Annie's Clear Wax.
To inquire about purchasing this piece please call (631) 560-9759 and reference item SPH392. This petite server measures 31ʺW × 17.5ʺD × 30ʺH and is $295.
Using colored wax isn't the only way to highlight the beautiful details of a furniture piece. This pair of easily adaptable end tables were painted in a base color of Chalk Paint® by Annie Sloan in French Linen, then given a wash in Graphite Chalk Paint®. Everything was then sealed and protected with Annie's Clear Wax. Want to learn how to do a wash yourself? Check out the Suite Pieces YouTube channel where you can learn how and loads more!!
To inquire about purchasing this pair of end tables, please call our Massapequa location at (516) 308-4447 and reference item EI1418. Each table measures 15ʺW × 15ʺD × 15ʺH and is $150 for the pair.


text:
Arscott Takes Reins as Executive Director
Home » News » Arscott Takes Reins as Executive Director
https://stroudcenter.org/wp-content/uploads/sweeney-arscott-by-funk-meta-1024x538.jpg 1024 538 Stroud Water Research Center Stroud Water Research Center https://stroudcenter.org/wp-content/uploads/sweeney-arscott-by-funk-meta-1024x538.jpg May 25, 2017 February 5, 2018
Dear Friend of Stroud Water Research Center,
As the Stroud Center's Chairman of the Board of Directors for many years, I have had the pleasure to collaborate with Bern Sweeney, Ph.D., in his position as Executive Director and President. Always passionate in the mission to advance freshwater research, education, and restoration, Bern stewarded the vision that Joan and Dick Stroud and Ruth Patrick, Ph.D., conceived 50 years ago. He helped build and strengthen the world-renowned Stroud Water Research Center for more than 40 years.
After decades of such exceptional leadership, Bern is ready to focus on his primary passion at the Stroud Center, research, and continue to help with outreach and fundraising activities. To this end, he is transitioning from Executive Director and will serve full-time as a scientist and President of Stroud Water Research Center Inc. Additionally, I am pleased to share with you his well-deserved recognition in a title promotion from Senior Research Scientist to Distinguished Research Scientist.
David Arscott, Ph.D., who has served as Assistant Director for seven years, has been appointed the new Executive Director. Prior to serving as Assistant Director, Dave was the Project Coordinator at the Stroud Center for a three-year research project that tested all of the streams and rivers feeding Manhattan's drinking water. Dave's scientific background and inner knowledge of our operations make him an ideal choice to continue the Stroud Center's cutting-edge research, award-winning education programs, and watershed restoration efforts throughout the region.
On behalf of the Board of Directors, I share with you our confidence in Dave's ability to lead Stroud Water Research Center with strength, optimism, and hope for the future of fresh water.
With warm regards,
Rodman W. Moorhead III
Stroud Water Research Center Board of Directors
Frances Moran Abbott ~ Josh Auld, Ph.D. ~ Margaretta Brokaw ~ Michael Bucklin ~ Robert DiFilippo ~ John R.S. Fisher, VMD ~ Richard A. Hayne ~ Donnan Sharp Jones~ Bert Kerstetter ~ Peter Kjellerup ~ William Kronenberg III ~ Susan P. LeGros, Esq. ~ Frederick L. Meserve Jr. ~ Holly Michael, Ph.D. ~ Rodman W. Moorhead III ~ Barbara C. Riegel ~ Charles Porter Schutt III ~ Anne Stroud ~ W.B. Dixon Stroud Jr. ~ Bernard W. Sweeney, Ph.D. ~ Robert Whetzel, Esq.
Arscott
Makers of Popular Mayfly Cheese Win at Farm Show
https://stroudcenter.org/wp-content/uploads/award-winning-cheesemakers-1024x576.jpg 1024 576 Stroud Water Research Center Stroud Water Research Center https://stroudcenter.org/wp-content/uploads/award-winning-cheesemakers-1024x576.jpg January 16, 2023 January 16, 2023
Step Up Your Gardening Game With Healthier Soils
https://stroudcenter.org/wp-content/uploads/raised-beds-healthy-home-garden.jpg 800 450 Stroud Water Research Center Stroud Water Research Center https://stroudcenter.org/wp-content/uploads/raised-beds-healthy-home-garden.jpg January 16, 2023 January 24, 2023

redpajama_set_name: RedPajamaCommonCrawl


WASHINGTON — President Donald Trump is off, way off, on the U.S. trade deficit with China. He repeatedly uses an inflated number for the trade gap as the world's two largest economies escalate their dispute over imports and exports.
He's also taking liberties as he makes his case for a new crackdown on the southern border to stop illegal immigration, including requesting the deployment of the National Guard.
TRUMP: "Because of the Trump Administrations actions, Border crossings are at a still UNACCEPTABLE 46 year low. Stop drugs!" – tweet Thursday.
THE FACTS: Trump's numbers are dated, and he's taking credit for a reduction in apprehensions at the southwest border that began before he took office.
The detentions tend to follow a predictable pattern: The numbers begin to rise around January, peak in the spring, and fall as temperatures rise in the summer.
But fiscal year 2017, which lasted from Oct. 1, 2016, to Sept. 30, 2017, was an anomaly, with numbers dipping after the 2016 election and plummeting after Trump took office, through April 2017, which logged the fewest arrests in a single month since the Homeland Security Department was created in 2003. Indeed, thanks to that drop, the 2017 fiscal year logged the fewest Border Patrol arrests in 45 years.
But — and this is a big but — the numbers have been slowly ticking up since that banner month of April. And since the fall of 2017, the numbers have stabilized, returning to the typical arrest rates seen in the 2013, 2014, 2015 and 2016 fiscal years.
The Department of Homeland Security released new statistics this week that show 50,308 arrests in March — a whopping 203 per cent increase from March 2017, when there were only 16,588 arrests, and up 37 per cent from the previous month. Trump has called the spike a "crisis," though the numbers are on par with years prior.
Apprehensions at the border are a useful but imperfect gauge of illegal crossing, since nobody knows exactly how many people cross without being detected.
THE FACTS: He overstates the trade deficit by $163 billion.
He does this by counting Americans' purchases of goods from China as a loss for the U.S., while ignoring what China buys from the U.S. He also ignores another big part of the equation — trade in services.
Last year, Americans bought about $505.6 billion in goods from China while China bought about $130.4 billion in goods from the U.S. So the actual trade deficit in goods was just over $375 billion.
Factor in trade in services and the actual U.S trade deficit with China was $337 billion.
As for intellectual property theft, it's not clear where Trump gets his figure of $300 billion, though it may be a plausible estimate.
The Trump administration this week announced planned tariffs on $50 billion in Chinese imports; Beijing responded with plans to penalize imports from the U.S. by the same amount. This followed an opening salvo of U.S. penalties on steel and aluminum imports from overseas, including China, and Beijing's retaliatory taxes on $3 billion of U.S. products.
Associated Press writers Christopher Rugaber, Josh Boak and Elliot Spagat contributed to this report.


Sandvik QE141 is the latest version of the world's first revolutionary track mounted scalper.
Our goal of minimum user intervention means that we have focused on delivering huge stockpiling capacity, with ease of stockpile removal, uninhibited material flow and ability to handle the toughest of material with an apron feeder fitted as standard. The 16 ft x 5 ft / 4.7 x 1.5 m screen box is highly aggressive with 9mm throw operating at over 1000 RPM. This ensures that even the most difficult materials can be handled effectively.
Built utilising Sandvik's market leading PrisecTM technology, Sandvik QI341HS is the most versatile, compact mobile impactor in the market today. Capable of operating in primary and secondary applications, it has been designed with productivity, mobility, minimal environmental impact and user friendliness at its core.
Built utilising Sandvik's market leading PrisecTM technology, Sandvik QI341 is the most versatile, compact mobile impactor in the market today. Capable of operating in primary and secondary applications, it has been designed with productivity, mobility, minimal environmental impact and user friendliness at its core.
Sandvik UH430 is an electrically powered mobile crushing and screening unit mounted on a wheeled chassis. Featuring the proven reliability of Sandvik CH440 cone crusher from Sandvik, it offers exceptional rates of throughput at a low cost per tonne.
Sandvik UH440E is an electrically powered track-mounted complete process machine with a cone crusher and screens onboard. Aimed at the demanding quarry operator, construction company or contractor working with highly abrasive secondary and tertiary applications, Sandvik UH440E features Sandvik CH440 cone crusher, renowned for its strength and reliability, and is capable of achieving high productivity at an excellent reduction ratio and cubicity with high capacity due to its advanced pre-separation system.
Sandvik UI310+ is a primary crushing unit fully assembled on a single trailer frame and mounted on a quad axle bogie, supplied with EBS. This consists of a Sandvik ST1363 feeder screen, CI521 Prisec™ impactor and discharge belt conveyor.
Sandvik UJ310+ is a primary crushing unit fully assembled on a single trailer frame and mounted on a quad axle bogie. Featuring the highly reliable and productive CJ411 jaw crusher it comes complete with a highly efficient pre-screen, feeder motors, starters, frequency drive and electrical control panel.


text:
Swift Types
June 30, 2014 Stephen Darlington
If you look at the Swift Language guide, you get the distinct impression that the type system is sleek and modern. However the more you dig into it the more eccentricities you find.
The one I'm going to look at today makes sense only if you look at the problem domain from a slightly skewed perspective. I've been trying to think whether this is a sensible, pragmatic way of designing a language or a mistake. Judge for yourself.
So, the feature. Let's define a dictionary:
var test1 = [ "Foo" : "Bar" ]
Check the type and we find that it's of type Dictionary<String,String>. The generics and type inference are doing exactly what you'd image.
test1["Test"] = "Works"
So basically it's all good.
So, what type is this expression?
var test2 = [:]
And why does this not work?
test2["Test"] = "Doesn't work"
Let's take a step back. What's the problem? Well, [:] is an empty dictionary but give us no clue what the type is. Remember, Swift dictionaries and arrays use generics, so the compiler only allows objects of a particular type to be added.
A good guess for the type would be Dictionary<AnyObject,AnyObject>. But a little fishing around tells you that's not the case because AnyObject is neither "Hashable" or "Equatable" and keys need to be both.
The answer? test2 is an NSDictionary. That is, in this one circumstance, Swift extends outside its native dictionary type and decides to use a class found in Foundation.
Once you know that, it is clear that the second line should be:
test2.setValue("Does work now", forKey:"Test")
Maybe if you're familiar with the guts of both Objective C and Swift this behaviour makes sense, but a language built-in returning a completely different type just because it can't figure out the type feels broken to me.
In the end I think I've convinced myself that, while it might be convenient to allow this syntax, it's a bad idea to saddle the language with these semantics so early on. In a few years when no one uses Objective C or when Swift is no longer fully tied to Cocoa, will this make sense?
I would prefer to see it being a compiler error with the correct approach being explicit with the type:
var test2:Dictionary<String,String> = [:]
appleiosLanguagesmacProgrammingswift
Swift Hate
I'm seeing a surprising amount of vitriol aimed at Swift, Apple's new programming language for iOS and Mac development. I understand that there can be reasoned debate around the features (or lack thereof), syntax and even the necessity of it but there can be little doubt about the outcome: if you want to consider yourself an iOS developer, it's a language that you will need to learn.
The only variable I can think of is when you learn it.
I think it's perfectly reasonable to delay learning it as you have code to deliver now and because Swift is, well, very beta currently.
But asking what the point of Swift is not constructive. Asking what problems can be solved exclusively by Swift makes no sense at all you can do almost anything in most programming languages. Just because Intercal is Turing complete doesn't mean that you'd want to use it for any real work. What varies between languages is what's easy and what's hard.
Objective-C undoubtedly makes some things easier than Swift. It's a more dynamic language and its C foundations open up a lot of low-level optimisations that probably are not there in higher level languages.
But that same flexibility comes with a price: segmentation faults and memory leaks; pointers; easy-to-get-wrong switch statement; a lack of bounds checking. It also inherits a lot of ambiguity from original C language specification which makes certain automatic optimisations impossible.
How many applications require low-level optimisations more than safety? (And that's ignoring that the biggest optimisations are usually found in designing a better algorithm or architecture.) How often is it better to have five lines of code instead of one? Every line is a liability, something that can go wrong, something that needs to be understood, tested and maintained.
Whatever its failings, it's already clear that Swift is more concise and safer than Objective C.
There are absolutely applications where Objective C, C or C++ would be a better choice than Swift. It's the old 80-20 rule applied to a programming language. And, for those resistant to learning a new language, the 80% is not on "your" side.
Right now, some of this requires a bit of a leap of faith. Swift clearly isn't finished. You can either learn it now and potentially have some say on what the "final" version looks like, or you can learn it afterwards and just have to accept what's there. But, either way, you'll probably using it next year. Get used to it.
appledevelopmentiosLanguagesmacProgrammingswift
Learning Swift
Swift is a new programming language designed by Apple for development on OS X and iOS. I thought that I should try to learn it a little so I decided to convert a non-trivial collection of classes from one of my apps (www.cut) into Swift. I always find it better to work on a real project rather than just to play around with things aimlessly. Also, by re-working an old project, I knew that all the problems I would find would be language related rather than anything to do with the architecture.
The classes are also data related rather than being UI, so it is mostly a test of the language itself rather than how it interfaces with Objective C.
First impressions are good. Swift is mostly nice and consistent, which although sounding like damning with faint praise, is actually a compliment. I read a little of the language guide and dove straight in. A lot of the attempts to get the following right were me just typing stuff, guessing the syntax rather than looking it up.
Quite by accident I think my code sample inadvertently shows an area of strength for Objective-C and weakness for Swift.
The idea of the code is that it reads a Plist, instantiates a class based on that configuration and fills in a number of properties.
The first half of the code looks like this:
NSError* error = nil;
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"XXX" ofType:@"plist"];
NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
NSDictionary *temp = (NSDictionary *)[NSPropertyListSerialization propertyListWithData:plistXML
options:NSPropertyListMutableContainersAndLeaves
format:NULL
error:&error];
NSArray* values = [temp objectForKey:@"Entries"];
This was pretty straight forward to convert into Swift, though the type system gave me issues:
let plistPath =  NSBundle.mainBundle().pathForResource("XXX", ofType: "plist")
let plistXML = NSFileManager.defaultManager().contentsAtPath(plistPath)
var error:NSError? = nil
var format:CMutablePointer<NSPropertyListFormat>? = nil
let immutable:NSPropertyListReadOptions = 0
var pList = NSPropertyListSerialization.propertyListWithData(plistXML,
options:NSPropertyListReadOptions(NSPropertyListMutabilityOptions.Immutable.toRaw()),
format:format!,
error: &error) as NSDictionary
Getting the options property seems very clumsy; I'm sure that there must be a better way of doing it.
I had a real problem with the in/out parameters format and error. Not only was the documentation confusing but the Swift Playground kept crashing making it difficult to distinguish between what I was doing wrong and where the compiler itself was messing up. It's also a bit odd that, though both are in/out parameters, that they both need different methods to extract the values.
(To be fair, this is a beta and it is the first version of a whole language and compiler. I mention the crashes not because they're unexpected or even especially bad, just as an honest description of the difficulty I had.)
The next section, using the data in the plist, was much more problematic. The code looks like this, but I've trimmed a lot so what we have here isn't terribly useful now!
proxy = nil;
for (NSDictionary* i in values) {
if ([thing isEqualToString:[i objectForKey:@"Class"]]) {
dynamicClass = NSClassFromString([i objectForKey:@"BaseClass"]);
proxy = [[dynamicClass alloc] init];
I didn't do the straight conversion. A few more years of Cocoa programming allowed me to notice an optimisation:
let valueList = values.filteredArrayUsingPredicate(NSPredicate(format: "Class = %@", value))
let valueData = valueList[0] as NSDictionary
This same approach would work in Objective-C.
Next I tried:
let dynamicClass = NSClassFromString(valueData["BaseClass"])
let proxy = dynamicClass()
The first line works as expected. The second line doesn't compile.
Is there anything else that we can do with dynamicClass? Let's see. It's an AnyClass which is a type alias for AnyObject.Type. Which doesn't really help.
I tried casting it to a base class but no matter what I tried I couldn't alloc/init it (in Objective C terms).
Josh Smith figured out how to do it by creating a factory class in Objective-C.
I tried (and failed) to get it to work by calling some of the Objective-C runtime directly:
var bytes:Byte[] = [0,0,0,0]
let b = objc_constructInstance(a, &bytes)
But the second line doesn't work when using ARC. (To be fair, Xcode struck through the definition so I didn't have much confidence that it would work!)
So that leaves Josh's call out to Objective-C to be the best method that I'm aware of.
In the end I just used a switch statement to select between the relatively limited number of options that I had to choose between. Not as clever, but maybe that's a good thing?
appleioslanguagemacProgrammingswift
iTunes Match — addendum
July 10, 2013 Stephen Darlington 1 Comment
Since I wrote about iTunes Match nearly eighteen months ago I thought it was worth revisiting and seeing how things have changed in that time.
Oddly, the short answer is "not very much."
The problems that I identified last year are still very much present. Indeed there are some new examples. This is my favourite: when listening to "Man Machine" by Kraftwerk, iTunes Match seems to have decided that track four, which should be "The Model," is really "Wouldn't it be nice" by the Beach Boys. I don't even own a copy of "Wouldn't it be nice."
The biggest changes in those eighteen months have been on the client side. iTunes 11 (the lipstick on pig release), as far as I can tell, didn't change very much. iOS 6 wasn't nearly as fortunate. The point zero release removed the ability to delete individual tracks. Not exactly progress. (It's back again in 6.1.)
Apple likes to talk about its magical products that Just Work. iTunes Match tries to be more magical than most but clearly missed a few visits from the faeries.
One bit of magic that I thought was supposed to happen was that when getting low on disk space, iTunes Match would delete less played tracks. In fact, what I think happens is that it removes older, cached tracks.
The distinction here is between cached and downloaded. If you press the download (cloud) icon it isn't automatically removed; if you didn't it is.
But how do you tell? Well, that's the other major client flaw. There's no easy way to see which tracks have been downloaded without opening each album, one by one. I have six hundred albums which makes this an exceedingly tedious task.
My guess is that you're supposed to use it by just pressing the Play button and have iOS manage the space for you. But this would mean you live in a utopian universe where you have a data signal every time you want to play some music. That does not resemble my life.
What I want it to be able to download tracks that I think I'll want to listen to and then allow playing from the cloud. When low on space it should remove tracks that have not been played recently regardless of how they got there.
So eighteen months on I find that many of the same problems remain and I've found some new ones, yet I still paid for another years subscription without much though. Why? Well, it's still very useful. I like being able to play music using my Apple TV. I like being able to access any of my music when I have wifi or 3G. I just wish Apple would spend a little time and make it less like a 1.0 release1.
You could argue that they added iTunes Radio, but that only comes with iOS 7 — nearly two years after iTunes Match came out — which isn't out yet and even then that will only work in the US to start with. [↩]
appleComputingmusicOpinionreview
War?
December 13, 2012 Stephen Darlington
Eric Schmidt says Google is the new Microsoft and it's winning the war against Apple. I think he's missing some perspective.
One of the key things that Steve Jobs realised when he returned to Apple in the late nineties was that the industry is not necessarily a zero sum game.
"We have to let go of a few things here. We have to let go of the notion that for Apple to win, Microsoft has to lose."
The current situation is not identical but I think that the lessons might be substantially the same. While Google believe that they're winning it's not clear to me that they're playing the same game as Apple and Microsoft. It's like saying that you're winning at Scrabble when your opponent is playing Chess; sure, you played some great words on triple letter scores, but your chances of getting check-mate are limited.
For all Google's efforts and marketshare, most web traffic and ad impressions — the real metric that they're interested in — still comes from iOS. They largely succeeded in commoditising the smartphone, unfortunately their users either don't surf the web much or, in the case of Android-derived devices like the Kindle Fire, do but don't go via Google.
Would they not be better toning down the rhetoric and figuring out how everyone can play nicely? War makes for good headlines but often ends in everyone losing.
For Google to win, Apple does not have to lose.
applegooglehistorysteve jobs
January 9, 2012 Stephen Darlington
It seems that there's a large variation in people's experience with iCloud and iTunes Match, Apple's recently introduced service for making your entire music collection available across all your devices. At the risk of making things worse — since I have nothing conclusive to add — I thought that I'd add my anecdote to the collection.
Like most software — and especially Apples — it works best when you work in a particular way. It's often difficult to tell how close your expectations are to the real thing until after you've handed over your credit card. But what I will say is that iTunes Match works pretty well if you want to do what I do. So if you read nothing else in this post, you should look at the next few paragraphs.
What do I want to use it for?
I have about six hundred albums, comprising over six thousand tracks. I mostly listen to a smaller subset but I often get an ear-worm and want to listen to a random track that I may not have heard for years. So on my iPhone I have a lot of music, but not all of it. Use case one for iTunes Match was therefore to be able to access all my music on my iPhone even though I don't have the space for everything.
I typically don't put any music at all on my iPad, since I use it more for movies than music. But when I'm travelling it's occasionally nice to be able to rely on my iPads battery as well as my iPhones! So use case two is playing music on my iPad without explicitly copying any onto it.
(These last two are clearly variations on a theme, but the key point is that I don't want to have to stream everything. When I'm at work I don't always have internet access, but I can probably get WiFi access for a few minutes at lunchtime.)
Ten years ago I spent a lot of time ripping my CD collection. Most is in MP3 format at 160kbps, some is at 128kbps; the newer ones are reasonable quality AAC but, if I'm honest, there's little consistency. Additionally, many tracks are of dubious quality, with dust and scratches contributing most of the glitches. So, use case three is upgrading my library to clean, high bit rate copies.
How does it work in practice?
The process is typically Apple, by which I mean works without very much user intervention and pretty smoothly.
It first scans your library, sees what's already in the iTunes Store and then uploads any gaps. The scanning and matching is really quick. The upload depends on the speed of your broadband.
It matched around 5000 of my 6000 tracks, which is not bad going. However there were some oddities:
It was very inconsistent with spoken word tracks. I have a number of radio series — the Hitchhikers Guide and a bunch of Douglas Adams interviews, the Mighty Boosh — and some tracks were flagged as "Ineligible" while others were going to be uploaded
Some tracks that I purchased from iTunes a while ago were not matched
Some albums were only partially matched, despite the full album being available to purchase
The common element is that it's not at all clear what criteria are used to make the match. Either Lala wasn't quite as sophisticated as I thought or Apple have not fully integrated their software yet.
Whether these are problems or not depends entirely on what you want to do with the tracks. That the spoken word albums are (mostly) unavailable is slightly disappointing but not really a problem.
The iTunes tracks not being matched is, frankly, bizarre. Here you can see one track from an album "Purchased," one "Duplicate" (it isn't) and the rest were uploaded (i.e., not matched and a copy from my library uploaded to iCloud).
Still, neither of these issues stops all my music being available on all my devices — use cases one and two.
However the last point above is disappointing. Some albums match every track bar one or two. This means that it's not possible for me to upgrade the whole album to a 256kbps AAC file. Not the end of the world but not exactly what I was promised.
iTunes Match is mostly pretty seamless. You see all your music on all your devices. If the track hasn't been downloaded, it appears with a cloud symbol next to the name. Click or press on the track and it plays, albeit with a short delay. iOS clients download rather than stream the content. The Apple TV just streams the music and videos.
Two surprisingly un-Apple-like glitches take the edge off the whole thing.
Firstly, not all the album art work makes it from my iTunes library to my iPad and iPhone. It's a small point, but for a company that places so much emphasis on the aesthetics it's unexpected.
Secondly, while it is possible to upgrade your low quality MP3 files it's not entirely clear how to go about it. I guess I expected to see an "Upgrade track" or "Upgrade Library" or even a "Update to iTunes Match" menu option, but no.
I couldn't see anything in the documentation either. I had to fall back on Google. The trick, it turns out, is to delete the file. Obvious, no? Then iTunes will show the same track but with a cloud icon to the right. Then you can download it.
So, overall, I like iTunes Match. It's not without flaws, it's undoubtedly a 1.0 release, but it's already useful to me and I think it's only going to get better. I guess the big question comes at the time next year. Will I renew the service?
applereviewSoftwareweb


text:
using Robust.Shared.Serialization;

namespace Content.Shared.Weapons.Ranged.Events;

/// <summary>
/// Raised whenever a muzzle flash client-side entity needs to be spawned.
/// </summary>
[Serializable, NetSerializable]
public sealed class MuzzleFlashEvent : EntityEventArgs
{
    public EntityUid Uid;
    public string Prototype;

    /// <summary>
    /// Should the effect match the rotation of the entity.
    /// </summary>
    public bool MatchRotation;

    public MuzzleFlashEvent(EntityUid uid, string prototype, bool matchRotation = false)
    {
        Uid = uid;
        Prototype = prototype;
        MatchRotation = matchRotation;
    }
}

redpajama_set_name: RedPajamaGithub


text:
You are here: Home > M.C. Records Released Duke Robillard & His Dames of Rhythm October 13
M.C. Records Released Duke Robillard & His Dames of Rhythm October 13
M.C. Records To Release "Duke Robillard & His Dames Of Rhythm" October 13
With Special Guests Maria Muldaur, Kelley Hunt, Catherine Russell,
Sunny Crownover, Elizabeth McGovern (Downton Abbey) & Madeleine Peyroux
On October 13, M.C. Records is so thrilled to release Duke Robillard & His Dames of Rhythm, an eclectic collection of Jazz/Swing tunes from the 1920's & 30's. Duke invited some swinging and sultry ladies to the party, Maria Muldaur, Catherine Russell, Kelley Hunt, Sunny Crownover, Elizabeth McGovern (Downton Abbey) and Madeleine Peyroux. The record features a generous 15 tracks with liner notes from acclaimed producer and D.J. Bob Porter.
Robillard is a soloist of stunning force and originality. The New York Times
Duke, a founding member of the acclaimed swing band Roomful of Blues has recorded and toured with a who's who of roots music including Bob Dylan, Herb Ellis, Big Joe Turner, The Fabulous Thunderbirds, Ruth Brown, Jay Geils and John Hammond to name several. Duke' talents have garnered Grammy Award nominations, as well as having won or been nominated for multiple Blues Music Awards and Canadian Maple Blues Awards.
One of God's guitarists. The Houston Post
Duke talks about the sessions:
This recording marks a serious bucket list dream come true for me. When label owner Mark Carpentiari and I started talking about doing an album together we tossed around quite a few concepts and finally decided on a plan that put me with my rhythm section and a fabulous horn section, with me playing acoustic archtop guitar. The concept was to have several guest female vocalists joining me on a collection of tunes from the twenties and thirties that I loved.
I've always loved this period in music and wanted to dig deep into tin pan alley and the American songbook for tunes that weren't too overdone in recent years. Also I wanted the material to be simple, swinging and bluesy.
One final thing about Duke Robillard: whatever project he chooses to undertake will be delivered with expertise and integrity and the final result will always be worth checking out.
Article written by jenjo


All Time Low is one of my favorite bands, so when I got to see them in concert on Sunday, you can say I was just a little hyped. I did my hair and makeup up all nice, took a few selfies, and then I hopped in the car with my friend Amanda (the same one I did London with), and prepared myself for the 3 hour-long drive up to Columbus, Ohio.
About an hour and a half into the drive, we hit our first issue – a traffic buildup just outside of Cincinnati. Thankfully, I was using Waze, which was able to give us another route around the the traffic, but we still lost about a half an hour. And we had to drive through Covington, Kentucky, one of the sketchiest places I've had the misfortune of driving through (it's right up there with Camden, New Jersey – my dad's hometown), where I glimpsed more shirtless old men than I have ever cared to have seen.
Anyway, we finally made it to the venue, Express Live, where we were greeted by a pleasant surprise – it was a pretty small venue! That's always a good thing for concerts because it means, in a free admission seating arrangement like we had, you're more likely to be able to get up close to the stage.
On the other hand, being a smaller venue, there was no kind of overhead coverage to protect the audience from the weather. Normally, that wouldn't be a problem, but of course, it rained. And rained and rained and rained. It began right after the second opening act left the stage. Amanda and I had moved down into the pit and were standing there in the drizzle kicking ourselves over not bringing in our raincoats (and we couldn't go back and get them either – no re-entry) when the rain began to pick up, as it does in storms. We spent about 15 minutes running around, trying desperately to find some place where we could take shelter – there was literally nothing like, anywhere, not even a merch tent – before we finally found a bathroom that we could hide in.
And that's where we stood for the entirety of the third opening act, smushed up against the bodies of other soaking wet and miserable girls, shuffling around every once in a while when someone needed to get to the toilet, and listening to muffled sounds of the band through the brick.
Finally, about 40 minutes later, the rain let up. But by then my hair and makeup was pretty much ruined, so much so that I even considered not bothering to do photos today. I really loved my outfit though, so I forced Amanda to get some shots as quickly as she possibly could while trying to keep as much of the camera as possible under her rain poncho. It was all a very interesting experience, not unlike the adventure we had in the Atlanta airport (which, might I add, is abbreviated ATL – the same way as All Time Low…suspicious…). As for the All Time Low itself? They were great! Definitely a band I would go to see again, no question. Getting to hear songs I love like "Missing You" and "Weightless" in person was lovely and well-worth getting soaked just an hour prior.


text:
#include "integrator/IIntegrator.h"
#include "material/IMaterial.h"
#include "mesh/MeshBase.h"
#include "output/FrameOutputDevice.h"
#include "renderer/RenderContext.h"
#include "renderer/RenderFactory.h"

#include "Environment.h"
#include "SceneLoader.h"

#include "pypearray.h"

using namespace PR;
namespace PRPY {
PR_NO_SANITIZE_ADDRESS
void setup_environment(py::module& m)
{
	py::class_<OutputSaveOptions>(m, "OutputSaveOptions")
		.def(py::init<>())
		.def_readwrite("NameSuffix", &OutputSaveOptions::NameSuffix)
		//.def_readwrite("Image", &OutputSaveOptions::Image) /* TODO */
		.def_readwrite("Force", &OutputSaveOptions::Force);

	py::class_<Environment, std::shared_ptr<Environment>>(m, "Environment")
		.def_static("createRenderEnvironment", &Environment::createRenderEnvironment)
		.def_static("createQueryEnvironment", &Environment::createQueryEnvironment)
		.def("dumpInformation", &Environment::dumpInformation)
		.def("setup", &Environment::setup)
		.def("save", &Environment::save)
		.def("createSelectedIntegrator", &Environment::createSelectedIntegrator)
		.def("createRenderFactory", &Environment::createRenderFactory)
		.def("createAndAssignFrameOutputDevice", &Environment::createAndAssignFrameOutputDevice)
		.def_property(
			"renderSettings",
			[](Environment& env) { return env.renderSettings(); },
			[](Environment& env, const RenderSettings& st) { env.renderSettings() = st; },
			py::return_value_policy::reference_internal);

	auto sl = py::class_<SceneLoader>(m, "SceneLoader")
				  .def_static("loadFromString", &SceneLoader::loadFromString)
				  .def_static("loadFromFile", [](const std::wstring& path, const SceneLoader::LoadOptions& opts) {
					  return SceneLoader::loadFromFile(path, opts);
				  });

	py::class_<SceneLoader::LoadOptions>(sl, "LoadOptions")
		.def(py::init<>())
		.def_property(
			"PluginPath",
			[](SceneLoader::LoadOptions& ops) { return ops.PluginPath; },
			[](SceneLoader::LoadOptions& ops, const std::string& st) { ops.PluginPath = st; })
		.def_property(
			"WorkingDir",
			[](SceneLoader::LoadOptions& ops) { return ops.WorkingDir; },
			[](SceneLoader::LoadOptions& ops, const std::string& st) { ops.WorkingDir = st; })
		.def_readwrite("Progressive", &SceneLoader::LoadOptions::Progressive);
}
} // namespace PRPY


text:
package sched

import (
	"fmt"
	"reflect"
	"strings"
	"testing"
	"time"
)

func TestNewParseError(t *testing.T) {
	err := newParseError("expression", "description")
	if err.Expression != "expression" || err.Description != "description" {
		t.Fail()
	}
}

func TestParseError_Error(t *testing.T) {
	err := newParseError("expression", "description")
	const want = `sched: could not parse "expression": description`
	if result := err.Error(); result != want {
		t.Errorf("err.Error() = %v WANT %v", result, want)
	}
}

func TestFieldsFunc(t *testing.T) {
	tests := []struct {
		value  rune
		result bool
	}{
		{' ', true},
		{'\t', true},
		{'e', false},
		{'0', false},
	}
	for _, test := range tests {
		if result := fieldSeparatorFunc(test.value); result != test.result {
			t.Errorf("fieldSeparatorFunc(%v) = %v WANT %v", test.value, result, test.result)
		}
	}
}

func TestFields(t *testing.T) {
	tests := []struct {
		exp    string
		result []string
	}{
		{"", []string{}},
		{"expression", []string{"expression"}},
		{"a b", []string{"a", "b"}},
		{"a  b", []string{"a", "b"}},
		{"a\tb", []string{"a", "b"}},
		{"a\t\tb", []string{"a", "b"}},
		{"a\t \tb", []string{"a", "b"}},
		{" a\t \tb\t", []string{"a", "b"}},
		{" a\t \tb\t\n    ", []string{"a", "b"}},
	}
	for _, test := range tests {
		if result := Fields(test.exp); !reflect.DeepEqual(result, test.result) {
			t.Errorf("Fields(%v) = %q WANT %q", test.exp, result, test.result)
		}
	}
}

func TestFieldParts(t *testing.T) {
	tests := []struct {
		field  string
		result []string
	}{
		{"", []string{}},
		{"field", []string{"field"}},
		{"a,b", []string{"a", "b"}},
		{"a,,b", []string{"a", "", "b"}},
		{"a,b,c", []string{"a", "b", "c"}},
		{"this is a string a,this is a string b", []string{"this is a string a", "this is a string b"}},
	}
	for _, test := range tests {
		if result := FieldParts(test.field); !reflect.DeepEqual(result, test.result) {
			t.Errorf("FieldParts(%v) = %q WANT %q", test.field, result, test.result)
		}
	}
}

func TestGetNormalizedFields(t *testing.T) {
	tests := []struct {
		expression string
		result     []string
		hasError   bool
	}{
		{"", nil, true},
		{"expression", nil, true},
		{Secondly, []string{Asterisk, Asterisk, Asterisk, Asterisk, Asterisk, Asterisk, Asterisk}, false},
		{"a b ", []string{"a", "b"}, false},
		{"a b c", nil, true},
		{"a b c d", nil, true},
		{"a b c d e", []string{"0", "a", "b", "c", "d", "e", Asterisk}, false},
		{"a b c d e f", []string{"a", "b", "c", "d", "e", "f", Asterisk}, false},
		{"a b c d e f g", []string{"a", "b", "c", "d", "e", "f", "g"}, false},
		{"a b c d e f g h", nil, true},
	}
	for _, test := range tests {
		result, err := getNormalizedFields(test.expression)
		if (err != nil) != test.hasError {
			t.Errorf("getNormalizedFields(%v) error = %v WANT to have an error %v", test.expression, err, test.hasError)
		}
		if !reflect.DeepEqual(result, test.result) {
			t.Errorf("getNormalizedFields(%v) result = %v WANT %v", test.expression, result, test.result)
		}
		if test.result != nil && len(result) != int(fieldCount) && len(result) != 2 {
			t.Errorf("getNormalizedFields(%v) length must equal 2 or %v", test.expression, fieldCount)
		}
	}
}

func TestValidateNumberOfFields(t *testing.T) {
	errString := "number of fields must be 1, 2, 5, 6, or 7"
	tests := []struct {
		fields []string
		count  int
		err    string
	}{
		{nil, 0, errString},
		{[]string{}, 0, errString},
		{make([]string, 1), 1, ""},
		{make([]string, 2), 2, ""},
		{make([]string, 3), 0, errString},
		{make([]string, 4), 0, errString},
		{make([]string, 5), 5, ""},
		{make([]string, 6), 6, ""},
		{make([]string, 7), 7, ""},
		{make([]string, 8), 0, errString},
	}
	for _, test := range tests {
		count, err := validateNumberOfFields(test.fields)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("validateNumberOfFields(%v) error = %v WANT %v", test.fields, err, test.err)
		}
		if count != test.count {
			t.Errorf("validateNumberOfFields(%v) count = %v WANT %v", test.fields, count, test.count)
		}
	}
}

func TestGetNormalizedDirectiveFields(t *testing.T) {
	tests := []struct {
		directive string
		result    []string
		err       string
	}{
		{Yearly, Fields(YearlyFormat), ""},
		{Annually, Fields(AnnuallyFormat), ""},
		{Monthly, Fields(MonthlyFormat), ""},
		{Weekly, Fields(WeeklyFormat), ""},
		{Daily, Fields(DailyFormat), ""},
		{strings.ToUpper(Daily), Fields(DailyFormat), ""},
		{Hourly, Fields(HourlyFormat), ""},
		{Minutely, Fields(MinutelyFormat), ""},
		{Secondly, Fields(SecondlyFormat), ""},
		{"@reboot", nil, `the directive "@reboot" is not recognized`},
	}
	for _, test := range tests {
		result, err := getNormalizedDirectiveFields(test.directive)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("getNormalizedDirectiveFields(%v) error = %v WANT %v", test.directive, err, test.err)
		}
		if !reflect.DeepEqual(result, test.result) {
			t.Errorf("getNormalizedDirectiveFields(%v) result = %v WANT %v", test.directive, result, test.result)
		}
	}
}

func TestParseField(t *testing.T) {
	/**
	_ := []struct {
		field string
		fieldIndex
		result interface{}
		err    string
	}{}
	*/
}

func TestParseDateFieldNexterParts(t *testing.T) {
	tests := []struct {
		parts []string
		fieldIndex
		resultType reflect.Type
		err        string
	}{
		{[]string{"a"}, dom, nil, `section before modifiers "a" ` + errParseInteger.Error()},
		{[]string{"a", Asterisk}, dow, nil, `part 1: section before modifiers "a" ` + errParseIntegerAlias.Error()},
		{[]string{Asterisk}, dom, reflect.TypeOf(&domFieldNexter{}), ""},
		{[]string{Asterisk}, dow, reflect.TypeOf(&dowFieldNexter{}), ""},
		{[]string{Asterisk, Asterisk}, dow, reflect.TypeOf(multiDateFieldNexter{}), ""},
	}
	for _, test := range tests {
		result, err := parseDateFieldNexterParts(test.parts, test.fieldIndex)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseDateFieldNexterParts(%v, %v) error = %v WANT %v", test.parts, test.fieldIndex, err, test.err)
		}
		if err != nil {
			continue
		}
		if resultType := reflect.TypeOf(result); resultType != test.resultType {
			t.Errorf("parseDateFieldNexterParts(%v, %v) result type = %v WANT %v", test.parts, test.fieldIndex, resultType, test.resultType)
		}
	}
}

func TestParseFieldNexterParts(t *testing.T) {
	tests := []struct {
		parts []string
		fieldIndex
		resultType reflect.Type
		err        string
	}{
		{[]string{"a"}, second, nil, errParseInteger.Error()},
		{[]string{"a", Asterisk}, second, nil, "part 1: " + errParseInteger.Error()},
		{[]string{Asterisk}, second, reflect.TypeOf(&rangeNexter{}), ""},
		{[]string{Asterisk, Asterisk}, second, reflect.TypeOf(multiNexter{}), ""},
	}
	for _, test := range tests {
		result, err := parseFieldNexterParts(test.parts, test.fieldIndex)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseFieldNexterParts(%v, %v) error = %v WANT %v", test.parts, test.fieldIndex, err, test.err)
		}
		if err != nil {
			continue
		}
		if resultType := reflect.TypeOf(result); resultType != test.resultType {
			t.Errorf("parseFieldNexterParts(%v, %v) result type = %v WANT %v", test.parts, test.fieldIndex, resultType, test.resultType)
		}
	}
}

func TestNewPartError(t *testing.T) {
	err := newPartError(0, fmt.Errorf("error"))
	if err.Error() != "part 1: error" {
		t.Fail()
	}
}

func TestParseDateFieldNexterPart(t *testing.T) {
	tests := []struct {
		part   string
		index  fieldIndex
		result dateFieldNexter
		err    string
	}{
		//bad
		{"", 0, nil, errEmpty.Error()},
		{"2" + Weekday, dow, nil, `section before modifiers "2W" must be a decimal integer or valid string alias`},
		{Hash + "2", dom, nil, `section before modifiers "#2" must be a decimal integer`},
		{"a" + Weekday, dom, nil, `section before modifiers "a" must be a decimal integer`},
		{"", dow, nil, errEmpty.Error()},
		{Asterisk, year, nil, "invalid fieldIndex year for date field parsing"},
		//good
		{Last, dom, &domFieldNexter{nil, true, false}, ""},
		{Last + Weekday, dom, &domFieldNexter{nil, true, true}, ""},
	}
	for _, test := range tests {
		result, err := parseDateFieldNexterPart(test.part, test.index)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseDateFieldNexterPart(%q, %v) error = %v WANT %v", test.part, test.index, err, test.err)
		}
		if err != nil {
			continue
		}
		if !reflect.DeepEqual(result, test.result) {
			t.Errorf("parseDateFieldNexterPart(%q, %v) result = %v WANT %v", test.part, test.index, result, test.result)
		}
	}
}

func TestNewBeforeModifierError(t *testing.T) {
	err := newBeforeModifierError("before", fmt.Errorf("error"))
	if err.Error() != `section before modifiers "before" error` {
		t.Fail()
	}
}

func TestParseDomDateField(t *testing.T) {
	tests := []struct {
		modifiers string
		fieldNexter
		resultLast    bool
		resultWeekday bool
		err           string
	}{
		//bad
		{"", nil, false, false, errEmpty.Error()},
		{Weekday, &rangeNexter{1, 2}, false, false, `modifier "W" can only be used with a single, static value`},
		{Weekday, nil, false, false, `modifier "W" can only be used with a single, static value`},
		{"a", nil, false, false, `unknown modifier "a"`},
		{Last + Weekday, valueNexter(1), true, true, `modifiers "L" and "W" used together cannot have a value before them`},
		{Weekday + Last, valueNexter(1), true, true, `modifiers "L" and "W" used together cannot have a value before them`},
		//good
		{"", valueNexter(1), false, false, ""},
		{Last, &rangeNexter{MinDom, MaxDom}, true, false, ""},
		{Last, nil, true, false, ""},
		{Weekday, valueNexter(2), false, true, ""},
		{Last + Weekday, nil, true, true, ""},
		{Weekday + Last, nil, true, true, ""},
	}
	for _, test := range tests {
		dfn, err := parseDomDateField(test.fieldNexter, test.modifiers)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseDomDateField(%v, %q) error = %v WANT %v", test.fieldNexter, test.modifiers, err, test.err)
		}
		if err != nil {
			continue
		}
		if dfn.fieldNexter != test.fieldNexter || dfn.isLast != test.resultLast || dfn.isWeekday != test.resultWeekday {
			t.Errorf("parseDomDateField(%v, %q) result = %v WANT %v, %v, %v",
				test.fieldNexter, test.modifiers, dfn, test.fieldNexter, test.resultLast, test.resultWeekday,
			)
		}
	}
}

func TestParseDowDateField(t *testing.T) {
	tests := []struct {
		modifiers string
		fieldNexter
		resultLast bool
		resultHash int
		err        string
	}{
		{Hash + "6", nil, false, invalidValue, `invalid value for "#" modifier`},
		{Hash + "-1", nil, false, invalidValue, `invalid value for "#" modifier`},
		{Hash + "a", nil, false, invalidValue, `value after "#" ` + errParseInteger.Error()},
		{Last + Hash, nil, false, invalidValue, `cannot have "L" and "#" modifiers together`},
		{Hash + Last, nil, false, invalidValue, `cannot have "L" and "#" modifiers together`},
		{Last + Hash + "2", nil, false, invalidValue, `cannot have "L" and "#" modifiers together`},
		{"a", nil, false, invalidValue, `unknown modifier "a"`},
		{Last, nil, true, invalidValue, ""},
		{Hash + "2", nil, false, 2, ""},
		{Last, nil, true, invalidValue, ""},
		{"", valueNexter(1), false, invalidValue, ""},
	}
	for _, test := range tests {
		dfn, err := parseDowDateField(test.fieldNexter, test.modifiers)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseDowDateField(%v, %q) error = %v WANT %v", test.fieldNexter, test.modifiers, err, test.err)
		}
		if err != nil {
			continue
		}
		if dfn.fieldNexter != test.fieldNexter || dfn.isLast != test.resultLast || dfn.number != test.resultHash {
			t.Errorf("parseDowDateField(%v, %q) result = %v WANT %v, %v, %v",
				test.fieldNexter, test.modifiers, dfn, test.fieldNexter, test.resultLast, test.resultHash,
			)
		}
	}
}

func TestNewUnknownModifierError(t *testing.T) {
	err := newUnknownModifierError("modifiers")
	if err.Error() != `unknown modifier "modifiers"` {
		t.Fail()
	}
}

func TestHasAndRemoveModifier(t *testing.T) {
	tests := []struct {
		value    string
		modifier string
		result   string
		has      bool
	}{
		{"", Last, "", false},
		{Last, "", Last, false},
		{Last + Asterisk, Last, Asterisk, true},
		{Asterisk + Last, Last, Asterisk, true},
		{Hash + "value", Hash, "value", true},
		{Hash + "value", Last, Hash + "value", false},
	}
	for _, test := range tests {
		result, has := hasAndRemoveModifier(test.value, test.modifier)
		if result != test.result || has != test.has {
			t.Errorf("hasAndRemoveModifier(%q, %q) = %q, %v WANT %q, %v", test.value, test.modifier, result, has, test.result, test.has)
		}
	}
}

func TestParseFieldNexterPart_errors(t *testing.T) {
	tests := []struct {
		value string
		fi    fieldIndex
	}{
		{"", second},
		{"-", second},
		{"JAN   ", month},
		{"JAN", second},
		{"/2", second},
		{"3/2", second},
		{"14-16/a", second},
		{"14-16/-1", second},
		{"15-34/", second},
		{"23-12", second},
		{Last, second},
		{Weekday, second},
		{Last + Weekday, second},
		{"2-34#5", second},
	}
	for _, test := range tests {
		result, err := parseFieldNexterPart(test.value, test.fi)
		if err == nil {
			t.Errorf("parseFieldNexterPart(%v, %v) = %v, %v WANT nil, non-nil", test.value, test.fi, result, err)
		}
	}
}

func TestParseFieldNexterPart_valueNexter(t *testing.T) {
	value := "2026"
	fi := year
	result, err := parseFieldNexterPart(value, fi)
	want := valueNexter(2026)
	if err != nil || result != want {
		t.Errorf("parseFieldNexterPart(%v, %v) = %v, %v WANT %v, %v", value, fi, result, err, want, nil)
	}
}

func TestParseFieldNexterPart_rangeNexter(t *testing.T) {
	value := "2-8"
	fi := month
	result, err := parseFieldNexterPart(value, fi)
	want := rangeNexter{2, 8}
	if err != nil || *(result.(*rangeNexter)) != want {
		t.Errorf("parseFieldNexterPart(%v, %v) = %v, %v WANT %v, %v", value, fi, result, err, want, nil)
	}
}

func TestParseFieldNexterPart_rangeDivNexter(t *testing.T) {
	value := "40-50/2"
	fi := minute
	result, err := parseFieldNexterPart(value, fi)
	want := newRangeDivNexter(newRangeNexter(40, 50), 2)
	if err != nil || !reflect.DeepEqual(result, want) {
		t.Errorf("parseFieldNexterPart(%v, %v) = %v, %v WANT %v, %v", value, fi, result, err, want, nil)
	}
}

func TestParseRangeOrConstantNexter_range(t *testing.T) {
	tests := []struct {
		fi     fieldIndex
		value  string
		result *rangeNexter
		err    string
	}{
		{second, Hyphen, nil, "left side of range " + errParseInteger.Error()},
		{second, "0-1", &rangeNexter{0, 1}, ""},
	}
	for _, test := range tests {
		result, err := parseRangeOrConstantNexter(test.value, test.fi)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseRangeOrConstantNexter(%v, %v) error = %v WANT %v", test.value, test.fi, result, test.err)
		}
		if err != nil {
			continue
		}
		rn := result.(*rangeNexter)
		if rn.min != test.result.min || rn.max != test.result.max {
			t.Errorf("parseRangeOrConstantNexter(%v, %v) result = %v, %v WANT %v, %v",
				test.value, test.fi, rn.min, rn.max, test.result.min, test.result.max,
			)
		}
	}
}

func TestParseRangeOrConstantNexter_notRange(t *testing.T) {
	tests := []struct {
		fi     fieldIndex
		value  string
		result valueNexter
		err    string
	}{
		{second, "", invalidValue, errParseInteger.Error()},
		{second, "57", 57, ""},
	}
	for _, test := range tests {
		result, err := parseRangeOrConstantNexter(test.value, test.fi)
		if (err != nil || test.err != "") && err.Error() != test.err {
			t.Errorf("parseRangeOrConstantNexter(%v, %v) error = %v WANT %v", test.value, test.fi, err, test.err)
		}
		if err != nil {
			continue
		}
		vn := result.(valueNexter)
		if vn != test.result {
			t.Errorf("parseRangeOrConstantNexter(%v, %v) result = %v WANT %v", test.value, test.fi, vn, test.result)
		}
	}
}

func TestParseRangeNexter(t *testing.T) {
	tests := []struct {
		fi    fieldIndex
		value string
		min   int
		max   int
		err   string
	}{
		{second, "", invalidValue, invalidValue, errNoHyphen.Error()},
		{second, "a", invalidValue, invalidValue, errNoHyphen.Error()},
		{second, "-25", invalidValue, invalidValue, "left side of range " + errParseInteger.Error()},
		{second, "25-", invalidValue, invalidValue, "right side of range " + errParseInteger.Error()},
		{month, "a-b", invalidValue, invalidValue, "left side of range " + errParseIntegerAlias.Error()},
		{month, "-b", invalidValue, invalidValue, "left side of range " + errParseIntegerAlias.Error()},
		{month, "4-2", invalidValue, invalidValue, "left side value of range must be strictly less than right side value"},
		{dow, "SUN-SUN", invalidValue, invalidValue, "left side value of range must be strictly less than right side value"},
		{month, "feb-may", int(time.February), int(time.May), ""},
		{year, "1-3005", 1, 3005, ""},
	}
	for _, test := range tests {
		result, err := parseRangeNexter(test.value, test.fi)
		if err == nil && test.err != "" {
			t.Fatalf("parseRangeNexter(%v, %v) WANT ERROR got nil", test.value, test.fi)
		}
		if err != nil && err.Error() != test.err {
			t.Errorf("parseRangeNexter(%v, %v) error = %v WANT %v", test.value, test.fi, err, test.err)
		}
		if err == nil && (result == nil || result.min != test.min || result.max != test.max) {
			t.Errorf("parseRangeNexter(%v, %v) result = %v, %v WANT %v, %v", test.value, test.fi, result.min, result.max, test.min, test.max)
		}
	}
}

func TestConvertPossibleAnyToRange(t *testing.T) {
	tests := []struct {
		fi     fieldIndex
		value  string
		result string
	}{
		{second, "14", "14"},
		{second, Asterisk, second.rangeString()},
		{dom, Asterisk, dom.rangeString()},
		{dom, Question, dom.rangeString()},
		{dow, Asterisk, dow.rangeString()},
		{dow, Question, dow.rangeString()},
		{year, Question, Question},
	}
	for _, test := range tests {
		if result := convertPossibleAnyToRange(test.value, test.fi); result != test.result {
			t.Errorf("convertPossibleAnyToRange(%v, %v) = %v WANT %v", test.value, test.fi, result, test.result)
		}
	}
}

func TestParseValueNexter(t *testing.T) {
	tests := []struct {
		fi       fieldIndex
		value    string
		result   int
		hasError bool
	}{
		{second, "16", 16, false},
		{minute, "60", invalidValue, true},
		{hour, "0", 0, false},
		{month, "something", invalidValue, true},
		{dow, "tuesday", int(time.Tuesday), false},
		{year, "something", invalidValue, true},
	}
	for _, test := range tests {
		result, err := parseValueNexter(test.value, test.fi)
		if (err != nil) != test.hasError {
			t.Errorf("parseValueNexter(%v, %v) error = %v WANT ERROR %v", test.value, test.fi, err, test.hasError)
		}
		if int(result) != test.result {
			t.Errorf("parseValueNexter(%v, %v) result = %v WANT %v", test.value, test.fi, int(result), test.result)
		}
	}
}

func TestParseSingleValue(t *testing.T) {
	tests := []struct {
		fi     fieldIndex
		value  string
		result int
		err    string
	}{
		{second, "16", 16, ""},
		{minute, "60", invalidValue, errNotInRange.Error()},
		{hour, "0", 0, ""},
		{month, "something", invalidValue, "must be a decimal integer or valid string alias"},
		{dow, "tuesday", int(time.Tuesday), ""},
		{dow, "SUN", int(time.Sunday), ""},
		{year, "something", invalidValue, "must be a decimal integer"},
	}
	for _, test := range tests {
		result, err := parseSingleValue(test.value, test.fi)
		if err != nil && err.Error() != test.err {
			t.Errorf("parseSingleValue(%v, %v) error = %v WANT %v", test.value, test.fi, err, test.err)
		}
		if result != test.result {
			t.Errorf("parseSingleValue(%v, %v) result = %v WANT %v", test.value, test.fi, result, test.result)
		}
	}
}

func TestConvertPossibleMonthDowToInteger(t *testing.T) {
	tests := []struct {
		fi     fieldIndex
		value  string
		result string
	}{
		{second, "something", "something"},
		{month, "february", fmt.Sprint(int(time.February))},
		{dow, "sunday", fmt.Sprint(int(time.Sunday))},
		{month, "something", "something"},
	}
	for _, test := range tests {
		if result := convertPossibleMonthDowToInteger(test.value, test.fi); result != test.result {
			t.Errorf("convertPossibleMonthDowToInteger(%v) = %v WANT %v", test.value, result, test.result)
		}
	}
}

func TestConvertMonthToInteger(t *testing.T) {
	tests := []struct {
		value  string
		result string
	}{
		{"", ""},
		{"a", "a"},
		{"JA", "JA"},
		{"jan", fmt.Sprint(int(time.January))},
		{"MAY", fmt.Sprint(int(time.May))},
		{"Octo", fmt.Sprint(int(time.October))},
		{"july and some more stuff", "july and some more stuff"},
		{"4", "4"},
		{"20", "20"},
	}
	for _, test := range tests {
		if result := convertMonthToInteger(test.value); result != test.result {
			t.Errorf("convertMonthToInteger(%v) = %v WANT %v", test.value, result, test.result)
		}
	}
}

func TestConvertDowToInteger(t *testing.T) {
	tests := []struct {
		value  string
		result string
	}{
		{"", ""},
		{"a", "a"},
		{"JA", "JA"},
		{"sun", fmt.Sprint(int(time.Sunday))},
		{"Thurs", fmt.Sprint(int(time.Thursday))},
		{"FRIDAY", fmt.Sprint(int(time.Friday))},
		{"monday and some more stuff", "monday and some more stuff"},
		{"4", "4"},
		{"8", "8"},
	}
	for _, test := range tests {
		if result := convertDowToInteger(test.value); result != test.result {
			t.Errorf("convertDowToInteger(%v) = %v WANT %v", test.value, result, test.result)
		}
	}
}

func TestParseIncValue(t *testing.T) {
	const errString = "step value must be a positive decimal integer"
	tests := []struct {
		value  string
		result int
		err    string
	}{
		{"", invalidValue, "step value " + errEmpty.Error()},
		{"a", invalidValue, errString},
		{"-1", invalidValue, errString},
		{"0", invalidValue, errString},
		{"0xA", invalidValue, errString},
		{"12", 12, ""},
	}
	for _, test := range tests {
		result, err := parseIncValue(test.value)
		if (test.err != "" || err != nil) && err.Error() != test.err {
			t.Errorf("parseIncValue(%v) error = %v WANT %v", test.value, err, test.err)
		}
		if result != test.result {
			t.Errorf("parseIncValue(%v) = %v WANT %v", test.value, result, test.result)
		}
	}
}


On Rosh Hashana night we do a strange thing: we eat all sorts of different fruits, as well as fish and maybe even the head of a lamb. On each of these foods we say a special yehi ratzon. One may wonder, what exactly are we trying to accomplish when we eat these fruits? Is it supposed to be some sort of tefillah, or is there some other reason for it?
The source for eating the special foods is the Gemara in Kerisus 6a. The Gemara first establishes that there is an idea called simana, which will be explained later. It goes on to say now that we have determined that there is such an idea of simana, one should eat the following fruits, and begins to list them.
What is the purpose of the yehi ratzons? The Chayei Adam refers to a Ramban in parshas Lech Lecha (12:6) to explain this strange custom. The Ramban is discussing the idea of ma'aseh avos siman labanim (the acts of the avos is a sign for their children). This means that whatever happens to the avos will in some form happen to the children.
In his discussion the Ramban has the following line: "that when a gezaira is brought to an act that gezaira is effected". Meaning, when there is a decree upon a person and the person goes and kind of acts out that decree then the decree will last. For this reason, he says we find many times that when a navi will make a prophecy, he will then act out that nevu'a so that it comes true. For example, Yirmiyuhu when he prophecized about the downfall of Bavel he told someone to tie a stone to a book and throw it into the river, because that is what is going to happen to Bavel.
The Chayei Adam explains the strange custom of these yehi ratzons based on this Ramban. We do all of these things to act upon the decree that has been decreed upon us. Just like Hashem decreed that we should have a sweet year, in order to "strengthen" that decree we do an action that represents a sweet year. What comes out of this Chayei Adam, then, is that we are eating these fruits after Hashem has judged us. It's not that we are asking Hashem to decree upon us a good decree. Rather, we are asking that the decree that was already decreed come true.
The gemara in Krisus , however, does not seem to explain the idea of "simana" this way. Simana in the Gemara means that you aren't sure whether your business will be successful or not so you can raise a chicken and see whether it will be fatty. If it is fatty then that means that your business will be successful, and if not, it won't. Or if you want to know if you will live out the year you can light a candle in your house and see if it stays lit. What does this idea have to do with eating a sweet apple and saying that it should be a sweet year? The Drisha on the Tur asks this question and answers that really they aren't the same, and the Gemara was saying the following: Just like there is no problem of superstition in the other cases, so too there is no problem here.
Returning to the previous idea, it seems a bit strange that we need to act out the decree so it comes true. I would like to suggest and explanation. Perhaps we can say that when we act out the decree the decree will be fulfilled not for some reason that is totally beyond us, but because we are living out the decree. Meaning, when we eat the apple and say we should have a sweet year, we are actually causing that decree to begin. When we eat the apple, since it's sweet, the eating of the apple itself is part of the fulfillment of the gezaira, giving us a sweet year.
This approach is difficult, however, because there are other simmering that do not amount to a fulfillment of the correlated gezaira. For example, when we eat gourd and say that the evil decrees against us should be torn up, there is no way that eating a pumpkin fulfills that idea.