text:
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';

import { Injectable } from '@angular/core';
import { Actions, Effect } from '@ngrx/effects';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { TodoActions } from './todo-action';

@Injectable()
export class TodoEffects {
  constructor(
    private actions$: Actions,
    private api: any,
    // private store$: Store<any>,
    private todoActions: TodoActions
  ) { }

  @Effect()
  addTodo$ = this.actions$
    .ofType(TodoActions.ADD_TODO)
    .switchMap(({payload}) => this.api.addTodo(payload.todo)
    // .map(Todo => this.todoActions.createTodoFulfilled(Todo))
    // .catch(error => Observable.of(this.todoActions.createTodoFailed(error)))
    );

  @Effect()
  removeTodo$ = this.actions$
    .ofType(TodoActions.REMOVE_TODO)
    .switchMap(({payload}) => this.api.removeTodo(payload.todoId)
    // .map(Todo => this.todoActions.deleteTodoFulfilled(Todo))
    // .catch(error => Observable.of(this.todoActions.deleteTodoFailed(error)))
    );

  @Effect()
  loadTodos$ = this.actions$
    .ofType(TodoActions.LOAD_TODOS)
    .switchMap(() => this.api.loadTodos()
    // .map(Todo => this.todoActions.fetchTodosFulfilled(Todo))
    // .catch(error => Observable.of(this.todoActions.fetchTodosFailed(error)))
    );

  @Effect()
  updateTodo$ = this.actions$
    .ofType(TodoActions.UPDATE_TODO)
    .switchMap(({payload}) => this.api.updateTodo(payload.TodoId, payload.changes)
    // .map(Todo => this.todoActions.updateTodoFulfilled(Todo))
    .catch(error => Observable.of('error'))
    );
}


text:
Brandonvillers é uma comuna francesa na região administrativa do Grande Leste, no departamento de Marne. Estende-se por uma área de 11.69 km², e possui 187 habitantes, segundo o censo de 2018, com uma densidade de 16 hab/km².

Comunas de Marne (departamento)

redpajama_set_name: RedPajamaWikipedia


text:
Report on Soufriere Hills (United Kingdom) — 26 February-4 March 2003
Smithsonian / US Geological Survey Weekly Volcanic Activity Report, 26 February-4 March 2003
Managing Editor: Gari Mayberry
Global Volcanism Program, 2003. Report on Soufriere Hills (United Kingdom). In: Mayberry, G (ed.), Weekly Volcanic Activity Report, 26 February-4 March 2003. Smithsonian Institution and US Geological Survey.
Volcano Profile | Weekly Report (26 February-4 March 2003)
Soufriere Hills
16.72°N, 62.18°W; summit elev. 915 m
Activity at Soufrière Hills increased slightly during 21-28 February in comparison to the previous week. During an observation flight on 27 February, scientists saw that lava-dome growth was concentrated towards the NE. Pyroclastic flows and rockfalls traveled down the lava dome's E and NE flanks via the Tar River Valley and Tuitt's Ghaut. There were also several periods of activity on the N flank, with pyroclastic flows at the top of Farrell's Plain. SO2 emission rates were moderate for much of the report period, with the exception of 22-23 February, when rates increased. The Washington VAAC stated that several low-level ash plumes were visible on satellite imagery.
Geologic Background. The complex, dominantly andesitic Soufrière Hills volcano occupies the southern half of the island of Montserrat. The summit area consists primarily of a series of lava domes emplaced along an ESE-trending zone. The volcano is flanked by Pleistocene complexes to the north and south. English's Crater, a 1-km-wide crater breached widely to the east by edifice collapse, was formed about 2000 years ago as a result of the youngest of several collapse events producing submarine debris-avalanche deposits. Block-and-ash flow and surge deposits associated with dome growth predominate in flank deposits, including those from an eruption that likely preceded the 1632 CE settlement of the island, allowing cultivation on recently devegetated land to near the summit. Non-eruptive seismic swarms occurred at 30-year intervals in the 20th century, but no historical eruptions were recorded until 1995. Long-term small-to-moderate ash eruptions beginning in that year were later accompanied by lava-dome growth and pyroclastic flows that forced evacuation of the southern half of the island and ultimately destroyed the capital city of Plymouth, causing major social and economic disruption.
Sources: Montserrat Volcano Observatory (MVO), Washington Volcanic Ash Advisory Center (VAAC)

redpajama_set_name: RedPajamaCommonCrawl


A Shreveport man arrested in Broadmoor in February 2018 with methamphetamine was convicted of possession.
A Shreveport man arrested in Broadmoor in February 2018 with methamphetamine was convicted of possession of the illegal drug Tuesday in Caddo District Court.
Robert Bradley Brown, 36, was found guilty as charged by the two-man, four-woman jury in District Judge Roy Brun's courtroom after less than 40 minutes' deliberation.
The jury determined that Brown, the target of arrest warrants being executed on Leo Avenue by Caddo Parish Sheriff's deputies on Feb. 16, 2018, possessed under two grams of the Schedule II drug methamphetamine. According to deputies, when arrested he had the drug inside a pill bottle, as well as two smoking devices and a silver digital scale.
Brown, who has convictions for possession of Scheduled IV Controlled Dangerous Substances in 2001 and 2012, felony DWI in 2013 and possession of Schedule II CDS in 2014, was prosecuted by Assistant District Attorneys Ross Owen and Erica Jefferson. He was defended by Richard Fisher.
When Brown returns to Judge Brun's courtroom on May 8, he faces up to two years in prison with or without hard labor, as well as a fine of up to $5,000.


The British, known for our fantastic music culture but when it comes to cooking we're not always the go to cuisine. Despite this, there really are some great dishes. They may not have the fancy names but they're full of heart and taste great. This inspired me to make my very own cottage pie with a twist. Cottage pie is made with beef and Shepard's pie is made using lamb. It's proper comfort food. If the weather is cold or dark and gloomy you can always rely on a dish like this to lift your spirit.
Something to really give it that extra flavour in this recipe is the Smokey pancetta. You can also use smoked streaky bacon and it will work just the same; you'll find adding the pancetta helps season the dish without the need to add extra salt. Pepper of course can be added and plenty too. The next twist is the mustard. For me it has to be Dijon mustard as it's not too overpowering, yet has enough character to evolve the dish into something special.
I have always loved grated carrot in both a shepherds and cottage pie, so that's a must. Simply peel the skin then use a block grater. A big tip is to leave the end of the carrot on so that you have something to hold onto and you can avoid grating your hand.
Peel your potatoes and slice a millimetre thick. Don't worry about getting them spot on. This is a rustic dish and who cares if they are different shapes and sizes? You can use the traditional method which requires mash potato, but I'm trying to be a tad healthier and use less potatoes in this recipe. You only need 2-3 medium potatoes and it creates a lovely crust. Less carbs and no need for extra milk or cream (still need the cheese though)! I add a layer of sliced potato, a little grated cheese. Then a second next layer and top that off with some more cheese. You really don't need much, just a little to melt whilst baking and it will go a long way.
Place in the oven until golden brown, then it's ready to serve. When you divide it up and add each serving to a plate, you will notice lovely rich, silky gravy at the bottom. You can just add that on top or save it for bread and butter later! It goes really well with some freshly steamed green beans too.
Dice an onion and peel and grate your carrots ready to be cooked.
Brown off the beef in the pan separating it into a fine mince. Then set aside in a bowl.
Heat in the same pan a tablespoon of olive oil, add the onion and carrots then brown off for a couple of minutes on a medium heat, then add the mince back to the pan followed by a crushed clove of garlic.
Add the beef/chicken stock, tomato pure and Dijon mustard then bring to a boil.
Turn the heat down and simmer for 15 minutes with the lid on. Meanwhile preheat the oven to gas mark 6/200°C/400°F. Slice your potatoes about a millimetre thick and part boil for 5 minutes then cool under cold water.
Add the cooked mince to a dish and then cover with a layer of potatoes. Add some grated cheese, followed by another layer of potatoes. Finally another layer of grated cheese then drizzle some olive oil and a little black pepper.
Put in the oven for 25-30 minutes until golden brown.


text:
Q: Difference between "return 0" and "exit (0)" Is there any difference between return 0 and exit (0) when using in a function?
If yes, When should I use return 0 or exit (0) in a function?

A: Yes there is, since there is no statement called exit. I guess you mean the function exit?
In that case, there is a big difference: The exit function exits the process, in other words the program is terminated. The return statement simply return from the current function.
They are only similar if used in the main function.

A: return exits from the function while exit exits from the program.
In main function executing return 0; statement or calling exit(0) function will call the registered atexit handlers and will cause program termination.

A: exit 0 is a syntax error in C. You can have exit(0) that is instead a call to a standard library function.
The function exit will quit the whole program, returning the provided exit code to the OS. The return statement instead only quits the current function giving the caller the specified result.
They are the same only when used in main (because quitting the main function will terminate the program).
Normally exit is only used in emergency cases where you want to terminate the program because there's no sensible way to continue execution. For example:
//
// Ensure allocation of `size` bytes (will never return
// a NULL pointer to the caller).
//
// Too good to be true? Here's the catch: in case of memory
// exhaustion the function will not return **at all** :-)
//
void *safe_malloc(int size) {
    void *p = malloc(size);
    if (!p) {
        fprintf(stderr, "Out of memory: quitting\n");
        exit(1);
    }
    return p;
}

In this case if function a calls function b that calls function c that calls safe_malloc you may want to quit the program on the spot instead of returning to c an error code (e.g. a NULL pointer) if the code is not written to handle allocation failures.

A: *

*return is a statement that returns control back to the calling
function.

*exit is a system call which terminates the current process i.e the
currently executing program.

In main() the return 0; and exit(0); perform the same thing.
NOTE: you have to include #include<stdlib.h>.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Simple strtolower not working Im sure this is something obvious i'm missing but I have a string 'GB' that is stored as $str and is then echoed out using strtolower...
$str = bp_member_profile_data('field=Country');
echo strtolower($str);

I am expecting to see 'gb' (lowercase) but the output is still 'GB' (uppercase)
What could I be doing wrong?
UPDATE
Turns out That the issue lied with bp_member_profile_data, this is a BuddyPress PHP function that automatically echos so it was ignoring the strtolower - Thanks to everybody for helping to narrow it down!

A: Check out buddy press bp_member_profile_data() function, it echoes:
function bp_member_profile_data( $args = '' ) {
    echo bp_get_member_profile_data( $args );
}

You might want to use bp_get_member_profile_data()

A: Try to use:
mb_strtolower($str);

This may work.
From PHP Manual:

If the input string is in different language that server locale, then
  you should use mb_strtolower() function.

The function prototype is:
string mb_strtolower ( string $str [, string $encoding = mb_internal_encoding() ] )

You could try adding the appropriate encoding.

The encoding parameter is the character encoding. If it is omitted,
  the internal character encoding value will be used.


Don't let an injury keep you from playing the game. Mayo Clinic Health System offers comprehensive orthopedic services for athletes and active individuals, including evaluation and treatment of the conditions listed below.
For additional information or to schedule a sports medicine appointment, call 507-434-1999.
A concussion is a traumatic brain injury that is caused by a blow to the head or when the head and upper body are violently shaken. Concussions are common in contact sports, such as football, hockey and soccer. If you've had a concussion, your brain needs time to rest in order to recover and heal properly.
A dislocation is an injury to your joint in which the ends of your bones are forced from their normal positions. Your shoulder and fingers are common locations for a dislocation to occur. Other common places for a dislocation include your elbows, knees and hips.
If you have a history of dislocations, we can provide you with options to help prevent this from recurring.
One common site for a dislocation is your shoulder, which is a ball-and-socket joint. The ball is your upper arm bone (humerus), and the socket is part of your shoulder blade (scapula). In a shoulder dislocation, these two bones are forced from their normal positions.
The pain of tennis elbow occurs primarily where the tendons of your forearm muscles attach to the bony prominence on the outside of your elbow. The pain may result from tiny tears in the tendon.
Make an appointment with our orthopedic team if rest, ice and use of over-the-counter pain relievers don't ease your elbow pain and tenderness.
A sprain occurs when you overstretch or tear your ligaments — the tough bands of fibrous tissue that connects two bones together in your joints. The most common location for a sprain is in your ankle.
A strain occurs when you overstretch or tear your muscle or tendon. A tendon is a fibrous cord of tissue that connects muscles to bones. Strains most likely occur in the lower back and in the hamstring muscle in the back of your thigh.
To treat a sprain or a strain, use rest, ice, compression and elevation. If the injury is severe, you may need surgery to repair torn ligaments, muscles or tendons.
The rotator cuff is a group of muscles and tendons that surround your shoulder joint, keeping the head of your upper arm bone firmly within the shallow socket of the shoulder. If you're an athlete or individual who repeatedly performs overhead motions with your job or sport, you're most at risk for a rotator cuff injury.
Inflammation of a tendon can occur in any part of your body, which causes tenderness and pain with any movement you make in that area. If you've tried rest, ice and over-the-counter pain relievers and are still experiencing pain, we can help. Our skilled providers will talk with you to decide if a steroid injection or surgery is best to relieve your pain and prevent further injury. Conditions that can result from tendonitis include trigger finger and De Quervain's tenosynovitis.
Trigger finger – Trigger finger generally results from inflammation within a tendon sheath, restricting tendon motion. A bump (nodule) also may form.
De Quervain's tenosynovitis – A test called the Finkelstein test can help your doctor confirm de Quervain's tenosynovitis. To do this test, first bend your thumb down across the palm of your hand, covering your thumb with your fingers. Next, bend your wrist toward your little finger. If this causes pain, there is a chance you may have de Quervain's tenosynovitis.
Plantar Fasciitis - one of the most common causes of heel pain. It involves inflammation of a thick band of tissue that runs across the bottom of your foot and connects your heel bone to your toes. Plantar fasciitis often causes stabbing pain that usually occurs with your first steps in the morning. As you get up and move more, the pain normally decreases, but it might return after long periods of standing or after rising from sitting. It is more common in runners. In addition, people who are overweight and those who wear shoes with inadequate support have an increased risk of plantar fasciitis.


text:
Quantum structure in cognition
Diederik Aerts
Centre Leo Apostel
Foundations of the Exact Science
Similar to the 'guppy effect' identified in Osherson and Smith (1981), Hampton (1988a,b) measures substantial deviations from classical fuzzy set and probability models for membership weights for conjunction and disjunction, and calls them respectively 'overextension' and 'underextension'. We identify two types of non classical data and prove that membership weights of a specific item are (i) classical; (ii) non classical of the Delta-type, which is the non classicality of the 'guppy effect' or of Hampton's over - or underextension; (iii) non classical of the k-type, which is a new type of non classicality not identified before. We introduce a quantum mechanical formalism, where items are represented by vectors and concepts by subspaces of a vector space, and prove that classical items and non classical items of the k-type can be modeled within this quantum mechanical formalism, i.e. the vectors and subspaces plus the proper quantum calculation rules reproduce the experimental data of Hampton (1988a,b). We show that to represent also the Delta-type non classical items extra aspects of the quantum mechanical formalism need to be introduced, namely those aspects that make it possible to represent the formation of a new concept. An interpretation of this complete quantum mechanical representation leads us to propose a specific cognitive thought mechanism, containing a 'classical logical part', for which membership weights are classical, they would result if only this part would take place, and a 'quantum conceptual part', for which membership weights are non classical, they would result if only this part would take place.
Journal of Mathematical Psychology
quantum structures
guppy effect
combinations of concepts
http://uk.arxiv.org/abs/0805.3850
Dive into the research topics of 'Quantum structure in cognition'. Together they form a unique fingerprint.
Cognition Mathematics 100%
Poecilia Medicine & Life Sciences 61%
Weights and Measures Medicine & Life Sciences 46%
Vector spaces Engineering & Materials Science 37%
Thinking Medicine & Life Sciences 18%
Fuzzy Probability Mathematics 17%
Subspace Mathematics 17%
FWOAL475: The elaboration of an operational framework for the representation of concepts, their combinations and contextual meaning to improve the automated extraction of semantical information from unstructured documents
Aerts, D., Aerts, S. & Aerts, D.
Project: Fundamental
FWOAL230: Development of a contextual theory for concepts.
Aerts, D., Gabora, L., Aerts, D. & Storms, G.
1 Membership of external research organisation
Unknown (External organisation)
Diederik Aerts (Member)
Activity: Membership › Membership of external research organisation
Aerts, D. (2009). Quantum structure in cognition. Journal of Mathematical Psychology, 53(5), 314-348. http://uk.arxiv.org/abs/0805.3850
Aerts, Diederik. / Quantum structure in cognition. In: Journal of Mathematical Psychology. 2009 ; Vol. 53, No. 5. pp. 314-348.
@article{0f0bbfb0f52345d286208b7e5e91791b,
title = "Quantum structure in cognition",
abstract = "Similar to the 'guppy effect' identified in Osherson and Smith (1981), Hampton (1988a,b) measures substantial deviations from classical fuzzy set and probability models for membership weights for conjunction and disjunction, and calls them respectively 'overextension' and 'underextension'. We identify two types of non classical data and prove that membership weights of a specific item are (i) classical; (ii) non classical of the Delta-type, which is the non classicality of the 'guppy effect' or of Hampton's over - or underextension; (iii) non classical of the k-type, which is a new type of non classicality not identified before. We introduce a quantum mechanical formalism, where items are represented by vectors and concepts by subspaces of a vector space, and prove that classical items and non classical items of the k-type can be modeled within this quantum mechanical formalism, i.e. the vectors and subspaces plus the proper quantum calculation rules reproduce the experimental data of Hampton (1988a,b). We show that to represent also the Delta-type non classical items extra aspects of the quantum mechanical formalism need to be introduced, namely those aspects that make it possible to represent the formation of a new concept. An interpretation of this complete quantum mechanical representation leads us to propose a specific cognitive thought mechanism, containing a 'classical logical part', for which membership weights are classical, they would result if only this part would take place, and a 'quantum conceptual part', for which membership weights are non classical, they would result if only this part would take place.",
keywords = "cognition, quantum structures, guppy effect, concept modeling, interference, combinations of concepts",
author = "Diederik Aerts",
journal = "Journal of Mathematical Psychology",
Aerts, D 2009, 'Quantum structure in cognition', Journal of Mathematical Psychology, vol. 53, no. 5, pp. 314-348. <http://uk.arxiv.org/abs/0805.3850>
Quantum structure in cognition. / Aerts, Diederik.
In: Journal of Mathematical Psychology, Vol. 53, No. 5, 2009, p. 314-348.
T1 - Quantum structure in cognition
AU - Aerts, Diederik
N2 - Similar to the 'guppy effect' identified in Osherson and Smith (1981), Hampton (1988a,b) measures substantial deviations from classical fuzzy set and probability models for membership weights for conjunction and disjunction, and calls them respectively 'overextension' and 'underextension'. We identify two types of non classical data and prove that membership weights of a specific item are (i) classical; (ii) non classical of the Delta-type, which is the non classicality of the 'guppy effect' or of Hampton's over - or underextension; (iii) non classical of the k-type, which is a new type of non classicality not identified before. We introduce a quantum mechanical formalism, where items are represented by vectors and concepts by subspaces of a vector space, and prove that classical items and non classical items of the k-type can be modeled within this quantum mechanical formalism, i.e. the vectors and subspaces plus the proper quantum calculation rules reproduce the experimental data of Hampton (1988a,b). We show that to represent also the Delta-type non classical items extra aspects of the quantum mechanical formalism need to be introduced, namely those aspects that make it possible to represent the formation of a new concept. An interpretation of this complete quantum mechanical representation leads us to propose a specific cognitive thought mechanism, containing a 'classical logical part', for which membership weights are classical, they would result if only this part would take place, and a 'quantum conceptual part', for which membership weights are non classical, they would result if only this part would take place.
AB - Similar to the 'guppy effect' identified in Osherson and Smith (1981), Hampton (1988a,b) measures substantial deviations from classical fuzzy set and probability models for membership weights for conjunction and disjunction, and calls them respectively 'overextension' and 'underextension'. We identify two types of non classical data and prove that membership weights of a specific item are (i) classical; (ii) non classical of the Delta-type, which is the non classicality of the 'guppy effect' or of Hampton's over - or underextension; (iii) non classical of the k-type, which is a new type of non classicality not identified before. We introduce a quantum mechanical formalism, where items are represented by vectors and concepts by subspaces of a vector space, and prove that classical items and non classical items of the k-type can be modeled within this quantum mechanical formalism, i.e. the vectors and subspaces plus the proper quantum calculation rules reproduce the experimental data of Hampton (1988a,b). We show that to represent also the Delta-type non classical items extra aspects of the quantum mechanical formalism need to be introduced, namely those aspects that make it possible to represent the formation of a new concept. An interpretation of this complete quantum mechanical representation leads us to propose a specific cognitive thought mechanism, containing a 'classical logical part', for which membership weights are classical, they would result if only this part would take place, and a 'quantum conceptual part', for which membership weights are non classical, they would result if only this part would take place.
KW - quantum structures
KW - guppy effect
KW - concept modeling
KW - interference
KW - combinations of concepts
JO - Journal of Mathematical Psychology
JF - Journal of Mathematical Psychology
Aerts D. Quantum structure in cognition. Journal of Mathematical Psychology. 2009;53(5):314-348.


Get on your skis and experience the amazing feeling of riding fluffy powder far away from the crowds!
Whether you're a beginner or freeride freak, our mountain guide will show you pristine powder runs or steep couloirs. Perfect snow and insider tips are guaranteed!
At 8.30am, you will meet your mountain guide at the Matterhorn Express bottom station. From there, you'll explore the ski resort and off-piste terrain and even the glacier, where your guide will show you the best powder runs.
Beginners: You are an experienced skier and feel comfortable skiing on pistes of all colours. You would like to go off-piste now and learn how to ski safely in the backcountry.
Advanced skiers: You feel comfortable skiing off-piste and have already descended a few powder runs.
Bring warm winter clothing and your freeride equipment (incl. shovel and probe). It's also possible to rent freeride equipment (including airbag backpacks) in any of Zermatt's sports shops.


text:
Helmut(h) Tarand (until 1935; Helmuth Takenberg; 8 October 1911 – 1 November 1987) was an Estonian poet, philologist, philosopher and cultural figure. He used also pseudonyms Annus Rävälä and Aili Helm (with Hilja Rüütli).

From 1929 to 1936 he attended Tartu University, studying philosophy.

He was a member of student society Veljesto.

In 1945 he was arrested because of his anti-Soviet activities during WW II. He was sent to Vorkuta coal mines. In 1956 he moved back to Estonia.

His son is climatologist and politician Andres Tarand and his grandchildren include politician Indrek Tarand and journalist Kaarel Tarand. His nephew is poet, humorist and politician Priit Aimla.

Pseudonym Aili Helm
With Hilja Rüütli they used pseudonym "Aili Helm". Hilja was a nurse and writer who also was sent to Vorkuta camps. Under the pseudonym "Aili Helm", they published five-part sequence of documentary novels about the Soviet prison system.

Selected works
 1981: poetry collection "Vorkuta värsse" ('The Vorkuta Verses')
 1990: poetry collection "Epitaaf" (published posthumously)
 2011: poetry collection "Ürglohutus" (published posthumously)

References

1911 births
1987 deaths
Estonian male poets
20th-century Estonian poets
Estonian philologists
20th-century Estonian philosophers
Gulag detainees
Prisoners and detainees of the Soviet Union
University of Tartu alumni
Writers from Tallinn
People from Tallinn
20th-century philologists
Soviet poets


text:
Q: Parametric composite type inner constructors in Julia: Why is `where {T}` necessary? Why does this raise LoadError: UndefVarError: T not defined:
struct Point{T}
    x::T
    y::T
    Point{T}(x,y) = new(x,y)
end

while this works fine:
struct Point{T}
    x::T
    y::T
    Point{T}(x,y) where {T} = new(x,y)
end

?
It seems that once upon a time they were both fine: Inner constructor of parametric type
EDIT: To clarify, I would have expected the fact that we are within the struct Point{T} block to have made it clear what T refers to even in the first case.

A: Without where clause T is inherited from the global scope (which is kind of surprising, but this is how it works):
julia> T = String
String

julia> struct Point{T}
           x::T
           y::T
           Point{T}(x,y) = new(x,y)
       end

julia> Point{String}("b","a")
Point{String}("b", "a")

julia> Point{String}(SubString("b",1,1),SubString("a",1,1))
Point{String}("b", "a")

julia> Point{Int}(1, 2)
ERROR: MethodError: no method matching Point{Int64}(::Int64, ::Int64)

julia> Point{String}(1, 2)
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type String

EDIT
The short answer, given the comments on Discourse, is that the reason for this is that T of struct is not known at the moment an inner constructor is called.


Eamonn O' Callaghan is an Irish artist currently living and working in Vietnam. He studied at the Crawford College of Art and Design in Ireland and graduated in 2007. Since then he has traveled and has taught art in Africa, Europe and Asia.


Are you looking seraphin shirts	and seraphin hoodies?. There are many T-Shirts, Meaning, Hoodies, Sweaters, V-neck, Tank Top, Longsleeve Tee, Sweatshirts about your name Seraphin here. Check it now!
SERAPHIN This Is An Amazing Thing For You. Select The Product You Want From The Menu. Never Underestimate Of A Person With SERAPHIN Name. 100% Designed, Shipped, and Printed in the U.S.A.
SERAPHINGuysTee SERAPHIN I was born with my heart on sleeve, a fire in soul and a mounth cant control. 100% Designed, Shipped, and Printed in the U.S.A.
Its a SERAPHIN Thing, You Wouldnt Understand!


text:
REVENGE: BACK WITH A VENGEANCE
Season two of REVENGE kicked off on September 30th with a BANG! The 26-year old Canadian-born actress, Emily VanCamp, plays a powerful woman with convincing control. At the start of the 2011 series, the premise of a girl who had grown up as a troubled youth, the daughter of a murderer, being found on the street by a rich benefactor, a young man her father had wisely invested in before the unfortunate turn of events, required a great deal of suspended disbelief in its neatly arranged packaging. But if that wasn't enough, the very same street urchin with dyed-black hair and punk clothes with an attitude to match suddenly becomes a swan with a polished, poised, and well-dressed blondely-ambitious mean streak? Thanks entirely to VanCamp, the audience not only believes, we're completely enthralled!!!
But what makes a show like REVENGE so appealing, besides the fetching VanCamp??? It's all in the title....
We all live in the human community. So we all know the barbaric behavior human beings are capable of. Who hasn't wanted to act out some form of revenge on those who have committed heinous wrongs, irreparably changing our lives forever?
The 17th century poet, George Herbert, is well known for his quote, "Living well is the best revenge." But is it? We're not talking about the jerk who cat-calls as you walk into the mall, or whoever it was that dinged the side of your brand new car. We're talking about the people who actually hate you with enough vehemance that they attempt to irreparably alter your life by diminishing you--for Emily VanCamp's character, that means framing her father for murder and arranging for his untimely death, institutionalizing/disappearing her mother, and of course, institutionalizing/disappearing her. For the rest of us, it might mean a supervisor who, before firing you, tortured you with pointed, visceral harassment for a year and a half. And after that, ruining your professional reputation with deliberation, thereby, diminishing your ability to earn so that you can no longer provide for yourself, your family, or, your future. Maybe it's that old flame who became your stalker, attacking you at the mall in broad daylight while you held your newborn in your arms, altering your sense of trust in humanity and the world... forever. Perhaps it was a relative who abused you, a parent who neglected you, or a teacher who abused their power over you as a child. All irreparable, heinous acts that permanently change a person forever. And if you have ever had such an unfortunate experience, most of the time, you're powerless to turn back the hands of time and prevent whatever happened from occurring. You're powerless to bring justice to the perpetrators. You're powerless to take back the things you lost as a result of their actions. Basically, you are left hopeless and helpless. But what if you could exact strategic revenge on those people, and not suffer any further negative reprecussions? Would you do it? Or, would you simply say, "Living well is the best revenge," and go buy yourself the latest Viutton?
The fantasy of getting back the people who have irreparably damaged our lives, and in so doing, irreparably damaged us as individuals, is too deliciously tempting. But in the hands of any other actor, such enacted desire would appear silly, if not down-right ridiculous. Not so with VanCamp!
If only she were real, and for hire! Sadly, the satisfaction of watching Emily (VanCamp's aptly named character) on screen for an hour will have to suffice for most of us.
This season, REVENGE is sweetly sandwiched between the fairytale mystery adventure, ONCE UPON A TIME, and a new devilshly delightful series, 666 PARK PLACE. Hello, fall! We're happy you're back...and, that you brought a little taste of REVENGE with you.
The new season of REVENGE is #PopCultureProfessor APPROVED! If you've ever had someone take away something precious from your life, this show is for you! And with the numbers of unemployed Americans on the rise...I'd say this series isn't going anywhere fast.


A neurologist shares how parents can help their children during seizures and what steps to take next.
Parents who witness their children having seizures can feel helpless and afraid. We asked Kevin Ess, M.D., Ph.D., the director of Pediatric Neurology at Monroe Carell Jr. Children's Hospital at Vanderbilt, to answer parents' questions about how to handle a child's first seizure.
Should I attempt first aid during a seizure, call 911 or take my child to the ER?
Remain calm. Seizures are scary, but your child is safer if you stay calm. In most cases, seizures last fewer than 5 minutes and usually stop on their own.
Roll your child onto his side.
Remove any objects your child might hit. Try to cushion the head.
Do not restrain or hold the child down.
Loosen any clothing around the child's head and neck.
When the seizure is over, talk to your child gently and stay with her until she is well enough to return to usual activities.
It's normal to be sleepy after a seizure. You may let the child sleep.
Do not give your child anything to eat or drink until he or she is awake and alert.
"We recommend calling 911 the first time a child has a seizure so that they can be acutely assessed and stabilized," said Ess. After the event, it's important to determine if the event was actually a seizure. An exam can find abnormalities that increase the risk for developing epilepsy or the possibility of future seizures.
Does a seizure mean my child has epilepsy?
A seizure does not necessarily mean your child has epilepsy. Many first seizures in children have a provoking cause, including fever, head injury, low blood sugar or dehydration. Seizures related to fever are common in young children and are usually outgrown by 5 or 6 years of age. Most of these children never have another seizure and do not need treatment.
If doctors cannot find a provoking cause or your child has a second unprovoked seizure separated by at least 24 hours, doctors recommend a follow-up exam to test for epilepsy or other conditions.
How will my child's seizure be assessed during a clinic visit?
Your child will have an electroencephalogram, or EEG, to record brain activity. An EEG records the electrical activity of the brain and may help determine the potential for more seizures. An EEG is usually scheduled on the same day as the clinic visit, ideally before the visit.
We'll ask you about medical history and perform a neurologic exam. It's important for parents to provide details about the child's seizure. It's best if the person who witnessed the seizure writes down everything about the event as soon as possible.
Based on results from the EEG, medical history and exam, your child may be scheduled for a brain MRI to evaluate brain structure.
A child's first seizure can be a scary event. The Pediatric New Onset Seizure Clinic at Monroe Carell Jr. Children's Hospital at Vanderbilt can help. The hospital also has a four-bed pediatric epilepsy monitoring unit to accurately diagnose seizures in children and teens.


Rent a Dumpster in Morattico Now!
Simply give us a call and we will answer any questions you may have about the Morattico dumpster rental procedure, allowed materials, size you may need, etc.
Our roll off containers can usually be delivered in Morattico the day after you place your order. Make sure to call us early to ensure timely delivery.
Choosing the top dumpster for your project is an important aspect of dumpster rental in Morattico. Should you pick a dumpster that is too small, you won't have enough room for your debris and waste, which means you will have to schedule additional trips. In the event that you select one that is too large, you will save time, but you will waste money.
Should you call a dumpster rental business in Morattico and describe the job for which you want a dumpster, they can recommend the best size. Their years of experience mean they generally get it just about right. A 10-yard dumpster typically functions well for moderate-sized cleaning projects and small remodeling jobs. A 20-yard dumpster is the most suitable choice for big residence cleaning projects and moderate-sized renovation projects, while a 30-yard dumpster has higher walls that are perfect for a house cleanout or remodeling jobs on a large house. 40-yard dumpsters are massively big and are used only on the biggest projects such as new construction.
5. Learn what services you get with your dumpster rental in Morattico.
If you want to rent a dumpster in Morattico, you'll discover that costs vary considerably from state to state and city to city. One method to get real quotes for the service you need would be to telephone a local dumpster company and ask regarding their costs. You can also request a quote online on some sites. These sites may also include complete online service that's constantly open. On these sites, you can pick, schedule and pay for your service whenever it's suitable for you.
Variables that affect the price of the container include landfill fees (higher in some areas than others) as well as the size of the container you choose. You need to also consider transport costs as well as the type of debris you'll be putting into your container.
Price quotes for dumpster rental in Morattico typically include the following: the size of the container, the type of debris involved, the base price for the dumpster, how much weight is contained in the estimate, a specified rental period and delivery and pickup fees.
As with any service, it's almost always an excellent plan to reserve your dumpster as far ahead as you possibly can in order to make sure that the dumpster will be accessible when you need it. Should you wait until the final minute, there's no promise that the organization will likely be able to fill your order.
Two or three days notice is generally sufficient to ensure your dumpster delivery in time. Remember that the busiest days tend to be on Mondays and Fridays (surrounding the weekend), so if you can organize your mission for the midst of the week, you've a increased possibility of getting the dumpster you need.
Should you find out you want a dumpster the following day or even the same day, please go ahead and phone the company. Should they have what you need, they will certainly make arrangements to get it to you as soon as possible.
Garbage removal vs dumpster rental in Morattico - Which is right for you?
When you have a job you are going to undertake at home, you might be wondering if it's better to hire someone to come haul off all your waste and crap for you, or if you need to just rent a dumpster in Morattico and load it yourself.
Renting a container is a better option if you would like the flexibility to load it on your own time and you don't mind doing it yourself to save on work. Dumpsters also function well in the event that you have at least seven cubic yards or more of debris. Roll-offs normally start at 10 cubic yards, thus if you just have 3-4 yards of waste, you are paying for a lot more dumpster than you want.
Trash or crap removal makes more sense in case you would like someone else to load your old things. It also functions well if you would like it to be taken away quickly so it's out of your own hair or in the event that you simply have a few big items; this is likely cheaper than renting an entire dumpster.
Deciding where to place your dumpster can have a big effect regarding how fast you finish projects. The most efficient alternative would be to pick a place that's close to the worksite. It is important, however, to consider whether this place is a safe alternative. Make sure the place is free of barriers that could trip folks while they carry heavy debris.
Lots of folks decide to put dumpsters in their own drives. This really is a handy alternative because it usually means you can avoid requesting the city for a license or permit. If you have to put the dumpster on the road, then you should get in touch with your local government to ask whether you have to get a permit. Although many municipalities will let folks keep dumpsters on the road for short amounts of time, others are going to ask you to fill out some paperwork. Following these rules will help you stay away from fines that'll make your job more costly.
Most dumpster rental businesses in Morattico normally rent containers for a normal speed for 7 days, although most one time customers end up keeping their container an average of three and a half days. When you call to reserve the container, talk with the customer support representative about the amount of time you think you will need.
If it turns out that your job takes longer than you expected, only phone the dumpster company to describe. Most businesses will bill you on a per-day basis following your first 7 days. It is very important to convey this additional need as soon as you understand you have it since most dumpster companies have a limited number of bins that could already be allowed. Most businesses will work together with you to accommodate your additional rental time. Should you think you'll need the dumpster for an additional week or more, make sure to mention that; rates may change based on a longer time period.
It's possible for you to set most types of debris into a dumpster rental in Morattico. There are, however, some exclusions. For instance, you cannot put substances into a dumpster. That includes motor oil, paints, solvents, automotive fluids, pesticides, and cleaning agents. Electronic Equipment and batteries are also prohibited. If something introduces an environmental risk, you likely cannot place it in a dumpster. Get in touch with your rental business if you're unsure.
That makes most varieties of debris that you could place in the dumpster, include drywall, concrete, lumber, and yard waste. Pretty much any sort of debris left from a construction job can go in the dumpster.
Certain kinds of satisfactory debris, however, may require additional fees. If you intend to throw away used tires, mattresses, or appliances, you need to request the rental business whether you need to pay an extra fee. Adding these to your dumpster may cost anywhere from $25 to $100, depending on the thing.
The amount of time that you have to rent a dumpster in Morattico usually depends on the kind of project you're working on. A small project, including a cellar clean out, will likely take a couple of days to finish while bigger projects, like building a new house, could take several months.
Most dumpster rental businesses in Morattico are happy to adjust their schedules to suit your needs. Keep in your mind, nevertheless, that the the more time you keep the dumpster, the more you'll have to pay for it.
When you contact dumpster rental businesses in Morattico, ask them how long their durations are. Many will allow you choices such as several days or one week, however there are usually longer periods available, too.
You must also ask how much the businesses charge for extra time. That way, you know how much it costs to keep the dumpster for a few extra days if desired.
The cost to rent a dumpster in Morattico depends on several factors such as the size you need and how long you need to keep it to complete your project. Generally, you can expect to spend more money for larger dumpsters. Keeping the dumpster for a longer amount of time will even raise the cost.
Getting estimates is one of the most effective ways to compare dumpster prices to be sure to get a fair deal. Since some companies may charge additional fees, it is important to make sure the price quote comprises all of the equipment and services that you need.
Typically, renting a dumpster in Morattico is an affordable way to remove debris from a building, remodeling, or clean out endeavor. So long as you get price quotes so you can compare your options, you need to realize that you could get an excellent deal on a dumpster rental in Morattico.
All major credit cards accepted for dumpster rentals in Morattico.


text:
package com.fruit.entity.management;

import java.util.Date;

/**
 * 灌溉记录
 * Irrigation entity. @author MyEclipse Persistence Tools
 */

public class Irrigation implements java.io.Serializable {

	// Fields

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Productinformation productinformation;
	private Farmer farmer;
	private String way;
	private String water;
	private String watersource;
	private Date date;
	private String number;
	/** 企业介绍图片 */
	private String pictures ;
	private Date createTime;

	// Constructors

	/** default constructor */
	public Irrigation() {
		this.createTime = new Date();
	}

	/** full constructor */
	public Irrigation(Productinformation productinformation, Farmer farmer,
			String way, String water, String watersource, Date date,
			String number) {
		this.productinformation = productinformation;
		this.farmer = farmer;
		this.way = way;
		this.water = water;
		this.watersource = watersource;
		this.date = date;
		this.number = number;
		this.createTime = new Date();
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Productinformation getProductinformation() {
		return this.productinformation;
	}

	public void setProductinformation(Productinformation productinformation) {
		this.productinformation = productinformation;
	}

	public Farmer getFarmer() {
		return this.farmer;
	}

	public void setFarmer(Farmer farmer) {
		this.farmer = farmer;
	}

	public String getWay() {
		return this.way;
	}

	public void setWay(String way) {
		this.way = way;
	}

	public String getWater() {
		return this.water;
	}

	public void setWater(String water) {
		this.water = water;
	}

	public String getWatersource() {
		return this.watersource;
	}

	public void setWatersource(String watersource) {
		this.watersource = watersource;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getNumber() {
		return this.number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getPictures() {
		return pictures;
	}

	public void setPictures(String pictures) {
		this.pictures = pictures;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
}

redpajama_set_name: RedPajamaGithub


Dedicated to strict quality manage and thoughtful buyer company, our experienced workers members are generally available to discuss your specifications and make certain full consumer gratification for Promotional Trolley Coin Keychains , Shopping Trolley Coin Keychains , Promotional Metal Keychains , We're going to provide high-quality merchandise and excellent products and services at competitive costs. Start benefiting from our comprehensive products and services by contacting us today.
We'll make every effort and hard work being outstanding and excellent, and speed up our techniques for standing during the rank of global top-grade and high-tech enterprises for Promotional Trolley Coin Keychains , Shopping Trolley Coin Keychains , Promotional Metal Keychains , Our company will continue to serve customers with best quality, competitive price, timely delivery, the best payment term! We sincerely welcome friends from all over the world to visit & cooperate with us and enlarge our business. If you are interested in our goods please do not hesitate to contact us we will be happy to provide you with further information!


Hidden gem of the Fleurieu Peninsula, offering the best in regional food & drink.
Only 1 hour drive from Adelaide throught the stunning hills, Strathalbyn, Langhorne Creek and Currency Creek offers expcetional food, wine and beer experiences. This hidden gem of South Australia is a favorite to many locals.


text:
Entertainment Celebrity Park Yoo Chun ordered to pay woman in sex assault case
Park Yoo Chun ordered to pay woman in sex assault case
In July, Park was sentenced to two years' probation for drug use, and fined 1.4 million won (SGD1,600).
Photo: Screengrab from Instagram
Lydia Koh
EntertainmentCelebrityLifestyle
Fallen South Korean K-Pop star Park Yoo-chun is ordered by a court in Seoul to compensate a woman who claimed the former boy band member sexually assaulted her.
Park, popularly known as Micky has to pay 100 million won (SGD115,000) to the victim by the Mediation Centre of Seoul court.
She is among one of four women who reported Park for alleged sexual assault in 2016.
The order, which was first delivered after a mandatory mediation last month, came into effect after a two-week grace period and carries the same weight as a court ruling.
This is not the first in Park's legal troubles.
Through a separate investigation in connection with South Korea's explosive Burning Sun sex scandal Park and his former fiancée Namyang Dairy Products heiress Hwang Ha-na, were arrested for illegal drug use after testing positive for methamphetamine.
The scandal involves big names in K-pop including Big Bang singer-songwriter Seungri, former CEO of YG Entertainment Yang Hyun-suk, singers Jung Joon-young, Roy Kim, Choi Jong-hoon and several others.
In July, Park was sentenced to two years' probation for drug use, and fined 1.4 million won (SGD1,600).
Park Yoo-chun formerly-known as Micky Yoochun is better known by the nickname Yoochun is a former South Korean singer-songwriter and actor as a member of the South Korean boy bands JYJ and TVXQ.
He has starred in dramas Sungkyunkwan Scandal (2010), Miss Ripley (2011), Rooftop Prince (2012), Missing You (2012), Three Days (2014) and The Girl Who Sees Smells (2015).
On April 23, 2019, Park's agency announced his retirement from the entertainment industry after he tested positive for drugs.
Yoochun was born to a wealthy family and his family moved to the United States in the late 90s.
He was schooled in American education from middle school up to high school.
In 2001, he won an award at the American Music Festival and then returned to Korea to prepare for his debut.
After a relatively short training period of one year and five months, he made his debut as a member of the five-member male group TVXQ through SBS BoA & Britney Spears Special Stage on December 26, 2003.
Park Yoochun graduated from the Hanam High School in 2007 along with fellow members Kim Junsu and Kim Jaejoong.
Park Yoo-chun


text:
Star Wars: The Empire Strikes Back at Secret Cinema. © Mike Massaro
Secret, immersive cinema is likely to change the future of film
December 1, 2015 5.39am EST
Sarah Atkinson, King's College London, Helen W. Kennedy, University of Brighton
Senior Lecturer in Digital Cultures, King's College London
Helen W. Kennedy
Deputy Head: Art, Design and Media, University of Brighton
The research project referenced in the article is funded by Arts Council England Grants for the Arts.
King's College London and University of Brighton provide funding as members of The Conversation UK.
The soon-to-be-released Star Wars: Episode VII – The Force Awakens is tipped to be the box office success of 2015. Hardly surprising given that fans have been waiting ten years since the last installment.
A lot has changed in how films are produced and promoted in the intervening decade. Last summer, for example, there was a huge Secret Cinema Star Wars event. Their immersive The Empire Strikes Back experience sold a staggering 100,000 tickets, generating over £6 million at the box office.
Running over four months, the event brought to the fore a new form of immersive cinematic entertainment which exploded in the UK over the summer of 2015. In addition to Secret Cinema's event, the largest season of Open Air Cinema concluded its 125 outdoor screening run. In fact, a dizzying number of organisations now turn cinema into events: in the UK these include Sneaky Experience, Floating Cinema, Sing-alonga, Rooftop Film Club and Nomad Cinema.
There is a growing trend toward cinema-as-event – where film screenings are augmented by synchronous live performance, site-specific locations, technological interventions, social media engagement, and all manner of simultaneous interaction including singing, dancing, eating, drinking, even smelling.
Wizarding Weekend Sneaky Experience. Author provided
This summer also saw the UK tour of a live re-scoring of George Lucas's 1971 film THX 1138 by Asian Dub Foundation. A unique score was composed by the band and played live alongside the film's screening, interwoven with the film's original soundtrack. This is one of the first times this has been done in this way: re-scorings are usually performed to silent and foreign language films (where it isn't crucial for an English-speaking audience to hear the original soundtrack due to subtitles).
The last performance of the tour was attended by sound designer Walter Murch, who said afterwards: "It's like being the author of a 19th century novel who then sees that novel being turned into an opera."
Walter's presence at the event signalled that live cinema has passed a landmark moment. These events have become mainstream, achieving significant box office success and commercial gain. They have also been accepted by the film industry as a normalised part of the distribution and development of a film. As a matter of course, decisions in Hollywood as to whether there will be a live distribution strategy are made from the outset.
Secret Cinema's Star Wars event. © Paul Cochrane
Shifting grounds
So why are we seeing such a sudden change in the way that film is consumed?
Technologically, the industry has burgeoned as a result of the rapid advancement of "pop-up" screen technology (such as inflatable screens and directional audio). This enables screenings to take place in locations that have previously been inaccessible, such as Hampton Court Palace, Kew Gardens or an obscure warehouse rooftop.
In commercial terms, we might compare the film industry's need to branch out to that of the music industry. Both are facing threats to traditional forms of revenue generation due to the easy access offered by the internet. So both have turned their attention to the attraction of live events as an alternative. The film industry has also expanded in response to the public's love for nostalgia and the power of fan engagement – many events tend to revolve around "old" and well-loved film releases; Secret Cinema's Back to the Future was one such example last year.
Secret Cinema do Back to the Future. © Al Overdrive
The rise in events also dovetails with the rise in social media. Individuals have a growing need to populate their social media streams with novel and exciting experiences.
Artistically, this new form also offers audiences a deeper emotional engagement with films. Murch recalled a moment of anticipating these latent possibilities during the 1971 scoring session for THX 1138:
It was electrifying to see a film energised by 80 musicians recording that music, and I thought at the time, and this was 45 years ago, wouldn't it be great to allow ordinary people to experience this.
The future of film
Live cinema events are not just new ways of experiencing film. The trend is also likely to direct the development of film itself. Early cinema history shows that new forms of exhibition and audience engagement drove the evolution of new film genres and techniques.
For example, the 1908 explosion of Nickelodeon movie theatres in the USA led to the creation of the fiction film and film studio in order to provide a constant flow of viewing fodder for the masses cheaply and efficiently. Likewise, the 1950s rise of drive-in cinema culture spawned the teen-movie genre in order to fill the double and triple bills that the audiences demanded.
A more recent drive-in, Brussels. Christian Kremer, CC BY-SA
The current growth of live cinema exhibition and distribution will surely have the same impact today. Certain films are chosen and promoted because of characteristics which make them suitable for this kind of exhibition.
THX 1138 worked because of its sparse dialogue, meaning that the live music could be woven in effectively, still enabling the audiences to hear the dialogue and original sound score. The Empire Strikes Back screening and pre-event build-up was infused with the theme of rebellion and secrecy, which was germane to the film's original narrative, ensuring the audience's willingness to engage in the experience, purchasing costumes from the pop-up and online shops, and bringing along props as instructed.
In the future, genre conventions and production practices and processes will respond directly to the "live" model in the development and production phases. Film aesthetics, style and process will evolve as a result, and we are likely to see films being made specifically for live exhibition –- which will take increasingly spectacular forms.
blurring of art forms


Free Home Business – # 1 FREE Home Based Business In The World!
I do not know what you want, but then if you want to earn some funds on the web paid, and without investment by verify / PayPal a look at this Web site: http://wvwv.headplug.com/Hop that helps. Thank you.


text:
Home » Donate to Isaac's Bookshelf
Donate to Isaac's Bookshelf
Isaac's Bookshelf was created in loving memory of Isaac Emzy Brincken to share the joy of reading with children who are in the hospital. Isaac passed away at five months of age due to complications with Hypoplastic Left Heart Syndrome and CHARGE Syndrome. Among all of Isaac's favorite activities, including playing his foot piano, holding hands, nibbling on his fingers, and snuggling, Isaac's absolute favorite pastime was reading. Isaac's two favorite books were Rex Wrecks It and Pete the Cat and His Four Groovy Buttons. Isaac's Bookshelf is located in the Pediatric Intensive Care Unit at Sacred Heart Medical Center in Spokane, Washington. The bookshelf rolls around the unit visiting patients. It is also serves as an exciting destination for patients who are working on improving their mobility after surgery. Every patient has the opportunity to pick a book from Isaac's Bookshelf to read in the hospital and then take home with them. To learn more about Isaac's Bookshelf, please visit isaacsbookshelf.org
Isaac's Bookshelf accepts books for readers ages 0-17. If you need some ideas, please consider donating any of the following titles. Auntie's gift card donations are welcome, too! Be sure to include in your order notes that your purchase is for Isaac's Bookshelf and select "in-store pickup" as your shipping option. Auntie's will coordinate delivery of the books to Isaac's Bookshelf.
Rex Wrecks It! (Board book)
By Ben Clanton, Ben Clanton (Illustrator)
Published: Candlewick - March 28th, 2017
"A warm and wacky story that feels both fresh and familiar. This enchanting, quirky quartet will entertain children with what are sure to be repeat readings." — Booklist
Pete the Cat and His Four Groovy Buttons (Hardcover)
By Eric Litwin, James Dean (Illustrator), Kimberly Dean
Published: HarperCollins - May 1st, 2012
An award-winning and bestselling Pete the Cat hardcover picture book! Count down with Pete in this rocking story that makes counting fun! Pete the Cat is wearing his favorite shirt—the one with the four totally groovy buttons.
Pete the Cat and the New Guy (Hardcover)
By James Dean, James Dean (Illustrator), Kimberly Dean
Published: HarperCollins - August 5th, 2014
From Kimberly and James Dean's bestselling Pete the Cat series comes a groovy story about new beginnings and new friends.
That's Not My Dinosaur (Board Books)
By Fiona Watt, Rachel Wells
Published: E.D.C. Publishing - June 1st, 2002
Mighty, Mighty Construction Site (Easy Reader Books, Preschool Prep Books, Toddler Truck Book) (Hardcover)
By Sherri Duskey Rinker, Tom Lichtenheld (Illustrator)
Published: Chronicle Books - February 14th, 2017
Recommended for children ages 2-5 years to enjoy any time of day.
First 100 Words (Board book)
Published: Priddy Books US - May 10th, 2011
Beloved child educator Roger Priddy's classic First 100 Words is now a padded board book introducing 100 essential first words and pictures
Room on the Broom (Board book)
Availability: Backordered
Published: Dial Books - August 16th, 2012
This fun family read-aloud is a story of quick wits, friendship, and inclusivity from the creators of The Gruffalo, and this board book edition is perfect for little hands.
Goodnight, Goodnight Construction Site (Hardcover Books for Toddlers, Preschool Books for Kids) (Hardcover)
By Tom Lichtenheld (Illustrator), Sherri Duskey Rinker
Published: Chronicle Books - May 4th, 2011
The #1 New York Times bestselling children's book
As the sun sets behind the big construction site, all the hardworking trucks get ready to say goodnight. One by one, Crane Truck, Cement Mixer, Dump Truck, Bulldozer, and Excavator finish their work and lie down to rest—so they'll be ready for another day of rough and tough construction play!
Steam Train, Dream Train (Easy Reader Books, Reading Books for Children) (Hardcover)
Published: Chronicle Books - April 16th, 2013
From the team behind the #1 New York Times Bestseller Goodnight, Goodnight, Construction Site
Corduroy (Paperback)
By Don Freeman
Published: Puffin Books - September 30th, 1976
A picture book classic!
One of School Library Journal's "Top 100 Picture Books" of all time (2012)
One of the National Education Association's "Teachers' Top 100 Books for Children."
Llama Llama Loves to Read (Hardcover)
By Anna Dewdney, Reed Duncan, JT Morrow (Illustrator)
Published: Viking Books for Young Readers - May 1st, 2018
Anna Dewdney's Bestselling Llama Llama series continues with Llama learning to read!
Llama Llama learns at school.
Counting, writing, reading, rules.
Friends and school -- there's nothing better.
Llama learning all the letters!
Nelly Gnu and Daddy Too (Board book)
By Anna Dewdney
Published: Viking Books for Young Readers - March 28th, 2017
Drawing.
These are things Nelly loves to do…but they're always better with Daddy Gnu!
I'd Know You Anywhere, My Love (Board book)
By Nancy Tillman, Nancy Tillman (Illustrator)
Published: Feiwel & Friends - December 29th, 2015
There are things about you quite unlike any other.
Things always known by your father or mother.
So if you decide to be different one day,
no worries… I'd know you anyway.
You're Here for a Reason (Board book)
By Nancy Tillman
Now available in board book, You're Here for a Reason, from national-bestselling and beloved author Nancy Tillman, takes a universal truth and makes it accessible for readers young and old.
Never Touch a Dragon (Board Books)
By Make Believe Ideas Ltd
Published: Make Believe Ideas - February 27th, 2018
You must never touch a dragon . . . unless it's in this book This dragon-themed touch-and-feel board book is great for children of all ages and fits perfectly into tiny hands. Kids will love reading the silly rhymes that warn the dangers of touching a dragon--and then ignoring the advice
Children of all ages, 0 and up, will enjoy:
Puddle Pug (Board Books)
By Kim Norman, Keika Yamaguchi (Illustrator)
Published: Sterling Children's Books - March 6th, 2018
Can Percy the Pug find the perfect puddle? Young children will love this delightful board book version of a favorite, fun story.
Chicka Chicka Boom Boom (Chicka Chicka Book, A) (Paperback)
By Jr. Martin, Bill, John Archambault, Lois Ehlert (Illustrator)
Published: Beach Lane Books - August 1st, 2000
In this lively alphabet rhyme, the letters of the alphabet race up the cocunut tree. Will there be enough room? Oh, no - Chicka Chicka Boom! Boom!
A told B, and B told C, I'll meet you at the top of the coconut tree.
In this lively alphabet rhyme, all the letters of the alphabet race each other up the cocunut tree. Will there be enough room? Oh, no - Chicka Chicka Boom! Boom!
Pig the Pug (Hardcover)
By Aaron Blabey, Aaron Blabey (Illustrator)
Published: Scholastic Press - December 27th, 2016
A hilarious book about learning to share from the much loved, awarding winning author and illustrator Aaron Blabey.
You Belong Here (Hardcover)
By M. H. Clark
Published: Compendium Publishing & Communications - June 1st, 2016
"The stars belong in the deep night sky, and the moon belongs there too, and the winds belong in each place they blow by, and I belong here with you. So begins this classic bedtime book, richly illustrated by award-winning artist Isabelle Arsenault. The pages journey around the world, observing plants and animals everywhere, and reminding children that they are right where they belong.
Make Way for Ducklings (Paperback)
By Robert McCloskey, Robert McCloskey (Illustrator)
Published: Puffin Books - February 1st, 1999
"Robert McCloskey's unusual and stunning pictures have long been a delight for their fun as well as their spirit of place."—The Horn Book
God Bless You and Good Night (God Bless Book) (Board Books)
By Hannah Hall, Steve Whitlow (Illustrator)
Published: Thomas Nelson - October 2nd, 2018
God Bless You and Good Night is now available as a touch-and-feel book This beloved bedtime classic has touched more than 315,000 families, and this touch-and-feel edition offers even more fun as little ones prepare for bed.
I Prayed for You (Board Books)
By Jean Fischer
Published: Thomas Nelson - November 3rd, 2015
One of the best children's books about love and family, I Prayed for You by Jean Fischer reveals how deep a mother's love for her child can go. This board book is great for little ones and has sold more than 300,000 copies


text:
Anasayfa/Economy/Ukraine, Turkey sign agreement on housing construction for Crimean Tatars
Ukraine, Turkey sign agreement on housing construction for Crimean Tatars
President Volodymyr Zelensky welcomes the signing of an intergovernmental agreement between Ukraine and Turkey on the construction of housing for Crimean Tatars, which will allow building about 500 apartments for internally displaced persons.
He said this during a joint briefing with President of the Republic of Turkey Recep Tayyip Erdoğan following the bilateral talks in Istanbul, an Ukrinform correspondent reports.
"I welcome the signing of an intergovernmental agreement on cooperation in housing construction. This makes it possible to build 500 apartments for Crimean Tatars and other internally displaced persons," Zelensky noted.
According to the president, this agreement is an extremely important humanitarian project that will bring our peoples closer together.
As Ukrinform reported, President Volodymyr Zelensky was on a visit to Turkey on April 10. The ninth meeting of the High-level Strategic Council between Ukraine and Turkey was held under the co-chairmanship of the presidents of the two states.
Following the talks, a number of bilateral documents were signed.
Source: crimea.suspilne.media
Ukraine, Turkey have every opportunity to deepen bilateral cooperation - Zelensky
European Parliament formally approves post-Brexit agreement


text:
De Musica Sacra é um decreto apresentado no capítulo IX do Concílio Plenário da América Latina (Concilium Plenarium Americæ Latinæ), evento convocado pelo Papa Leão XIII por meio da Carta Apostólica Cum diuturnum (de 25 de dezembro de 1898), realizado em Roma (entre 28 de maio a 9 de julho de 1899) e publicado na versão original latina em 1900. Esse decreto, como os demais emitidos no Concílio Plenário da América Latina, teve a função de fortalecer a romanização do catolicismo nessa região do mundo e coibir as tradições religiosas locais, especialmente o uso dos idiomas vernaculos e os cânticos religiosos populares. O decreto De Musica Sacra do Concílio Plenário da América Latina manteve as determinações anteriores da Igreja Católica sobre música sacra, especialmente a Ordinatio quoad sacram musicen (1884) e a Quod sanctus Augustinus de Leão XIII (1894), além dos demais decretos da Sagrada Congregação dos Ritos e da Carta Encíclica Annus qui hunc de Bento XIV (1749). Foi mantida a proibição das mulheres nos coros, exceto nos mosteiros e conventos femininos.

Documentos da Igreja Católica sobre música sacra
A Igreja Católica, desde a Idade Média, emitiu determinações sobre a música sacra, na forma de bulas, encíclicas (epístolas encíclicas ou cartas encíclicas), constituições, decretos, instruções, motu proprio, ordenações e outras. A maior parte dessas decisões foi local ou pontual, e apenas algumas tiveram caráter geral, dentre as quais estão, segundo Paulo Castagna, os doze conjuntos de determinações mais impactantes na prática musical, do século XIV ao século XX, excetuando-se destas as inúmeras instruções cerimoniais (ou rubricas) dos livros litúrgicos:

1. A Bula Docta Sanctorum Patrum de João XXII (1322)

2. O Decreto do que se deve observar, e evitar na celebração da Missa de 17 de setembro de 1562, da Seção XXII do Concílio de Trento

3. O Cæremoniale Episcoporum (Cerimonial dos Bispos), publicado por Clemente VIII em 1600, reformado por Bento XIV em 1752 e por Leão XIII 1886.

4. Os Decretos da Sagrada Congregação dos Ritos (1602-1909)

5. A Constituição Piæ sollicitudinis studio, de Alexandre VII (23 de abril de 1657)

6. A Carta Encíclica Annus qui hunc, do papa Bento XIV (19 de fevereiro de 1749)

7. A Ordinatio quoad sacram musicen, da Sagrada Congregação dos Ritos (25 de setembro de 1884)

8. O Decreto Quod sanctus Augustinus de Leão XIII (7 de julho de 1894), ratificado pela Sagrada Congregação dos Ritos como decreto n.3830

9. O Motu Proprio Inter pastoralis officii sollicitudines (Tra le sollecitudini) de Pio X (22 de novembro de 1903)

10. A Carta Encíclica Musicæ sacræ disciplina sobre a música sacra, do papa Pio XII (25 de dezembro de 1955)

11. A Instrução De musica sacra et sacra liturgia sobre música sacra e liturgia, do papa Leão XXIII, 3 de setembro de 1958

12. O Decreto Sacrosanctum Concilium sobre música sacra do Concílio Vaticano II (4 de dezembro de 1963)

Significado do Concílio Plenário da América Latina
O documentos eclesiásticos mais amplos aplicados diretamente ao Brasil foram inicialmente as Constituições Primeiras do Arcebispado da Bahia, promulgadas em 12 de junho de 1707 pelo Arcebispo Dom Sebastião Monteiro da Vide (aceitas nas demais dioceses erigidas nos séculos XVIII e XIX), em vigor até a realização do Concílio Plenário da América Latina, de 9 de junho de 1899, substituído pelo Concílio Plenário do Brasil (1939), que tornou-se o primeiro código jurídico-eclesiástico exclusivo para o Brasil.

A música no Concílio Plenário da América Latina
No que se refere à atividade musical, as Constituições de 1707 determinaram "que nenhumas pessoas, eclesiásticas ou seculares, tanjam ou bailem, nem façam danças ou jogos profanos nas igrejas, nem em seus adros, nem se cantem cantigas desonestas ou cousas semelhantes", decisão refletida em vários documentos eclesiásticos brasileiros subsequentes, até o início do século XX (CASTAGNA, 1999 e 2000, v.1).

O Concílio Plenário da América Latina, que substituiu as Constituições Primeiras do Arcebispado da Bahia (1707) como o máximo código jurídico-eclesiástico para o Brasil, incluiu o decreto De Musica Sacra que, apesar de sua amplitude, ainda manteve os ideais puristas do Concílio de Trento, especialmente na proibição dos idiomas vernáculos, do repertório sacro-popular e do canto feminino, com recomendações expressas à fidelidade dos textos litúrgicos, ao uso dos livros de canto aprovados pela Sagrada Congregação dos Ritos e ao caráter "grave, pio e distinto" da música sacra. Mesmo assim, o Concílio Plenário da América Latina marcou uma nova era no controle exercido pela Igreja Católica no país.

Paralelamente, em 22 de novembro de 1903 (pouco após a entrada em vigor do Concílio Plenário da América Latina), o Papa Pio X (eleito em 4 de agosto desse mesmo ano) fez publicar o Motu Proprio Inter pastoralis officii sollicitudines (Tra le sollecitudini), que acarretou o maior impacto na música sacra desde o Concílio Tridentino: o documento determinou, entre outros aspectos, que das igrejas fossem excluídas as bandas de sopros e todas as formas de composição musical aparentadas à ópera, admitindo somente a música composta com base na polifonia renascentista, principalmente na música de Giovanni Pierluigi da Palestrina (c.1525-1594).

Além da existência de um novo código jurídico eclesiástico no Brasil (o Concílio Plenário da América Latina, de 1899), a música sacra passou a ser regulada, em todo o mundo, diretamente pelo Motu Proprio de 1903 (reiterado em inúmeras determinações diocesanas brasileiras nos anos subsequentes), o que iniciou uma era de clara e intensa regulamentação da prática musical nas igrejas a partir das normas romanas e o progressivo abandono da forma de controle baseada no Concílio de Trento (reformado somente com a promulgação do Código de Direito Canônico de 1917). O Primeiro Sínodo da Diocese de Mariana realizado em 17 de julho de 1903, poucos meses antes da emissão do Motu Proprio de Pio X, foi o último documento diocesano do Sudeste brasileiro a determinar o controle da música nas igrejas a partir do Concílio de Trento, proibindo, entre outras, "quaisquer festividades que, sob o pretexto de devoção, se celebram com orgias ou danças, verbi gratia os congados, charolas, etc."

A maior parte das decisões sobre música, nas Atas e Decretos do Concílio Plenário da América Latina encontram-se no título IV (De Cultu Divino), capítulo IX, "De Musica Sacra" (§ 439-450), porém há outras determinações relacionadas à música entre os 998 parágrafos, sendo estas as principais:

 § 232: aos cônegos é obrigatório o canto dos ofícios divinos no coro
 § 617: o canto eclesiástico está sujeito aos decretos do Concílio de Trento
 § 627: seja ensinado canto ritual aos alunos dos seminários
 § 681: seja promovido o ensino do canto litúrgico
 § 884: veta os cantos lascivos nas igrejas
 § 893: cuidem os diretores do coro da decência do canto e do órgão

O Concílio Plenário do Brasil (1939) basicamente aplicou no Brasil as determinações do Motu Proprio Inter pastoralis officii sollicitudines (Tra le sollecitudini) de 1903, de Pio XI.

Conteúdo do decreto De Musica Sacra do Concílio Plenário da América Latina

Ligações externas

ACTA et decreta Concilii Plenarii Americæ Latinæ in urbe celebrati (Biblioteca Nacional, Madrid)

Ver também

 Música sacra
 Música religiosa
 Concílio ecumênico
 Concílio plenário
 Concílio
 Concílio Vaticano II
 Documentos pontifícios
 Documentos da Igreja Católica sobre música sacra

Documentos do papa Leão XIII
Motu proprio
Cartas apostólicas
Cartas pontifícias
Instruções da Santa Sé
Documentos da Igreja Católica sobre música sacra
Documentos conciliares
Obras de 1899


I found a site some time ago where women uploaded pictures of their bellies.
Those women and those bellies had held life and lived life. And those women, by uploading those pictures, were somewhere on the path of learning how to love their looks, including their bellies.
I don't know if the link I'm posting here is the same site I found before; if it is, it's changed a lot. But it makes the same point.
I've changed a lot, too, but I never forgot this concept, or its point. It's resonated in my heart, my gut, my belly. It's become, along with other concepts, a foundation for my life now.
Everyone I know has SOMETHING about their looks they don't like, no matter how beautiful they are.
Everyone I know has SOMETHING about themselves they don't like, no matter how much work they've done.
My life's goal isn't to look better or 'fix' all my 'flaws'. Instead, my life's goal is to completely accept myself for exactly who I am, and understand on a core level that I'm not broken. I am a product of my environment, my genetics, my experience, and my effort. In any moment, I perceive and interact based on what I know in that moment.
And my life's mission is to convince others to be and accept themselves and everyone else in their lives.
Understand why, and find the value in everything you have and do. Change what you can, but not because you're "broken". Change because it's fun, because you want to, because it will serve you and others better. But in the meantime, accept yourself. Spend your time discovering the best location for the lighthouse that you are and can be.
Obtaining perfection isn't a goal that can be accomplished. Obtaining acceptance is. You don't have to be perfect, to be perfectly loved by anyone, including yourself.
This entry was posted in Essay and tagged body, essay, inspiration, life. Bookmark the permalink.
Accepting yourself is one hard hard task.


text:
Review: The Southbury Child, Bridge Theatre
July 13, 2022 Leave a Comment on Review: The Southbury Child, Bridge Theatre Posted in Bridge Theatre, LGBTQ+, Stephen Beresford, Theatre, Theatre review
Excellent work by Alex Jennings carries Stephen Beresford's new play The Southbury Child over the line at the Bridge Theatre
"Death is death, it isn't balloons"
There's no escaping the fact that The Southbury Child is an archetypal National Theatre play and fair play to Nicholas Hytner as he knows what he is doing in programming this kind of stuff. For me though, it just never quite seems to justify the addition of the Bridge Theatre to the already crowded London theatre landscape. Stephen Beresford's last play – the excellent The Last of the Haussmans with Julie Walters, the glorious Helen McCrory and Taron Egerton in his swimming trunks – was indeed a hit in the Lyttelton but it is what it is…
Led by a barnstorming performance by Alex Jennings, The Southbury Child is a co-production with Chichester Festival Theatre and is soaked through like elderflower cordial in its Englishness. The milieu is the Church of England in Devon, the setting is the vicarage kitchen of David Highland and the flashpoint is a request from the family of a dead schoolgirl to fill the church with Disney balloons for her funeral. Highland says no and chaos ensues as the community turns viciously against him.
Thus the scene is set for an even-handed and, initially at least, enlightening debate about the role of the CoE in contemporary British society. How much does David owe to a community who only turn up for special occasions and never on Sundays? As we see members of that very community traipse in and out of this uber-middle-class kitchen, the pot is brought to the boil most effectively towards the end of the first act.
But…but…there's a dissonance that gets harder and harder to ignore, in the sense that it never really flies that this is the sticking point for as erudite and enlightened a figure as this witty vicar. The sniffiness towards the balloons you buy (though Beresford could usefully develop his representation of the working class characters here), the reactionary determination not to cave to the mob understandable but the ultimate denial of a grieving mother's wishes rings false.
That said, Alex Jennings does a hell of a job in selling it. A thoroughly flawed but compassionate character (though clearly, to a point), he plays up the notes of Alan Bennett-esque humour wonderfully, even if we might wish for a little more analytical depth. And around him, Phoebe Nicholls (as his wife), and Jo Herbert and Racheal Ofori (as his daughters) impress, as do Josh Finan and Sarah Twomey who elevate the material for the grieving uncle and mother.
Running time: 2 hours 30 minutes (with interval)
Photo: Manuel Harlan
The Southbury Child is booking at the Bridge Theatre until 27th August
DVD Review: The Ruby in the Smoke
Review: Platonov, Chichester Festival Theatre
Short Film Review #46
69th British Academy Film Awards nominations
Tagged Alex Jennings, Helen McCrory, Hermione Gulliford, Holly Atkins, Jack Greenlees, Jo Herbert, Josh Finan, Julie Walters, Nick Barclay, Phoebe Nicholls, Racheal Ofori, Sarah Twomey, Taron Egerton
Review: A Doll's House Part 2, Donmar Warehouse →
← News: Casting announced for HORSE-PLAY


text:
The Tapes Archive
Alan Berry
#036 Paul Stanley (KISS) interview from 1996 6
18 minutes Posted Aug 18, 2020 at 9:01 pm.
In the interview, Stanley talks about:
- How the 1996 tour is going to be a better Kiss concert than the 1974 shows.
- The familiarity of playing with Ace Frehley and Peter Criss
- Parasitic friends and business associates
- If there will be more reunion tours
- How fast tickets are selling
- How KISS fans are the greatest fans in the world
- His thoughts on the Rock and Roll Hall of Fame
- The founding of the Kiss Army and Bill Starkey, the founder
In this episode, we have the Starchild, Kiss guitarist Paul Stanley. At the time of this interview in 1996, Stanley was 44 years old and was promoting the Kiss reunion tour. In the interview, Stanley talks about the Kiss Army and its founder, Bill Starkey; the familiarity of playing with Ace Frehley and Peter Cross; and how Kiss fans are the greatest in the world.
This podcast uses Acast for stats, tracking, and dynamic audio. Learn more on this podcast's About tab.
#035 Kurtis Blow interview from 1997
#37 Vince Welnick (Grateful Dead) Interview 1992
← See all 43 episodes of The Tapes Archive


'PLANT A CARROT, get a carrot, not a Brussels sprout,' proclaims the song from the 1960 (and ongoing) musical "The Fantasticks." But in 2014–no thanks to genetic engineering, gladly, but to charmingly low-tech creativity and total brilliance–you can plant a carrot and get a clarinet. I've been watching this over and again for weeks, and meant to share it sooner. Sorry to be distracted and selfish until now, but thankfully there's still time to sow more clarinets. Bless you, Linsey Pollak.
Margaret, how wonderful! Thanks for this. Did you cry too?
Hi, Maggie. Nice of you to say hello!
Me, too, Betsy. It's wonderful; makes me hopeful and happy.
hmm, do you have to keep in fridge? or let it dry!
Very funny, Stephanie. Nice to "meet" you.
round, and hard, such as ??


Have you ever wondered what the most popular dropshipping niches are? Or the best markets for dropshippers? Well, in this article, we're going to share just that. Join us for an in-depth look at the best niches in the biggest markets.


text:
Emergency & Transfer Services
Physician Liaison Service
Reduce Stigmatizing Language
Publications for Healthcare Professionals
Join Temple Health
U.S. News & World Report Best Hospitals
About Temple Health
The Philadelphia Inquirer and Healio Orthopaedic...
The Philadelphia Inquirer and Healio Orthopaedics Highlight the Life and Legacy of Dr. Joseph Torg Following His Passing at Age 88
Joseph S. Torg, MD, who graduated from the Lewis Katz School of Medicine at Temple University in 1961 and co-created the first university-based sports medicine program with Ted Quedenfeld at Temple University Hospital in 1974, passed away on December 15 at 88 years old. Known as the "Father of Sports Medicine," Dr. Torg also created the Joe Torg, MD, Endowed Scholarship Fund with his wife, Barbara, at the Katz School of Medicine, and his work was instrumental in spear tackling being banned in football in 1976. Dr. Torg's passing and accomplishments were covered by the Philadelphia Inquirer and Healio Orthopedics.
Contact our media relations team.


text:
from JumpScale import j
import sys
import time
try:
    import ujson as json
except:
    import json
import psutil
import JumpScale.baselib.taskletengine
from JumpScale.baselib import cmdutils

# Preload libraries
j.system.platform.psutil=psutil
# import JumpScale.baselib.graphite
import JumpScale.lib.diskmanager
import JumpScale.baselib.stataggregator
import JumpScale.grid.agentcontroller
import JumpScale.grid.osis
import JumpScale.baselib.redis
from JumpScale.baselib.redisworker.RedisWorker import RedisWorkerFactory
import JumpScale.grid.jumpscripts

import os

RUNTIME = 24 * 3600

def restart_program():
    """Restarts the current program.
    Note: this function does not return. Any cleanup action (like
    saving data) must be done before calling this function."""
    python = sys.executable
    os.execl(python, python, * sys.argv)

class Worker(object):

    def __init__(self,queuename, logpath):
        self.actions={}
        self.clients = dict()
        self.acclient = None
        self.redisw = RedisWorkerFactory()
        self.queuename=queuename
        self.init()
        self.starttime = time.time()
        self.logpath = logpath
        self.logFile = None
        if self.logpath != None:
            self.logFile = open(self.logpath,'w',0)

    def getClient(self, job):
        ipaddr = getattr(job, 'achost', None)
        client = self.clients.get(ipaddr)
        if not client:
            if ipaddr:
                client = j.clients.agentcontroller.get(ipaddr, login='node')
                self.clients[ipaddr] = client
            else:
                if self.acclient==None:
                    self.acclient = j.clients.agentcontroller.getByInstance()
                return self.acclient
        return client

    def init(self):
        j.system.fs.createDir(j.system.fs.joinPaths(j.dirs.tmpDir,"jumpscripts"))
        self.redisw.redis.delete("workers:action:%s"%self.queuename)

    def processAction(self, action):
        self.redisw.redis.delete("workers:action:%s"%self.queuename)
        if action == "RESTART":
            print "RESTART ASKED"
            restart_program()
            j.application.stop()

        if action=="RELOAD":
            print "RELOAD ASKED"
            self.actions={}

    def run(self):
        self.log("STARTED")
        while True:
            self.redisw.redis.hset("workers:heartbeat",self.queuename,int(time.time()))
            if self.starttime + RUNTIME < time.time():
                print "Running for %s seconds restarting" % RUNTIME
                restart_program()

            try:
                self.log("check if work")
                jtype, job = self.redisw._getWork(self.queuename,timeout=10)
            except Exception,e:
                if str(e).find("Could not find queue to execute job")<>-1:
                    #create queue
                    self.log("could not find queue")
                else:
                    j.events.opserror("Could not get work from redis, is redis running?","workers.getwork",e)
                time.sleep(10)
                continue
            if jtype == "action":
                self.processAction(job)
                continue
            if job:

                j.application.jid=job.guid
                try:
                    if self.actions.has_key(job.jscriptid):
                        jscript=self.actions[job.jscriptid]
                    else:
                        self.log("JSCRIPT CACHEMISS")
                        try:
                            jscript=self.redisw.getJumpscriptFromId(job.jscriptid)
                            if jscript==None:
                                msg="cannot find jumpscript with id:%s"%job.jscriptid
                                self.log("ERROR:%s"%msg)
                                j.events.bug_warning(msg,category="worker.jscript.notfound")
                                job.result=msg
                                job.state="ERROR"
                                self.notifyWorkCompleted(job)
                                continue

                            if jscript.organization<>"" and jscript.name<>"" and jscript.id<1000000:
                                #this is to make sure when there is a new version of script since we launched this original script we take the newest one
                                jscript=self.redisw.getJumpscriptFromName(jscript.organization,jscript.name)
                                job.jscriptid=jscript.id
                                #result is method action

                            jscript.write()
                            jscript.load()

                            self.actions[job.jscriptid]=jscript

                        except Exception,e:
                            agentid=j.application.getAgentId()
                            if jscript<>None:
                                msg="could not compile jscript:%s %s_%s on agent:%s.\nError:%s"%(jscript.id,jscript.organization,jscript.name,agentid,e)
                            else:
                                msg="could not compile jscriptid:%s on agent:%s.\nError:%s"%(job.jscriptid,agentid,e)
                            eco=j.errorconditionhandler.parsePythonErrorObject(e)
                            eco.errormessage = msg
                            eco.code=jscript.source
                            eco.jid = job.guid
                            eco.category = 'workers.compilescript'
                            eco.process()
                            job.state="ERROR"
                            eco.tb = None
                            job.result=eco.__dict__
                            # j.events.bug_warning(msg,category="worker.jscript.notcompile")
                            # self.loghandler.logECO(eco)
                            self.notifyWorkCompleted(job)
                            continue

                        self.actions[job.jscriptid]=jscript

                    self.log("Job started:%s script:%s %s/%s"%(job.id, jscript.id,jscript.organization,jscript.name))

                    j.logger.enabled = job.log

                    status, result=jscript.executeInWorker(**job.args)
                    self.redisw.redis.hdel("workers:inqueuetest",jscript.getKey())
                    j.logger.enabled = True
                    if status:
                        job.result=result
                        job.state="OK"
                        job.resultcode=0
                    else:
                        if isinstance(result, basestring):
                            job.state = result
                        else:
                            eco = result
                            agentid=j.application.getAgentId()
                            msg="Could not execute jscript:%s %s_%s on agent:%s\nError: %s"%(jscript.id,jscript.organization,jscript.name,agentid, eco.errormessage)
                            eco.errormessage = msg
                            eco.jid = job.guid
                            eco.code=jscript.source
                            eco.category = "workers.executejob"

                            out=""
                            tocheck=["\"worker.py\"","jscript.executeInWorker","return self.module.action","JumpscriptFactory.py"]
                            for line in eco.backtrace.split("\n"):
                                found=False
                                for check in tocheck:
                                    if line.find(check)<>-1:
                                        found=True
                                        break
                                if found==False:
                                    out+="%s\n"%line

                            eco.backtrace=out

                            if job.id<1000000 and job.errorreport==True:
                                eco.process()
                            else:
                                self.log(eco)
                            # j.events.bug_warning(msg,category="worker.jscript.notexecute")
                            # self.loghandler.logECO(eco)
                            job.state="ERROR"
                            eco.tb = None
                            job.result=eco.__dict__
                            job.resultcode=1

                    #ok or not ok, need to remove from queue test
                    #thisin queue test is done to now execute script multiple time
                    self.notifyWorkCompleted(job)
                finally:
                    j.application.jid = 0

    def notifyWorkCompleted(self,job):
        job.timeStop=int(time.time())

        # if job.state[0:2]<>"OK":
        #     self.log("result:%s"%job.result)

        if job.jscriptid>1000000:
            #means is internal job
            # q=j.clients.redis.getGeventRedisQueue("127.0.0.1",9999,"workers:return:%s"%jobid)
            self.redisw.redis.hset("workers:jobs",job.id, json.dumps(job.__dict__))
            self.redisw.redis.rpush("workers:return:%s"%job.id,time.time())
        else:
            try:
                acclient = self.getClient(job)
            except Exception,e:
                j.events.opserror("could not report job in error to agentcontroller", category='workers.errorreporting', e=e)
                return
            #jumpscripts coming from AC
            if job.state<>"OK":
                try:
                    acclient.notifyWorkCompleted(job.__dict__)
                except Exception,e:
                    j.events.opserror("could not report job in error to agentcontroller", category='workers.errorreporting', e=e)
                    return
                #lets keep the errors
                # self.redis.hdel("workers:jobs",job.id)
            else:
                if job.log or job.wait:
                    try:
                        acclient.notifyWorkCompleted(job.__dict__)
                    except Exception,e:
                        j.events.opserror("could not report job result to agentcontroller", category='workers.jobreporting', e=e)
                        return
                    # job.state=="OKR" #means ok reported
                    #we don't have to keep status of local job result, has been forwarded to AC
                self.redisw.redis.hdel("workers:jobs",job.id)

    def log(self, message, category='',level=5, time=None):
        if time == None:
            time = j.base.time.getLocalTimeHR()
        msg = "%s:worker:%s:%s" % (time, self.queuename, message)
        print msg
        if self.logFile != None:
            msg = msg+"\n"
            self.logFile.write(msg)

if __name__ == '__main__':
    parser = cmdutils.ArgumentParser()
    parser.add_argument("-qn", '--queuename', help='Queue name', required=True)
    parser.add_argument("-i", '--instance', help='JSAgent instance', required=True)
    parser.add_argument("-lp", '--logpath', help='Logging file path', required=False, default=None)

    opts = parser.parse_args()

    jp = j.packages.findNewest('jumpscale', 'jsagent')
    jp.load(opts.instance)
    j.application.instanceconfig = jp.hrd_instance

    j.core.osis.client = j.core.osis.getClientByInstance(die=False)

    j.application.start("jumpscale:worker:%s" % opts.queuename)

    if j.application.config.exists("grid.id"):
        j.application.initGrid()

    j.logger.consoleloglevel = 2
    j.logger.maxlevel=7

    worker=Worker(opts.queuename, opts.logpath)
    worker.run()