text:
All-New Season of "Expedition Unknown" Premieres February 5 on Discovery Channel
And beginning on February 12, viewers can also tune-in to the all-new series "Expedition X" starring Josh Gates, Phil Torres and Jessica Chobot.
[via press release from Discovery Channel]
JOSH GATES TAKES OVER WEDNESDAYS AND BRINGS VIEWERS ON A FULL NIGHT OF EXPLORATION STARTING WITH A BRAND-NEW SEASON OF 'EXPEDITION UNKNOWN', PREMIERING FEBRUARY 5 ON DISCOVERY CHANNEL
This season following EXPEDITION UNKNOWN, Josh Gates teams up with scientist Phil Torres and Jessica Chabot to investigate some of the world's strangest, unexplained mysteries in the brand-new series 'EXPEDITION X'
(Los Angeles) - With a passion for the unexplained and a thirst for adventure, Josh Gates has spent his career traversing the globe investigating history's greatest legends and mysteries. Now, he faces his most daring expeditions yet, from searching for the only large U.S. commercial airliner to vanish off the face of the earth to a quest across Africa to unearth the many missing links between modern man and our earliest ancestors. The brand-new season of EXPEDITION UNKNOWN, from Ping Pong Productions, premieres Wednesday, February 5 at 8 PM ET/PT on Discovery Channel. Beginning on February 12th, right out of EXPEDITION UNKNOWN, viewers can tune-in to the all-new series EXPEDITION X starring Josh Gates, Phil Torres and Jessica Chobot. Following the investigations, Josh digs in deeper on EXPEDITION UNKNOWN: AFTER THE HUNT.
In an epic, two-hour season premiere, Gates travels to the D-Day battlefields and the beaches of Normandy where he joins investigators making history-changing discoveries about the Longest Day. Josh explores alongside military historians using cutting edge technology to uncover shocking secrets about the invasion, including a never-before-discovered complex of Nazi bunkers as well as an unexploded bomb frozen in time in the waters off Normandy's coast. Josh's in-depth investigation reveals forgotten mysteries surrounding the most important battle in modern history.
Throughout the season, Gates takes viewers on thrilling global adventures including a trek across the U.K. in the footsteps of a Celtic warrior queen and a journey to the islands of the Seychelles to decipher a cryptic code that may lead to lost pirate treasure. Finally, in a two-part season finale, Josh will sail in to the enigma that is the Bermuda Triangle on a dangerous voyage of discovery.
Following EXPEDITION UNKNOWN, audiences can continue their search for adventure with Josh, as Gates introduces scientist Phil Torres and paranormal researcher Jessica Chobot to investigate reports of supernatural encounters, mysterious creatures, and astonishing extraterrestrial phenomena in the brand-new series, EXPEDITION X. Whether trekking through the remote jungles of Cambodia in search of a legendary ape-man or exploring the secrets of the world's largest cave system right here in the United States, the EXPEDITION X team is taking viewers to the stranger side of the unknown.
In addition to watching the series on Discovery, viewers can check out new episodes each week by downloading the Discovery GO app. Viewers can join the conversation on social media by using the hashtag #ExpeditionUnknown. Host Josh Gates can be found on Facebook: @joshgatesofficial, Twitter: @joshuagates, and Instagram: @gatesygram.
EXPEDITION UNKNOWN and EXPEDITION X are produced for Discovery Channel by Ping Pong Productions. For Ping Pong Productions, executive producers are Brad Kuhlman, Casey Brumels and Josh Gates, and co-executive producers are Roger Roddy and Matthew Meltzer. For EXPEDITION X, Scot Hartford is Executive Producer. For Discovery Channel, Michael Gara is executive producer and associate producer is Olivia Ghersen.
About Discovery Channel
Discovery Channel is dedicated to creating the highest quality non-fiction content that informs and entertains its consumers about the world in all its wonder, diversity and amazement. The network, which is distributed to 88.3 million U.S. homes, can be seen in 224 countries and territories, offering a signature mix of compelling, high-end production values and vivid cinematography across genres including, science and technology, exploration, adventure, history and in-depth, behind-the-scenes glimpses at the people, places and organizations that shape and share our world. For more information, please visit www.discovery.com.
Discovery, Inc. (Nasdaq: DISCA, DISCB, DISCK) is a global leader in real life entertainment, serving a passionate audience of superfans around the world with content that inspires, informs and entertains. Discovery delivers over 8,000 hours of original programming each year and has category leadership across deeply loved content genres around the world. Available in 220 countries and territories and nearly 50 languages, Discovery is a platform innovator, reaching viewers on all screens, including TV Everywhere products such as the GO portfolio of apps; direct-to-consumer streaming services such as Eurosport Player and MotorTrend OnDemand; digital-first and social content from Group Nine Media; a landmark natural history and factual content partnership with the BBC; and a strategic alliance with PGA TOUR to create the international home of golf. Discovery's portfolio of premium brands includes Discovery Channel, HGTV, Food Network, TLC, Investigation Discovery, Travel Channel, MotorTrend, Animal Planet, and Science Channel, as well as OWN: Oprah Winfrey Network in the U.S., Discovery Kids in Latin America, and Eurosport, the leading provider of locally relevant, premium sports and Home of the Olympic Games across Europe. For more information, please visit corporate.discovery.com and follow @DiscoveryIncTV across social platforms.
· EXPEDITION UNKNOWN (DISCOVERY)
· EXPEDITION X (DISCOVERY)


text:
Franklin James Cook
Suicide Prevention News and Comment
Grief after Suicide Blog
About SPNAC
Personal Grief Coaching Helps Bereaved People by Phone
In Announcements, Grief, Postvention on January 26, 2014 at 10:01 am
In 2013, Suicide Prevention News & Comment editor and publisher Franklin Cook earned his Certified Professional Coach credentials and combined the principles and practices of Life Coaching with those of peer help for traumatic loss survivors to create an innovative telephone support service called Personal Grief Coaching. Here is what it's all about:
Helping people cope with grief after a loved one's traumatic death is Franklin Cook's mission in life. His own father died traumatically in 1978, and two decades later, he began working with bereaved people as a newfound vocation. After 15 years as a peer helper, he became a Certified Professional Coach and developed this model for one-on-one telephone support, called Personal Grief Coaching. Franklin believes that each person's unique experience of loss should be honored and respected, and his coaching sessions provide a safe space for grieving people to tell their story as they wish to tell it.
The guiding principles of Personal Grief Coaching:
Grief is a natural human response to a loved one's death.
Each bereaved person's needs are unique, and people benefit from individualized assistance.
Peer support from a person who has recovered from a traumatic death can be very helpful to a bereaved person.
Grief involves making meaning from things about life that are confusing and painful (which is also called "relearning the world").
Compassionate dialogue with a peer coach can create a place from where bereaved people can find their own way to healing.
Comment »
Top Dozen SPNAC Posts Highlighted for Readers
In Announcements on January 26, 2014 at 7:41 am
The dozen most-read posts from Suicide Prevention News & Comment are listed below. Please see the original announcement or the About Page to learn about SPNAC's current status (briefly, all posts are available, comments continue to be moderated). Please see the post at the left to learn about SPNAC editor and publisher Franklin Cook's telephone support service, Personal Grief Coaching — or contact Franklin for more information.
"Please Stop Saying, 'Suicide is a permanent solution …'": bit.ly/permanentsolution
"Youth Suicide among Native Americans Linked to Colonialism": bit.ly/suicidecolonialism
"'Cyberbullying not epidemic … not killing our children'": bit.ly/bullyingnot
"The Last Word on the Financial Crisis and Suicide Prevention": bit.ly/suicidefinancial
"Edwin Shneidman's Meditations on Death Are Full of Life": bit.ly/edshneidman
"Culture of Stigma Is a Key Cause of Military, Veteran Suicides": bit.ly/culturestigma
"'Seven Pounds'" Is Guilty of Irresponsibility with Suicide": bit.ly/poundsguilty
"Dylan Klebold's Mom Is a Survivor of Suicide Loss": bit.ly/kleboldmom
"Links to Suicide Grief Stories: May 4, 2009": bit.ly/grief050409
"Links to Suicide Grief Stories: March 8, 2010": bit.ly/grief030810
"'Badge of Life' Works To Counter Police Trauma, Suicide": bit.ly/badgeoflife
"Military Widow: After Suicide, 'The family is chastised, too'": bit.ly/militarywidow
All of the content on SPNAC will continue to be made available as long as there is an interest in the posts and WordPress continues to provide this basic service for free.
Please Stop Saying, "Suicide is a permanent solution …"
In Opinion, Prevention on March 5, 2010 at 10:11 am
By Franklin Cook, SPNAC Editor
I have worked in suicide prevention and suicide grief support for a little more than a decade, and for the past year and a half (since the SPNAC blog was launched), I've scanned hundreds of articles on this tragic subject. In the course of my encounters with what is said and written in communities across the country and on the Internet, I have been subjected about a thousand times to the declaration "suicide is a permanent solution to a temporary problem," and I cannot hear it one more time without crying out: Please stop saying that!
I know that it must seem like a clever and even a helpful thing to say (or else why would people have kept saying it, right up to the point where it has become nothing less than a cliche but with the power, I'm afraid, of an axiom). The declaration seems clever, I suppose, because it has the pleasant sing-song rhythm of an advertising jingle, like "I am stuck on Band-Aid, 'cause a Band-Aid's stuck on me." And it seems helpful because, of course, it is true: Indeed, suicide is a permanent solution.
But here's why I argue that we should stop saying it:
The statement violates the age-old principle that what we communicate ought to be designed specifically with a focus on the audience for whom the particular communication is intended. "Suicide is a permanent solution to a temporary problem" might strike someone who is not suicidal as a clever statement, and it might be a helpful thing to hear from the point of view of someone who already believes (or is likely to be convinced) that his or her problem is temporary. But the audience for this anti-suicide ditty is, of course, people who are suicidal.
As Edwin Shneidman points out in his Ten Commonalities of Suicide, "The common purpose of suicide is to seek a solution." So emphasizing to a suicidal person that suicide is a permananet solution is as likely to be unhelpful — or even harmful or dangerous — as it is to be helpful.
The problem a suicidal person is trying to solve, according to Shneidman, is how to escape from psychache, which Shneidman defines as "intolerable emotion, unbearable pain, unacceptable anguish … [that] cannot be abated by means that were previously successful" (emphasis added). In other words, from the point of view of someone who is earnestly considering killing himself or herself, the pain from which suicide would provide escape is not temporary.
Even though the perception that the pain is permanent is not accurate, the strategy of trying to convince a suicidal person that his or her pain is temporary is as likely to be counter-productive as it is to be productive.
Read more here …
GOOGLE+ "Grief after Suicide"
Bereavement after Suicide
Franklin's Blog
Promoting Hope, Preventing Suicide
Survivor Support Groups
The Weekly Spark (SPRC)
Themes Select Category Advocacy (19) Grief (72) Grief Stories Series (10) In-Depth (2) Intervention (33) Hotlines (7) Key Quote (6) Media (32) Mental Illness (36) Opinion (5) People (6) Policy (29) Postvention (14) Prevention (100) Research (40) SPNAC Stuff (9) Announcements (7) Stigma (36) Take Action (2) Uncategorized (1)
Archives Select Month January 2014 (2) February 2012 (1) March 2010 (5) February 2010 (19) January 2010 (2) December 2009 (1) November 2009 (7) October 2009 (1) September 2009 (3) August 2009 (9) July 2009 (19) June 2009 (7) May 2009 (8) April 2009 (10) March 2009 (12) February 2009 (10) January 2009 (22) December 2008 (35) November 2008 (42) October 2008 (14)

redpajama_set_name: RedPajamaCommonCrawl


Much of the theoretical, normative and prescriptive research in Islamic economics, finance and accounting emphasizes the social and moral character of these disciplines. Considering such emphases, this paper critically explores the potential of aspects of contemporary Islamic accounting research and practice to contribute to the critical accounting project in the latter's efforts to achieve more emancipatory and enabling forms of accounting. The paper concludes that minimal critical theorizing, as well as the narrow instrumental and mechanical emphasis of the majority of Islamic accounting research, are indications that Islamic accounting research is diverting from its primarily proclaimed social and moral roles. This is further exacerbated by the uncritical emulation and embracing of conventional accounting operations and standards by so-called Islamic ones. The paper also attempts to identify ways forward for Islamic banking and accounting research to realize more emancipatory praxis.
A most defining aspect of this era is the return to the religious in all its different pretexts (Žižek, 2000 and Pollack, 2008), a resurgence leading some to warn against the repressive nature of religion vis-à-vis modernity and the enlightenment (see, e.g., Grayling, 2006 and Hichens, 2007). In critical theorization, religion has more often than not been negatively portrayed as a threat to social justice and emancipation. Critical thinkers such as Adorno and Horkheimer have perceived religion and faith as a 'swindle' (Hind, 2007, p. 74). They argued that religion is often employed and exploited by the elite to achieve their goals and maximize their wealth. It is often used to protect the elite from public scrutiny and inquiry (Hind, 2007; see also Derrida, 2008). A number of thinkers, however, have argued that some core religious values, divorced from fundamentalism and corruption, constitute emancipatory aspects that if employed may contribute positively to social justice (see Žižek, 2000). Žižek (2000, p. 2), for instance, maintains that the 'substantive core' of Christianity has a significant lineage with Marxism and that both should join forces to fight against capitalism, repression and injustice. Islam, in particular, has been largely accused in the West of fostering fundamentalism and repression (Said, 1978, Said, 1993 and Said, 1997; cf. Tinker, 2004 and Kamla et al., 2006). It is often attacked in the Western political and cultural spheres on the grounds that its ideology constitutes threats to modernity and the enlightenment (Hind, 2007). Nonetheless, Islamic revival in the Islamic world (where Muslims constitute a majority) may be appreciated from a political economy perspective, as a concern about social well-being and Islam's ways forward (Wardi, 2005). For many Muslims, both Western capitalism and socialism failed to address their poverty and social misery, enhancing wealth concentration amongst small social elites (Gambling and Karim, 1991, Wilson, 1997 and Kuran, 2004).1 Events are convincing many Muslims that an alternative to Western imperial capitalism is necessary and a key form of resistance. For many Muslims, modern interactions with the West have constituted imperialism, colonialism and entailed use of the military to defend Western privileges and ideology (Patel, 2004).2 Equally, the spread and predominance of liberal capitalism is seen as on the back of violence (Patel, 2004). For many Muslims, the operations of multinationals, whose search for profits has entailed mobilization of Western governments using soft and/or hard force to serve mutual interests in, e.g., Iraq, reflects this (Patel, 2004; see also Hind, 2007). Such views add to calls for adoption of a comprehensive Islamic social, political and economic system (or such systems). Here, many Muslims perceive Islam to go beyond the spiritual dimension and bring society great blessings, promising a mobilization for justice and fairness, kindness, fulfilment and enlightenment (Soroush, 2002). The contemporary phenomenon with the 'banner of Islamic finance' (El-Gamal, 2006a, p xi) developed capitalizing on the desire of many Muslims for an Islamic socio-economic and political way (see Choudhury, 1986, Wilson, 1997 and El-Gamal, 2006a). Yet several scholars here suspect this phenomenon as it has manifested (see Kuran, 2004, Patel, 2004, El-Gamal, 2006a, El-Gamal, 2006b and El-Gamal, 2007). Contemporary Islamic finance, banking and accounting practices and institutions have indeed been described as 'ideologically driven by liberalism and the common opposition to socialism that Saudi Arabia and the US shared' (Wardi, 2005, p. 43). Many ostensibly Islamic financial institutions and the research driving them are funded by oil-rich Gulf States, especially Saudi Arabia (Choudhury, 1986).3 Consequently, cooperation between Muslim businessmen and experts in Western business environments to promote and operate financial institutions under the banner of Islam manifested. The UK and US, rather than the Middle East or the Islamic world, became the centres for Islamic financial organizations and research, not denying the significant role played by large Muslim states such as Malaysia and Indonesia in promoting Islamic finance globally (Wardi, 2005). Islamic finance, especially banking, has today become one of the fastest growing financial sectors globally (Rad, 2006). Thus, research has explored the most suitable accounting methods for the operations of Islamic financial institutions. Further, accounting and auditing standards have been developed to help legitimize and standardize these methods. On behalf of these Islamic banking and accounting manifestations, basic conceptual adherence to Islam's moral and social code is substantively claimed. This paper's objective is to critically appraise contemporary research and practices of Islamic banking and accounting against these social and moral claims. It explores the potential of these contemporary manifestations to address Muslims' calls for a more just and equitable society inspired by Islam. Here, the paper offers critique of the limited scope of Islamic banking and accounting practices and research. It pinpoints their obsession with technical and instrumental matters related to the interest ban and Zakah calculations. The paper discusses how these instrumental emphases are displacing more enabling and emancipatory potentials of Islamic banking and accounting informed by broader and more enabling dimensions of Islam's teachings: Islam's holistic approach to life; its concentration on social justice and the central message of the importance of seeking knowledge. The analysis builds on the critical school's use of 'immanent criticism' and the importance of interdisciplinary dimensions and theorization (see Held, 1980).4 The paper, furthermore, goes beyond highlighting contradictions and negativity in Islamic finance and accounting practices and research. It engages with praxis through identifying practices that would better achieve emancipation, inspired by aspects of Islam's teachings and the broader Islamic social agenda. According to Kuran (2004), critical writings in Islamic economics literature are rare. And it is rare to find substantial critique of Islamic accounting in the literature and an aligning of Islamic accounting with critical accounting theorizing and research. This paper attempts to help fill gaps in the literature and encourage research bringing the Islamic accounting agenda closer to the critical accounting project. The paper's objectives and themes are developed in the following sections. Section two elaborates the emancipatory potential of religion, with a specific focus on Islam, to contribute to an enabling accounting project. It relates Islam's emancipatory potential for the critical accounting school agenda and highlights the obstacles imposed by narrow capitalist ideology to Islamic or other faith-based approaches to accounting and business. Section three critically discusses the nature, work and role of Islamic banking and the AAOIFI (Accounting and Auditing Organisation for Islamic Financial Institutions). It addresses contradictions between what these institutions claim to encompass in respect to Islamic values and what they actually achieve. Section four critically assesses Islamic accounting research papers. It offers critique of the failure of the research to address relevant social issues, such as poverty, in Islamic societies and beyond or to develop a significant critique of capitalistic ideology and contemporary Islamic accounting and banking practice. Section five concludes, reflecting on ways forward for Islamic banking and accounting research and practice. It develops a vision for a critical Islamic accounting where broader social issues constitute a primary concern.
This study has critically explored the potential of contemporary manifestations of Islamic accounting and research to join the critical accounting agenda. The analysis indicates that these manifestations fall significantly short of realizing the enabling praxis of a more emancipatory accounting and constitute little departure from conventional accounting and finance. Discussion also highlighted contradictions between the ethical claims of these manifestations and their actualities. A serious reflection on the current role of Islamic banking and accounting opens up the urgency for a radical change. Building on Islamic teachings discussed in this study such as holism, social justice and knowledge development constitutes a platform for Islamic banking and accounting to go beyond emphasis on interest prohibition and ethical rhetoric that in practice bears little resemblance to operations. These teachings may shift Islamic banking and accounting practice to emphasize social justice, working with local communities, provision of business opportunities for the cash-poor, decision-making beyond merely financial criteria, the environment, accountability and transparency, which should all be central to the operations of Islamic banks and their accounting practices. Inspiration to realize these radical changes and shift in emphasis in Islamic banking can also draw upon and emulate other non-religious initiatives that to a certain extent succeeded in bringing benefits to local communities and to the poor. Microcredit schemes, famously manifest in the Grameen Bank in Bangladesh, have brought significant benefits to rural, poor communities, especially women (see Rahman, 1999). Providing small loans exclusively to the poor to promote self-employment and income generation has transformed many lives in rural Bangladesh (Rahman, 1999; see also Islam, 2007, for discussion of the good, the bad and the required improvements for microcredits). Islamic banks can learn from the successful experience of the Grameen Bank and similar initiatives in poorer communities. Islamic principles such as social justice discussed here are more in line with local initiatives to empower the poor and the community than with global business expansion. Islamic teachings can contribute to expanding the microcredits phenomenon further to the extremely poor in Muslim societies. Islam (2007) holds that the extremely poor in rural Bangladesh are sometimes refraining from engagement with the Grameen Bank and other similar initiatives because of interest bearing transactions. Islamic banks, in this context, may reach more Muslims in need of finance by genuinely introducing PLS techniques to microcredits (see Islam, 2007). To be successful though, Islamic banking, as with the Grameen Bank, needs to monitor and train and engage closely with its customers (see Islam, 2007). Further, in line with the holistic approach to life and knowledge development in Islam, Islamic banking needs to open up and cooperate with other religious and secular social institutions and programs that aim to achieve social justice solutions. For instance, Kuran (2004) maintains that Islamic (local) institutions like clinics, schools and centres that serve the underprivileged in society have had significant success in a number of communities in the Islamic world. Similarly, vast numbers of religious institutions (such as of Liberation Theology in Christianity and the Jubilee Debt Campaign in Judaism) have been active and committed to the betterment of society and the realization of social justice (see Pepinster, 2008). Islamic banking needs to join forces and cooperate with these community initiatives. A social framework aimed at achieving social justice can only be established through the exchange and cooperation of a multitude of social and financial organizations in the community or society (see also Islam, 2007). Accounting, inspired by Islamic teachings, can play a role in the realization of this radical change in the nature of Islamic banking and finance. The holistic message of Islam is central here. It requires that a separation between the sacred and the secular be abandoned. The accounting system, therefore, on macro and micro levels, should create and provide information that reflects deeper social and ethical dimensions (see Kamla et al., 2006). Knowledge development, social justice and community principles require honest and full disclosures to empower society and the community and not just capital expansion and growth. In this sense, accounting should enable the regulator, the auditor and society to establish whether the organization has contributed positively to social justice and whether its money and profits come from fair and honest practices. For example, accounting should help the community to establish whether institutions, such as Islamic banks, are practicing the values they espouse. Accounting, including quantitative and qualitative information, should enable different constituents in society to establish whether the bank has contributed to elevating its customers from poverty conditions or not. Further, financial and risk assessment techniques in conventional accounting and banks should be changed and developed to allow for more loans and investment opportunities for customers from poorer backgrounds. After all, the experience of the Grameen Bank has shown that the poor, with adequate support, training and mentoring, are very good in paying back their debts (see Rahman, 1999 and Islam, 2007). Internal accounts going beyond financial growth and efficiency could also provide the institution or the Islamic bank's management with information on whether they have met their religious as well as financial commitments. External and internal accounting should be related to wider social accountability concepts including details of the types of projects the bank is financing and their social and environmental impacts and assessment. Accounting that enhances the organization's as well as society's appreciation of organizational impact on the overall socio-economic systems is more in line with the knowledge principle in Islam. As Kamla et al. (2006, p. 258) maintain, it contributes to enhancing the type of 'social knowledge' necessary for development in Islamic society. The role of accounting regulatory bodies and of accountants can also be changed to embrace a more holistic approach. Section two demonstrates how the Hisba and the Muhtasib historically incorporated both spiritual and secular dimensions and went beyond narrowly conceived financial considerations. They sought as duty significant accountability to society and the environment (see Kamla et al., 2006 for further discussion of the role of accountants in Islam). Islamic accounting regulatory bodies such as the AAOIFI should play the role of regulating business organizations in the interest of the public, equality, sustainability and social justice. Only then may the AAOIFI properly claim to operate and develop accounting standards according to Sharia. Islamic accounting research, for its part, needs to play a role in making these changes in the role of Islamic banking and accounting possible. Developing and researching ways in which accounting can change in line with Islamic teachings to include rather than exclude the disadvantaged and the poor is one dimension. Bringing the financial and social needs of the poor to the centre of Islamic research is important here. The critical evaluation of Islamic accounting research indicated a significant lack of studies that focus on Muslim's voices or insights into the needs of the poor and disadvantaged in society. Islamic accounting research, in line with seeking knowledge and the truth, should also embark on interrogating the limitations and flaws of contemporary practices of Islamic banking and finance. It is clear that so far Islamic accounting research is reluctant to openly criticize and expose the nature of Islamic banking activities and institutions. Engagement with praxis that builds on Islamic teachings, other religious initiatives and the work and theorization of the critical school can provide Islamic accounting research with the tools to live up to their own ethical claims about the role of Islamic banking and accounting. The critical accounting school itself can begin to engage and open up more to Islam (and other religions) and make use of the ability of faith to change people's lives to the better. It can move beyond a simple negative suspicion of religion and its role in society (Gallhofer and Haslam, 2004) and begin working with religion to open up new possibilities for emancipation. For instance, the significance of the spiritual in Islamic accounting thought can provide a boost to the critical school's calls for an accounting that goes beyond efficiency and profits and concentrates on issues such as how we are affecting the livelihood of each other and our environment (see Kamla et al., 2006). Accounting inspired by Islam and the spiritual can shift emphasis from the measurable to the non-measurable. Concerns about the spiritual can bring in voices from different ranges of people and help in making the marginalized and the distressed heard and their wishes acted upon. Furthermore, as discussed in section two, Islamic teachings constitute significant dimensions that contradict and stand aside from capitalism. Consequently, Islamic accounting and the critical school project can join forces in their interrogation of Western capitalism and fight against conditions of labour, capital, commodity and other resource exploitation. The Western system's aggressive position against all, but specifically against Muslims in Palestine, Iraq, Afghanistan and even those living in the West can be exposed. Engagement, dialogue and cooperation between Islam, the critical school and other religions can create a platform for resisting the hostilities of classical and neoclassical schools of thought to Muslims and beyond. In Summary Islamic banking and accounting need to build more on Islamic teachings of holism, justice and importance of knowledge in order to broaden their social agenda and realize their ethical claims. They also need to engage, cooperate and communicate with other religious and non-religious initiatives and critical theorization seeking social justice and community empowerment. The Islamic accounting and banking project must respond to the masses of Muslims who supported it initially on the grounds of advancing social justice, eradication of poverty and freedom from forms of subjection, imperialism and colonialism. Unless it does so, it will most certainly begin to lose Muslims' support and diminish as it will be exposed as a superficial phenomenon that does not constitute the substance and spirit of Islam.


Was there more to last week's 1851 Trophy event than met the eye?
Last week's America's Cup style racing in the 1851 Trophy may have looked like a showcase event, but there was far more at stake in this 'friendly regatta'.
With around 3-4 years to go until the next Cup, there are precious few long term contracts out there and this four day series was another opportunity for any crew member looking for a longer term deal to prove that they would be the right person for the job. But there were other reasons why the 1851 Trophy may turn out to be a significant event and play a part in shaping the future of the America's Cup.
"There's no point in spending millions of pounds on a challenge that's unwinnable," he told the Sunday Times.
His comments shortly after winning the 1851 Trophy and the Trafalgar Cup will surprise many, especially given the decisive manner in which his team proved that it could take on and beat the current Cup holders in a form of match racing that the American team has a long track record in.
There are however, some who may think that the American team were prepared to accept a loss at an event that counts for nothing towards the next America's Cup. With plans for the new boat for the next event due to be announced at the end of September, winning the 1851 Trophy in a version 5 America's Cup class boat that is unlikely to be used beyond this year, has little appeal for a team that is focussed on the next Cup cycle.
Yet there is a feeling within the British camp that last week BMW Oracle Racing were every bit as motivated as Team Origin to win the 1851 Trophy in order to ease the way forward for the next step in the new Cup cycle.
With the decision as to whether the next America's Cup is to be raced for in monohulls or multihulls yet to take place, it is believed that the current Cup holders are strongly in favour of the latter. Hardly surprising perhaps, given that the American team is significantly further down the road with its experience of multihulls and wing masts in the last America's Cup. If you're going to level the playing field with talk of independent race officials and no racing between challenger and defender in the build up to the event, why give away the one significant advantage that you may have, technical know how.
To choose a multihull over a monohull would be a lot easier if your team had proved that it could win in either. But that wasn't the case last week. While BMW Oracle Racing was the clear winner in the race around the island, when it came to the match racing, Ainslie and Co. had the upper hand.
So while a victory for the Brits in an event that drew plenty of attention will do Mills' campaign and its search for funds no harm, the win could also help to put pressure on the American team over the next few weeks as it considers which way to step when it comes to the crucial decision on the boat.
According to Mills there is very little support from future challengers for a multihull.
The next battle in the long campaign towards the 34th America's Cup looks likely to take place ashore.


text:
Q: Audio context not working properly on android I'm having this issue with android (either for android browser or chrome for android): getByteFrequencyData method returns 0 values.
Some say that the Web Audio Api is not supported in android mobile devices (IOS does support it) but I have juste checked this link, where it says that chrome 49 support Audio Api.
Some say that it is an old issue
And some say that the problem comes from the media element, if you can load the media with XHR into a buffer and play it, it will work (I tested but it didn't work)
I'm trying to make an audio visualizer working on android cordova by using Audio APi + Canvas
Any help?

A: I got it to work, createBuffer() method with two arguments was not working on chrome versions anymore, so I had to use decodeAudioData in order to get the buffer source:
// Create AudioContext and buffer source
var audioCtx = new AudioContext();
source = audioCtx.createBufferSource();
// load in an audio track via XHR and decodeAudioData
function getData() {
request = new XMLHttpRequest();
request.open('GET', 'Test.mp3', true);
request.responseType = 'arraybuffer';
request.onload = function() {
var audioData = request.response;

audioCtx.decodeAudioData(audioData, function(buffer) {
myBuffer = buffer;
source.buffer = myBuffer;

analyser = audioCtx.createAnalyser(); // AnalyserNode method
canvas = document.getElementById('CanvasDiv');
canvasContext = canvas.getContext('2d');
source.connect(analyser);
analyser.connect(audioCtx.destination);

frameLooper();
},
function(e){"Error with decoding audio data" + e.err});
}
request.send();
}
function frameLooper(){
ionic.requestAnimationFrame(frameLooper); //You can use window instead of ionic
fbc_array = new Uint8Array(analyser.frequencyBinCount);
analyser.getByteFrequencyData(fbc_array);
canvasContext.clearRect(0, 0, canvas.width, canvas.height); // Clear the canvas
canvasContext.fillStyle = '#00CCFF'; // Color of the bars
bars = 100;

for (var i = 0; i < bars; i++) {
    bar_x = i * 3;
    bar_width = 2;
    bar_height = -(fbc_array[i] / 2);
    //  fillRect( x, y, width, height ) // Explanation of the parameters below
    canvasContext.fillRect(bar_x, canvas.height, bar_width, bar_height);
}
}
getData();
var audio = document.getElementById('audioTagId');
Callback = function(){
        source.start();
    }
document.getElementById("PlayButton").addEventListener("click", Callback);

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to save multiple files in bundle in iphone app? Hi all i am trying to save image in the bundle which i have currently on my view,but the problem is that i can only save one image,if i want to save the another image it replaces the old.I am not getting how to save the multiple images in the bundle then.
Here is my code.
- (void)writeImageToDocuments:(UIImage*)image
{
    NSData  *png = UIImagePNGRepresentation(image);
    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSError *error = nil;
    [png writeToFile:[documentsDirectory stringByAppendingPathComponent:@"image.png"] options:NSAtomicWrite error:&error];

}

Please Help me out, how to save multiple images, files e.t.c in bundle
Thanks in advance

A: You're not saving into a bundle, you're saving into your app's documents directory. There's no bundle aspect to it.
You're using the filename @"image.png" for every file that you save. Hence each new write overwrites the old one. In fact, you write each file twice. To save multiple files, use different file names.
It's also bad form to pass a numeric constant as the 'options:' parameter of NSData writeToFile:options:error: (or indeed, any similar case). The value '3' includes an undefined flag, so you should expect undefined behaviour and Apple can legitimately decline to approve your application. Probably you want to keep the NSAtomicWrite line and kill the one after it.
If you're just looking to find the first unused image.png filename, the simplest solution would be something like:
int imageNumber = 0;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *pathToFile;

do
{
    // increment the image we're considering
    imageNumber++;

    // get the new path to the file
    pathToFile = [documentsDirectory stringByAppendingPathComponent:
                                           [NSString stringWithFormat:
                                                    @"image%d.png", imageNumber]];
}
while([fileManager fileExistsAtPath:pathToFile]);
/* so, we loop for as long as we keep coming up with names that already exist */

[png writeToFile:pathToFile options:NSAtomicWrite error:&error];

There's one potential downside to that; all the filenames you try are in the autorelease pool. So they'll remain in memory at least until this particular method exits. If you end up trying thousands of them, that could become a problem — but it's not directly relevant to the answer.
Assuming you always add new files but never remove files then this problem is something you could better solve with a binary search.
File names searched will be image1.png, image2.png, etc.


text:
OLD FORT QUARTER FESTIVAL 2018
Excellent Irish comedy line up announced for Old Fort Quarter Festival
Comedy is a new addition to the Old Fort Quarter Festival
Local comedian Mark Doheny has curated the line up for the Old Fort Quarter Festival comedy 2018.
Excitement is building around Laois for the Old Fort Quarter Festival 2018 taking place in Portlaoise this weekend.
The festive fun kicks off with the official launch on Friday evening, June 22 on Main Street Portlaoise.
In another exciting new addition to the growing festival, a number of comedy acts have been announced. All of the comedy gigs will be free to attend, just like the music, family entertainment and heritage walks.
Some of the next stars of Irish comedy will take to the stage over the Old Fort weekend curated by local comedian and resident MC in Kavanagh's Mr Mark Doheny.
Some of the acts are returning to the Kavanagh's stage and some making their debut. There is a variety of styles and shows to suit all tastes.
The laughs will begin from 4pm on Saturday, June 23 upstairs in Kavanagh's pub on Main Street.
Eve Darcy is a comedian, writer, podcaster and host of AFOG mental health variety show who has appeared at the Vodafone Comedy Festival and Cat Laughs in Kilkenny to name but two. She returns to the Edinburgh Fringe with her show "All about Eve" this year too. Anyone can drop in and see the show for free as part of the Old Fort Quarter Festival.
Pauline Shanahan is an actor, writer and comedian and former finalist in Funny Women This year she is taking her show 'What's cooler than a Hipster? A Spinster' to the Edinburgh Festival. She will also feature in the Saturday lineup in Portlaoise.
From 5.45pm on Saturday, Cornelius O'Sullivan will take to the stage. Mr O'Sullivan is a comedian and poet, regular contributor to CCCahoots comedy team and he writes/stars in Culchie Comic Sketches. He is taking his show, about the comedy that goes with being a new father, "The Family Guy" to Edinburgh Fringe Festival this year too. Catch Cornelius and Anthony Riordan, another comedian who writes/stars in the Culchie Comic Sketches at the festival too.
From 7.30pm on Saturday Mr Mark Doheny will take to the stage. He is a local and an award winning comedian who has appeared at festivals such the Cat Laughs, Halloween Howls, B.A.R.E, Indiependence and Edinburgh Fringe.
In addition he has supported Bernard O'Shea on two national tours. Mark is performing his new show "Derailed" which will be touring nationwide later in 2018.
The fun continues from 5.45pm on Sunday, June 24 at the same venue, upstairs in Kavanagh's.
Gary Lynch is Ireland's leading mid-life crisis comedians and he is spending much of 2018 touring with Irish comedy roadshow, The Good The Bad & The Irish around Germany, Holland, Belgium, Poland, Austria and Czech Republic. Catch him in Portlaoise before he takes on Europe.
Catch Greg Marks too, a witty and energetic comedian. He has been a regular on the Irish Scene for a number of years as well appearing at a number of festivals across Ireland and the UK.
From 7.30pm Tullamore native Jonathan Sheehan will entertain the crowds. He has performed at festivals such as Longitude, B.A.R.E, Belfast comedy festival and the Edinburgh Fringe Festival over the past few years.
Last but not least make sure to have a laugh with Ashlee Bentley, the winner of Show me the Funny 2015 & Funny Women Regional winner 2017. She has played the Vodafone Comedy Festival, Longitude & Electric Picnic.
No cover charge applies to any of the comedy gigs however there will be a voluntary bucket collection after each show.
The comedy lineup is a new addition to the festival which is now in its third year.
Music, food, local history and heritage, family entertainment and now comedy are all combined in the rapidly growing Old Fort Quarter festival.
The festival runs from Friday, June 22 to Sunday, June 24 on Main Street, Portlaoise and Fitzmaurice Place.
Festival Chairperson, Ivor O'Loughlin says excitement building for 'bigger and better' Old Fort Quarter Festival this year.
Full line up of free family events at Old Fort Quarter Festival in Laois.
Sharon Shannon's vegan stall and Laois food producers feature in Old Fort Food Festival.


Perhaps one of the United States of America's most important annual festivities, The Tournament of Roses Parade is the 114 year old traditional parade held New Year's Day in Pasadena, California. Rooted in tradition, this parade is carried on the big-three networks and watched by one million on the parade route, and millions more on television. It has become a lead in to the Rose Bowl football game.
First staged in 1890 by members of Pasadena's Valley Hunt Club, the Tournament of Roses has quite evidently undergone major change.
Many of the members of the Valley Hunt Club were former residents of the American east and midwest. They wished to showcase their new Californian homes' mild winter weather. At a club meeting, Professor Charles F. Holder announced, "In New York, people are buried in the snow. Here our flowers are blooming and our oranges are about to bear. Let's hold a festival to tell the world about our paradise."
And so the Club decided to organize their first New Year's Day parade. Horse-drawn carriage covered in flowers, followed by foot races, polo matches, and a game of tug-of-war on the town lot attracted a crowd of 2000 to the event. Upon seeing the scores of flowers on display, the Professor decided to suggest the name "Tournament of Roses".
Over the next few founding years, marching bands and motorized floats were added. By 1895, the event was too large for the Valley Hunt Club to handle, hence the Tournament of Roses Assoication was formed. By the eleventh annual Tournament (1900), the town lot on which the activities were held was re-named Tournment Park. Activities soon included ostrich races, bronco busting demonstrations, and an odd novelty race between a camel and an elephant. (The elephant won the race.) Soon, reviewing stands were built along the parade route, and newspapers on/along the eastern seaboard started to take notice of the event.
The Tournament of Roses Parade has followed the same route for many decades now. It starts out going north on South Orange Grove Boulevard, beginning at Ellis Street. It proceeds east on Colorado Boulevard to Sierra Madre Boulevard. Turning north on Sierra Madre, it ends at Paloma Street. In total, this route is 5� miles long.
Each year, a pageant is held to find out which Pasadena-area girls have the honor of being crowned Queen of the Tournament, or in substitution, one of the members of her "Royal Court". The winners then ride on a float in the parade, and carry out duties in promotion of the Tournament, mainly during its duration and prelude.
Originally, floats were created solely by volunteers from sponsoring communities. Nowadays, most are built by professional float building companies, and take nearly a year to construct. This is not the be-all-and-end-all of the Tournament, some communities still rely on volunteers.
Shortly after the previous year's parade is over, the parade sponsors and participating communities start to plan their floats. Then a chassis is built; it's a framework of steel and chicken wire.
The chassis is then "cocooned" in the cocooning process; it is sprayed with a polyvinyl material. This cocoon is painted with the colors of the flowers to be applied to the float.
Every square inch of the exposed surface of a float entered in the Rose Parade strictly must be covered with flowers or other natural materials. These other decorative applicants include bark, seed and leaves.
In the days after Christmas, these natural additions to the float are added by volunteers. Many volunteers end the day covered in glue and petals. Delicate flowers are even set up in individual vials of water, set into the float one-by-one.
Underneath many of the modern floats are computer-controlled robotic action, to animate the floats.
While many distinct changes have taken place with the Festival's floats, including computer-aided movement and professional float building, the floats have kept true to the event's title and heritage, by using real, fresh flowers.
The sheer amount of flowers consumed by a single float in its decoration is actually more than the average American florist will use in five years of operation.
More recent attendance figure are followed by the predicted attendances in parenthesis. Most predictions are conducted by The Tournament of Roses and the Pasadena Police Department. Actual figures are by the Anderson School of Management at UCLA.
This section is being worked on by Zanimum. Please kindly leave a reminder on his talk page.
The Tournament of Roses has become such a large event that it requires 65,000 hours of combined manpower each year. That is the equivalent of roughly 7.42 years of combined man power. Luckily for the Association, the group has 935 members, each whom is put in one of 34 committees.


text:
IATA Welcomes Single African Air Transport Market Initiative by African Union
By Miriro Matema on	 August 20, 2018 Special Feature
The International Air Transport Association (IATA) has welcomed the launch of the Single African Air Transport Market (SAATM) initiative by the African Union (AU).
The initiative is set to open up Africa's skies and improve intra-African air connectivity, which in turn will stimulate demand, improve African airline industry competitiveness and allow for an increase in air travel accessibility, thereby generating higher volumes of trade, expanded tourism and growing commerce between African nations and the rest of the world.
"The SAATM has the potential for remarkable transformation that will build prosperity while connecting the African continent. Every open air service arrangement has boosted traffic, lifted economies and created jobs, and we expect no less in Africa on the back of the SAATM agreement. An IATA survey suggested that if just 12 key African countries opened their markets and increased connectivity, an extra 155,000 jobs and $1.3bn in annual GDP would be created in those countries," said Rapahel Kuuchi, IATA's vice president for Africa.
"We commend the 23 states that have signed up to SAATM. It is an important step forward, but the benefits of a connected continent will only be realised through effective implementation of SAATM – firstly by the countries already committed and also by the remaining 32 AU member nations still to come on board," added Kuuchi.
One of the main obstacles to the implementation of previous open skies pledges – 1988 Yamoussoukro Declaration and 1999 Yamoussoukro Decision – has been the absence of an underpinning regulatory text. IATA welcomes the AU's adoption of the regulatory text of the Yamoussoukro Decision (YD) – also the framework for SAATM – which covers competition and consumer protection and dispute settlements, as these safeguard the efficient operation of the market.
"This decision is momentous. SAATM is a decisive step towards greater intra-African connectivity and delivers the framework on which to achieve it. Now it's time to get down to the work of implementation. Greater connectivity will lead to greater prosperity. Governments must act on their commitments, and allow their economies to fly high on the wings of aviation," concluded Kuuchi.
An extract from 1999 Yamoussoukro Decision: Aviation is a vital tool for development globally and has the potential to greatly transform and improve economic and social benefits across Africa. The SAATM is therefore a clear path for a more prosperous and secure African future. Improved intra-Africa connectivity facilitates business and trade, enables tourism, connects friends, families and cultures, and promotes the exchange of knowledge and ideas. Aviation is the foundation of many established and emerging economies, e.g. UAE, Singapore, Rwanda, Ghana, Cote D'Ivoire. The African aviation market however remains underdeveloped, especially when it comes to connectivity within the continent, presenting infinite opportunities.
Air connectivity is a measure of economic potential and opportunity. The better connected a country is by air, the greater its ability to unlock the economic and social benefits that air transport can deliver. Currently, air connectivity in Africa is focused on international routes, most especially from Europe and the Middle East, whilst intra-Africa connectivity is much more limited. Air connectivity has many dimensions; the number of routes, the range of destinations served, the frequency of services and 'number of seats' available to and from a country. Passenger benefits of enhanced connectivity are air service liberalisation would result in substantial benefits for passengers such as fare savings, more direct routes, increased route frequencies resulting in greater convenience and time savings. For example, there is currently no direct service between Algeria and Nigeria. The most convenient routing available is via Morocco (Algiers-Casablanca-Lagos).
The minimum journey time for this routing is 9 hours, but depending on connecting times could be as much as 17 hours. A direct service would reduce the travel time between Algiers and Lagos to approximately 4.5 hours.
The impact of enhanced connectivity extends beyond those to passengers. The increased air service levels will stimulate employment in the aviation industry to handle passengers and their baggage and to operate, service, and maintain aircraft.
Liberalisation would also be expected to stimulate trade and tourism between the countries, generating an estimated US$1.3 billion in additional spending. And perhaps most significantly, the increased air services could facilitate many other sectors of the economy by supporting increased trade, attracting new businesses to the region, encouraging investment and enhancing productivity and competitiveness. Industries and activities that would otherwise not exist in a region could be attracted by improved air transport connectivity. The future of air transport in Africa: The goal of the YD is to strengthen safety and security oversight on the continent and promote a climate of cooperation among African carriers through partnerships, mergers and consortiums. Improved airline brands will be able to compete favourably with stronger states or blocks of states from outside the continent.
The full implementation of YD will guarantee the creation of a larger market for African carriers and an improved access to capital. In addition, airlines and governments can optimise existing capacities. African Open Skies creates much more opportunities and economies of scale. When African airlines are empowered by this realisation, economic development on the continent would be accelerated, thousands more jobs would be created and the move. Travel and tourism is vital to the globalised economy.
This article was written by KRISTIE OMAR.
Previous ArticleFast Jet Making moves to help Open Skies Drive Tourism
Next Article Blocked Funds: Increasing Problem for Airlines In Africa


text:
The Aurora Australis is coming to the end of her working life, and her future is uncertain. Whether she will remain in Australia, or under Australian ownership, is unknown.
The ultimate fate of many old ships is, sadly, ending up as scrap metal. We are doing everything we can to prevent that happening to the 'Orange Roughy'.
The Aurora Australis Foundation is working hard to achieve an ambitious set of goals, and aims to:
Preserve and protect the Aurora Australis as a ship of national significance, and in recognition of her unique role in Australia's Antarctic history
Provide access to the Aurora Australis to share her story and the experience of being on board with Australian and international visitors
Promote awareness of Australia's work in Antarctica in the past, the present and for the future.
Over 2020 the AAF intends to:
Secure a memorandum of understanding for acquisition of the Aurora Australis
Confirm a date for acquisition
Discuss options for securing a long-term berth for the Aurora Australis in Hobart
Begin the planning and design process for onboard and on-shore critical museum infrastructure
Seek and confirm seed funding for museum development
Confirm a timeline for museum development, aiming for an opening date no later than December 2024.


In trading, greed can sometimes get the best of you. In your journey to be a consistently profitable trader, the urge to bag those extra pips can be too irresistible. As a result, you sometimes force your trades.
During losing streaks, your frustration and need to enter more trades to earn lost money can overwhelm rational thinking. This line of thinking may actually make a lot of sense to you because it's not like you can make money if you don't have a trade on, right? Instead of being patient by waiting for the best setups and letting the market come to you, you… well, force a trade.
Take a look at Paolo, an intermediate trader from MeetPips.com, who lost a trade by forcing it.
Right off the bat he realized that he lost because he forced trades. He took trades that didn't follow the rules of his system and got burned for it.
There's also Ikori. In his post, Ikori touches upon how the perils of impatience has affected his trading, resulting in a blown account.
Fortunately, there is a way to overcome these destructive urges. It requires discipline and dedication in the beginning, but it definitely pays off in the end. A way to get over the impulse of forcing trades is by making your trading rules your habits.
Just like how your mom made you put your dirty clothes in the laundry basket to keep your room clean, you start forming good habits by consciously repeating an action. Whether it is by saying "no" to that second doughnut, going to the gym twice a week, or something as simple as eating breakfast in the morning, habits start with deliberate repetition until the act becomes a part of you that you no longer need to be reminded of the rules.
In trading, consciously sticking to your trading rules is a solid step towards forming good trading habits. After practicing your trading rules over and over, you will notice that you have more control over your trading. You may still experience anxiety over price action, but you will control your decisions better because you stress less over it.
1.	Make a list of rules and write them down.
The first thing you should do is to make a list of trading rules. These rules will govern how you trade, where you will enter, exit, and how much you will risk. It also isn't enough to just have these rules in your head – you should write them down. Writing down your rules solidifies and reinforces them as you will always be reminded what they are.
Imagine that you have an open position. Think of all the different price action scenarios you could encounter and imagine how you would adjust your position in these situations. Visualize yourself following your rules. The more you practice and repeat this process, the more natural it becomes for you to follow your rules and turn them into habits in a real trade.
At the end of each trading day, take some time to review your trading. Ask yourself, "Did I follow all my trading rules?" Grade yourself and make it a point to work on your weaknesses. By reviewing your trading, you can see whether your rules are effective and whether you are really following them or just fooling yourself.


text:
tygus.shooting
Ride, Shoot, Speak the Truth
Is There a .22 Revolver in Your Future?
Date: April 23, 2017Author: tygus 0 Comments
Smith & Wesson's Model 17 is not new at all.
It was, in fact, designed in 1947. The original revolver had a 6-shot cylinder, and was actually dropped from production in 1998, ostensibly because of poor sales. Fortunately, the company discerned a resurgent demand for good .22 revolvers, and the model was resurrected in 2009 with the now-iconic 10-shot cylinder.
My particular example of the Model 17 is a resurrected version, designated as the Model 17 Masterpiece. It comes from the factory wearing rubber target grips with comfortable finger grooves, one indication that it was designed for target shooting.
Revolver Versatility
This revolver is built on S&W's sturdy K-frame, and has an all-steel 10-round cylinder. It's officially designated as a Model 17-8 in S&W nomenclature, and features a semi-matte finish on the frame. It also lacks any sort of key-activated locking device, which I particularly like.
My example of the Model 17 features a fully under-lugged 6-inch barrel, which completely tames recoil, and a rear sight with comprehensive windage and elevation adjustments.
Like most revolvers chambered for .22 LR, it will fire practically every kind of .22 rimfire ammunition on the market, from .22 CB to .22 Shotshells. I normally feed it .22 standard-velocity solids, but I will occasionally run some of the newer .22 hyper-velocity stuff through it when I want some extra power.
Superb Trigger Action
As any Smith & Wesson revolver aficionado will testify, the trigger action on a K-frame revolver has to be experienced to be fully appreciated.
Like all regular K-frames, the Model 17 has two firing modes — double-action and single-action.
To fire the revolver double-action, you apply steady pressure on the trigger until the hammer moves backward and then drops to fire the cartridge. The test of a good double-action revolver is how smoothly this movement can actually be achieved. The reasoning behind this is simple: the smoother the movement, the less the sights move off target, and the more accurate your shot becomes.
Smith and Wesson K-frames (especially the vintage examples) have always been renowned for their smooth double-action pulls. You never feel that there is anything snagging or catching as you squeeze the trigger back to raise and eventually drop the hammer. Even at the very end of the stroke, the gun provides no indication that the hammer is about to drop, and you get the "surprise break" that is so conducive to accurate shooting.
To fire the Model 17 single-action, on the other hand, you thumb the hammer back until it locks into its cocked position. Then you squeeze off your shot as gently as you can. The test of a good revolver is how cleanly the trigger releases the hammer, and how far back the trigger actually moves before dropping the hammer. The less movement, the better.
In a Smith & Wesson K-frame, the trigger movement is almost imperceptible. In my particular revolver, the hammer drops when you apply 3.5 pounds of pressure, which is hardly enough to cause tremors in your shooting hand. The sights stay on target, and the bullet goes where it's supposed to.
This is what makes an S&W revolver's lockwork appear magical.
Using .22 Shorts
When teaching youngsters who are shooting for the first time, I will often load the revolver with .22 Shorts. This removes any sort of recoil impulse when the gun is fired, and cuts the noise down significantly. Taken together, it makes for a gentler shooting experience. Standard eye and ear protection is still worn, of course, in spite of the .22 Short's relatively low noise level.
The only downside is that the residue from .22 Shorts seems to be particularly dirty, and leaves a lot more fouling to clean up after an extended range session. The shorter cartridges also appear to produce an inordinate amount of smoke, for some strange reason!
When you use .22 Shorts in a revolver chambered for .22 LR, you're bound to discover that cleaning the gun after a range session is a lot more tedious than cleaning a semi-automatic pistol. A revolver has holes in the cylinders, and if you like to clean each one as thoroughly as the barrel itself, it takes a lot of time and patience. Considering that the Model 17 has 10 such holes to clean, the job is even more tedious.
Nonetheless, the Smith & Wesson Model 17 remains my favorite .22 revolver today.
Scope-Mounting the Model 17
I have always believed in the accuracy of 6-inch barrels, and after I got this gun, I was determined to find out just how well it would shoot with decent optics.
I ran into two problems here:
1. The Model 17 doesn't have provisions for scope mounting as it comes from the factory, and
2. I couldn't find a 4X pistol scope, which I figured would give me the best chance of maximizing the revolver's accuracy potential.
Eventually, I did find a fixed power 4X scope with about 6 inches of eye relief, and decided that it would have to do. But the problem of getting it mounted on the gun still remained.
I instinctively felt that there had to be some kind of drop-in scope mount fitting for this gun, but could not locate any at the time.
Removing the revolver's rear sight, I discovered that it actually fit into a narrow channel on the gun's top strap. I figured that if I could machine a metal bar to fit precisely into that channel, then attach a mounting rail to that, I would have a workable scope mount. This was done in due time, and with the mount duly screwed onto the revolver's top strap, I mounted the 4X scope on the revolver.
The results were eminently satisfying.
With the 4X scope mounted, the gun produced 10-shot, one-hole groups at 15 meters with almost every brand of .22LR ammunition, and 1-inch groups at 25 meters from a sandbagged rest.
Tiring of the 4X scope after a while, I decided to try something else, and replaced it with a Tasco red-dot reflex sight. This negated the bothersome issue of having to maintain the correct eye relief for every shot, and still produced better groups than were possible using the gun's open sights.
It felt like a reasonable compromise, and the revolver has worn the big Tasco sight ever since.
Finding the Best Ammo for the M17
The next issue was finding out what brand of ammunition my particular revolver favored. To factor out as much human error as possible, testing was conducted from a sandbagged rest on the shooting bench.
I tried six different types of .22LR, ranging from CCI Stingers to Eley Tenex. What I finally settled on was RWS Pistol Match ammunition. This soft-shooting load produced one-hole groups at 15 meters, and 3/4-inch spreads at 25 meters for every cylinder full of cartridges (10 shots).
Bear in mind, however, that this is the ammunition that my specific example of the Model 17 prefers. The Model 17 you own is likely to have an entirely different preference from mine. It may actually like Stingers! So as they like to say on the gun forums, your mileage may vary.
Later on, I experimented with .22 Shorts, to see how the revolver performed with them. For some reason, however, accuracy wasn't quite as good, so it was back to regular .22LR from then on.
Right now I'm still on the lookout for the match-grade stuff they used to run through Olympic rapid-fire pistols like the Walther OSP. This sort of .22 Short ammunition now appears to be in short supply, ever since Olympic rapid-fire pistols switched to .22 LR.
The Fun Factor
In my book, a plinker is supposed to be a "fun" gun, not one that's meant to be shot at paper bullseyes all the time.
The most fun you can get out of a plinker is with shooting reactive targets—metal plates that 'ping' when you hit them, and small animal silhouettes that get knocked over when hit by .22 projectiles.
Empty plastic bottles are also particularly engaging. They bounce around when you hit them, and will oftentimes land a few meters further away after every hit. The challenge is to keep nailing them as they keep moving further away, until they disappear from sight in the rocks or in the tall grass.
I took the gun to an open range which provided such an assortment of targets, and my fellow shooters and I had the time of our life. It's funny how easily you can go through 100 rounds of .22 LR ammunition each, when you're having fun!
We actually made a game of shooting plastic bottles—we'd let everyone shoot for as long as he or she hit the bottle. On the first miss, the next shooter in line took over, starting with a fresh and empty hand-thrown plastic bottle. (We used the smaller, 500-ml. water bottles to keep things interesting.)
Keeping It Environmentally Friendly
A cautionary note here: don't be tempted to use glass bottles, ever! Glass bottles shatter, and they tend to make a mess that can't be cleaned up afterwards. Stick to plastic, and if you get the chance to do this on public land, make sure to clean up after yourself.
Do everyone a favor and take the perforated plastic bottles away with you when you leave. A plastic bottle with bullet holes in it leaves very little doubt that a shooter is responsible, and leaving something like that behind tends to give ALL shooters a bad rep (!)
Functioning Issues
The problem when you fire hundreds of rounds through the gun in one session is, quite simply, fouling. The cylinder holes of the Model 17 are relatively tight, and they get so dirty that it becomes difficult to eject the empty cases, and almost impossible to shove fresh .22 rounds into the cylinder holes.
If you intend to fire more than a hundred rounds through a .22 revolver, it pays to bring a .22 cleaning kit along to the range with you, and to perform the requisite cleaning after every hundred rounds or so, to keep the gun functioning properly.
You'll also find that a bit of lead and firing residue will accumulate on the underside of the top strap, right about where the bullet jumps from the cylinder into the barrel's forcing cone. Unless you clear up that accumulation from time to time, the build-up will eventually touch the cylinder and cause it to bind, or fail to rotate normally. Just a little something to check on, whenever cylinder rotation becomes an issue.
Definitely a Keeper
All told, this is definitely one gun I intend to keep.
It's accurate, it has demonstrated durability, and it fires 100% of the time. It feeds an impressive variety of ammunition, and will fulfill a number of divergent roles, from competition shooting to small-game hunting.
At 45 ounces, Smith and Wesson's Model 17 might seem a little heavy for newbies to shoot unsupported, but if you let them lay that heavy barrel on a sandbag, you'll see just how much they'll love it!
.22 LRhandgunHuntingModel 17PlinkerRed-dot sightrevolvershootingshooting sportsSmith and Wessontarget shooting
Published by tygus
View all posts by tygus
Previous Previous post: Refugees, Law Enforcement, and Gun Control: Learning from the Swedish Experience
Next Next post: All-Stock Performer!
View Tygus.Shooting's profile on Facebook
View tygus.shooting's profile on Instagram
© 2019 tygus.shooting


text:
Q: How to improve performance of pyspark UDFs? I have the following pyspark code.
# Reading contents of a text file into an RDD
data_set_rdd = spark_context.textFile(full_file_path)

# Read the header line
header = data_set_rdd.first()

# Construct the schema
fields = [StructField(field_name, StringType(), True) for field_name in header.split(",")]
schema = StructType(fields)

# Filter empty lines
non_empty_lines = self.data_set_rdd.filter(lambda line: len(line)>0)

# Filter header record from the RDD
contents_rdd = non_empty_lines.filter(lambda line: line != header)

# Split the RDD into columns based on delimiter
delimited_contents_rdd = contents_rdd.map(lambda k: k.split(delimiter))

# Convert RDD into DataFrame
contents_df = sqlContext.createDataFrame(delimited_contents_rdd, schema)

# Create a function
def check_value(val):
    if val > 220:
        return 220
    else:
        return val

# Register the function as a pyspark udf
check_val = udf(check_value, IntegerType())

# Add a column to the dataframe which uses the check_val function to perform some computation
final_df = contents_df.withColumn("transformed_voltage", check_val (contents_df["voltage"]))

final_df.show(10)

Now the step where the UDF is called to add the column (withColumn) takes a long time to complete. It takes around 10 mins to complete. I am running this on my laptop with 8 GB RAM, 4 Cores.
I have only 10 records in my input file.
My text file is of the following schema with 2 columns [timestamp,voltage]
If I replace the UDF with a pyspark built-in function like WHEN, it completes within a few milliseconds.
I was expecting UDFs to be slow, but can they be so slow ?
Am I doing something wrong here?
Any help would be appreciated because I will end up writing custom UDFs for my project.


We searched for the perfect white t-shirt for our Bombesquad, and we found it! You'll love the fit and feel. True to size.
Plus, recipes from the hottest chefs, bakers, and makers around.
This issue celebrates all things California! Both as a place and a state of mind. First up, we visit with model and new mom Chrissy Teigen, whose debut cookbook was an instant hit. Find out what this social media superstar is all about and why her favorite place is in the kitchen. Also in this issue: Chef Nancy Silverton, pastry pro Liz Prueitt. toast of the town Jessica Koslow, plus a special photo essay on the Bay Area chefs and restaurateurs making it happen. We end on a colorful note with Dita Von Teese and her pink kitchen.
Plus, recipes from your favorite chefs, bakers, and makers.
We celebrate writers and cookbooks in this issue, starting with Lena Dunham and Jenni Konner, the best friends who brought us HBO's Girls. They talk about their partnership, their show, and their food misadventures, including Lena's brownie mishap with Nora Ephron. Also, Dominique Crenn, Alice Waters, and Nigella Lawson discuss life and their latest books, Ruth Reichl reflects on the cookbook she wrote in the 1970s, cookbook queen Melissa Clark explains how she's written 30+ books, and Chef Angela Dimayuga embraces the word fusion.
Plus, recipes from your favorite chefs, makers, and bakers.


When he held a four-shot lead entering the final round of the 2011 Masters Tournament, Rory McIlroy changed his demeanor.
Sunday collapses are nothing new, especially in Augusta. In 75 Masters Tournaments, only 41 players holding at least a share of the 54-hole lead have gone on to win the green jacket. The last 54-hole leader to win the Masters was Angel Cabrera in 2009; he shared the third-round lead with Kenny Perry.
Peter Hanson will try to hold onto the 54-hole Masters lead today. He is one shot ahead of Phil Mickelson, a three-time winner at Augusta National Golf Club.
There have been several famous final-day collapses. In 1996, Greg Norman lost the largest 54-hole lead in Masters history, when he watched a six-shot advantage disappear en route to 78 and a runner-up finish to Nick Faldo.
Ed Sneed lost a five-shot lead in 1979. Ken Venturi almost became the first amateur to win in 1956, but he blew a four-shot advantage on a windswept Sunday and closed with 80.
Last year, McIlroy seemed on his way to his first major title. After rounds of 65-69-70, the Northern Irishman led Cabrera by four entering the final round. After a triple bogey on No. 10, McIlroy ultimately shot 80. He said he learned from the experience, and two months later, he won the U.S. Open by eight shots.
Kyle Stanley knows what it's like trying to convert a big lead into a win. At the Farmers Insurance Open in January, he led by six entering the final round and by three as he walked to No. 18. He posted a triple bogey, then lost a sudden-death playoff to Brandt Snedeker.
Stanley bounced back the following week, roaring from eight shots back of 54-hole leader Spencer Levin to win the Phoenix Open.
"It's probably easier to play chase than to play protecting the lead," Stanley said. "When you're protecting something, you're trying not to make mistakes. When you're chasing something, you're trying to make birdies.
On the PGA Tour this season, only four 54-hole leaders in 14 tournaments have gone on to win – McIlroy, Tiger Woods, George McNeill and Steve Stricker.


How can core cities become cycling cities?
The Transport Seminars programme is jointly organised by Dr David Ling and Dr Philip Bell in collaboration with Transport for Greater Manchester, the Chartered Institute of Logistics & Transport, and the Greater Manchester Council for Voluntary Organisations. Contact david.ling@manchester.ac.uk for more information.
This entry was posted in Events on September 23, 2014 by Rachel Lea.


text:
Can you keep a secret? We have a new building!
The Board of KGC has been working on securing a new space for KGC for the last two and a half years. At a minimum a new gym must have at least 19-foot ceilings, a 40-foot by 40-foot space for the floor programs, and a long runway for the vault track.
It was not feasible for a not-for-profit organization like KGC to borrow money to finance the purchase of a new building.
During our search we have seen many possible rental spaces, and none could fulfill all the criteria we sought.
Robyn Carter owner of Premiere Studio of Dance approached the KGC board early this year with the idea to partner with her as she redeveloped her property. Robyn wanted to partner with an organization that shared her value of excellence and a focus on athlete development.
Over the last number of months Robyn developed her vision and organized her building team. After seeing that the project could fulfill all the gym site requirements we collaborated on the final building design to provide an amazing gym space and dance space under one roof. Robyn will construct this new building on her existing property located at 1046 County Road 19, Selwyn Township, just north of the City of Peterborough limits. KGC will be her main tenant at this site.
What does this mean for your kids at KGC?
As part of the arrangement we will fulfill the minimum needs of a gym – a 19-foot ceiling, adequate space for the floor programs, and a vault runway. We will also add major improvements to our gym facility. For instance, we will have a variety of pits to support our athletes "going to the next level." The building will have change rooms and bathrooms located within the gym space, a stipulation of Gymnastics Ontario's Safe Sport guidelines. The space is also larger than our existing facility.
You have supported KGC through fundraising efforts to update many pieces of equipment over the last five years, and this equipment will move to the new location. The board of KGC will replace any older equipment such as the sprung floor, beams, bars and trampoline once we move.
The new club will offer many benefits that go beyond the space and equipment. The new gym will allow our athletes to gain new perspectives and improve their dance routines with Premiere's coaching. KGC will help Robyn and her team improve the gymnastics-related skills in her dance programs.
KGC's staff and Robyn and her team will have monthly meetings to ensure everything is working perfectly. We will plan for future programs that we can offer together.
The board has weighed all the options, and we have agreed that the best plan for our athletes is to sign a 20-year lease at this location.
The future facility will give KGC new creative energy and the ability to develop exciting programs. We will also bring our current culture of safety and pursuit of excellence to this new location.
The board has worked hard on our finances over the last five years. The new gym will come with new costs, but we did all the future financial modeling based on our current revenues. The bottom line is fees will go up at a modest rate over the next 20 years. We anticipate that new programs will sustain our current fiscal planning, which is to build a prudent operating surplus and create an equipment replacement program over the next 20 years. If you are interested in knowing more about the financial model please let us know, and we can share it with you.
The next steps in the process is to secure Selwyn Township's approval of the completed building design. After that Robyn's team will get the shovels in the ground, and we will see the new building take shape. You can expect regular progress reports. Please be aware that the approval process and construction can take a bit of time.
We are starting a new social media account to update you about the building in partnership with Premiere Studio of Dance. @PSDxKGC.
If you have any questions, or comments, please let us know.
Your current KGC board and staff is made up of the following people, who all have a deep connection to KGC, and have worked on this issue together.
KGC Board of Directors
The foundation of Danielle Rocheleau's professional experience, career, and passion has been rooted in community development. A resourceful, strategic thinker who values collaborative approaches to problem solving. As the CEO at Laridae Danielle leads strategic planning, communications, and branding projects. Prior to consulting, she held executive roles with the Greater Peterborough Innovation Cluster (GPIC) and Peterborough & Kawarthas Economic Development (PKED). Danielle has actively engaged in governance throughout her career as a volunteer Board member of local non-profits. In addition to her years in the not-for-profit sector, Danielle has been an entrepreneur, starting an award-winning business. Bilingual, Danielle is originally from Timmins. She lives in Keene, Ontario with her family and can be found in the viewing seats at KGC while her two daughters aspire competitive dreams in gymnastics.
Patrick Sheehan has been a member of the board of directors at KGC since February, 2018. Patrick's professional career has spanned over 28 years in the foodservice industry in various management and senior sales positions including Director of Independent Sales and Vice President of Customer Service, Sysco Canada. In his current role, Patrick is Vice President of Partnership Development for Synergy Purchasing Partners. When not working, Pat enjoys playing baseball, hockey and watching his daughter perform her gymnastics routines at KGC!!
Kathy Garvey was born and raised in Peterborough and has been involved in gymnastics as an athlete, judge and coach for many years. She is a retired Physical Education teacher with the PVNC school board and was a coach with the Kawartha Gymnastics Club in its early years. Kathy's background includes competing at the National level in University before working as Athletic Event Manager and woman's gymnastics coach at the University of Calgary. Upon her return to Peterborough she initiated the gymnastics program at St. Peter Secondary School which she ran for 25 years. Kathy's passion for gymnastics has lead her to sit on the KGC Board for the last 7 years and see the club continue to grow and prosper. She also volunteers with Hospice Peterborough and Wheelchair Rugby.
In the past, Neil Hannam worked in the heath care sector and completed a Master's Degree on Social Entrepreneurship. Neil is the CEO of HC, a company that leads social entrepreneurship projects, and is a partner with Workforcewins, which is a Human Resources outsourcing company. Neil is the current chair of the board and has been on the board for 5 years. His daughter, Chloe, has been an athlete with the club for 11 years and is currently on the competitive team and is a level-one coach at KGC.
Tim Haxton has been a member of the board of directors for two years. His daughter joined KGC 8 years ago at the age of 4 and he has enjoyed watching her tumble her way through life. Tim works as a Fisheries Specialist with the Aquatic Research Monitoring Section of the Ontario Ministry of Natural Resources and Forestry, an agency he has worked for since 1987. He currently resides on COSEWIC's Freshwater Fish Species Specialist Subcommittee, the Science Advisory Committee for the International Symposium on Sturgeon, was the co-founder and past co-chair of the North American Sturgeon and Paddlefish Society, has adjunct Professor status at Trent University and is a subject editor for the Journal of Applied Ichthyology.
Amy Gerolamy has been involved in the sport of gymnastics since age two. Amy a former competitive gymnast, coach and judge has worked at 4 different clubs over her years in the sport from Ottawa to Niagara Falls. Amy has been a member of our club since 2011. In 2018 Amy officially retired from her role as a coach to join the Board of Directors. Amy has a passion for athletics of all kinds and has a Physical Education Honors Degree from Brock University and is a currently a grade 2 teacher with the Peterborough Victoria Northumberland Clarington Catholic District School Board. Amy is our Social Director for the 2019/2020 season.
Sue Connelly has been involved with KGC since its beginning in 1971 and was one of our Athletes on our first Competitive team. Throughout high school, Sue also became a Coach of our pre-competitive program. After high school, Sue went to Seneca College and came back to Peterborough and was our Head Coach from 1981-1984 while also being a Judge. After three years of being our Head Coach, Sue decided to step away to pursue another career and to raise a family. After ten years of being away from the sport she loves, she came back and coached for one year in 1994. At this time, Sue was expecting her youngest child, so she stepped away again from coaching. In 1998, Sue's daughter Cassidy followed in her footsteps and began her successful gymnastic career competing for 10 years with KGC and has been coaching competitively herself for the last 6 years. Sue has been on the Board of Directors for 12 years and for the last four, she has been Co-Meet Director of our successful Swingin Safari Competition. Sue is entering her 32nd year being apart of KCG and being an Athlete, Coach, Head Coach, Parent and Board Member, she has a unique perspective of KCG and it's safe to say that gymnastics is Sue's passion.
Tiffany Creasy has been a board member for a few years. Her daughter started out in recreational and has worked her way up to the competitive level. Tiffany works at Ricart Promotions & Recognition and looks after Marketing & Sales.
KGC Staff Team
Heidi Collins has been the Administrator at KGC for nearly 2 years. Involved in sports her entire life, she has been a varsity volleyball team captain, travel soccer club player and world champion jump rope athlete. Heidi is thrilled to be continuing her passion of enhancing the lives of children through sport at KGC. Prior to moving to Peterborough, Heidi was the Group Director at "UGot Active Kids" in Toronto where she led the company through programming, sales and operations for over 2 years. Additionally, Heidi spent 5 years with Mosaic Experiential Marketing as a National Sales Manager for multiple fortune 500 companies. Heidi's vast background also includes being a member of the Canadian Forces Naval Reserve, a cast member and Canadian ambassador at Walt Disney World, and a Boutique Manager with Oceania Cruises. When she's not in the office at KGC, you can find Heidi coaching local skippers through her organization "Jump Rope Kawartha", designing jewelry with "Scarlett Leather", and chasing her 5 and 3 year old at her home in Buckhorn, ON.
Becky Ansell has been part of the gymnastics community all of her life. Starting as an athlete in Lindsay she eventually competed at the Provincial level. Becky has been coaching gymnastics for 23 years. Becky moved to Peterborough to attend Trent University in the year 2000. She has been coaching at Kawartha gymnastics for the past 19 years and has been the head coach for the past 7 years. Becky was named the 2013 Competitive Coach of the Year by Gymnastics Ontario. When she's not at the gym you can find Becky judging Provincial Gymnastics Competitions or teaching with the Trillium Lakelands District School Board.


text:
Q: How to test a Java EE7 Websocket I have implemented a WebSocket using the api provided with Java EE 7. Additionally I have implemented a client that requests my WebSocket without any problems. To be sure this remains working when performing some code changes I want to implement tests which can also be run on a build server like e.g. Jenkins CI and not only locally. I am using maven.
Here's my server endpoint:
import javax.enterprise.context.ApplicationScoped;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

@ApplicationScoped
@ServerEndpoint("/example")
public class WebSocket {

    private final Set<Session> sessions = Collections.synchronizedSet(new HashSet<>());

    @OnOpen
    public void open(Session session) {
        sessions.add(session);
    }

    @OnClose
    public void close(Session session) {
        sessions.remove(session);
    }

    @OnError
    public void onError(Throwable error) {
        //TODO do something
    }

    @OnMessage
    public void handleMessage(String message, Session session) throws IOException {
        session.getBasicRemote().sendText("Hello "+message+"!");
    }
}

Here's my client endpoint:
import javax.websocket.*;
import java.io.IOException;
import java.net.URI;

@ClientEndpoint
public class WebsocketClient {

    private String uri = "ws://localhost:8181/<some-path>/example";
    private Session userSession = null;
    private String answer;

    public WebsocketClient() {
        try {
            WebSocketContainer container = ContainerProvider
                .getWebSocketContainer();
            container.connectToServer(this, new URI(uri));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public boolean isClosed() {
        return userSession == null || !userSession.isOpen();
    }

    @OnOpen
    public void onOpen(Session userSession) {
        this.userSession = userSession;
    }

    @OnClose
    public void onClose(Session userSession, CloseReason reason) {
        this.userSession = null;
    }

    @OnMessage
    public void onMessage(String message) {
        this.answer = message;
    }

    public String getAnswer() {
        return answer;
    }

    public void sendMessage(String message) {
        if (userSession != null && userSession.isOpen())
            try {
                this.userSession.getBasicRemote().sendText(message);
            } catch (IOException e) {
                e.printStackTrace();
            }
        else {
            System.out.println("Session closed!");
        }
    }

    public void reset() {
        this.answer = null;
    }
}

I also have some other classes that are tested on the build server that use CDI. To be able to use the CDI and other application container functionality I am using the EJBContainerRunner with apache TomeEE/OpenEJB in version 7.0.0-M3 which starts an embedded TomEE runs my tests and shuts it down afterwards. Using this approach I don't have an URL to call. This works fine with e.g. JAX-RS REST services where you can simply call your classes methods in your tests and check the responses. But how do you do something like this with WebSockets? I can't simply call the methods due to the missing Session.
My current test looks like this:
import org.apache.openejb.junit.jee.EJBContainerRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.net.SocketException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

@RunWith(EJBContainerRunner.class)
public class TestWebsocket {

    private WebsocketClient socket;

    @Test
    public void test() throws SocketException {
        String answer = requestSynchronous("Java");
        assertThat(answer, is(equalTo("Hello Java!")));
    }

    public String requestSynchronous(String message) throws SocketException {
        if (socket == null || socket.isClosed()) {
             socket = new WebsocketClient();
        }
        socket.reset();
        socket.sendMessage(message);
        String answer = null;
        int i = 0;
        while (answer == null && i < 10000) {
            try {
                answer = socket.getAnswer();
                Thread.sleep(1);
                i++;
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        if (answer != null)
            return answer;
        else throw new SocketException("Connection timeout");
    }

}

This works running a TomEE on my local machine with e.g. the tomee-maven-plugin. But this approach can't be done on the build server. Is there a simpler way than configuring special ports or setting up a virtual machine for testing?
Thanks in advance!

A: I found a solution for my testing problem without mocking, using a vm, ...
For sending an answer message to the client it is not needed to call session.getBasicRemote().sendText("...");. Instead return the message you want to send.
The handleMessage method in the class WebSocket changes to:
@OnMessage
public String handleMessage(String message){
    return "Hello "+message+"!";
}

And the test simplifies to:
@RunWith(EJBContainerRunner.class)
public class TestWebsocket {

    @Inject
    private WebSocket socket;

    @Test
    public void test() throws SocketException {
        String answer = socket.handleMessage("Java");
        assertThat(answer, is(equalTo("Hello Java!")));
    }
}

This approach doesn't send messages to the outside of the web application container that is started for the test. This makes it much easier to handle the test.


YASKAWA has 30 years of expertise in plant engineering and offers turnkey welding solutions and systems configured to customer specifications.
Customers who choose YASKAWA get much more than just an extensive range of products. With over 30 years of experience in plant development and engineering as well as a wide range of knowledge and expertise in robot technology, YASKAWA provides a complete package fully tailored to your requirements.
YASKAWA assists you in the development of your projects from the beginning all the way through to delivery and continues to provide assistance for your production requirements by offering a widerange of product and customer support services.