Information provided whilst using this service, including personal information, may be published or disclosed in accordance with access to information regimes, primarily the Freedom of Information Act 2000 (FOIA) and UK Data Protection legislation.
The Department for International Trade will process personal data supplied in this service in accordance with the DPA. The information you provide will be processed on a lawful basis in License Controlled Items and Services to enable DIT to perform a task in the public interest or to fulfil an official function, and the task or function has a clear basis in law and/or the processing is necessary for a contract DIT have with an individual and/or the individual has given consent for the processing of their personal data for a specific task.
This information will be shared within the department and with selected third parties for purposes connected with DIT performing a task in the public interest or to fulfil an official function and the task or function has a clear basis in law, including:
Third parties with whom information will be shared are:
Aggregated analysis of responses may also be shared with the Information Commissioner's Office (ICO) the Government Internal Audit Agency (GIAA) and the National Audit Office (NAO) and Business Partners as above.
Consent will be sought in accordance with the DPA should there be a requirement to share information with any other third parties outside of those listed above. If you want the information you provide to be treated confidentially, please be aware that, in accordance with the FOIA, public authorities are required to comply with a statutory code of practice which deals, amongst other things, with obligations of confidence. In view of this, it would be helpful if you could explain to us why you wish that information to be treated confidentially. If we receive a request for disclosure of that information, we will take full account of your explanation, but we cannot give an assurance that confidentiality can be maintained in all circumstances.
Please note users may be asked to log in whilst using License Controlled Items and Services. This will need to be using username and password details previously registered for in SPIRE (www.spire.trade.gov.uk (opens in a new tab)) as both services use the same account.


--- title: Fall Treasures date: 2013-10-31 00:00:00 -06:00 categories: - whats-blooming layout: post blog-banner: whats-blooming-now-fall.jpg post-date: October 31, 2013 post-time: 7:40 AM blog-image: wbn-default.jpg ---
European Cranberrybush Viburnum Viburnum opulus
This viburnum dazzles with yellow tinted foliage and an abundance of bright red berries.
Black Chokeberry Aronia melanocarpa
The deep purple hued berries of this shrub are not just beautiful, but have been used to create an infusion to treat colds.
Dwarf Cedar of Lebanon Cedrus libani 'Sargentii'
The year round interest of conifers can include their decorative cones, as with the golden male cones on this pendulous evergreen.
Italian Arum Arum pictum
This diminutive fall blooming arum doesn't make a small statement; it's deep purple and yellow flower is a fun and unique treat at the end of the blooming season.
Cat-face Spider Araneus gemmoides
The fauna of the Garden are also slowing down for the winter, but this seasonally striking native spider was still out and about for a stroll.
Japanese Maple Acer palmatum 'Bloodgood'
Many of the Japanese maples are still holding their distinctive colorful fall leaves.
Apple Serviceberry Amelanchier x grandiflora 'Autumn Brilliance'
Multicolored serviceberry leaves carpet the ground along the Floral Walk.
Hybrid Toad Lily Tricyrtis x 'Sinome'
An absolute favorite jewel of fall here at the Garden is the blooming of the toad lily. These fairytale looking blooms dance in the fall wind, displaying wonderfully whimsical combinations of color and form.
Hybrid Toad Lily Tricyrtis x 'Sinome'
There are a good deal of buds still waiting to bloom, but with the threat of frost it's best to head in soon to make sure you have the chance to appreciate this beauty in person!


Web Design
We design the Website with latest technology and offer a creative technology solution
Website Maintenance
Get Maintain your website by our professional with fresh content, images
Insight to ST@RWebS
ST@RWebS , the name synonymous with Website Maintenance and web support, offers focused services that ensure your website stay well supported, well maintained and give its due. Unless you have a real big team of website designers, HTML programmers, PHP developers, SEO personals or you are all these rolled in you and you have the time, it would be better if you were to outsource your website support and concentrate on your business.
ST@RWebS Annual Statistics
ST@RWebS is the second fastes growing startup in India. We are investing


This test passes if the image below is positioned away from the bottom of the frame.
This test passes if the image below is positioned away from the top of the frame.
This test passes if the image below is positioned at the left of the frame.
This test passes if the image below is positioned out and to the left of the frame.
This test passes if the image below is clipped.


DQ XI S #2 25K
Dates 2019-11-21 to 2019-12-4
Max Laps Unlimited
Lapis Cost per Lap 25000
Base 5★ in EX pool 90
Summary
| 1 Lap | 2 Laps | 3 Laps | 4 Laps | 5 Laps | |
|---|---|---|---|---|---|
|
Probability for
|
62.26% | 85.76% | 94.63% | 97.97% | 99.24% |
|
Probability for 7★
|
21.81% | 55.23% | 77.34% | 89.28% | 95.13% |
|
Probability for STMR
|
0.81% | 9.37% | 27.78% | 49.13% | 67.45% |
Stats per Lap
Pulls and Rates
| Pulls |
Rate
|
Banner Rate
OR
OR
|
Rainbow Rate
|
|---|---|---|---|
| 43 | 1% | 3% | 5% |
| 10 | 1.25% | 3.75% | 7% |
| 1 | 33.333% | 100% | 100% |
| 1 | 1.111% | 3.333% | 100% |
Expected Value
Jasper Unbound
0.9
Banner Rainbows
OR
OR
2.7
Rainbows
4.85
Probability for at least X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 1 | 62.265% | 100% | 100% |
| 2 | 21.807% | 82.198% | 100% |
| 3 | 4.951% | 50.973% | 94.667% |
| 4 | 0.808% | 24.101% | 78.585% |
| 5 | 0.101% | 8.978% | 54.802% |
| 6 | 0.01% | 2.718% | 31.818% |
| 7 | 0.001% | 0.686% | 15.492% |
Probability for exactly X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 0 | 37.735% | 0% | 0% |
| 1 | 40.458% | 17.802% | 0% |
| 2 | 16.856% | 31.225% | 5.333% |
| 3 | 4.143% | 26.872% | 16.083% |
| 4 | 0.707% | 15.124% | 23.783% |
| 5 | 0.091% | 6.26% | 22.985% |
| 6 | 0.009% | 2.032% | 16.326% |
| 7 | 0.001% | 0.539% | 9.087% |
Pulls and Rates
| Pulls |
Rate
|
Banner Rate
OR
OR
|
Rainbow Rate
|
|---|---|---|---|
| 86 | 1% | 3% | 5% |
| 20 | 1.25% | 3.75% | 7% |
| 2 | 33.333% | 100% | 100% |
| 2 | 1.111% | 3.333% | 100% |
Expected Value
Jasper Unbound
1.8
Banner Rainbows
OR
OR
5.4
Rainbows
9.7
Probability for at least X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 1 | 85.761% | 100% | 100% |
| 2 | 55.227% | 100% | 100% |
| 3 | 26.138% | 96.831% | 100% |
| 4 | 9.372% | 85.714% | 100% |
| 5 | 2.644% | 66.396% | 99.716% |
| 6 | 0.607% | 44.23% | 98% |
| 7 | 0.116% | 25.336% | 92.877% |
Probability for exactly X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 0 | 14.239% | 0% | 0% |
| 1 | 30.533% | 0% | 0% |
| 2 | 29.09% | 3.169% | 0% |
| 3 | 16.766% | 11.117% | 0% |
| 4 | 6.727% | 19.317% | 0.284% |
| 5 | 2.037% | 22.166% | 1.715% |
| 6 | 0.491% | 18.895% | 5.123% |
| 7 | 0.097% | 12.761% | 10.101% |
Pulls and Rates
| Pulls |
Rate
|
Banner Rate
OR
OR
|
Rainbow Rate
|
|---|---|---|---|
| 129 | 1% | 3% | 5% |
| 30 | 1.25% | 3.75% | 7% |
| 3 | 33.333% | 100% | 100% |
| 3 | 1.111% | 3.333% | 100% |
Expected Value
Jasper Unbound
2.7
Banner Rainbows
OR
OR
8.09
Rainbows
14.55
Probability for at least X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 1 | 94.627% | 100% | 100% |
| 2 | 77.344% | 100% | 100% |
| 3 | 51.614% | 100% | 100% |
| 4 | 27.782% | 99.436% | 100% |
| 5 | 12.191% | 96.467% | 100% |
| 6 | 4.44% | 88.705% | 100% |
| 7 | 1.367% | 75.261% | 99.985% |
Probability for exactly X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 0 | 5.373% | 0% | 0% |
| 1 | 17.283% | 0% | 0% |
| 2 | 25.73% | 0% | 0% |
| 3 | 23.832% | 0.564% | 0% |
| 4 | 15.591% | 2.969% | 0% |
| 5 | 7.751% | 7.762% | 0% |
| 6 | 3.073% | 13.444% | 0.015% |
| 7 | 1.005% | 17.356% | 0.137% |
Pulls and Rates
| Pulls |
Rate
|
Banner Rate
OR
OR
|
Rainbow Rate
|
|---|---|---|---|
| 172 | 1% | 3% | 5% |
| 40 | 1.25% | 3.75% | 7% |
| 4 | 33.333% | 100% | 100% |
| 4 | 1.111% | 3.333% | 100% |
Expected Value
Jasper Unbound
3.6
Banner Rainbows
OR
OR
10.79
Rainbows
19.4
Probability for at least X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 1 | 97.972% | 100% | 100% |
| 2 | 89.277% | 100% | 100% |
| 3 | 71.67% | 100% | 100% |
| 4 | 49.131% | 100% | 100% |
| 5 | 28.515% | 99.9% | 100% |
| 6 | 14.072% | 99.195% | 100% |
| 7 | 5.963% | 96.735% | 100% |
Probability for exactly X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 0 | 2.028% | 0% | 0% |
| 1 | 8.695% | 0% | 0% |
| 2 | 17.607% | 0% | 0% |
| 3 | 22.539% | 0% | 0% |
| 4 | 20.616% | 0.1% | 0% |
| 5 | 14.443% | 0.705% | 0% |
| 6 | 8.109% | 2.46% | 0% |
| 7 | 3.768% | 5.7% | 0% |
Pulls and Rates
| Pulls |
Rate
|
Banner Rate
OR
OR
|
Rainbow Rate
|
|---|---|---|---|
| 215 | 1% | 3% | 5% |
| 50 | 1.25% | 3.75% | 7% |
| 5 | 33.333% | 100% | 100% |
| 5 | 1.111% | 3.333% | 100% |
Expected Value
Jasper Unbound
4.5
Banner Rainbows
OR
OR
13.49
Rainbows
24.25
Probability for at least X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 1 | 99.235% | 100% | 100% |
| 2 | 95.133% | 100% | 100% |
| 3 | 84.63% | 100% | 100% |
| 4 | 67.452% | 100% | 100% |
| 5 | 47.211% | 100% | 100% |
| 6 | 28.828% | 99.982% | 100% |
| 7 | 15.383% | 99.825% | 100% |
Probability for exactly X units
| X |
Jasper Unbound
|
Banner
OR
OR
|
Rainbows
|
|---|---|---|---|
| 0 | 0.765% | 0% | 0% |
| 1 | 4.102% | 0% | 0% |
| 2 | 10.504% | 0% | 0% |
| 3 | 17.178% | 0% | 0% |
| 4 | 20.241% | 0% | 0% |
| 5 | 18.383% | 0.018% | 0% |
| 6 | 13.445% | 0.157% | 0% |
| 7 | 8.167% | 0.685% | 0% |


HANDY 6
Setup Hadoop
Setup Hadoop 2
Cluster Status
Setup Web Server
Manage Docker Containers
Online Bash
© Invasive Analysts, 2017


The Mission
+Singles Friendly!
Changes in the city caused a crop of Internet startups to spring up around the Potrero Hill side of the Mission, and with them a flock of chic restaurants and bars.
Noe Valley
+Family friendly
Noe Valley is a neighborhood of contradictions. It's home to both liberals and conservatives, it has attracted the working class, dot.com millionaires, Hollywood film crews, and more.
North Beach
+Singles Friendly!
North Beach is best known as San Francisco's Little Italy, with its high density of check-clothed ristorantes, caffes and Old World delicatessens.
Outer Richmond
+Family Friendly!
This spot retains a neighborhood feel along its main shopping streets and prime (albeit foggy) real estate. The many waves of immigrants who have settled have also put their stamp on it.
Parkside
+Family Friendly!
Despite a well-earned reputation as the place fog calls home, there's a lot to explore in this area's three major neighborhoods: the Outer Sunset, Parkside and West Portal.
Park Merced Condos
+Family Friendly!
Southwest San Francisco, 10 miles from downtown. Next to Lake Merced and nearby to Ocean Beach, the San Francisco Zoo, five golf courses, and scenic walking trails.
South Beach
+Singles Friendly!
The South Beach neighborhood encompasses the moderately affluent, medium-density mixed-use blocks which border The Embarcadero and King Street from south of the Bay Bridge down to 3rd Street.
Financial District
+Singles Friendly!
Home to the city's largest concentration of corporate headquarters, law firms, insurance companies, real estate firms, banks, savings and loans, and other financial institutions.
NOPA (Panhandle)
+Family Friendly!
North Panhandle is the 24th most walkable neighborhood in San Francisco with 10,973 residents. North Panhandle has excellent public transportation and is a biker’s paradise.
Laurel Heights
+Family Friendly!
South of the Presidio and east of the Richmond District. Bordered by Geary Boulevard or the University of San Francisco campus to the south.
SoMa
+Singles Friendly!
The neighborhood is a patchwork of warehouses, swanky nightspots, residential hotels, art spaces, loft apartments, furniture showrooms, and tenacious Internet companies.


Hello $salutation $firstName $middleName $lastName !
<% if (shopUrl != null && !shopUrl.isEmpty()) { %>
You or somebody else request new password at "$shopName" shop.
<% } else { %>
You or somebody else request new password at $shopName
<% }%>
New password is $password


X
Home
My Orders
X
Your Cart
| Total amount: ₦
Delivery Details
Address
Phone No
LOADING
X
DeLite Fast Food
Home
My Orders
Login
|
Signup
view cart
clear cart
Menu
No Menu Items Yet.
check back in a bit
X


It was created as a thought experiment with two goals in mind:
As this is a thought experiment, please be aware that there are many alternative ways to traverse object graphs, and that for the most part they are much saner than this one. You have been warned!
Despite that caveat, you can do some interesting and powerful things using this approach.
For more information, read the docs at GitHub.


projects
I am interested in several aspects of Software Engineering. I am particularly interested in devising ways to explore, test and re-engineer software systems. Much of my work is concerned with systems that pose particular problems - poorly documented legacy systems, black-box components, or resource-intensive processes that take a long time to execute and are hard to control.
A list of my main research themes is listed below (they are broadly in order of recent activity). I’m happy to discuss any of these topics, please feel free to get in touch. If I haven’t published in an area for a while, it won’t be because I have lost interest in it! I post some links to research papers below, but please see my publications page for a full list of publications.
Causal inference for software testing
Causal Inference describes a family of statistical techniques that can establish causal relationships between events. They are powerful because they can, with the appropriate guidance, offer a way to work around the criticism of traditional associational statistics, that `correlation does not imply causation’. These techniques offer lots of potential in the context of software testing (e.g. to establish definitively that a particular input configuration causes a particular output, or to reliably establish the cause of a bug).
On this project, we are currently particularly interested in focussing on the challenge of testing computational models and digital twins.
This work is being carried out on the EPSRC-funded CITCOM project, with Rob Hierons, Michael Foster, Andy Clark, and Richard Somers along with Nick Latimer in the Sheffield School for Health and Related Research (ScHaRR) and David Wagg in the department for Mechanical Engineering.
Software
Funding
- 2021-2024 - Causal Inference for Testing Computational Models (CITCoM), PI, funded by EPSRC
Reverse engineering and testing models of software behaviour
Model based software testing is nice in theory, but problematic in practice because the required models are rarely produced to begin with. With the rapid improvement of Machine Learning techniques, it has become possible to take a sample of program executions and to infer models from these. Once a model exists, this can in turn be used to `test’ (or at least explore) the behaviour of the system under test, and so a virtuous cycle emerges.
This idea isn’t mine (it was possibly Elaine Weyuker’s, who published the idea in 1983). It does however raise some important challenges. How does one infer a useful model from sets of traces, perhaps some of which lead to failures (or turn out to be infeasible)? How does one select suitable test cases from an inferred model? Etc.
On the model inference front, much of this has focussed on approaches to infer state machines for reactive systems (e.g. for testing GUIs, or network protocols). I have developed several inference techniques, for finite state machines with guards (EFSMs), and variants of those that also include complete transition functions, inferred using Genetic Programming.
It hasn’t all revolved around state machines and reactive systems though. I’ve been interested in automatically testing non-interactive black-box programs that constitute simpler functions that take a set of parameters and return a value. My Ph.D. student Tom Gransden at Leicester also investigated the use of this technology to automate proofs in Coq.
Aside from the specific question of how to infer a model, there is also the broader question of how to pick useful test cases once a model has been inferred. It is in this context that, together with Gordon Fraser, I have been investigating uncertainty (in its various forms) as a basis for driving test selection and assessing test adequacy.
Funding
- October 2012 – May 2013 BATS (Building Adequate Test Sets by Reverse Engineering), PI, funded by DSTL.
- July 2009 – June 2012 StaMInA (A Novel Competition to Drive the Comparative Evaluation of State Machines), Researcher Co-investigator, funded by EPSRC
- April 2009 – September 2012 REGI (Reverse Engineering State Machines by Grammar Inference), Researcher Co-investigator, funded by EPSRC
Uncertainty (or doubt, or ignorance) in Software Engineering
Software engineers are often uncertain about the software they are developing or maintaining. This is unavoidable for any non-trivial system. I am particularly interested in the challenge of quantifying, communicating and managing this uncertainty.
My interest in this started in 2013 when I tried to develop techniques to support the assessment of software systems in terms of their quality or safety. This requires the assessor to ultimately arrive at some assessment (e.g. to state that some safety process has been diligently followed during the construction of the system). Of course, these statements are often subject to some inherent uncertainty. To address this, I adopted an uncertainty-based reasoning technique known as Evidential Reasoning, first to reason about software quality, then specifically to support safety arguments for safety-critical systems.
Recently, I have taken an interest in using these techniques to capture and reason about uncertainty in the context of empirical software engineering. Together with Martin Shepperd this involved the use of Subjective Logic to capture the uncertainty associated with (replications of) empirical studies, to systematically reason about the uncertainty associated with their conclusions. Having found Subjective Logic an especially interesting framework, I am currently working on its use as a basis in the context of software testing.
Funding
- 2016 - Evidential Reasoning for Radiological Detection, AWE (PI)
- 2016 - Trustworthiness Level Determination and Aggregation for Operation of Autonomous Vehicles, DSTL ASUR programme (PI for Leicester), joint with Qinetiq and Fraser Nash Consulting
- 2015 - EVIRE (An Evidence-Driven Reasoning Framework to Support the Transparent Control, Verification, and Validation of Autonomous Systems), DSTL ASUR programme (PI for Leicester).


Two rest services are deployed:
A simple Pojo one:
http://localhost:8080/cimweb/cim/pojo
An EJB one:
http://localhost:8080/cimweb/cim/ejb
Both are defined to be deployed through the ApplicationConfig class.


Html Webpack Plugin:
EntryModuleNotFoundError: Entry module not found: Error: Can't resolve 'C:\Users\User\Desktop\couponer\client\src\index.html' in 'C:\Users\User\Desktop\couponer\client' - Compilation.js:971 moduleFactory.create [client]/[webpack]/lib/Compilation.js:971:31 - NormalModuleFactory.js:397 factory [client]/[webpack]/lib/NormalModuleFactory.js:397:22 - NormalModuleFactory.js:130 resolver [client]/[webpack]/lib/NormalModuleFactory.js:130:21 - NormalModuleFactory.js:224 asyncLib.parallel [client]/[webpack]/lib/NormalModuleFactory.js:224:22 - async.js:2817 [client]/[neo-async]/async.js:2817:7 - async.js:6783 [client]/[neo-async]/async.js:6783:13 - NormalModuleFactory.js:214 normalResolver.resolve [client]/[webpack]/lib/NormalModuleFactory.js:214:25 - Resolver.js:184 doResolve [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:184:12 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - UnsafeCachePlugin.js:37 resolver.doResolve [client]/[webpack]/[enhanced-resolve]/lib/UnsafeCachePlugin.js:37:5 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - DescriptionFilePlugin.js:42 resolver.doResolve [client]/[webpack]/[enhanced-resolve]/lib/DescriptionFilePlugin.js:42:38 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - DescriptionFilePlugin.js:42 resolver.doResolve [client]/[webpack]/[enhanced-resolve]/lib/DescriptionFilePlugin.js:42:38 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - Resolver.js:238 hook.callAsync [client]/[webpack]/[enhanced-resolve]/lib/Resolver.js:238:5 - DirectoryExistsPlugin.js:22 fs.stat [client]/[webpack]/[enhanced-resolve]/lib/DirectoryExistsPlugin.js:22:13 - CachedInputFileSystem.js:73 process.nextTick [client]/[webpack]/[enhanced-resolve]/lib/CachedInputFileSystem.js:73:15 - next_tick.js:131 _combinedTickCallback internal/process/next_tick.js:131:7 - next_tick.js:180 process._tickCallback internal/process/next_tick.js:180:9


Check the status: press the 4 o’clock button to view the Bluetooth state, the light at 12 o’clock flash 2 times means that the watch is not connected with the mobile phone; the 12 o’clock light for 2 seconds means that the watch is connected with the phone; if the light does not on or flash means the Bluetooth of watch is not open.
Open Bluetooth: when the watch is in the power-saving mode or Bluetooth off, press and hold the 4 o’clock button about 2 seconds to open the Bluetooth.
Hang up the phone: When there is a phone call, press the 4 o'clock button to hang up the phone when the watch is connected.
Remote control camera: when the watch is connected with the mobile phone, long press 4 o’clock button for about 2 seconds to enter into the remote camera mode, and then open the phone camera, press the 4 o’clock button or turn the wrist to take photos.
The watch will automatically synchronize the phone time, if the watch pointer is not accurate, you can pull out the 3 o'clock watch crown, turn the crown to adjust the hour hand and minute hand; after the watch time is same as the mobile phone time, push back the crown, then the watch pointer will automatically catch the correct time. There is a small dial on the watch, pull out the crown, pressing the 2 o’clock button to control the small dial pointer rotation, turn the circle pointer in the small dial point at 12 o’clock position, push back the crown, the small pointer automatically catch the correct week. When message reminds, the circle pointer in the small dial will automatically point to the relative reminder. In the case of cross time zone, when the watch is connected to the mobile phone APP, the watch will automatically synchronize to the new time zone.
Frequently Question and Answer：
Q: After the mobile phone time is changed, the watch does not change the time automatically.
A: Open the mobile phone app in the foreground, and make sure that the watch is connected with the phone App, wait for about 10 seconds; the watch will automatically match the time with the phone. If testing the automatic calibration function, please manually change the phone time or time zone while the APP is connected to the watch, and the watch will automatically follow the time.
Q: When connected with iPhone, no reminder or no remote control camera, the reason is that the watch is not paired with iPhone Bluetooth.
A: Open the mobile phone flight mode about 10 seconds and then closed. If the phenomenon still exists after re-connected, long press the 4 o’clock button for over 7 seconds to restart the watch.
Q: The watch is connected with Android mobile phone but not paired.
A: Restart the phone Bluetooth to re-search and re-connect.
Q: The watch is paired with the Android phone but can not remote control camera.
A: Enter the Bluetooth device details to see if the device is checked for the input device, if yes, turn on the phone camera to change the camera button for the volume key control or click to take pictures. (Some Android phone models do not support input devices)
Q: Watches connected to Android phone but no reminder.
A: Check the phone app that the call reminder and message reminder are open or not;
Add the phone app to the mobile phone trust list (part of phone security assistant will be shielded);
Check the reminder switch in the phone notification bar is open to the phone app or not.
Q: Other abnormal conditions, such as Bluetooth light continue to light or continuous flashing and so on.
A: Long press the 4 o’clock button for over 7 seconds to restart the watch;
Invalid operation, open the watch back cover and press the reset button.


--- layout: post title: The Art of Cold Calling (Updated) date: 2013-11-21 time: "15:00:00" favorite: true root: ../../.. tags: ["Bootcamps"] ---
This is an update to an earlier post about how to approach potential bootcamp hosts.
Newly-trained instructors have asked how we go about approaching potential workshop hosts. The short answer is, however we can. The longer answer is, we collect names from journal articles, our Twitter followers, people we bump into at conference, or (increasingly) people who've been through bootcamps, then send emails like the one below. But there's an art to it:
It's worked pretty well for us:
If you'd like to give this a try (i.e., email someone on behalf of Software Carpentry to try to start setting something up for 2014), we'd be happy to proofread your mail before it goes out. Here's a template:
Hi,
I hope you don't mind mail out of the blue, but I saw your recent paper on building a computational materials repository, and was wondering if you'd be interested having us run a Software Carpentry workshop for your intended users. We're scheduling workshops for the coming year right now, and it might be a way to help your community get more out of what you're doing.
Software Carpentry's aim is to teach researchers (usually graduate students) basic computing concepts and skills so that they can get more done in less time and with less pain. Our usual two-day curriculum includes:
We're funded by the Sloan Foundation and Mozilla, and our instructors are volunteers, so the only cost to host sites is their travel and accommodation plus a $1500 contribution toward central costs (such as instructor training and curriculum development). We aim for 40 people per workshop, and look for 2-3 local helpers to assist during practicals; we can handle registration through EventBrite, or leave it in hosts' hands. Two independent assessments have confirmed that what we're doing actually helps, so if this sounds interesting, we'd welcome a chance to chat at greater length.
Thanks for your time --- we look forward to hearing from you.
Dr. Greg Wilson
<EMAIL_ADDRESS>http://software-carpentry.org


TryLockMutex()
语法
Result = TryLockMutex(Mutex)概要
Tries to lock the specified mutex. Unlike LockMutex(), this function does not stop execution until the mutex is available. It returns immediately and the return-value indicates if the lock was successful or not. This is useful in situations were the thread should not wait for the mutex to be available but rather do other things in the meantime.
参数
Mutex The mutex to lock.
返回值
Nonzero if the mutex was successfully locked, zero otherwise.
备注
If the lock was successful, the UnlockMutex() function must be called to make the mutex available to other threads again. If this is not done, this could easily lead to a lockup situation.
示例
Procedure ThreadProcedure(*Value) Shared Mutex Repeat If TryLockMutex(Mutex) PrintN("Mutex successfully locked.") UnlockMutex(Mutex) Break ; quit the loop and thread Else PrintN("Still waiting for mutex access...") Delay(200) ForEver EndProcedure OpenConsole() Mutex = CreateMutex() LockMutex(Mutex) ; main program has the mutex locked at first Thread = CreateThread(@ThreadProcedure(), 0) Delay(4000) UnlockMutex(Mutex) ; now release the mutex, so the thread can get it Input()
参阅
UnlockMutex()
已支持操作系统
所有


| Home | Trees | Indices | Help |
|
|---|
|
|
object --+ | NOESpectrum
Describes an NOE spectrum.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| iterable of int |
|
||
| EnumItem |
|
||
| bool |
|
||
| bool |
|
||
|
Inherited from |
| Static Methods | |||
| NOESpectrum |
|
| Properties | |
| tuple of EnumItem |
dimensions Tuple of all dimensions (nucleus types) |
| float |
max_intensity Maximum intensity |
| float |
min_intensity Minimum intensity |
| int |
num_dimensions Number of dimensions |
| int |
num_proton_dimensions Number of proton dimensions |
| tuple of int |
proton_dimensions Tuple of all proton dimension indices |
|
Inherited from |
| Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
str(x)
|
Add a new NOE peak.
|
Mark dimensions with indices
|
Return a list of all dimension indices, covalently connected to
dimension
|
Return True of dimension index
|
Return True if the spectrum contains a dimension of the specified type
|
Merge multiple NOESpectrum instances. All
|
| Property Details |
dimensionsTuple of all dimensions (nucleus types)
|
max_intensityMaximum intensity
|
min_intensityMinimum intensity
|
num_dimensionsNumber of dimensions
|
num_proton_dimensionsNumber of proton dimensions
|
proton_dimensionsTuple of all proton dimension indices
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue Jul 4 20:19:05 2017 | http://epydoc.sourceforge.net |


---
layout: post
title: Nutella
date: '2015-11-04T18:30:21+01:00'
categories:
- Storyboards
vimeo-id: 150263746
picture_url: https://film-Storyboards.tumblr.com/post/132568537888/production-mad-director-brent-bonacorso
---
Production: MAD Director: Brent Bonacorso
Nutella, "le petit garçon" Storyboard, first rough.


Play now for free
You will be playing the games of two brothers that played together countless games on Super Nintendo, Playstation 1 and Playstation 2. Now we hope to bring to our games, the joy we felt playing the two genres we like the most: Platformers and Fighting Games.
Those are the three main principles of our games!
The games we love playing and inspire us are: Super Ghouls'n Ghosts, Megaman X, Megaman X4 Zero, Super Smash Bros, Celeste, The Messenger, Street Fighter, Marvel vs Capcom, Castlevania Symphony of the Night, and others.


{% extends 'layout.html' %} {% block pageTitle %} Change the way you design and build things - Inclusive and equitable NHS services {% endblock %} {% block beforeContent %} {{ breadcrumb({ items: [ { href: "/index", text: "Home" } ] }) }} {% endblock %} {% block content %}
Involve your users or charities that represent them. You may be able to draw on internal staff networks.
When we co-design, we share power more equally. Share power at every stage of your project: in research, decision-making, design, delivery and evaluation. Make it an ongoing conversation.
We designed a new video player, so that it could show British Sign Language (BSL) versions of videos. We worked with our internal Deaf and hard of hearing group and with charities and iterated our prototypes with them.


Built-In Namespace Array
| Method Attributes | Method Name and Description |
|---|---|
|
every(fun, thisp)
Invokes `fun` on each element of the array and returns true if every
invocation of `fun` returns true or returns a truthy value.
|
|
|
filter(fun, thisp)
Applies `fun` to each element of the array and returns a new array of all
the values for which `fun` returned `true`.
|
|
|
forEach(fun, thisp)
Invokes `fun` on each element of the array in turn.
|
|
|
indexOf(searchElement, fromIndex)
Compares elements in the array with `searchElement` using strict equality
(===).
|
|
|
lastIndexOf(searchElement, fromIndex)
Compares elements in the array with `searchElement` using strict equality
(===).
|
|
|
map(fun, thisp)
Invokes `fun` on each element of the array and returns a new array of the
results of each application.
|
|
|
reduce(fun, initial)
Applies `fun` to `initial` and the first element of the array, and then to the
result and the second element, and so on.
|
|
|
reduceRight(fun, initial)
Applies `fun` to `initial` and the last element of the array, and then to
the result and the second-to-last element, and so on.
|
|
|
some(fun, thisp)
Invokes `fun` on each element of the array and returns true if at least one
invocation of `fun` returns true or returns a truthy value.
|
Invokes fun
on each element of the array and returns true if every
invocation of fun
returns true or returns a truthy value. Otherwise
returns false.
The first argument given to fun
is a single array element and the second
argument is the index of that element in the array.
This definition is compatible with the JavaScript 1.6 definition for
Array#every
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5Reference/GlobalObjects/Array/every
Defined in: array.js.
- Parameters:
- {Function} fun
- predicate function that will be applied to each array element
- {Object} thisp Optional
- context in which `fun` will be invoked - `this` in `fun` will refer to `thisp`
- Returns:
- {Boolean} true if `fun` returned true for every array element, false otherwise
Applies fun
to each element of the array and returns a new array of all
the values for which fun
returned true
.
The first argument given to fun
is a single array element and the second
argument is the index of that element in the array.
This definition is compatible with the JavaScript 1.6 definition for
Array#filter
in Spidermonkey and with the definition in the Prototype library.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5Reference/GlobalObjects/Array/filter
Defined in: array.js.
- Parameters:
- {Function} fun
- predicate function that will be applied to each array element
- {Object} thisp Optional
- context in which `fun` will be invoked - `this` in `fun` will refer to `thisp`
- Returns:
- {Array} a new array containing only the elements for which `fun` return true
Invokes fun
on each element of the array in turn.
The first argument given to fun
is a single array element and the second
argument is the index of that element in the array.
This definition is compatible with the JavaScript 1.6 definition for
Array#forEach
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/forEach
Defined in: array.js.
- Parameters:
- {Function} fun
- function that will be applied to each array element
- {Object} thisp Optional
- context in which `fun` will be invoked - `this` in `fun` will refer to `thisp`
Compares elements in the array with searchElement
using strict equality
(===). If any element matches searchElement
the lowest matching index is
returned. Otherwise -1 is returned.
You can optionally restrict the search by passing a fromIndex
argument.
This definition is compatible with the JavaScript 1.6 definition for
Array#indexOf
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5Reference/GlobalObjects/Array/indexOf
Defined in: array.js.
- Parameters:
- {any} searchElement
- element to search for within the array
- {number} fromIndex Optional
- index at which to begin search
- Returns:
- {number} the index of the matching element if one is found, -1 otherwise
Compares elements in the array with searchElement
using strict equality
(===). If any element matches searchElement
the highest matching index is
returned. Otherwise -1 is returned.
You can optionally restrict the search by passing a fromIndex
argument.
This definition is compatible with the JavaScript 1.6 definition for
Array#indexOf
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5Reference/GlobalObjects/Array/indexOf
Defined in: array.js.
- Parameters:
- {any} searchElement
- element to search for within the array
- {number} fromIndex Optional
- index at which to begin search
- Returns:
- {number} the index of the matching element if one is found, -1 otherwise
Invokes fun
on each element of the array and returns a new array of the
results of each application.
The first argument to fun
is a single array
element and the second argument is the index of that element in the array.
This definition is compatible with the JavaScript 1.6 definition for
Array#map
in Spidermonkey and with the definition in the Prototype library.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5Reference/GlobalObjects/Array/map
Defined in: array.js.
- Parameters:
- {Function} fun
- function that will be applied to each array element
- {Object} thisp Optional
- context in which `fun` will be invoked - `this` in `fun` will refer to `thisp`
- Returns:
- {Array} a new array made up of the return values of every invocation of `fun`
Applies fun
to initial
and the first element of the array, and then to the
result and the second element, and so on. Returns the result of applying
fun
to the accumulated value and the last element of the array.
fun
is given four arguments:
- the result of the previous invocation of `fun`, or the initial value on the first invocation
- a single array element
- the index of that element in the array
- the original array
The 'reduce' algorithm is also known as 'fold' and 'inject'.
This definition is not compatible with the definitions of Array#reduce
or Array#inject
in the Prototype library. However it is compatible with
the JavaScript 1.6 definition of Array#reduce
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/En/CoreJavaScript1.5Reference/GlobalObjects/Array/Reduce
Defined in: array.js.
- Parameters:
- {Function} fun
- function that will be applied to each array element
- {any} initial Optional
- initial value; defaults to the first array element
- Returns:
- {any} the return value from the last invocation of `fun`
Applies fun
to initial
and the last element of the array, and then to
the result and the second-to-last element, and so on. Returns the result of
applying fun
to the accumulated value and the first element of the array.
fun
is given four arguments:
- the result of the previous invocation of `fun`, or the initial value on the first invocation
- a single array element
- the index of that element in the array
- the original array
This method behaves identically to Array#reduce except that it performs a right-reduce instead of a left-reduce.
This definition is compatible with the JavaScript 1.6 definition of
Array#reduceRight
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/En/CoreJavaScript1.5Reference/GlobalObjects/Array/Reduce
Defined in: array.js.
- Parameters:
- {Function} fun
- function that will be applied to each array element
- {any} initial Optional
- initial value; defaults to the last array element
- Returns:
- {any} the return value from the last invocation of `fun`
Invokes fun
on each element of the array and returns true if at least one
invocation of fun
returns true or returns a truthy value. Otherwise
returns false.
The first argument given to fun
is a single array element and the second
argument is the index of that element in the array.
This definition is compatible with the JavaScript 1.6 definition for
Array#every
in Spidermonkey.
This implementation comes from: https://developer.mozilla.org/en/CoreJavaScript1.5Reference/GlobalObjects/Array/some
Defined in: array.js.
- Parameters:
- {Function} fun
- predicate function that will be applied to each array element
- {Object} thisp Optional
- context in which `fun` will be invoked - `this` in `fun` will refer to `thisp`
- Returns:
- {Boolean} true if `fun` returned true for some array element, false otherwise


John Doe New message received 3 minutes ago
Michael Smith New message received 18 minutes ago
John Lenons New message received Yesterday, 18:27
John Doe User registration 3 minutes ago
Michael Cox Task 2 completed 12 minutes ago
Michelle Dolores New job completed 35 minutes ago
Settings 1
Settings 2
Settings 3


All screenshots are captured with Greenshot; the Greenshot editor was used to add the Drop Shadow effekt.
For which project do you use WETATOR?
Project name
Project programming language(s)
JAVA
JavaScript
C#
other
What do you think about WETATOR?
WETATOR is
amazing
visionary
marvelous
WETATOR makes
Click
Show details
Set
Your profession
Upload your resume
Donate for WETATOR development
Please improve
Payment Options
Amount
execution speed
more commands
WTE
documentation
web site
Mastercard
Visa
American Express
Paypal
10 €
100 €
1000 €
10000 €
10000= €
1000000 €
Layout
Foreground
Red
Green
Blue
Orange
Gray
Background
Red
Green
Blue
Orange
Gray
Payment
Credit card no
-
-
-
Confirm
Tables
Id
Item
Price
Quantity
Total
1
Charles Web Proxy
42
€
84
€
✖
2
JProfiler
4711
€
4711
€
✖
3
WETATOR
1
beer
7
beer
✖


servREG
(service in module tri
)
Registration service for application tables.
Note that two formats for the table is used internally. The first, the static object definition, is a reference to the static Javascript definition. The second, the
Return specific table whose recTitle
is called sTable
sTable – {string} –
{Object}
– of table or null
Return array of registered tables
{Object[]}
– of registered tables
Register tab (static object form)
tab – {Object} –


public interface WorkerEvent
| Modifier and Type | Interface and Description |
|---|---|
static interface |
WorkerEvent.EventType |
| Modifier and Type | Method and Description |
|---|---|
WorkerEvent.EventType |
getEventType()
Returns the type of event.
|
Exception |
getException()
Returns any exceptions thrown while processing the work.
|
Integer |
getId()
Returns the client-unique id for the communication with the Cyc server.
|
float |
getPercentComplete()
Returns the percentage complete, or negative if the SubL code does not
maintain this information.
|
WorkerStatus |
getStatus()
Returns the worker status appropriate for this event.
|
Object |
getWork()
Returns the work (or subset if incrementally collecting results), that has
been produced by the Worker.
|
Worker |
getWorker()
Returns the worker that generated this event.
|
String |
toString()
Returns a string representation of the Worker.
|
String |
toString(int indentLength)
Returns a string representation of the Worker.
|
WorkerEvent.EventType getEventType()
Exception getException()
Integer getId()
float getPercentComplete()
WorkerStatus getStatus()
Object getWork()
Worker getWorker()
String toString()
String toString(int indentLength)
indentLength
- the number of spaces to preceed each line of output
StringCopyright © 2013–2015 Cycorp, Inc. All rights reserved.


# Licensed under a 3-clause BSD style license - see LICENSE.rst
""" This module contains helper functions for accessing, downloading, and
caching data files.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..extern import six
from ..extern.six.moves import urllib
import atexit
import contextlib
import fnmatch
import hashlib
import os
import io
import shutil
import socket
import sys
import time
from tempfile import NamedTemporaryFile, gettempdir
from warnings import warn
from .. import config as _config
from ..utils.exceptions import AstropyWarning
__all__ = [
'Conf', 'conf', 'get_readable_fileobj', 'get_file_contents',
'get_pkg_data_fileobj', 'get_pkg_data_filename',
'get_pkg_data_contents', 'get_pkg_data_fileobjs',
'get_pkg_data_filenames', 'compute_hash', 'clear_download_cache',
'CacheMissingWarning', 'get_free_space_in_dir',
'check_free_space_in_dir', 'download_file',
'download_files_in_parallel']
[docs]class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astropy.utils.data`.
"""
dataurl = _config.ConfigItem(
'http://data.astropy.org/',
'URL for astropy remote data site.')
remote_timeout = _config.ConfigItem(
3.,
'Time to wait for remote data queries (in seconds).',
aliases=['astropy.coordinates.name_resolve.name_resolve_timeout'])
compute_hash_block_size = _config.ConfigItem(
2 ** 16, # 64K
'Block size for computing MD5 file hashes.')
download_block_size = _config.ConfigItem(
2 ** 16, # 64K
'Number of bytes of remote data to download per step.')
download_cache_lock_attempts = _config.ConfigItem(
5,
'Number of times to try to get the lock ' +
'while accessing the data cache before giving up.')
delete_temporary_downloads_at_exit = _config.ConfigItem(
True,
'If True, temporary download files created when the cache is '
'inaccessible will be deleted at the end of the python session.')
conf = Conf()
DATAURL = _config.ConfigAlias(
'0.4', 'DATAURL', 'dataurl')
REMOTE_TIMEOUT = _config.ConfigAlias(
'0.4', 'REMOTE_TIMEOUT', 'remote_timeout')
COMPUTE_HASH_BLOCK_SIZE = _config.ConfigAlias(
'0.4', 'COMPUTE_HASH_BLOCK_SIZE', 'compute_hash_block_size')
DOWNLOAD_CACHE_BLOCK_SIZE = _config.ConfigAlias(
'0.4', 'DOWNLOAD_CACHE_BLOCK_SIZE', 'download_block_size')
DOWNLOAD_CACHE_LOCK_ATTEMPTS = _config.ConfigAlias(
'0.4', 'DOWNLOAD_CACHE_LOCK_ATTEMPTS', 'download_cache_lock_attempts')
DELETE_TEMPORARY_DOWNLOADS_AT_EXIT = _config.ConfigAlias(
'0.4', 'DELETE_TEMPORARY_DOWNLOADS_AT_EXIT', 'delete_temporary_downloads_at_exit')
[docs]class CacheMissingWarning(AstropyWarning):
"""
This warning indicates the standard cache directory is not accessible, with
the first argument providing the warning message. If args[1] is present, it
is a filename indicating the path to a temporary file that was created to
store a remote data download in the absence of the cache.
"""
def _is_url(string):
"""
Test whether a string is a valid URL
Parameters
----------
string : str
The string to test
"""
url = urllib.parse.urlparse(string)
# url[0]==url.scheme, but url[0] is py 2.6-compat
# we can't just check that url[0] is not an empty string, because
# file paths in windows would return a non-empty scheme (e.g. e:\\
# returns 'e').
return url[0].lower() in ['http', 'https', 'ftp', 'sftp', 'ssh', 'file']
def _is_inside(path, parent_path):
# We have to try realpath too to avoid issues with symlinks, but we leave
# abspath because some systems like debian have the absolute path (with no
# symlinks followed) match, but the real directories in different
# locations, so need to try both cases.
return os.path.abspath(path).startswith(os.path.abspath(parent_path)) \
or os.path.realpath(path).startswith(os.path.realpath(parent_path))
@contextlib.contextmanager
[docs]def get_readable_fileobj(name_or_obj, encoding=None, cache=False,
show_progress=True, remote_timeout=None):
"""
Given a filename or a readable file-like object, return a context
manager that yields a readable file-like object.
This supports passing filenames, URLs, and readable file-like
objects, any of which can be compressed in gzip or bzip2.
Notes
-----
This function is a context manager, and should be used for example
as::
with get_readable_fileobj('file.dat') as f:
contents = f.read()
Parameters
----------
name_or_obj : str or file-like object
The filename of the file to access (if given as a string), or
the file-like object to access.
If a file-like object, it must be opened in binary mode.
encoding : str, optional
When `None` (default), returns a file-like object with a
``read`` method that on Python 2.x returns `bytes` objects and
on Python 3.x returns `str` (`unicode`) objects, using
`locale.getpreferredencoding` as an encoding. This matches
the default behavior of the built-in `open` when no ``mode``
argument is provided.
When ``'binary'``, returns a file-like object where its ``read``
method returns `bytes` objects.
When another string, it is the name of an encoding, and the
file-like object's ``read`` method will return `str` (`unicode`)
objects, decoded from binary using the given encoding.
cache : bool, optional
Whether to cache the contents of remote URLs.
show_progress : bool, optional
Whether to display a progress bar if the file is downloaded
from a remote server. Default is `True`.
remote_timeout : float
Timeout for remote requests in seconds (default is the configurable
REMOTE_TIMEOUT, which is 3s by default)
Returns
-------
file : readable file-like object
"""
# close_fds is a list of file handles created by this function
# that need to be closed. We don't want to always just close the
# returned file handle, because it may simply be the file handle
# passed in. In that case it is not the responsibility of this
# function to close it: doing so could result in a "double close"
# and an "invalid file descriptor" exception.
close_fds = []
delete_fds = []
if remote_timeout is None:
# use configfile default
remote_timeout = conf.remote_timeout
# Get a file object to the content
if isinstance(name_or_obj, six.string_types):
if _is_url(name_or_obj):
name_or_obj = download_file(
name_or_obj, cache=cache, show_progress=show_progress,
timeout=remote_timeout)
if six.PY3:
fileobj = io.FileIO(name_or_obj, 'r')
elif six.PY2:
fileobj = open(name_or_obj, 'rb')
close_fds.append(fileobj)
else:
fileobj = name_or_obj
# Check if the file object supports random access, and if not,
# then wrap it in a BytesIO buffer. It would be nicer to use a
# BufferedReader to avoid reading loading the whole file first,
# but that is not compatible with streams or urllib2.urlopen
# objects on Python 2.x.
if not hasattr(fileobj, 'seek'):
fileobj = io.BytesIO(fileobj.read())
# Now read enough bytes to look at signature
signature = fileobj.read(4)
fileobj.seek(0)
if signature[:3] == b'\x1f\x8b\x08': # gzip
import struct
try:
from .compat import gzip
fileobj_new = gzip.GzipFile(fileobj=fileobj, mode='rb')
fileobj_new.read(1) # need to check that the file is really gzip
except (IOError, EOFError): # invalid gzip file
fileobj.seek(0)
fileobj_new.close()
except struct.error: # invalid gzip file on Python 3
fileobj.seek(0)
fileobj_new.close()
else:
fileobj_new.seek(0)
fileobj = fileobj_new
elif signature[:3] == b'BZh': # bzip2
try:
# bz2.BZ2File does not support file objects, only filenames, so we
# need to write the data to a temporary file
tmp = NamedTemporaryFile("wb", delete=False)
tmp.write(fileobj.read())
tmp.close()
delete_fds.append(tmp)
import bz2
fileobj_new = bz2.BZ2File(tmp.name, mode='rb')
fileobj_new.read(1) # need to check that the file is really bzip2
except IOError: # invalid bzip2 file
fileobj.seek(0)
fileobj_new.close()
else:
fileobj_new.seek(0)
close_fds.append(fileobj_new)
fileobj = fileobj_new
# By this point, we have a file, io.FileIO, gzip.GzipFile, or
# bz2.BZ2File instance opened in binary mode (that is, read
# returns bytes). Now we need to, if requested, wrap it in a
# io.TextIOWrapper so read will return unicode based on the
# encoding parameter.
if six.PY3:
needs_textio_wrapper = encoding != 'binary'
elif six.PY2:
needs_textio_wrapper = encoding != 'binary' and encoding is not None
if needs_textio_wrapper:
# A bz2.BZ2File can not be wrapped by a TextIOWrapper,
# so we decompress it to a temporary file and then
# return a handle to that.
import bz2
if isinstance(fileobj, bz2.BZ2File):
tmp = NamedTemporaryFile("wb", delete=False)
data = fileobj.read()
tmp.write(data)
tmp.close()
delete_fds.append(tmp)
if six.PY3:
fileobj = io.FileIO(tmp.name, 'r')
elif six.PY2:
fileobj = open(tmp.name, 'rb')
close_fds.append(fileobj)
# On Python 2.x, we need to first wrap the regular `file`
# instance in a `io.FileIO` object before it can be
# wrapped in a `TextIOWrapper`. We don't just create an
# `io.FileIO` object in the first place, because we can't
# get a raw file descriptor out of it on Python 2.x, which
# is required for the XML iterparser.
if six.PY2 and isinstance(fileobj, file):
fileobj = io.FileIO(fileobj.fileno())
fileobj = io.BufferedReader(fileobj)
fileobj = io.TextIOWrapper(fileobj, encoding=encoding)
# Ensure that file is at the start - io.FileIO will for
# example not always be at the start:
# >>> import io
# >>> f = open('test.fits', 'rb')
# >>> f.read(4)
# 'SIMP'
# >>> f.seek(0)
# >>> fileobj = io.FileIO(f.fileno())
# >>> fileobj.tell()
# 4096L
fileobj.seek(0)
try:
yield fileobj
finally:
for fd in close_fds:
fd.close()
for fd in delete_fds:
os.remove(fd.name)
[docs]def get_file_contents(name_or_obj, encoding=None, cache=False):
"""
Retrieves the contents of a filename or file-like object.
See the `get_readable_fileobj` docstring for details on parameters.
Returns
-------
content
The content of the file (as requested by ``encoding``).
"""
with get_readable_fileobj(name_or_obj, encoding, cache) as f:
return f.read()
[docs]def get_pkg_data_fileobj(data_name, encoding=None, cache=True):
"""
Retrieves a data file from the standard locations for the package and
provides the file as a file-like object that reads bytes.
Parameters
----------
data_name : str
Name/location of the desired data file. One of the following:
* The name of a data file included in the source
distribution. The path is relative to the module
calling this function. For example, if calling from
``astropy.pkname``, use ``'data/file.dat'`` to get the
file in ``astropy/pkgname/data/file.dat``. Double-dots
can be used to go up a level. In the same example, use
``'../data/file.dat'`` to get ``astropy/data/file.dat``.
* If a matching local file does not exist, the Astropy
data server will be queried for the file.
* A hash like that produced by `compute_hash` can be
requested, prefixed by 'hash/'
e.g. 'hash/395dd6493cc584df1e78b474fb150840'. The hash
will first be searched for locally, and if not found,
the Astropy data server will be queried.
encoding : str, optional
When `None` (default), returns a file-like object with a
``read`` method that on Python 2.x returns `bytes` objects and
on Python 3.x returns `str` (`unicode`) objects, using
`locale.getpreferredencoding` as an encoding. This matches
the default behavior of the built-in `open` when no ``mode``
argument is provided.
When ``'binary'``, returns a file-like object where its ``read``
method returns `bytes` objects.
When another string, it is the name of an encoding, and the
file-like object's ``read`` method will return `str` (`unicode`)
objects, decoded from binary using the given encoding.
cache : bool
If True, the file will be downloaded and saved locally or the
already-cached local copy will be accessed. If False, the
file-like object will directly access the resource (e.g. if a
remote URL is accessed, an object like that from
`urllib2.urlopen` on Python 2 or `urllib.request.urlopen` on
Python 3 is returned).
Returns
-------
fileobj : file-like
An object with the contents of the data file available via
``read`` function. Can be used as part of a ``with`` statement,
automatically closing itself after the ``with`` block.
Raises
------
urllib2.URLError, urllib.error.URLError
If a remote file cannot be found.
IOError
If problems occur writing or reading a local file.
Examples
--------
This will retrieve a data file and its contents for the `astropy.wcs`
tests::
from astropy.utils.data import get_pkg_data_fileobj
with get_pkg_data_fileobj('data/3d_cd.hdr') as fobj:
fcontents = fobj.read()
This would download a data file from the astropy data server
because the ``standards/vega.fits`` file is not present in the
source distribution. It will also save the file locally so the
next time it is accessed it won't need to be downloaded.::
from astropy.utils.data import get_pkg_data_fileobj
with get_pkg_data_fileobj('standards/vega.fits') as fobj:
fcontents = fobj.read()
This does the same thing but does *not* cache it locally::
with get_pkg_data_fileobj('standards/vega.fits', cache=False) as fobj:
fcontents = fobj.read()
See Also
--------
get_pkg_data_contents : returns the contents of a file or url as a bytes object
get_pkg_data_filename : returns a local name for a file containing the data
"""
datafn = _find_pkg_data_path(data_name)
if os.path.isdir(datafn):
raise IOError("Tried to access a data file that's actually "
"a package data directory")
elif os.path.isfile(datafn): # local file
return get_readable_fileobj(datafn, encoding=encoding)
else: # remote file
return get_readable_fileobj(conf.dataurl + datafn, encoding=encoding,
cache=cache)
[docs]def get_pkg_data_filename(data_name, show_progress=True, remote_timeout=None):
"""
Retrieves a data file from the standard locations for the package and
provides a local filename for the data.
This function is similar to `get_pkg_data_fileobj` but returns the
file *name* instead of a readable file-like object. This means
that this function must always cache remote files locally, unlike
`get_pkg_data_fileobj`.
Parameters
----------
data_name : str
Name/location of the desired data file. One of the following:
* The name of a data file included in the source
distribution. The path is relative to the module
calling this function. For example, if calling from
``astropy.pkname``, use ``'data/file.dat'`` to get the
file in ``astropy/pkgname/data/file.dat``. Double-dots
can be used to go up a level. In the same example, use
``'../data/file.dat'`` to get ``astropy/data/file.dat``.
* If a matching local file does not exist, the Astropy
data server will be queried for the file.
* A hash like that produced by `compute_hash` can be
requested, prefixed by 'hash/'
e.g. 'hash/395dd6493cc584df1e78b474fb150840'. The hash
will first be searched for locally, and if not found,
the Astropy data server will be queried.
show_progress : bool, optional
Whether to display a progress bar if the file is downloaded
from a remote server. Default is `True`.
remote_timeout : float
Timeout for the requests in seconds (default is the
configurable `astropy.utils.data.Conf.remote_timeout`, which
is 3s by default)
Raises
------
urllib2.URLError, urllib.error.URLError
If a remote file cannot be found.
IOError
If problems occur writing or reading a local file.
Returns
-------
filename : str
A file path on the local file system corresponding to the data
requested in ``data_name``.
Examples
--------
This will retrieve the contents of the data file for the `astropy.wcs`
tests::
from astropy.utils.data import get_pkg_data_filename
fn = get_pkg_data_filename('data/3d_cd.hdr')
with open(fn) as f:
fcontents = f.read()
This retrieves a data file by hash either locally or from the astropy data
server::
from astropy.utils.data import get_pkg_data_filename
fn = get_pkg_data_filename('hash/da34a7b07ef153eede67387bf950bb32')
with open(fn) as f:
fcontents = f.read()
See Also
--------
get_pkg_data_contents : returns the contents of a file or url as a bytes object
get_pkg_data_fileobj : returns a file-like object with the data
"""
data_name = os.path.normpath(data_name)
if remote_timeout is None:
# use configfile default
remote_timeout = conf.remote_timeout
if data_name.startswith('hash/'):
# first try looking for a local version if a hash is specified
hashfn = _find_hash_fn(data_name[5:])
if hashfn is None:
return download_file(
conf.dataurl + data_name, cache=True,
show_progress=show_progress,
timeout=remote_timeout)
else:
return hashfn
else:
datafn = _find_pkg_data_path(data_name)
if os.path.isdir(datafn):
raise IOError("Tried to access a data file that's actually "
"a package data directory")
elif os.path.isfile(datafn): # local file
return datafn
else: # remote file
return download_file(
conf.dataurl + data_name, cache=True,
show_progress=show_progress,
timeout=remote_timeout)
[docs]def get_pkg_data_contents(data_name, encoding=None, cache=True):
"""
Retrieves a data file from the standard locations and returns its
contents as a bytes object.
Parameters
----------
data_name : str
Name/location of the desired data file. One of the following:
* The name of a data file included in the source
distribution. The path is relative to the module
calling this function. For example, if calling from
``astropy.pkname``, use ``'data/file.dat'`` to get the
file in ``astropy/pkgname/data/file.dat``. Double-dots
can be used to go up a level. In the same example, use
``'../data/file.dat'`` to get ``astropy/data/file.dat``.
* If a matching local file does not exist, the Astropy
data server will be queried for the file.
* A hash like that produced by `compute_hash` can be
requested, prefixed by 'hash/'
e.g. 'hash/395dd6493cc584df1e78b474fb150840'. The hash
will first be searched for locally, and if not found,
the Astropy data server will be queried.
* A URL to some other file.
encoding : str, optional
When `None` (default), returns a file-like object with a
``read`` method that on Python 2.x returns `bytes` objects and
on Python 3.x returns `str` (`unicode`) objects, using
`locale.getpreferredencoding` as an encoding. This matches
the default behavior of the built-in `open` when no ``mode``
argument is provided.
When ``'binary'``, returns a file-like object where its ``read``
method returns `bytes` objects.
When another string, it is the name of an encoding, and the
file-like object's ``read`` method will return `str` (`unicode`)
objects, decoded from binary using the given encoding.
cache : bool
If True, the file will be downloaded and saved locally or the
already-cached local copy will be accessed. If False, the
file-like object will directly access the resource (e.g. if a
remote URL is accessed, an object like that from
`urllib2.urlopen` on Python 2 or `urllib.request.urlopen` on
Python 3 is returned).
Returns
-------
contents : bytes
The complete contents of the file as a bytes object.
Raises
------
urllib2.URLError, urllib.error.URLError
If a remote file cannot be found.
IOError
If problems occur writing or reading a local file.
See Also
--------
get_pkg_data_fileobj : returns a file-like object with the data
get_pkg_data_filename : returns a local name for a file containing the data
"""
with get_pkg_data_fileobj(data_name, encoding=encoding, cache=cache) as fd:
contents = fd.read()
return contents
[docs]def get_pkg_data_filenames(datadir, pattern='*'):
"""
Returns the path of all of the data files in a given directory
that match a given glob pattern.
Parameters
----------
datadir : str
Name/location of the desired data files. One of the following:
* The name of a directory included in the source
distribution. The path is relative to the module
calling this function. For example, if calling from
``astropy.pkname``, use ``'data'`` to get the
files in ``astropy/pkgname/data``.
* Remote URLs are not currently supported.
pattern : str, optional
A UNIX-style filename glob pattern to match files. See the
`glob` module in the standard library for more information.
By default, matches all files.
Returns
-------
filenames : iterator of str
Paths on the local filesystem in *datadir* matching *pattern*.
Examples
--------
This will retrieve the contents of the data file for the `astropy.wcs`
tests::
from astropy.utils.data import get_pkg_data_filenames
for fn in get_pkg_data_filename('maps', '*.hdr'):
with open(fn) as f:
fcontents = f.read()
"""
path = _find_pkg_data_path(datadir)
if os.path.isfile(path):
raise IOError(
"Tried to access a data directory that's actually "
"a package data file")
elif os.path.isdir(path):
for filename in os.listdir(path):
if fnmatch.fnmatch(filename, pattern):
yield os.path.join(path, filename)
else:
raise IOError("Path not found")
[docs]def get_pkg_data_fileobjs(datadir, pattern='*', encoding=None):
"""
Returns readable file objects for all of the data files in a given
directory that match a given glob pattern.
Parameters
----------
datadir : str
Name/location of the desired data files. One of the following:
* The name of a directory included in the source
distribution. The path is relative to the module
calling this function. For example, if calling from
``astropy.pkname``, use ``'data'`` to get the
files in ``astropy/pkgname/data``
* Remote URLs are not currently supported
pattern : str, optional
A UNIX-style filename glob pattern to match files. See the
`glob` module in the standard library for more information.
By default, matches all files.
encoding : str, optional
When `None` (default), returns a file-like object with a
``read`` method that on Python 2.x returns `bytes` objects and
on Python 3.x returns `str` (`unicode`) objects, using
`locale.getpreferredencoding` as an encoding. This matches
the default behavior of the built-in `open` when no ``mode``
argument is provided.
When ``'binary'``, returns a file-like object where its ``read``
method returns `bytes` objects.
When another string, it is the name of an encoding, and the
file-like object's ``read`` method will return `str` (`unicode`)
objects, decoded from binary using the given encoding.
Returns
-------
fileobjs : iterator of file objects
File objects for each of the files on the local filesystem in
*datadir* matching *pattern*.
Examples
--------
This will retrieve the contents of the data file for the `astropy.wcs`
tests::
from astropy.utils.data import get_pkg_data_filenames
for fd in get_pkg_data_filename('maps', '*.hdr'):
fcontents = fd.read()
"""
for fn in get_pkg_data_filenames(datadir, pattern):
with get_pkg_data_fileobj(fn, encoding=encoding) as fd:
yield fd
[docs]def compute_hash(localfn):
""" Computes the MD5 hash for a file.
The hash for a data file is used for looking up data files in a unique
fashion. This is of particular use for tests; a test may require a
particular version of a particular file, in which case it can be accessed
via hash to get the appropriate version.
Typically, if you wish to write a test that requires a particular data
file, you will want to submit that file to the astropy data servers, and
use
e.g. ``get_pkg_data_filename('hash/a725fa6ba642587436612c2df0451956')``,
but with the hash for your file in place of the hash in the example.
Parameters
----------
localfn : str
The path to the file for which the hash should be generated.
Returns
-------
md5hash : str
The hex digest of the MD5 hash for the contents of the ``localfn``
file.
"""
with open(localfn, 'rb') as f:
h = hashlib.md5()
block = f.read(conf.compute_hash_block_size)
while block:
h.update(block)
block = f.read(conf.compute_hash_block_size)
return h.hexdigest()
def _find_pkg_data_path(data_name):
"""
Look for data in the source-included data directories and return the
path.
"""
from ..utils.misc import find_current_module
module = find_current_module(1, True)
if module is None:
# not called from inside an astropy package. So just pass name through
return data_name
if not hasattr(module, '__package__') or not module.__package__:
# The __package__ attribute may be missing or set to None; see PEP-366,
# also astropy issue #1256
if '.' in module.__name__:
pkgname = module.__name__.rpartition('.')[0]
else:
pkgname = module.__name__
else:
pkgname = module.__package__
rootpkgname = pkgname.partition('.')[0]
rootpkg = __import__(rootpkgname)
module_path = os.path.dirname(module.__file__)
path = os.path.join(module_path, data_name)
root_dir = os.path.dirname(rootpkg.__file__)
assert _is_inside(path, root_dir), \
("attempted to get a local data file outside "
"of the " + rootpkgname + " tree")
return path
def _find_hash_fn(hash):
"""
Looks for a local file by hash - returns file name if found and a valid
file, otherwise returns None.
"""
try:
dldir, urlmapfn = _get_download_cache_locs()
except (IOError, OSError) as e:
msg = 'Could not access cache directory to search for data file: '
warn(CacheMissingWarning(msg + str(e)))
return None
hashfn = os.path.join(dldir, hash)
if os.path.isfile(hashfn):
return hashfn
else:
return None
[docs]def get_free_space_in_dir(path):
"""
Given a path to a directory, returns the amount of free space (in
bytes) on that filesystem.
Parameters
----------
path : str
The path to a directory
Returns
-------
bytes : int
The amount of free space on the partition that the directory
is on.
"""
if sys.platform.startswith('win'):
import ctypes
free_bytes = ctypes.c_ulonglong(0)
retval = ctypes.windll.kernel32.GetDiskFreeSpaceExW(
ctypes.c_wchar_p(path), None, None, ctypes.pointer(free_bytes))
if retval == 0:
raise IOError('Checking free space on %r failed unexpectedly.' %
path)
return free_bytes.value
else:
stat = os.statvfs(path)
return stat.f_bavail * stat.f_frsize
[docs]def check_free_space_in_dir(path, size):
"""
Determines if a given directory has enough space to hold a file of
a given size. Raises an IOError if the file would be too large.
Parameters
----------
path : str
The path to a directory
size : int
A proposed filesize (in bytes)
Raises
-------
IOError : There is not enough room on the filesystem
"""
from ..utils.console import human_file_size
space = get_free_space_in_dir(path)
if space < size:
raise IOError(
"Not enough free space in '{0}' "
"to download a {1} file".format(
path, human_file_size(size)))
[docs]def download_file(remote_url, cache=False, show_progress=True, timeout=None):
"""
Accepts a URL, downloads and optionally caches the result
returning the filename, with a name determined by the file's MD5
hash. If ``cache=True`` and the file is present in the cache, just
returns the filename.
Parameters
----------
remote_url : str
The URL of the file to download
cache : bool, optional
Whether to use the cache
show_progress : bool, optional
Whether to display a progress bar during the download (default
is `True`)
timeout : float, optional
The timeout, in seconds. Otherwise, use
`astropy.utils.data.Conf.remote_timeout`.
Returns
-------
local_path : str
Returns the local path that the file was download to.
Raises
------
urllib2.URLError, urllib.error.URLError
Whenever there's a problem getting the remote file.
"""
from ..utils.console import ProgressBarOrSpinner
if timeout is None:
timeout = conf.remote_timeout
missing_cache = False
if timeout is None:
# use configfile default
timeout = REMOTE_TIMEOUT()
if cache:
try:
dldir, urlmapfn = _get_download_cache_locs()
except (IOError, OSError) as e:
msg = 'Remote data cache could not be accessed due to '
estr = '' if len(e.args) < 1 else (': ' + str(e))
warn(CacheMissingWarning(msg + e.__class__.__name__ + estr))
cache = False
missing_cache = True # indicates that the cache is missing to raise a warning later
if six.PY2 and isinstance(remote_url, six.text_type):
# shelve DBs don't accept unicode strings in Python 2
url_key = remote_url.encode('utf-8')
else:
url_key = remote_url
try:
if cache:
# We don't need to acquire the lock here, since we are only reading
with _open_shelve(urlmapfn, True) as url2hash:
if url_key in url2hash:
return url2hash[url_key]
with contextlib.closing(urllib.request.urlopen(
remote_url, timeout=timeout)) as remote:
#keep a hash to rename the local file to the hashed name
hash = hashlib.md5()
info = remote.info()
if 'Content-Length' in info:
try:
size = int(info['Content-Length'])
except ValueError:
size = None
else:
size = None
if size is not None:
check_free_space_in_dir(gettempdir(), size)
if cache:
check_free_space_in_dir(dldir, size)
if show_progress:
progress_stream = sys.stdout
else:
progress_stream = io.StringIO()
dlmsg = "Downloading {0}".format(remote_url)
with ProgressBarOrSpinner(size, dlmsg, file=progress_stream) as p:
with NamedTemporaryFile(delete=False) as f:
try:
bytes_read = 0
block = remote.read(conf.download_block_size)
while block:
f.write(block)
hash.update(block)
bytes_read += len(block)
p.update(bytes_read)
block = remote.read(conf.download_block_size)
except:
if os.path.exists(f.name):
os.remove(f.name)
raise
if cache:
_acquire_download_cache_lock()
try:
with _open_shelve(urlmapfn, True) as url2hash:
# We check now to see if another process has
# inadvertently written the file underneath us
# already
if url_key in url2hash:
return url2hash[url_key]
local_path = os.path.join(dldir, hash.hexdigest())
shutil.move(f.name, local_path)
url2hash[url_key] = local_path
finally:
_release_download_cache_lock()
else:
local_path = f.name
if missing_cache:
msg = ('File downloaded to temporary location due to problem '
'with cache directory and will not be cached.')
warn(CacheMissingWarning(msg, local_path))
if conf.delete_temporary_downloads_at_exit:
global _tempfilestodel
_tempfilestodel.append(local_path)
except urllib.error.URLError as e:
if hasattr(e, 'reason') and hasattr(e.reason, 'errno') and e.reason.errno == 8:
e.reason.strerror = e.reason.strerror + '. requested URL: ' + remote_url
e.reason.args = (e.reason.errno, e.reason.strerror)
raise e
except socket.timeout as e:
# this isn't supposed to happen, but occasionally a socket.timeout gets
# through. It's supposed to be caught in `urrlib2` and raised in this
# way, but for some reason in mysterious circumstances it doesn't. So
# we'll just re-raise it here instead
raise urllib.error.URLError(e)
return local_path
def _do_download_files_in_parallel(args):
return download_file(*args, show_progress=False)
[docs]def download_files_in_parallel(urls, cache=False, show_progress=True,
timeout=None):
"""
Downloads multiple files in parallel from the given URLs. Blocks until
all files have downloaded. The result is a list of local file paths
corresponding to the given urls.
Parameters
----------
urls : list of str
The URLs to retrieve.
cache : bool, optional
Whether to use the cache
show_progress : bool, optional
Whether to display a progress bar during the download (default
is `True`)
timeout : float, optional
Timeout for the requests in seconds (default is the
configurable `astropy.utils.data.Conf.remote_timeout`).
Returns
-------
paths : list of str
The local file paths corresponding to the downloaded URLs.
"""
from .console import ProgressBar
if timeout is None:
timeout = conf.remote_timeout
if show_progress:
progress = sys.stdout
else:
progress = io.BytesIO()
if timeout is None:
# use configfile default
timeout = REMOTE_TIMEOUT()
# Combine duplicate URLs
combined_urls = list(set(urls))
combined_paths = ProgressBar.map(
_do_download_files_in_parallel,
[(x, cache) for x in combined_urls],
file=progress,
multiprocess=True)
paths = []
for url in urls:
paths.append(combined_paths[combined_urls.index(url)])
return paths
# This is used by download_file and _deltemps to determine the files to delete
# when the interpreter exits
_tempfilestodel = []
@atexit.register
def _deltemps():
global _tempfilestodel
if _tempfilestodel is not None:
while len(_tempfilestodel) > 0:
fn = _tempfilestodel.pop()
if os.path.isfile(fn):
os.remove(fn)
[docs]def clear_download_cache(hashorurl=None):
""" Clears the data file cache by deleting the local file(s).
Parameters
----------
hashorurl : str or None
If None, the whole cache is cleared. Otherwise, either specifies a
hash for the cached file that is supposed to be deleted, or a URL that
has previously been downloaded to the cache.
Raises
------
OSEerror
If the requested filename is not present in the data directory.
"""
try:
dldir, urlmapfn = _get_download_cache_locs()
except (IOError, OSError) as e:
msg = 'Not clearing data cache - cache inacessable due to '
estr = '' if len(e.args) < 1 else (': ' + str(e))
warn(CacheMissingWarning(msg + e.__class__.__name__ + estr))
return
_acquire_download_cache_lock()
try:
if hashorurl is None:
if os.path.exists(dldir):
shutil.rmtree(dldir)
if os.path.exists(urlmapfn):
os.unlink(urlmapfn)
else:
with _open_shelve(urlmapfn, True) as url2hash:
filepath = os.path.join(dldir, hashorurl)
assert _is_inside(filepath, dldir), \
("attempted to use clear_download_cache on a path "
"outside the data cache directory")
# shelve DBs don't accept unicode strings as keys in Python 2
if six.PY2 and isinstance(hashorurl, six.text_type):
hash_key = hashorurl.encode('utf-8')
else:
hash_key = hashorurl
if os.path.exists(filepath):
for k, v in list(six.iteritems(url2hash)):
if v == filepath:
del url2hash[k]
os.unlink(filepath)
elif hash_key in url2hash:
filepath = url2hash[hash_key]
del url2hash[hash_key]
os.unlink(filepath)
else:
msg = 'Could not find file or url {0}'
raise OSError(msg.format(hashorurl))
finally:
# the lock will be gone if rmtree was used above, but release otherwise
if os.path.exists(os.path.join(_get_download_cache_locs()[0], 'lock')):
_release_download_cache_lock()
def _get_download_cache_locs():
""" Finds the path to the data cache directory and makes them if
they don't exist.
Returns
-------
datadir : str
The path to the data cache directory.
shelveloc : str
The path to the shelve object that stores the cache info.
"""
from ..config.paths import get_cache_dir
datadir = os.path.join(get_cache_dir(), 'download')
shelveloc = os.path.join(get_cache_dir(), 'download_urlmap')
if not os.path.exists(datadir):
try:
os.mkdir(datadir)
except OSError as e:
if not os.path.exists(datadir):
raise
elif not os.path.isdir(datadir):
msg = 'Data cache directory {0} is not a directory'
raise IOError(msg.format(datadir))
if os.path.isdir(shelveloc):
msg = 'Data cache shelve object location {0} is a directory'
raise IOError(msg.format(shelveloc))
return datadir, shelveloc
def _open_shelve(shelffn, withclosing=False):
"""
opens a shelf in a way that is py3.x and py2.x compatible. If
`withclosing` is True, it will be opened with closing, allowing use like:
with _open_shelve('somefile',True) as s:
...
"""
import shelve
if six.PY2:
shelf = shelve.open(shelffn, protocol=2)
elif six.PY3:
shelf = shelve.open(shelffn + '.db', protocol=2)
if withclosing:
return contextlib.closing(shelf)
else:
return shelf
#the cache directory must be locked before any writes are performed. Same for
#the hash shelve, so this should be used for both.
def _acquire_download_cache_lock():
"""
Uses the lock directory method. This is good because `mkdir` is
atomic at the system call level, so it's thread-safe.
"""
lockdir = os.path.join(_get_download_cache_locs()[0], 'lock')
for i in range(conf.download_cache_lock_attempts):
try:
os.mkdir(lockdir)
#write the pid of this process for informational purposes
with open(os.path.join(lockdir, 'pid'), 'w') as f:
f.write(str(os.getpid()))
except OSError:
time.sleep(1)
else:
return
msg = 'Unable to acquire lock for cache directory ({0} exists)'
raise RuntimeError(msg.format(lockdir))
def _release_download_cache_lock():
lockdir = os.path.join(_get_download_cache_locs()[0], 'lock')
if os.path.isdir(lockdir):
#if the pid file is present, be sure to remove it
pidfn = os.path.join(lockdir, 'pid')
if os.path.exists(pidfn):
os.remove(pidfn)
os.rmdir(lockdir)
else:
msg = 'Error releasing lock. "{0}" either does not exist or is not ' +\
'a directory.'
raise RuntimeError(msg.format(lockdir))


Over 1,000,000 Ravencoin in bounties for code, development & bugs are available:
- security patches / bug ID
- updates and maintenance of code base / adapting and merging relevant post-fork Bitcoin developments
- implementation of LN on the Ravencoin chain
- RSK & two way...


���ޥ�� You can now submit data about the UI actions you did in the IDE and help us make NetBeans better. Read more...


Dianne M Pauls
Republican
not employed at this time, retired. On the board for the Telluride Adaptive Sports Program, on the Metro District Board for Twin Buttes, business Sundance Antiques, Ski Instructor for The Telluride Adaptive Ski Program for 18 years, trainer as well.
associate degree from the university of MN, Cosmetologist, small business owner for over 20 yrs., certified ski instructor for 25 years, on the board for Telluride Adaptive Sports program, brought the first Wounded Warrior ski group to Telluride in 2017, worked on getting the Navajos St.Michael school for disabilities to ski in Telluride and worked closely with St.Michaels on getting The Telluride Mountain School in partnership for community projects, help start the Telluride Mountain School, our family has done many conservation easements, donated bike trails to the city, served on many community boards, ongoing study of archaeology in the Southwest, certified in some archaeology classes, private Pilot, worked on keeping public land open for all public use, especially people with disabilities.
81301
RNC, Trump, Biden, McCain, Scott Tipton, Cory Gardner, Lauren Boebert, Mitt Romney, Bush/Cheney
Telluride Adaptive Ski program, SW Pickleball association, Twin Buttes Metro Board, political San Miguel Republican party, PaPa -Public Access Preservation Assoc.
Organized many fundraiser parties, advocating for people with disabilities, keeping public lands open to all groups, Wounded Warriors groups access for all, we have done land conservation and donations, worked with TPL, help start a group Called PAPA, Public Access Preservation Association
To make sure that all the lands are open and certain issues are related to the areas that effect their lively hood. Not everyone has to vote on all the issue ,like the wolfs. re introduce the wolfs to Denver not the hunting, or ranch lands, make sure every vote can count and that one party doesn't have a monopoly of power.
Mainly keeping in mind the people and their demographics. What effects some people can't be voted by the whole state. I have lived in Colorado where certain interest groups move in and take over not considering the people who have lived there for generations. I would like to preserve the history of our state and work to improve relationships with people
I'm a hometown women, growing up in middle class family with great parents that let me make my own decisions to a point, I had to reason with them to get what I wanted. I Went to Beauty School at age 13, had my own business at 17. AS a business owner and employer at a very young age taught me a lot about relationships. AS a hairdresser I had to become a very good listener, and good a what I did. Patience is a virtue but acquired one too. I also taught adaptive skiing which not only do you need to know how to teach skiing but side effects of the disabilities, medications. I was taught to teach to the person first, and then the disabilities. The most important thing is to look at the person first and second is whatever it is they are dealing withand find a way to accomplish your goal. It is a process of elimination
female


Tell us a little about yourself
E.g. How long have you been a developer? Where are you from? What languages, frameworks or libraries do you work with?
Join


Adaptive Cards Demo Using JavaScript SDK
Basic rendering of adaptive card using JavaScript SDK
Templating adaptive card and populating data using JavaScript
Adaptive card form using action buttons
Adaptive card complex input form with validations and action buttons
Wizard experience with Adaptive cards


Site performance boost up by loading icons from amazon s3 instead of heroku file system Apr 14 amazon-s3, heroku, preformance, ruby-on-rails
How to bootup rails server and other rake task faster Apr 10 development, ruby-on-rails, tips-and-tricks
How to disable inherited_resources controller in ruby on rails Apr 10 inherited_resources, ruby-on-rails
How to generate css sprites automatically using a gem in ruby on rails Apr 4 Performance, Ruby on Rails
Graphical Representation of my model data ie charts in ruby on rails using highcharts Feb 10 General, Ruby On Rails
How to send devise emails via delayed job or rescue or any other background jobs Feb 9 Optimization, Performance, Ruby On Rails, Tips and Tricks
Change browser url in case of ajax request using HTML5 pushState Feb 9 Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
How to implement action caching in ruby on rails with ajax enabled Feb 8 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks
How to test emails in development mode in ruby on rails Jan 27 Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Rails 3 Speeds up assets precompile time by only recompiling changed assets Jan 26 Optimization, Performance, Quick Solution, Ruby On Rails, Server, Tips and Tricks
Quick way to setup memcached in Ruby on Rails application Jan 26 Optimization, Performance, Quick Solution, Ruby On Rails, Server, Tips and Tricks
Converting Ruby time function into a database friendly format to compare time. Jan 26 Optimization, Ruby On Rails, Tips and Tricks, Utilities
Chrome extension for Rails development Jan 26 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Better Rails error page customization, display more information Jan 26 Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Use cookie-free domains for components in ruby on rails application. Jan 18 Optimization, Performance, Quick Solution, Ruby On Rails, Server, Tips and Tricks, Utilities
Not able to call group model methods in delayed job perform method Jan 15 Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Adding validations in your ajax based controllers – Ajaxify your site – Part 2 Jan 15 Ruby On Rails, Tips and Tricks, Utilities
Use pluck instead of collect in ruby on rails. Dec 31 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Clear your logs in development automatically when they are too large in ruby on rails Dec 21 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
How to make –no-ri –no-rdoc the default for gem install? Dec 18 Optimization, Quick Solution, Ruby On Rails, Tips and Tricks
4. Adding Validations in models in backbone js – Learning Backbone js Dec 17 Backbone.js, Validations
1. Introduction to backbone js and setting up an working environment – Learning Backbone js Dec 16 Backbone.js
Add Expires headers to the assets in ruby on rails. Dec 14 Optimization, Performance, Quick Solution, Ruby On Rails, Server, Tips and Tricks
Some basic guidelines I always follow before launching a ruby on rails application. Dec 7 General, Optimization, Performance, Quick Solution, Ruby On Rails, Server, Tips and Tricks, Utilities
Not able to start rails application as port 3000 is already in use. Dec 4 Ruby On Rails, Server, Tips and Tricks, Utilities
Use rescue to rescue in ruby on rails Dec 3 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks
Mixpanel event tracking with Ruby on Rails Dec 2 Optimization, Performance, Ruby On Rails, Server, Tips and Tricks
Modules as application model in ruby on rails or refactor your code. Dec 1 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Ajaxify your site with remote => true and respond_to block Dec 1 Ruby On Rails, Tips and Tricks, Utilities
A simple way to implement soft delete in rails application. Dec 1 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Validating email address by defining custom validations in ruby on rails. Nov 27 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities, Validations
Pagination with ajax using will paginate in ruby on rails Nov 27 Optimization, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Use after_commit instead of active record callbacks to avoid unexpected errors Nov 26 Optimization, Performance, Quick Solution, Ruby On Rails, Server, Tips and Tricks
Update the fields a single document in an index via thinking sphinx using Delta Index. Nov 26 General, Optimization, Quick Solution, Ruby On Rails, Tips and Tricks
Track changes in your active record object using Dirty Objects in Rails Nov 25 Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks
Rollback all database changes on exit Nov 14 General, Quick Solution, Ruby On Rails, Tips and Tricks, Utilities
Rescue blocks don’t need to be tied to a ‘begin’ Nov 14 General, Optimization, Quick Solution, Ruby On Rails, Tips and Tricks
validates_uniqueness_of doesn’t guarantee the absence of duplicate record insertions Nov 1 Ruby On Rails, Validations
Snapdeal – Why don’t you restrict number of record per requests in API calls? Visible from ajax calls..!!! Oct 28 General, Tips and Tricks
Block email sending to certain email addresses or domain in ruby on rails? Oct 27 Ruby On Rails, Tips and Tricks
Displays footnotes in your application for easy debugging Oct 22 Performance, Ruby On Rails, Tips and Tricks
Optimize database queries in ruby on rails using Bullet gem Oct 21 Optimization, Performance, Ruby On Rails
How to deploy assets on Amazon S3 and why deploying assets to Amazon S3 is important. Oct 21 Performance, Ruby On Rails
How to add cache-control, expires headers to images (Content) served by S3 Oct 21 Optimization, Performance, Ruby On Rails
Compress all your public images using smush it, before going to production mode Oct 21 General, Optimization, Performance, Quick Solution, Ruby On Rails, Tips and Tricks
Use say and say_with_time in migrations to make a useful migration log Oct 20 Ruby On Rails, Tips and Tricks
Save image as progressive image using paperclip and imageMagick Oct 20 Optimization, Performance, Ruby On Rails
Know on which git branch you are, right from your terminal, basically git branch prompt Oct 20 Git, Tips and Tricks
Instantly show localhost to the rest of the world using localtunnel Oct 20 Quick Solution, Ruby On Rails, Tips and Tricks
How to disable logging of asset pipeline (sprockets) messages in Rails. Oct 20 Ruby On Rails, Tips and Tricks


WC(1) User Commands WC(1) NAME wc - print newline, word, and byte counts for each file SYNOPSIS wc [OPTION]... [FILE]... wc [OPTION]... --files0-from=F DESCRIPTION Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified. With no FILE, or when FILE is -, read standard input. A word is a non-zero-length sequence of characters delimited by white space. The options below may be used to select which counts are printed, always in the following order: newline, word, charac‐ ter, byte, maximum line length. -c, --bytes print the byte counts -m, --chars print the character counts -l, --lines print the newline counts --files0-from=F read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input -L, --max-line-length print the length of the longest line -w, --words print the word counts --help display this help and exit --version output version information and exit AUTHOR Written by Paul Rubin and David MacKenzie. REPORTING BUGS Report wc bugs to<EMAIL_ADDRESS>GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> Report wc translation bugs to <http://translationproject.org/team/> COPYRIGHT Copyright © 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO The full documentation for wc is maintained as a Texinfo manual. If the info and wc programs are properly installed at your site, the command info coreutils 'wc invocation' should give you access to the complete manual. GNU coreutils 8.12.197-032bb September 2011 WC(1)


--- layout: page ---
A list of books that have made me a better developer, designer, friend, son, human, etc.


Description: Equal (==) vs Identical Equal (===)
Equal operator converts sides to Number() if types are: Number, String, Boolean OR to Boolean() if types are: undefined, null.
On the other hand Identical Equal operator does not convert.
Results:


Diptendra is currently pursuing his M.S. in Statistics from University of Illinois, Urbana-Champaign. He is also working as a Consultant at the Illinois Business Consulting, where he leverages his problem-solving and quantitative skills to solve business problems from various domains.
He has four years of professional work experience in the data science/data consulting, primarily in the Retail/CPG sector, on various cutting-edge and strategic analytical problems.
In the past he has worked with Anheuser-Busch InBev and Target as a Data Science professional, where he had not only worked on challenging problems in Retail/CPG but also lead a team of 2 individuals and managed multiple projects simultaneously. One of his biggest learnings has been to go out of comfort zone and learn more about the business problem before diving to solve it. He loves working in cross-functional team with individual’s from different backgrounds because he believes diversity in perspectives drives innovation.
He received his MS in Economics (2013-2015) from Madras School of Economics and BSc.(Hons.) in Physics (2009-2012) from Hindu College, University of Delhi.
Here is my resume
.


Ionic Native
Ionic Native is a TypeScript wrapper for Cordova/PhoneGap plugins that make adding any native functionality you need to your Ionic mobile app easy.
Promises and Observables
Ionic Native wraps plugin callbacks in a Promise or an Observable, providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.
import { Geolocation } from [email protected]/geolocation';
import { Platform } from 'ionic-angular';
class MyComponentOrService {
constructor(private platform: Platform, private geolocation: Geolocation) {
platform.ready().then(() => {
// get current position
geolocation.getCurrentPosition().then(pos => {
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
});
const watch = geolocation.watchPosition().subscribe(pos => {
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
});
// to stop watching
watch.unsubscribe();
});
}
}
Runtime Diagnostics
Spent way too long diagnosing an issue only to realize a plugin wasn’t firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
Installation
To add Ionic Native to your app, run following command to install the core package:
npm install @ionic-native/core --save
Note that Ionic Native core package is included by default with every Ionic app.
Usage
Install the Needed Plugins
Install the Ionic Native package for each plugin you want to add.
For example, if you want to install the Camera plugin, you will need to run the following command:
npm install @ionic-native/camera --save
Then install the plugin using Cordova or Ionic CLI.
For example:
ionic plugin add cordova-plugin-camera
All package names are documented on the plugin’s documentation. It is recommended to follow the installation instructions on each plugin’s documentation, as some plugins require additional steps to fully install.
Add Plugins to Your App's Module
After installing a plugin’s package, add it to your app’s NgModule
.
...
import { Camera } from [email protected]/camera';
...
@NgModule({
...
providers: [
...
Camera
...
]
...
})
export class AppModule { }


Find out more about the Apprenticeship Support and Knowledge for schools and colleges programme (ASK).


|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
#include <assert.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <malloc.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Macros | |
| #define | FREERTOS_HEAP_REGION_CNT 2 |
| NOTE: This FreeRTOS malloc implementation requires heap_5.c. More... | |
Functions | |
| static int | cmp_heap (const void *a, const void *b) |
| void | malloc_addblock (void *addr, size_t size) |
| malloc_addblock must be called before memory allocation calls are made. More... | |
| __attribute__ ((weak)) | |
| void * | malloc (size_t size) |
| Allocates size bytes of uninitialized storage. More... | |
| void | free (void *ptr) |
| Deallocates allocated memory space. More... | |
Variables | |
| static const uint8_t | heap_region_max = FREERTOS_HEAP_REGION_CNT |
| Maximum number of heap regions that can be specified. More... | |
| static volatile uint8_t | heap_region_cnt = 0 |
| Current number of allocated heap regions. More... | |
| static HeapRegion_t | heap_regions [FREERTOS_HEAP_REGION_CNT+1] |
| FreeRTOS internal memory pool stucture when using heap_5.c. More... | |
| static volatile bool | initialized_ = false |
| Flag that is used in malloc() to cause competing threads to wait until initialization is completed before allocating memory. More... | |
| #define FREERTOS_HEAP_REGION_CNT 2 |
NOTE: This FreeRTOS malloc implementation requires heap_5.c.
Please define the correct heap_region for your project.Your application can define this macro to increase the number of heap regions
| __attribute__ | ( | (weak) | ) |
References assert, cmp_heap(), heap_region_cnt, heap_regions, initialized_, and qsort().
|
static |
Referenced by __attribute__().
| void free | ( | void * | ptr | ) |
Deallocates allocated memory space.
Deallocates the space previously allocated by
The behavior is undefined if the value of ptr does not equal a value returned earlier by
The behavior is undefined if the memory area referred to by ptr has already been deallocated, that is, free() or realloc has already been called with ptr as the argument and no calls to malloc, calloc or realloc resulted in a pointer equal to ptr afterwards.
The behavior is undefined if after free returns, an access is made through the pointer ptr (unless another allocation function happened to result in a pointer value equal to ptr)
| ptr | pointer to the memory to deallocate |
free should NEVER be called before malloc is init'd
References assert, and initialized_.
| void* malloc | ( | size_t | size | ) |
Allocates size bytes of uninitialized storage.
If size is zero, the behavior is implementation defined (null pointer may be returned, or some non-null pointer may be returned that may not be used to access storage, but has to be passed to
| size | number of bytes to allocate |
References initialized_, and NULL.
| void malloc_addblock | ( | void * | addr, |
| size_t | size | ||
| ) |
malloc_addblock must be called before memory allocation calls are made.
Assign blocks of memory for use by malloc().
In this FreeRTOS implementation, malloc() calls will block until memory has been allocated
References assert, heap_region_cnt, heap_region_max, and heap_regions.
|
static |
Current number of allocated heap regions.
Referenced by __attribute__(), and malloc_addblock().
|
static |
Maximum number of heap regions that can be specified.
Referenced by malloc_addblock().
|
static |
FreeRTOS internal memory pool stucture when using heap_5.c.
The block with the lowest starting address should appear first in the array
An additional block is allocated to serve as a NULL terminator
Referenced by __attribute__(), and malloc_addblock().


Sets the sorting for the grid.
options
(array)
- List of column sorting options to use.
Each column sorting options object should have two parameters:
options[x].columnId
(string)
- The 'id' value of the column by which to sort.
options[x].sortAsc
(boolean)
- Iftrue
the sort direction with be ascending,false
makes it descending.
(object)
- A Doby Grid class instance
new DobyGrid(...).setSorting([
{columnId: 'myfirstcolumn', sortAsc: true},
{columnId: 'myothercolumn', sortAsc: false}
])


Name:
Email:
Year:
Year of birth:
Name:
Email:
Year:
Year of birth:
Edit
Insert password
×
Password
Confirm password