The AACon
AACon is a set of tools implementing 17 different conservation scores reviewed by Valdar as well as the more complex SMERFS algorithm for predicting protein functional sites. AACon has been written with efficiency in mind and takes less than a second to calculate conservation by all 18 methods for an alignment of 500 sequences 350 residues long on a single CPU. AACon exploits parallelism for the more demanding methods and to allow multiple methods to run simultaneously. The parallel code gives close to linear speedup with the number of processors, thus making it suitable for server applications or other demanding environments.
AACon is available as a SOAP web service, a stand alone Java executable and a Java library with concise API for accessing all the conservation methods programmatically. The executable runs on all platforms that support Java version 5 and above (Windows, Unix/Linux, Mac).
Contact
If you have any issues, questions or suggestions feel free to contact us on<EMAIL_ADDRESS>Authors
Peter Troshin, Agnieszka Golicz, David Martin and Geoff Barton are the authors of the AACon Web Services.


Welcome to the BetterDiscord documentation. If you encounter any problems when using BetterDiscord, have a look at the troubleshooting guides, raise an issue on GitHub or join the Discord Server.
What is BetterDiscord?
BetterDiscord is a client side modification for the Discordapp, you are able to add custom themes, plugins and even emotes. Take control of your Discordapp! BetterDiscord is in continuous development and new features get added daily!
Installation
Windows
Mac
Linux
Uninstall
Having a bad day and want to uninstall BetterDiscord? Before you go on Please check our troubleshooting guides to help you in any way if not just sumbit an issue on our Github and we will get back to you shortly!
Windows
-
Remove the following
%appdata%\BetterDiscord %localappdata%\Discord\app-x.x.xxx\resources\node_modules\BetterDiscord %localappdata%\Discord\app-x.x.xxx\resources\app
Mac
-
Remove the following
~/Library/Preferences/BetterDiscord ~/Library/Application Support/Discord/app-x.x.xxx/resources/node_modules/BetterDiscord ~/Library/Application Support/Discord/app-x.x.xxx/resources/app


So set up your Metasmask account and go bullish!
Heroes are hodler, dude!
A part of the invoice is transformed into tokens for hodlers.
Because you want to attract investors, you can distribute some tokens to your hodlers.
Selling reserve: 0 ETH
Total supply: 0 TOK


RIS3 Open Data Tool
Heatmap
Compare projects across regions.
| {{ forloop.counter0 }}{% if forloop.counter0 > 9 %}+{% endif %} | {% endfor %}
Map
Relevant organisations in this region.
{% for result in results %}
{% endfor %}
{{ result.projects|length }} relevant project(s) in this region by {{ result.organisations|length }} organisation(s).
{% include "projects.html" with projects=result.projects %}


Lisbon International Half Marathon
Lisbon POR
Website: www.meiamaratonadelisboa.com
Race Winners
(29 runnings)
1:08:52 1:08:28 1:08:38 1:08:30 1:09:57 18 Mar
2007
1:00:31a
1:07:05a
26 Mar
2006
59:30a
1:07:52a
13 Mar
2005
59:10a
1:08:49a
28 Mar
2004
59:49a
1:08:11a
16 Mar
2003
1:00:10a
1:09:20a
24 Mar
2002
59:41a
1:08:23a
01 Apr
2001
1:00:26a
1:05:44a
26 Mar
2000
59:06a
1:07:23a
21 Mar
1999
1:00:01a
1:07:52a
15 Mar
1998
59:43a
1:07:50a
09 Mar
1997
1:01:17a
1:09:01a
10 Mar
1996
1:01:15a
1:07:12a
12 Mar
1995
1:00:26a
1:08:21a
13 Mar
1994
1:01:34a
1:09:27a
14 Mar
1993
59:24a
1:09:47a
15 Mar
1992
1:01:17a
1:10:01a
17 Mar
1991
1:01:44a
1:09:52a
17 Mar
2019
59:37
Mosinet Geremew (ETH)
1:06:34
Vivian Cheruiyot (KEN)
11 Mar
2018
1:00:05
Erick Kiptanui (KEN)
1:11:27
Etagegne Woldu (ETH)
19 Mar
2017
1:00:01
Jake Robertson (NZL)
1:09:43
Mare Dibaba Hurssa (ETH)
20 Mar
2016
59:47
Sammy Kitwara Kirop (KEN)
1:09:16
Hirut Aga Sora (ETH)
22 Mar
2015
59:32
Mohamed Farah (ENG)
1:08:22
Rose Chelimo (KEN)
16 Mar
2014
59:58
Bitan Karoki Muchiri (KEN)
1:08:46
Worknesh Debele Degafa (ETH)
24 Mar
2013
59:54
Bernard Koech (KEN)
1:08:48
Edna Kiplagat Ngeringwony (KEN)
25 Mar
2012
59:34
Zersenay
Tadesse-3
Shalane Flanagan (OR/USA)
20 Mar
2011
58:30
Zersenay
Tadesse-2
Aberu Kebede Shewaye (ETH)
21 Mar
2010
58:23
Zersenay Tadesse (ERI)
Peninah Arusei (KEN)
22 Mar
2009
59:56
Martin Lel-3
Kara Goucher (OR/USA)
16 Mar
2008
59:15
Haile Gebrselassie-2
Salina Kosgei-2
Robert Kipchumba (KEN)
Rita Cheptoo (KEN)
Martin Lel-2
Salina Kosgei (KEN)
Paul Tergat-2
Susan Chepkemei-3
Rodgers Rop (KEN)
Joyce Chepchumba (KEN)
Martin Lel (KEN)
Derartu Tulu (ETH)
Haile Gebrselassie (ETH)
Susan Chepkemei-2
Henrick Ramaala (RSA)
Susan Chepkemei (KEN)
Paul Tergat (KEN)
Tegla Loroupe-6
Japheth Kosgei (KEN)
Tegla Loroupe-5
Antonio Pinto (POR)
Catherina McKiernan (IRL)
Mohammed Mourhit (BEL)
Tegla Loroupe-4
Clement Kiprotich (KEN)
Tegla Loroupe-3
Simon Lopuyet (KEN)
Tegla Loroupe-2
Andres Espinosa (MEX)
Tegla Loroupe (KEN)
Sammy Lelei (KEN)
Nadezhda Ilyina (RUS)
Tendai Chimusasa (ZIM)
Helena Barocsi (HUN)
Paul Evans (ENG)
Rosa Mota (POR)
Notes: Thie courses used for races thru and including 2007 are considered to be point-to-point because they dropped an average
of 3.27 m/km from start to finish altho the start/finish lines were within 30% of the race distance.
The 1993 course was remeasured as 97 meters short; all prior races are
also considered suspect and not considered eligible for record or ranking status. The time differential represented
by the 97 meters shortness is roughly 16 seconds. The years 1996, 1998, 2000-01, 2004, and 2006 are considered
excessive aided by the drop and possibly tail winds. The race time biases are faster than -5 sec/km (see
the Race Time Bias table) and are not considered eligible for record/ranking status
altho all marks after 1993 are considered for event records. From 2013 the elite women have had a separate start. Race currently known as EDP MeiaMaratona de Lisboa.
Most Wins
(1991-date)
Men 3 6
Martin Lel (KEN)
2003,2006,2009
Women
Tegla Loroupe (KEN)
1994-97,1999-2000
Prize Money
(ADR qualified runners)
Year Men Women Total 2017 $5,470 $5,525 $10,995 .... 2014 5,980 5,560 11,540 .... 2010 67,650 67,650 .... 2002 14,580 9,685 24,265 .... 2000 115,425 11,135 126,560 1999 17,195 12,030 29,225 1998 24,000 11,300 35,300 1997 18,575 10,180 28,755 1996 17,300 10,850 28,150 1995 20,240 11,360 31,600 Sums $306,415 $87,625 $394,040
Race Time Bias (sec/km)
Year Men Women 2017 -3.9 -1.4 2016 -4.0 -3.9 2015 -3.5 -1.6 2014 -0.6 -3.3 2013 -1.2 +0.7 2012 -1.7 -1.4 2011 -2.8 -3.8 2010 -4.0 +0.8 2009 -3.4 -3.1 2008 -4.1 -0.8 2007 -3.8 -5.9 2006 -6.4 -7.2 2005 -5.5 -3.6 2004 -5.3 -7.0 2003 -4.4 -4.0 2002 -4.0 -6.5 2001 -5.2 -6.0 2000 -4.9 -7.4 1999 -4.1 -4.9 1998 -5.8 -5.7 1997 -3.3 -3.1 1996 -4.7 -10.3 1995 -2.8 -5.1 1994 -3.6 -5.6 1993 -7.9 -10.4 1992 -5.9 -7.9 1991 -5.4 -4.3 Avgs -3.9 -4.0
Notes: The 1993 course was remeasured as 97 meters short (17 seconds);
the time bias suggests that the 1992 and 1991 courses were short as well. The average and extreme time biases are
given for the period 1994-date.
Competitive Level
(1990-date)
Year Men Women 2017<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER> 605 523
Quality Performances through 2019
Men < 58:30 1 < 59:00 2 < 59:30 6 <1:00:00 26 <1:00:30 55 <1:01:00 94 <1:01:30 126 <1:02:00 162 <1:02:30 186 <1:03:00 223 Women <1:08:00 3 <1:09:00 28 <1:10:00 65 <1:11:00 96 <1:12:00 137 <1:13:00 169 <1:14:00 198 <1:15:00 231
Note: Includes only statistically valid performances (1994-95,1997,1999,2002-03,2005,2007-date)
Last Updated on 10 May 2019 mp
Contributors: Maarten Krol, Carlos Fernández Canet (5)


We are an open organization that welcomes students from all majors! That being said, this is a must-have on your resume if you are an International Business major. While other majors like Marketing, Human Resources, and Accounting have classes and organizations to augment their network and learning experience, we are the only place and organization where IB majors can gather and meet one another in an international business emphasized setting.
Be a current student at San Jose State University
Have a 3.0 and above GPA
Attend at least 3 events (After registration, of course! All new members are registered under a probationary period and are subject to be dropped from the organization if participation does not happen by the end of the semester. Being dropped from the organization means you will not recieve any further perks, you will be removed from the LinkedIn IBA page, and no refund will be made for membership fees paid.)
Pay the membership fee ($25 per semester, $40 per year)
Be an open minded person
Be ready to learn and make friends!
*Although the membership fee is mandatory, you don't need to pay the fee in order to participate in our events or come to our meetings. If you are unable to pay the fee for whatever reason, but would like to get the perks, you can speak privately to an officer or email us at<EMAIL_ADDRESS>and we can have it waived as well.
LinkedIn Group Membership: You must have attended 3 events (within one semester) before you are accepted into the LinkedIn group. The reason for this is that we get many requests from people who have never participated in the organization and we want the LinkedIn Membership be a way for us to recognize members who have actually contributed.
In Person - You can turn in your membership money and details in a sealed envelope with your name, ID number, and email address to an officer at an official IBA meeting or whenever you see one on campus. Don't be shy! Just email or text us and we can meet! ;)
Email us at<EMAIL_ADDRESS>if you have any questions regarding our membership Policy!


We are still looking for game dev freelancers and game studios interested in open source collaborations. The #Komodo Team is preparing a huge #Blockchain #Gaming DEV #competition to take place in a couple weeks. A huge prizepool is waiting for you - get in touch! #KMD #DEV...


You pay only for the beers that you want to drink, and drink only the beers that you pay for
There will be two beers every Friday
Anyone can add beers to the beer list. Beers must be from bestofbeers.dk.
When you have added a beer to the beer list, you can then add that beer to an order
Until one week before the order date of an order, anyone can add beers to orders. After this point in time the order will be locked, and a committee will be appointed to select which beers will be ordered. The committee takes into consideration the types of beer, the price and volume, among other things. For now this locking is enforced by everyone being polite and not touching anything. In the future the locking will be enforced by the site.
Orders are placed such that beer is available on the first Friday of each month
A few days prior to the order date of an order, a mail will be send with details on how to pay for the beers.
When you have drunk a beer, please go and rate it. In the future ratings may be used to select encore beers.


{% extends "base.html" %} {% block title %}Store{% endblock %} {% block content %}
Below are some great volleyball products that are highly recommended by the HP volleyball community. Just click on the image link to buy from Amazon. All affiliate proceeds go to the HP volleyball crew.


|
xpcc
|
Public Types | |
| enum | InputType : uint8_t { InputType::Floating, InputType::PullUp } |
| Each Input Pin can be configured in one of these states. More... | |
| enum | InputTrigger : uint8_t { InputTrigger::LowLevel, InputTrigger::BothEdges, InputTrigger::FallingEdge, InputTrigger::RisingEdge } |
| Each External Interrupt can be configured to trigger on these conditions. More... | |
| enum | Port { C, B, D } |
| Available ports on this device. | |
|
strong |
|
strong |


fun getSmarts(): WiseFy
Uses a private constructor and returns a WiseFy instance.
See Also
WiseFyLogger.configureWiseFyLoggerImplementation
WiseFyConnection.init
Author Patches
Since 3.0


Intel to regain crown; Sony grows the fastest
by David MannersAll of the top-15 companies are expected to have sales of at least $7.0 billion in this year, the same number of companies as in 2018.
Intel is expected to be back on top of the semiconductor league table in 2019, regaining the crown it lost in 2017, predicts IC Insights, while Sony is expected to be the only top 15 company to grow year.
The top-15 worldwide semiconductor (IC and O-S-D—optoelectronic, sensor, and discrete) sales ranking for 2019 is shown in Figure 1.
Figure 1
In total, the top-15 semiconductor companies’ sales are forecast to drop by 15% in 2019 compared to 2018, two points lower than the expected total worldwide semiconductor industry decline of 13%.
The three largest memory suppliers—Samsung, SK Hynix, and Micron—are each forecast to register ≥29% year-over-year declines in 2018 with SK Hynix expected to log the biggest decline among the top-15 companies with a 38% plunge in sales this year.
As shown in Figure 2, only three of the top-15 companies are forecast to register year-over-year growth in 2019—Sony, TSMC, and MediaTek.
Moreover, six companies are expected to have double-digit sales declines this year, including four of the big memory suppliers (Samsung, SK Hynix, Micron, and Toshiba/Kioxia) as well as Nvidia and Qualcomm.
Figure 2
The largest move upward in the ranking is forecast to come from Sony, which is expected to move up four spots to the 11th position on the strength of extremely strong image sensor sales. In contrast, NXP is expected to fall two places to 14th with a sales decline of 6% this year.
Intel was the number one ranked semiconductor supplier in 1Q17 but lost its lead spot to Samsung in 2Q17.
It also fell from the top spot in the full-year 2017 ranking, a position it had held since 1993. With the strong surge in the DRAM and NAND flash markets in 2018, Samsung went from having 7% more total semiconductor sales than Intel in 2017 to having 12% more semiconductor sales than Intel in 2018.
However, with a forecasted 34% drop in the memory market this year, Intel is once again expected to rank as the largest semiconductor supplier and have sales that are 26% larger than Samsung in 2019.
The 2019 top-15 ranking includes one pure-play foundry (TSMC) and four fabless companies. If TSMC is excluded from the top-15 ranking, China-based HiSilicon (Huawei) would move into the 15th position with forecasted 2019 sales of $7.5 billion, up 24% from 2018.


CCore is released without known bugs or defects (but intermediate states of the repository between release tags MAY be broken). This code is made "as best as possible" and has a top quality both in design and implementation. It's a reliable piece of software. So if you experience troubles, CCore code is the last place to look for bugs. This does not mean, naturally, that I do guarantee the code is completely bug-free and absolutely perfect. That is not achievable in the mean time. And, of course, everybody is welcome to contribute in its perfection: report a real problem or suggest a design improvement.
CCore is a platform mainly for the development of real-time applications. It is distributed under the Boost Software License. You can use CCore to build host applications also, but without any real-time properties. We use the term "host application" to designate an application, running on a host machine. "Stand-alone application" means an application, running on a stand-alone device. CCore is a multi-target platform, you can (and, in fact, must!) develop your own target (host or stand-alone) for your specific target device. The installation of CCore provides the following targets:
Target includes compiler and tools, makefile rules and parts of source code, specific for the target. In most cases you are encouraged to develop components of your application using WIN32 target (or another host target) and then port it to a stand-alone target when it's ready. CCore is designed in target-independent and platform-independent manner (despite it's a platform itself!). So it's recommended to follow this practice. Developing components on a host target is usually simpler and more productive.
CCore is implemented using C++11. It enables the full advantage of this renewed language for embedded and real-time software development. You can also use it to build usual host applications. CCore is well-suited to develop a wide range of applications like servers, mathematical calculations or file-processing utilities. The number of them are supplied as supplementary tools. CCore is based on the comprehensive, type-rich library, well, CCore. That's the core part of the platform. The next part is HCore for host targets and XCore for stand-alone targets. On host targets we rely on an operating system to perform some tasks (like primary memory management, task synchronization etc.). So a host target provides a tiny layer between HCore and OS system calls. But on a stand-alone target we implements these fundamental functions ourself. XCore is an implementation of this part for single-core CPUs. A target provides an implementation of very low-level CPU specific functions XCore is based on. For example, the following 3 functions are required for interrupt lock support:
/* functions */ bool IsIntContext() noexcept; /* classes */ class IntLock; /* class IntLock */ class IntLock : NoCopy { bool enable; public: IntLock() { enable=Internal::Disable(); } ~IntLock() { if( enable ) Internal::Enable(); } struct Internal { static bool Disable() noexcept; static void Enable() noexcept; }; };
CCore is designed as a compliant C++11 library. There are a few places where we are using non-standard language extensions. In fact, we need only two of them: restrict and initialization priority attribute for static objects, supported in gcc family of compilers. As the result, there is no restriction on the compiler optimization level, unlike other OS cores. Another advantage is the platform-independence of the code.
Since the version 1.05 CCore supports the 64-bits Linux development. The host target LIN64 is provided. This target is developed based on Ubuntu 13.04 (running on the VirtualBox), but should be fine on others 64-bits Linux platforms.
To deploy CCore on Linux, you need to install some additional developers components.
First, you need gcc-4.7.1 or later.
Second, you need the library libaio.
Finally, you need the library libgmp.
On Ubuntu you may use the following command to install additional packages:
sudo apt-get install <package-name>
The packages you need are: g++, libaio-dev, libgmp-dev (double check with the system support).
Once you have installed required packages, place CCore at a desired directory. You need /bin subdirectory in your home directory for tools, it must be included in the search path. You have to replace the Makefile in the CCore root by the Makefile.LIN64. You also have to edit the file Makefile.host: change it from
CCORE_TARGET = WIN32
to
CCORE_TARGET = LIN64
To run on the VirtualBox hack the source code at the file IntelCPUID.s (Target/LIN64/CCore/src/crypton). Uncomment the following line to get the hardware AES support.
# orl $0x42000000, %ecx
Since the version 1.06 CCore supports the 64-bits Windows development using cygwin64. The host target WIN64 is provided. This target is simpler in use, than WIN32. All you need to deal is the cygwin64 installation. You don't need additional compilers and dll management.
To use WIN64, you need to install cygwin64 with gcc-4.8.1 (or later) and libgmp-devel.
Once you have installed required packages, place CCore at a desired directory. You need /bin subdirectory in your home directory for tools, it must be included in the search path. You have to replace the Makefile in the CCore root by the Makefile.WIN64. You also have to edit the file Makefile.host: change it from
CCORE_TARGET = WIN32
to
CCORE_TARGET = WIN64
Since the version 1.08 CCore includes the target BeagleBoneBlack. You can use this target to build applications running on the popular board BeagleBone Black. Read this document to learn more about this target.
CCore is a language support library. It's created to provide an improved language support for C++ and to replace the error-prone and obsolete "old bad" C RTL and STL. CCore is focused on the "everyday programmer's needs", it tries to be small, but powerful.
In particular, it contains:
XCore is a multi-task core for embedded systems. It is combined with CCore library. The core is designed for single-core CPU systems.
XCore:
One of the innovation in CCore is the set of task synchronization objects. Mutex, Event and Sem(aphore) are common. But we widely use also: AntiSem, ResSem, MultiSem, MultiEvent.
AntiSem is useful for the resource control:
class AntiSem : public Funchor_nocopy { .... public: // constructors explicit AntiSem(ulen level=0); explicit AntiSem(TextLabel name,ulen level=0); ~AntiSem(); // add/sub void add(ulen dcount); void sub(ulen dcount); // inc/dec void inc() { add(1); } void dec() { sub(1); } // wait bool try_wait(); void wait(); bool wait(MSec timeout); bool wait(TimeScope time_scope); // functions Function<void (void)> function_inc(); Function<void (void)> function_dec(); };
AntiSem waits until "all taken is released". I.g. until the internal counter falls below a given level (usually 0).
ResSem is used to control a resource allocation. It is combined Sem and AntiSem.
class ResSem : public Funchor_nocopy { public: // constructors explicit ResSem(ulen max_count); ResSem(TextLabel name,ulen max_count); ~ResSem(); // give void give(); // take bool try_take(); void take(); bool take(MSec timeout); bool take(TimeScope time_scope); // wait bool try_wait(); void wait(); bool wait(MSec timeout); bool wait(TimeScope time_scope); // functions Function<void (void)> function_give(); };
ResSem has the internal counter between 0 and the given max_count (initial value). You can take and give it back. take may wait if the counter is zero. Finally, wait waits until the counter reaches max_count.
MultiSem and MultiEvent are "multi-channel" versions of the Sem and Event. They can wait for one of the several events. They also ensure the "fairness" in the event reporting.
template <ulen Len> class MultiEvent : public Funchor_nocopy { public: // constructors MultiEvent(); explicit MultiEvent(TextLabel name); ~MultiEvent(); // trigger bool trigger(ulen index); // [1,Len] // wait ulen try_wait(); // [0,Len] ulen wait(); // [1,Len] ulen wait(MSec timeout); // [0,Len] ulen wait(TimeScope time_scope); // [0,Len] // functions template <ulen Index> Function<void (void)> function_trigger(); }; template <ulen Len> class MultiSem : public Funchor_nocopy { public: // constructors MultiSem(); explicit MultiSem(TextLabel name); ~MultiSem(); // give void give(ulen index); // [1,Len] // take ulen try_take(); // [0,Len] ulen take(); // [1,Len] ulen take(MSec timeout); // [0,Len] ulen take(TimeScope time_scope); // [0,Len] // functions template <ulen Index> Function<void (void)> function_give(); };
All synchronization classes "publish" "giving" functions callbacks.
Packet is a micro-task. It has the associated small stack to store call parameters and return values. A larger data buffer also may be attached. Packets allow design of a request processing systems as a collection of packet-processing devices. Packets are initiated by some initiator and passed to the processing device. It may pass a packet further until it's completed or cancelled by the initiator. Initiator assigns a completion function for a packet. So when packet is completed it goes to this function, where result can be extracted and packet is disposed. Also a completion signaling is performed there.
CCore includes implementations of lists, trees, and arrays.
CCore lists and trees are intrusive. Intrusive linked containers have the following advantages:
CCore implements wide range of lists, both single linked and double linked, linear and circular.
CCore implements radix and red-black trees.
CCore provides implementation for dynamic arrays. Unlike STL vector, CCore arrays may contains object of any types, there is no requirement for copyability.
PTP — packet transaction protocol. It supersedes TCP as a main network protocol for client-server applications. PTP is a packet-based, parallel and transactional protocol. It is simple and convenient for the development of "remote call" type interactions. Parallel nature of PTP makes obsolete such tricks as multi-thread FTP download. PTP is working atop a packet point-to-point or point-to-multipoint service like UDP (or even raw Ethernet). PTP has ability to adapt for smaller MTU lengths, that is important to combine with another network protocols, which can reduce MTU (for example, to implement encapsulation or encryption).
There are several typical problems when network interaction is developed based on TCP:
PTP resolves all these issues.
PTPServer — a PTP server on a host machine, it provides access to the host file system via HFS over PTP protocols.
DDL — data definition language. It is designed to represent an abstract linked data in a textual form. DDL has a C-style syntax. Here is a short example of a parser state machine representation, expressed in DDL:
struct State { StateIndex state; struct Transition { NTIndex ntt; State *state; } [] transitions; struct Final { TIndex t; Rule *rule; } [] finals; }; State[22] StateTable= { { 0 , { { 1 , StateTable+1 }, { 5 , StateTable+2 }, { 6 , StateTable+3 }, { 7 , StateTable+4 }, { 8 , StateTable+16 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, ....
DDL can be used for a manually introduced data, like configuration information. Or it can be used to store a program-generated data to exchange with different data-processing programs.
LangLR1 is a tool for generation LR1 parser state machines. It takes a language description and produces a .ddl file with a state machine description. You can use this description further to generate code in any suitable for your purpose form. Another tool — ParserGen produces C++ code from a .ddl output in a some particular form.
Here is an example, the AMP language:
/* AMP.lang */ A : { M : A1 A + M : A2 } M { P : M1 P * M : M2 } P { x : P1 ( A ) : P2 }
Output is:
/* State.ddl */ type RIndex = uint ; type TIndex = uint ; type NIndex = uint ; type NTIndex = uint ; type StateIndex = uint ; RIndex RIndexLim = 7 ; TIndex TIndexLim = 6 ; NIndex NIndexLim = 3 ; NTIndex NTIndexLim = 9 ; // T , N StateIndex StateIndexLim = 22 ; struct State { StateIndex state; struct Transition { NTIndex ntt; State *state; } [] transitions; struct Final { TIndex t; Rule *rule; } [] finals; }; struct Rule { RIndex rule; text name; NIndex result; NTIndex[] str; }; struct NonTerminal { NIndex nt; text name; Rule * [] rules; }; State[22] StateTable= { { 0 , { { 1 , StateTable+1 }, { 5 , StateTable+2 }, { 6 , StateTable+3 }, { 7 , StateTable+4 }, { 8 , StateTable+16 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, { 1 , { { 1 , StateTable+5 }, { 5 , StateTable+6 }, { 6 , StateTable+7 }, { 7 , StateTable+8 }, { 8 , StateTable+19 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, { 2 , { }, { { 0 , RuleTable+5 }, { 3 , RuleTable+5 }, { 4 , RuleTable+5 } } }, { 3 , { { 4 , StateTable+9 } }, { { 0 , RuleTable+0 }, { 4 , RuleTable+0 } } }, { 4 , { }, { { 0 , RuleTable+1 }, { 4 , RuleTable+1 } } }, { 5 , { { 1 , StateTable+5 }, { 5 , StateTable+6 }, { 6 , StateTable+10 }, { 7 , StateTable+8 }, { 8 , StateTable+19 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, { 6 , { }, { { 2 , RuleTable+5 }, { 3 , RuleTable+5 }, { 4 , RuleTable+5 } } }, { 7 , { { 2 , StateTable+11 }, { 4 , StateTable+12 } }, { { 2 , RuleTable+0 }, { 4 , RuleTable+0 } } }, { 8 , { }, { { 2 , RuleTable+1 }, { 4 , RuleTable+1 } } }, { 9 , { { 1 , StateTable+1 }, { 5 , StateTable+2 }, { 7 , StateTable+14 }, { 8 , StateTable+16 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, { 10 , { { 2 , StateTable+17 }, { 4 , StateTable+12 } }, { { 2 , RuleTable+0 }, { 4 , RuleTable+0 } } }, { 11 , { }, { { 0 , RuleTable+6 }, { 3 , RuleTable+6 }, { 4 , RuleTable+6 } } }, { 12 , { { 1 , StateTable+5 }, { 5 , StateTable+6 }, { 7 , StateTable+18 }, { 8 , StateTable+19 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, { 13 , { { 1 , StateTable+5 }, { 5 , StateTable+6 }, { 7 , StateTable+20 }, { 8 , StateTable+19 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } }, { 14 , { }, { { 0 , RuleTable+2 }, { 4 , RuleTable+2 } } }, { 15 , { }, { { 0 , RuleTable+4 }, { 4 , RuleTable+4 } } }, { 16 , { { 3 , StateTable+21 } }, { { 0 , RuleTable+3 }, { 3 , RuleTable+0 }, { 4 , RuleTable+3 } } }, { 17 , { }, { { 2 , RuleTable+6 }, { 3 , RuleTable+6 }, { 4 , RuleTable+6 } } }, { 18 , { }, { { 2 , RuleTable+2 }, { 4 , RuleTable+2 } } }, { 19 , { { 3 , StateTable+13 } }, { { 2 , RuleTable+3 }, { 3 , RuleTable+0 }, { 4 , RuleTable+3 } } }, { 20 , { }, { { 2 , RuleTable+4 }, { 4 , RuleTable+4 } } }, { 21 , { { 1 , StateTable+1 }, { 5 , StateTable+2 }, { 7 , StateTable+15 }, { 8 , StateTable+16 } }, { { 1 , RuleTable+0 }, { 5 , RuleTable+0 } } } }; text[6] TNames= { "(End)", "T(\"(\")", "T(\")\")", "T(\"*\")", "T(\"+\")", "T(\"x\")" }; Rule[7] RuleTable= { /* shift, special */ { 0 , "<-" }, { 1 , "A1" , 0 , { 7 } }, { 2 , "A2" , 0 , { 6, 4, 7 } }, { 3 , "M1" , 1 , { 8 } }, { 4 , "M2" , 1 , { 8, 3, 7 } }, { 5 , "P1" , 2 , { 5 } }, { 6 , "P2" , 2 , { 1, 6, 2 } } }; NonTerminal[3] NonTerminalTable= { { 0 , "A" , { RuleTable+1, RuleTable+2 } }, { 1 , "M" , { RuleTable+3, RuleTable+4 } }, { 2 , "P" , { RuleTable+5, RuleTable+6 } } };
DDL implementation in CCore is built using these tools.
Regen is a tool for a generating helper classes and constants from a register description. It is used to simplify and beautify the low-level register device programming.
An example of the register description (IXP465 timers control):
reg Status : 32 { T0 : . T1 : . TS : . WD : . WarmReset : . } // TS reg TS : 32 {} reg TSCmp : 32 {} reg TSCfg : 32 { MHz50 : . Pause : . } reg TSPrescale : 32 { Div : .+16 } // T0 reg T0 : 32 {} reg T0Reload : 32 { Enable : . OneShort : . Reload : .+30 } reg T0Cfg : 32 { Reload : .+2 MHz50 : . Pause : . } reg T0Prescale : 32 { Div : .+16 } // T1 reg T1 : 32 {} reg T1Reload : 32 { Enable : . OneShort : . Reload : .+30 } reg T1Cfg : 32 { Reload : .+2 MHz50 : . Pause : . } reg T1Prescale : 32 { Div : .+16 } // WD reg WD : 32 {} reg WDKey : 32 { Key : .+16 { Open = 482Eh Close = 0 } } reg WDControl : 32 { Reset : . Int : . Enable : . } // bar bar OSTBar : address { TS = . T0 = . RO T0Reload = . T1 = . RO T1Reload = . WD = . WDControl = . WDKey = . Status = . TSCmp = . TSCfg = . TSPrescale = . T0Cfg = . T0Prescale = . T1Cfg = . T1Prescale = . }
And the output:
/* IXP465.OST.gen.h */ /* struct Type_Status */ enum Bits_Status : uint32 { Status_T0 = 0x00000001, Status_T1 = 0x00000002, Status_TS = 0x00000004, Status_WD = 0x00000008, Status_WarmReset = 0x00000010 }; inline Bits_Status operator | (Bits_Status a,Bits_Status b) { return Bits_Status(uint32(a)|uint32(b)); } struct Type_Status { typedef uint32 Type; Type value; explicit Type_Status(Type value_=0) : value(value_) {} operator Type() const { return value; } void operator = (Type value_) { value=value_; } template <class Bar> Type_Status & setTo(Bar &bar) { bar.set_Status(*this); return *this; } template <class Bar> Type_Status & setTo(Bar &bar,uint32 ind) { bar.set_Status(*this,ind); return *this; } template <class T> Type_Status & set(T to) { to(*this); return *this; } Type_Status & setbit(Bits_Status bits) { value|=Type(bits); return *this; } Type_Status & setbitIf(bool cond,Bits_Status bits) { if( cond ) value|=Type(bits); return *this; } Type_Status & clearbit(Bits_Status bits) { value&=~Type(bits); return *this; } Type_Status & clearbitIf(bool cond,Bits_Status bits) { if( cond ) value&=~Type(bits); return *this; } Type maskbit(Bits_Status bits) const { return value&bits; } bool testbit(Bits_Status bits) const { return (value&bits)==Type(bits); } template <class P> void print(P &out) const; .... }; ....


--- layout: default title: Content Creation and Perceived Performance permalink: /events/2013/content-performance/ --- {% assign currentEvent = page.title %}


 It will display a warning if the balance is unconfirmed.
Balance Widget Code
Shows the amount received by an address. Perfect for projects to show their donation count.
Received Widget Code


Commit new characters into the input field below to change the model's data
The current model data is...


own life energy
Energy
product Creator
Investment Portal
God Stats
System Life Energy
92,050
Own Life Energy
92,050
10% decrease per minute
Threshhold for investor
90
%
Lower Threshhold
90
%
150
profit gained
Interactive Life Energy Chart
Real time
On
Off


I love dolphins
I have 20 kids
I play the tamborine, tuba and didgeridoo.
I am an olympic speedwalker.


All content on this site is CC-BY-SA 4.0. Do with it what you will, but link back to this page, and if you publicly-release any content based on this page’s resources, be sure to license that content as CC-BY-SA 4.0, as well.
All resources on this site https://codercar.botinabox.ca are provided for informational purposes only. Anything you do because of what you read on this site is at your own risk, and I am not responsible for whatever happens because you accessed this site.
CodeRcar is an open-source project, released AS-IS, with no warranty (expressed or implied).
Have fun; learn something; be safe.
Sincerely, Matthew Piercey - Owner of Bot-In-a-Box Educational Robotics


[§342P-34] Priority in courts. All actions brought pursuant to this chapter, the rules adopted under this chapter, or the conditions of a permit issued under this chapter, at the discretion of the court, shall receive priority in the courts of the State. [L 1991, c 219, pt of §1]
Note
The amendment made by L 2014, c 218, §8 is not included in this section.


PHPFarm Episode 1: Getting started¶
So far, I merely described the raison d’être of phpfarm. In this new post, we’ll get things rolling by actually using it to build and install a single version of PHP.
Our hopes and expectations¶
phpfarm is a great tool, really. It provides for a very simple, and yet very flexible way to get multiple versions of PHP running side-by-side on a Linux or Mac system.
At the same time, it is not always clear what to use it for and how. So, let’s first review what it can and cannot do.
Can do:
- Build a stock PHP version from source on a standard Linux/Mac box.
- Script the installation of multiple versions with shared and version-specific build options.
- Isolate PHP versions from one another (separate binaries, separate configuration files, etc.)
- Automate the installation of a PEAR workspace.
- Compile and install PECL extensions.
No, can’t do:
Build PHP on a Microsoft Windows system.
...but maybe? PHPFarm uses various tools from the Linux world (eg. gcc). While it may be possible to use these under Windows too using specific environments (eg. MingW or Cygwin), the resulting binaries would not really be native Windows executables, which may cause issues later on.
Create “virtual environments”.
Unlike Python’s virtualenv project which can be used to create separate copies (environments) of the same Python version, phpfarm can only be used to create exactly one copy per PHP version.
However, this is generally not a problem unless your project uses function/class names that conflict with those from the PHP interpreter (either built-in names or through PHP extensions), or it relies on PEAR libraries.
Help diagnose misconfigurations / incorrect setups and so on.
While PHPFarm strives to give meaningful error messages for things under its control (eg. “Unknown option used when building ...”), there are many ways in which a particular build may fail, involving missing libraries/packages, bugs in third-party tools, incorrect options (eg. attempting to build a 64 bits version of PHP on a 32 bits system), etc.
PHPFarm can’t detect those. In case such an error occurs, you have to deal with the issue yourself.
It’s fairly safe to say that most PHP developers will probably never hear of phpfarm, nor will they have any need for it. It is mainly aimed at specific needs. Eg.
Continuous integration
Because phpfarm provides many hooks to customize the build and installation processes, it is perfect in situations where you need a repeatable way to build different PHP versions (eg. for the purpose of testing a PHP extension or application)
Benchmarking
PHPFarm can be useful if you’re looking for a quick way to set up a benchmark platform (eg. for performance comparison of some PHP code across various PHP versions)
Building a single version of PHP¶
Okay, now that we understand what PHPFarm can be used for, how do we actually use it?
Provided you have a standard developer environment (a compiler, development headers, etc.), you first need to clone the project’s git repository:
clicky@localhost:~/$ git clone https://github.com/fpoirotte/phpfarm.git
This will create a phpfarm
folder in the current directory.
Now, go to that folder and into the src
subfolder,
this is where all the good stuff is:
clicky@localhost:~$ cd phpfarm/src/
Call main.sh
with the PHP version you want to build, eg.:
clicky@localhost:~/phpfarm/src$ ./main.sh 7.0.0RC3
With that last command, we instructed PHPFarm to build and install a version of PHP (in our case, 7.0.0RC3 which was released just a few days ago). Depending on your machine, this may take 2-20 minutes to complete, so now is probably a good time to take a break (and drink a cup of coffee).
Once PHPFarm is done, go into the inst
directory at the top of PHPFarm’s
sources, you should see something like this:
clicky@localhost:~/phpfarm/src$ cd ../inst
clicky@localhost:~/phpfarm/inst$ ls -1p
bin/
php-7.0.0RC3/
The bin
folder contains symbolic links to the various executables
that were built as part of the PHP build process.
To test our new installation, just call the php interpreter with a very basic script:
clicky@localhost:~/phpfarm/inst$ bin/php-7.0.0RC3-debug -r 'echo "Hello world!" . PHP_EOL;'
Hello world!
Now, call the switch-phpfarm
script to mark the newly-built version
as the main version of PHP.
clicky@localhost:~/phpfarm/inst$ bin/switch-phpfarm 7.0.0RC3
Setting active PHP version to 7.0.0RC3
PHP 7.0.0RC3 (cli) (built: Sep 19 2015 14:58:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
Calling switch-phpfarm
with no arguments displays a list of all installed
PHP versions and the one that is currently selected as the main version.
In my case, I have several versions installed and PHP 7.0.0RC3 is the main one
as a result of the previous commands.
clicky@localhost:~/phpfarm/inst$ bin/switch-phpfarm
Available versions:
5.3.29
5.4.45
5.5.29
5.6.13
* 7.0.0RC3
Setting the main version creates a symbolic link called current
under the inst
folder. This is useful to get version-independent
paths for the PHP executables:
clicky@localhost:~/phpfarm/inst$ current/bin/php -v
PHP 7.0.0RC3 (cli) (built: Sep 19 2015 14:58:10)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
Down to business: customization¶
So far, we’ve seen how to build a single version of PHP.
Notice that we did not specify any build options (--enable-xxx
,
--with-xxx
and so on) to do so.
In fact, PHPFarm used various default options for the build.
These defaults are located in the options.sh
script under the src
folder. PHPFarm also create a php.ini
configuration file automatically,
based on the contents of the php.ini-development
file bundled with
the PHP sources and the default-custom-php.ini
from PHPFarm’s sources.
But what if we wanted to used custom build options and custom php.ini
settings? First, create a folder named custom
at the root of phpfarm’s
sources, and descend into it:
clicky@localhost:~/phpfarm/inst$ mkdir ../custom
clicky@localhost:~/phpfarm/inst$ cd ../custom
Now, create a file named options.sh
.
This script should (re)define the $configoptions
variable with whatever
options fit your needs:
clicky@localhost:~/phpfarm/custom$ cat options.sh
# Build the JSON PHP extension as a dynamic library (.so)
# in addition to extensions from the default options.sh script.
configoptions="$configoptions --enable-json=shared"
Similarly, you can create a file named php.ini
to overwrite settings
from the default-custom-php.ini
file.
clicky@localhost:~/phpfarm/custom$ cat php.ini
date.timezone=Europe/Paris
# $ext_dir gets replaced with the full path
# to the extensions' directory by phpfarm.
extension_dir="$ext_dir"
# Now, enable the JSON extension.
extension=json.so
That’s it for now...
Going further¶
In the next post in this series, I’ll explain how to manage multiple PHP versions and give you some tips about advanced usage of PHPFarm.
In particular, I’d like to explain how I use it to manage PECL extensions and why I think most people do it wrong.
Have you ever used PHPFarm on an esoteric operating system? Maybe even Windows?
Did you know about the existence of the custom
folder and its content?
Please tell me all about it using the comments form below!


🎂
Brace yourself for the finest collection of corniest birthday jokes!
🎂
It's Nathalia's Birthday! TomTomTomTomWho's Tom?!
A special day for a very special girl
Born on a Thursday
(Saturday, actually, I googled itit just rhymed with "birthday" better..Let's pretend it was Thursday)
A very happy lil' babe... with a very special soul!
🎂
We all know that deep inside you're just an 18 year old
with 6 years of experience being officially an adult
🎂
Nathalia's turning twenty four,
Time to take her for a tour (of the US)!
🎂
"Наталье двадцать четыре
восклицают во всем мире!"
Translation
🎂
Forget about the past - you can't change it
Forget about the future - you can't predict it
Forget about the present - I didn't get you one!ayyyye!
🎂
In all seriousness though I just thought that
I'd make this goofy page to say
that I am glad to have met you and am lucky
to be part of your First American Birthday celebrations!
1⃣ 🇺🇸 🎂 🎉
Happy Birthday!
♥ 🎂V 🎂♥
🇧🇷 🇺🇸 🇷🇺
By the way, all the dancing cats on this page are the same cats your rescued back home!
April 1st, 2019
Увидел ошибку - прими за улыбку :)


{% extends "layout.html" %} {% block page_title %} DBS Prototype {% endblock %} {% set main_question = "Payment screens placeholder" %} {% block content %} {% include 'includes/phase_banner_alpha.html' %} Back {% include 'includes/error_summary.html' %}{# include if this page has validation requirements #} {{ main_question }} This is where it would redirect to GOV.UK Pay Not shown here as we don't have control to change the Pay prototype screens or where they redirect THIS IS A PLACEHOLDER WHICH WILL NOT EXIST IN PRODUCTION {% endblock %}
This is where it would redirect to GOV.UK Pay
Not shown here as we don't have control to change the Pay prototype screens or where they redirect
THIS IS A PLACEHOLDER WHICH WILL NOT EXIST IN PRODUCTION


Aetas Bangkok
Lumpini Pathumwan, Bangkok - Thailand
AETAS bangkok invites you to be our guest, whether you are traveling to Bangkok on business or for pleasure. Our hotel is situated right in the heart of the city and offers a location and facilities that will meet your every need and convenience.
Map
Free Wifi


John Fernely, a successful Victorian dauber who lived in Melton Mowbray, charged ten pounds to paint a portrait of a horse, but only seven pounds for a portrait of a cow. Were these costs fair? Would you have been prepared to pay more for a cow picture than a horse painting? If not, why not? What do you think was going on in Fernely's head when he set these prices? Comments please.


Created by <Academia de Código_>
In the beginning... computers didn't have operating systems, they executed a single program from beginning to end with direct access to all the resources of the machine.
Operating Systems allow more than one program to execute, running individual programs in processes. Each process is isolated and executes independently from others, getting its share of resources such as memory, file handles, etc.
Processes can communicate through a variety of Inter Process Communication (IPC) mechanisms, such as sockets, signal handlers, shared memory, semaphores and files.
Allow multiple streams of program control flow to coexist and execute simultaneously within one single process.
They share process-wide resources such as memory and file handles, but they have their own stack and local variables.
All Threads within a process have access to the same variables, allowing them to share data without using IPC mechanisms.
Without explicit synchronization to coordinate access to shared data, a thread may modify variables that another thread is in the middle of using, with unpredictable results
Threads can simplify the development of complex systems, by turning complicated asynchronous code (remember JavaScript callback hell...) into simpler straight-line code.
Threads are the easiest way to take advantage of the computing power of multi-processor and multi-core systems.
Threads are an inescapable feature of the Java language, even if you do not explicitly create them in your code.
We can explicitly create a Thread in our code by:
The second is the proper way to do it, we are not really extending the thread behaviour but simply giving it something to run, while retaining the possibility for extending from something else.
There are times when one thread might want to wait for another thread to finish its execution or for some specific condition to occur
Loops are expensive and will eat up all the available CPU
We can throw a Thread.sleep() in the loop, which will ease the CPU by blocking the thread, but there is no way of knowing for sure how much time we should wait. There has to be another way to block those Threads...
Locks provide the proper way to achieve thread synchronization, but for now let's have a look at the Thread join method
Code that executes and behaves correctly when accessed simultaneously by multiple threads is called thread safe
Concurrent programming errors tend to fall into one of these three categories:
Memory Reads and Writes are slow and expensive operations compared to CPU internal registers. Modern CPUs introduced L1/L2 caches to speed things up.
Variables are not always read from or written to memory, but to the cache of the specific CPU the thread is executing on.
// thread unsafe class
public class IDFactory {
private long currentId = 0L;
public long getNextId() {
// retrieves and writes from cache
return currentId++;
}
}
Declare the variable volatile
Volatile variables will never be cached, all reads and writes will go straight to main memory
An operation (or set of operations) is atomic if it appears to occur instantaneously to the rest of the system.
Atomic operations commonly have a succeed-or-fail definition; they either successfully change the state of the system, or have no apparent effect.
Non-atomic operations in concurrent programming can cause sporadic and extraneous behaviour, which by nature will likely be hard to reproduce and debug.
// thread unsafe class
public class IDFactory {
volatile private long currentId = 0L;
public long getNextId() {
// How many operations are involved in incrementing a long?
return currentId++;
}
}
// is this class thread safe?
public class IDFactory {
volatile private long currentId = 0;
public long getNextId() {
// How many operations are involved here?
return currentId++;
}
}
The java.util.concurrent.atomic package defines classes that support atomic operations on single variables
All classes have get and set methods that work like reads and writes on volatile variables
public class IDFactory {
private AtomicLong currentId = new AtomicLong(0);
public long getNextId() {
return currentId.getAndIncrement();
}
}
Atomic Variables solve atomicity problem for isolated variables, but we need to watch for other types of Atomicity issues
public void withdrawMoney(int money) {
// CHECK
if (balance >= money) {
// ACT
balance -= money;
}
}
Watch out for CHECK-THEN-ACT type of logic, everything can happen between checking and acting!
The Java compiler can change the order of execution if it believes the outcome will not change...
//Code of Thread 1
operationResult = executeVeryComplexComputation();
done = true;
//Code of Thread 2
if (done) {
// This could go wrong...
System.out.println(operationResult);
}
This compiler assumption does not hold true in multithreading
How do we solve them?
Either we learn to cope with concurrency issues or we have to work with immutable objects only...
Immutable objects can help us make our objects thread safe.
The final keyword can be used to help enforce immutability:
// Immutable counter
final class Counter {
final int count;
public Counter(int value) {
this.count = value;
}
public int getCount() {
return count;
}
public Counter increment() {
return new Counter(count + 1);
}
}
Java provides a built-in locking mechanism, the synchronized block
The synchronized block has two parts:
synchronized (lock) {
// Access or modify shared state guarded by lock
}
Threads acquire a lock when entering a synchronized block
Threads release a lock when exiting the synchronized block
Only one single thread can hold the lock
If a thread attempts to acquire a lock that is already taken, it will block until that lock is released
// thread safe class
public class IDFactory {
// Shared mutable state is guarded by a lock on the object instance
private long currentId = 0L;
public long getNextId() {
synchronized(this) {
return currentId++;
}
}
}
Shorthand for synchronizing all the code inside a method with a lock on the object instance
// thread safe class
public class IDFactory {
// Shared mutable state is guarded by a lock on the object instance
private long currentId = 0L;
public synchronized long getNextId() {
return currentId++;
}
}
Efficient way to coordinate actions between Threads
public synchronized void guardedHappiness() {
// loop until happiness is achieved
while(!happy) {
try {
wait(); // release the lock and block until we get interrupted
} catch (InterruptedException e) {}
}
System.out.println("Happiness has been achieved!");
}
Always invoke wait inside a loop that tests for the condition being waited for.
public synchronized void notifyHappiness() {
happy = true;
notifyAll(); // notify all threads that blocked while using the same lock
}
wait, notify and notifyAll are methods inherited from Object
Invoking them on different objects will cause an IllegalMonitorStateException
notifyAll will unblock all threads and then let them fight for the lock
notify unblocks only one, but each thread needs to remember to unlock the next one
Classic example of a multi-process synchronization problem.
The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue.
The producer's job is to generate data, put it into the buffer, and start again.
At the same time, the consumer is consuming the data, removing it from the buffer, one piece at a time.
The problem is to make sure that the producer won't try to add data into the buffer if it's full and that the consumer won't try to remove data from an empty buffer.
Producer alerts when it has left the queue full
Consumer alerts when it has left the queue empty
State is encapsulated and all public methods are synchronized. This makes all operations on these classes atomic at the cost of poor concurrency, which can affect performance
The synchronized collection classes include:
Designed for concurrent access from multiple threads, replacing synchronized collections with concurrent collections can offer dramatic scalability improvements
The concurrent collection classes include:
Concurrency is hard, can't I just make everything volatile and synchronized?
You can, but...
Let's go back to our concurrent web server
private void dispatch(ServerSocket bindSocket) {
while (true) {
// accepts client connections and instantiates client dispatchers
ClientDispatcher clientDispatcher = new ClientDispatcher(bindSocket.accept());
// launch the client thread
Thread clientThread = new Thread(clientDispatcher);
clientThread.start();
}
}
Your single threaded Web Server worked but it performed poorly because it could only handle one request at a time
Executing each request in its own thread was an improvement over sequential execution because it enabled the main loop to resume waiting for the next incoming connection more quickly.
But, is it safe?...
Creating a new thread for each request can consume significant computing resources.
There are limits on how many threads can be created, imposed by both the JVM and the OS.
When you hit this limit, the most likely result is an OutOfMemoryError.
Having nothing but the rate at which users throw HTTP requests at your server to limit thread creation, makes you vulnerable to a malicious user or enough ordinary ones.
java.util.concurrent provides a flexible thread pool implementation.

The Executor interface provides a standard means of decoupling task submission from task execution, describing tasks with Runnable.
public interface Executor {
/**
* Executes the given command at some time in the future. The command
* may execute in a new thread, in a pooled thread, or in the calling
* thread, at the discretion of the implementation.
*/
void execute(Runnable command);
}
Reusing an existing thread reduces the costs of creating a new one for each request
Since most of the time, the worker thread is already there, task execution will not be delayed, improving responsiveness.
It gives you access to other actions such as tuning, management, monitoring, logging, or error reporting.
The ExecutorService interface extends Executor and provides multiple convenience methods for the lifecycle management of the Executor and submission of tasks.
An ExecutorService can be shut down, which will cause it to reject new tasks
You can create a thread pool by calling one of the static factory methods in Executors
// Allocate a Pool of 4 fixed threads
ExecutorService fixedPool = Executors.newFixedThreadPool(4);
// submit 10 tasks to be executed
for(int i = 0; i < 10; i++){
fixedPool.submit(new Runnable());
}
// shut down the executor after all submitted tasks are finished
fixedPool.shutdown();
A fixed-size thread pool creates threads as tasks are submitted, up to the maximum pool size, and then attempts to keep the pool size constant (adding new threads if a thread dies due to an unexpected Exception).
// Allocate a Pool of an undefined number of threads
ExecutorService cachedPool = Executors.newCachedThreadPool();
// submit 10 tasks to be executed
for(int i = 0; i < 10; i++){
cachedPool.submit(new Runnable());
}
// shut down the executor immediately, even if the submitted tasks haven't finished its execution
cachedPool.shutdownNow();
A much more flexible pool, will terminate idle threads when the current size of the pool exceeds the demand for processing, and add new ones when demand increases. Does not impose a size limit to the pool.
// Create an executor for a single thread
ExecutorService singleExecutor = Executors.newSingleThreadExecutor();
// submit 10 tasks to be executed sequentially
for(int i = 0; i < 10; i++){
singleExecutor.submit(new Runnable());
}
// shut down the executor after all submitted tasks are finished
singleExecutor.shutdown();
Creates a single worker thread to process tasks, replacing it if it dies unexpectedly. Tasks are guaranteed to be processed sequentially according to the order imposed by the task queue (FIFO, LIFO, priority order).


C, V to go down and up octaves
Q, W, E, R, T, Y and U for natural keys
G, H, J, K, and L for sharps/flats


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SetRefRepr interface Used in data flow analysis to represent a Stmt in HIR and an instruction in LIR. This is a wrapper interface that bridges the different data structure and interfaces between HIR and LIR. Used in conjuction with SetRefReprList and its associated SetRefReprIterator, this class serves as a basic building block for basic data flow analysis/optimization.
SetRefReprImpl
| Field Summary | |
static int |
HAS_CONTROL
|
static int |
IS_RETURN
|
static int |
SETS
|
| Method Summary | |
boolean |
allFalse()
|
java.util.List |
callNodes()
|
IR |
defNode()
Returns the IR node which links to the definitely defined (set) symbol. |
FlowAnalSym |
defSym()
Returns the symbol that is definitely defined in this SetRefRepr. |
java.util.Iterator |
expIterator()
|
java.util.ListIterator |
expListIterator()
Returns a DFO iterator that iterates over nodes that have a FlowExpId attached, and, if "this" is value-setting, is not a Def node. |
java.util.ListIterator |
expListIterator(boolean pFromTop,
boolean pFromLeft)
Returns an DFO iterator that iterates over nodes that have a FlowExpId attached, and, if "this" is value-setting, is not a Def node. |
BBlock |
getBBlock()
|
FlowAnalSym |
getDefSym()
|
boolean |
getFlag(int pFlag)
|
IR |
getIR()
Returns the IR node this SetRefRepr represents. |
java.util.Set |
getUseFlowAnalSyms()
|
boolean |
hasCallWithSideEffect()
|
boolean |
hasControl()
Does this SetRefRepr is at the end of the
BBlock and has a role to determine the flow of control
after this SetRefRepr ? |
boolean |
isReturn()
|
java.util.Set |
lhsSyms()
Returns the set of symbols that correspond to the set of nodes that are within the LHS of this SetRefRepr . |
java.util.Set |
modSyms()
Returns the set of symbols that are possibly modified in this SetRefRepr. |
java.util.Set |
modSyms00()
Returns the set of symbols that are accessed by its name in the subprogram containing this SetRefRepr and possibly
defined in this SetRefRepr . |
NodeListIterator |
nodeListIterator()
DFO iterator over the nodes under the subtree returned by getIR . |
void |
setFlag(int pFlag,
boolean pYesNo)
|
boolean |
sets()
Returns true if this SetRefRepr involves value-setting, other than via the external call. |
IR |
topUseNode()
If this is a value-setting node, returns the top node of the RHS. |
java.lang.String |
toString()
Converts to a String object. |
java.util.Iterator |
useNodeIterator()
DFO iterator over the nodes under the subtree returned by getIR() , but the node returned by getDefNode() excluded. |
java.util.List |
useNodeList()
Returns the List of nodes that are associated with a Sym that are used (read), in the depth first order that appears under the subtree returned by getIR(). |
java.util.List |
useSymList()
Returns the List of FlowAnalSyms used in this SetRefRepr. |
java.util.Set |
useSyms()
Returns the Set of the FlowAnalSyms used in this SetRefRepr. |
boolean |
writesToDefiniteAddress()
|
| Field Detail |
public static final int SETS
public static final int HAS_CONTROL
public static final int IS_RETURN
| Method Detail |
public IR getIR()
public java.util.List useNodeList()
public java.util.Set useSyms()
public java.util.Set getUseFlowAnalSyms()
public java.util.List useSymList()
public IR defNode()
public FlowAnalSym defSym()
public java.util.Set modSyms()
public java.util.Set lhsSyms()
SetRefRepr
. Returns null if sets()
returns false
. The return value is a superset of the return value of getModSyms()
.
public java.lang.String toString()
public NodeListIterator nodeListIterator()
getIR
.
public IR topUseNode()
getIR()
.
public java.util.Iterator useNodeIterator()
getIR()
, but the node returned by getDefNode()
excluded.
public java.util.Iterator expIterator()
public java.util.ListIterator expListIterator()
public java.util.ListIterator expListIterator(boolean pFromTop, boolean pFromLeft)
pFromTop
- iterate from top?pFromLeft
- iterate from left?public boolean sets()
true
if this SetRefRepr
involves value-setting, other than via the external call.
public boolean hasCallWithSideEffect()
public java.util.List callNodes()
public boolean hasControl()
SetRefRepr
is at the end of the
BBlock
and has a role to determine the flow of control
after this SetRefRepr
?
public boolean isReturn()
public boolean allFalse()
public boolean getFlag(int pFlag)
public void setFlag(int pFlag, boolean pYesNo)
public boolean writesToDefiniteAddress()
public java.util.Set modSyms00()
SetRefRepr
and possibly
defined in this SetRefRepr
.
Symbols that can be externally defined (i.e. via exteranl calls)
are included as well
(differs from modSym in this point). //##25-1
This is used in FindPEKill, FindDEGen, //##25-1
and findDefUseExhaustively(), findUseDefExhaustively(). //##73
public FlowAnalSym getDefSym()
public BBlock getBBlock()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Hello, this is a H3 tag
Primary button
a pararaph
not print.... ajosdjf aiojsdf lkjasdkfj
No to print this div part...
Hello sujan shreshta
generate PDF


Borrowed Goods
First of all many thanks to quixotic the designer of Borrowed Goods for providing a clean error-free design and to the designer of Summer Holiday pogy366 for a beautiful design. I currently have Borrowed Goods on thoughts garden, didn't make too many changes to it but, added some accessibility features.
I notice some very nice features on Borrowed Goods:
- The whole page loads quickly in less than 1 second
- Valid XHTML1.0 and valid CSS
- There's a printable version of the CSS too, simply hit print-preview to see a page in printer friendly format
- Crawlers give importance to what's above the fold that's why it makes sense to have the side navigation *after* the content, if there would be too many links on the side nav.
- When viewed with a plain text browser such as Lynx the side navigation text is not repeated on the top of each page, but instead it's located at the bottom.
- Borrowed Goods template can easily be made accessible by following some of the guidelines here.
Summer Holiday
All top navigation tabs, background image and a few colors are from Summer Holiday.
A wider banner image could be added as a background on the header.
This template is free for any one to use, modify and share
Lorem Ipsum:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus eget nunc. Sed consectetuer. Quisque consectetuer tellus et eros. Morbi adipiscing eleifend enim. Nullam a diam. Aenean eget eros. Sed a sem at ante hendrerit varius. Nulla facilisi. Praesent rutrum viverra lectus. Mauris tempus pretium orci. Fusce viverra nibh ac tellus. Aliquam erat volutpat. Donec lacus. In cursus est scelerisque nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent a libero quis augue hendrerit vehicula.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum ac orci. Phasellus nisi erat, scelerisque sed, facilisis eget, consectetuer gravida, orci. Fusce velit. Vestibulum odio elit, pharetra eu, malesuada vel, faucibus vitae, justo. Vestibulum non lorem. Fusce rhoncus, est eu mattis fermentum, nunc eros rutrum ante, nec vulputate nisl tellus eget leo. Sed id urna nec orci bibendum pellentesque. Etiam dictum, purus ut ornare euismod, nulla felis bibendum ipsum, nec vehicula augue tortor quis dolor. Aenean non massa sit amet turpis condimentum egestas. Integer ultrices justo id purus. In condimentum. Donec in nulla. Maecenas ut elit non nisl laoreet blandit. Praesent id arcu. Aliquam erat volutpat. In hac habitasse platea dictumst. Curabitur eu mauris.


Simple Test Case of Mavo - Expressions.register() and Expressions.unregister()
This simple case tests bugs in Expressions.register() and Expressions.unregister() when an expression involves multiple Mavo applications. Refer to Issue #434 and issue #436 for details.
Application name: Mavo
What do you think about [app1.appname]
awesome
Discovery:
[app1.appname] is [if(app1.rating, app1.rating, app2.rating)] !
Developers, check the dev console for errors. Click the button below to watch errors during unregistering domexpression object.


Configure Questions
Edit
Personal Questions
Medical Questions
Social Questions
Environmental Questions
Family Questions
Miscellaneous Questions
...
...
New
Personal Questions
Medical Questions
Social Questions
Environmental Questions
Family Questions
Miscellaneous Questions
...
...
Footer


How to Extract Data from a NetCDF File
Many important and useful public sources of geophysical data are distributed in the Network Common Data Format or NetCDF. NetCDF is a well supported and flexible standard that can be adapted to a wide range of data products including both vector and raster (grid) data types. Examples of the use of NetCDF for raster data include digital elevation models, satellite imagery, and even ocean currents. But NetCDF's flexibility brings a level of complexity that sometimes makes it hard to get started with the NetCDF software libaries. On first inspection of the API, it is not always clear how to extract data from a NetCDF file.
This article will attempt to assist software developers using NetCDF by presenting an example implementation of a Java application that uses the NetCDF to access two geophysical data products: ETOPO1 and GEBCO_2019. Both these products provide global-scale collections of elevation and ocean-depth (bathymetry) information. ETOPO1 features over 233 million data points arranged in a geographic coordinate system (a latitude/longitude grid) at regular intervals of 1 minute of arc (equivalent to about 1.85 kilometers at the equator). GEBCO_2019 features more than 3.7 billion data points arranged with a grid spacing of 15 seconds of arc (equivalent to about 0.46 kilometers).
The figure below illustrates the difference in resolution for the two data sets.
The full source code for the Java application described in this article is available as part of the "demo" module at The Gridfour Software Project. in the class ExtractData.java. Some of the code snippets shown below have been modified for use in this article. The examples will help to clarify how to read NetCDF files in Java.
Let's get started. Opening a NetCDF file using the Java API is easy. The code block below shows how:
// inputPath is a Java string giving the path to a file such as // 1. ETOPO1_Ice_c_gmt4.grd // 2. GEBCO_2019.nc NetcdfFile ncfile = NetcdfFile.open(inputPath);
Most NetCDF files end in the file-extension ".nc". The ETOPO1 file is somewhat unusual in that it is specified with the extension ".grd".
Just like any other file-access API in Java, the NetCDF file functions can throw I/O exceptions. Fortunately, the NetCDF authors avoided the temptation to implement custom exceptions (with a few exceptions), so exception-handling code for NetCDF is largely the same as for any Java file-based API. For simplicity, the code snippets in this article omit the exception-handling elements.
Having opened the file, it's time for the ExtractData application to extract content. The primary mechanism for accessing information in a NetCDF file is through the use of a Java class named Variable. The example below obtains a list of all the Variable instances stored in the NetCDF file and prints it using a Java PrintStream named "ps". In this example, we initialize ps to System.out, but it could also be repurposed to write to a text file if we wanted a more permanent record of the extracted data. When printing to standard output, I have one caveat... The 5.1 version of the NetCDF Java API had a bug in which it would close standard output when processing the GEBCO data (but not the ETOPO1). Therefore I recommend that you use more recent (or earlier) versions of the library.
PrintStream ps = System.out; NetcdfFile ncfile = NetcdfFile.open(inputPath); ps.println("Variables found in file:"); List<Variable> variables = ncfile.getVariables(); for (Variable v : variables) { ps.println("\n" + v.toString()); }
Like conventional variables, NetCDF Variable objects are identified by name. And each Variable may be associated with an underlying standard data type (integer, short, float, etc.). Variables may store either a single value, an array of values, a grid of values, and so forth. Part of the flexibility of a NetCDF file is its ability to store multiple data sets within a single file all with different names, data types, and raster definitions. Each data set is associated with one or more Variables.
The Java NetCDF Variable class implements quite a good toString() method. The text below shows the output from the ETOPO1 data file ETOPO1_Ice_c_gmt4.grd. Both the ETOPO1 and GEBCO products contain only three Variables. It is, however, common for NetCDF files to contain dozens of variables (often including several different kinds of content).
Variables found in file: double x(x=21600); :long_name = "Longitude"; :actual_range = -180.0, 180.0; // double :units = "degrees_east"; double y(y=10800); :long_name = "Latitude"; :actual_range = -89.99999999999997, 90.0; // double :units = "degrees_north"; int z(y=10800, x=21600); :long_name = "z"; :_FillValue = -2147483648; // int :actual_range = -10803.0, 8333.0; // double
The angular spacing for the coordinate grid used by ETOPO1 is 1 minute of arc. There are 60 minutes in one degree. So a grid with a 360-degree range of coverage would include 360x60 = 21600 columns. And 21600 is, in fact, the order of the Variable x. The interpretation of the Variable y is a bit more complicated because it doesn't start and end at the poles (+/- 90 degrees latitude), but the arithmetic is similar.
One thing worth noting here is that the authors of ETOPO1 chose to include Variables defining the geographic coordinates (latitude and longitude) associated with each row and column in the grid. They could have just as easily included variables giving the overall range of the coordinates or a uniform cell-spacing specification. However, a lot of products currently being produced in NetCDF format seem to prefer the convention used by ETOPO1. This approach increases the size of the specifications by a small proportion. But it has the advantage of flexibility, because it allows for non-uniform coordinate specifications (i.e. rows that are not equally spaced, columns that are not equally spaced, etc.).
Before we look into how to extract numeric (or text) values from a NetCDF Variable, let's take a look at the output that would result if we used the same code as shown above on the GEBCO_2019.nc file.
double lon(lon=86400); :standard_name = "longitude"; :long_name = "longitude"; :units = "degrees_east"; :axis = "X"; :sdn_parameter_urn = "SDN:P01::ALONZZ01"; :sdn_parameter_name = "Longitude east"; :sdn_uom_urn = "SDN:P06::DEGE"; :sdn_uom_name = "Degrees east"; double lat(lat=43200); :standard_name = "latitude"; :long_name = "latitude"; :units = "degrees_north"; :axis = "Y"; :sdn_parameter_urn = "SDN:P01::ALATZZ01"; :sdn_parameter_name = "Latitude north"; :sdn_uom_urn = "SDN:P06::DEGN"; :sdn_uom_name = "Degrees north"; float elevation(lat=43200, lon=86400); :long_name = "Elevation relative to sea level"; :units = "m"; :sdn_parameter_urn = "SDN:P01::ALATZZ01"; :sdn_parameter_name = "Sea floor height (above mean sea level) {bathymetric height}"; :sdn_uom_urn = "SDN:P06::ULAA"; :sdn_uom_name = "Metres"; :standard_name = "height_above_reference_ellipsoid"; :_ChunkSizes = 1U, 86400U; // uint
As you can see, the GEBCO product uses different variable names than ETOPO1. The choice of variable names is a matter of convention and taste. In the GEBCO product, the dimensions of the lon and lat Variables are four times that of the corresponding x and y Variables used in ETOPO1. These parameters reflect the factor of four difference in resolution (15 seconds of arc for GEBCO versus the 60 minutes of arc used for ETOPO1). The GEBCO product also includes a few more descriptive data items than the ETOPO1 product had (including units-of-measure, sdn_parameter_name, etc.). The NetCDF Java API uses the term "attribute" to describe these items. The role of NetCDF attributes used in relation to Variables is similar to the role of attributes in XML specifications. Just as an XML attribute provides supplemental or descriptive data for the XML element that includes it, a NetCDF attribute provides supplemental or descriptive data for the Variable to which it belongs.
For the ExtractData demonstration application, I wanted to produce a result that would indicate whether the data had been extracted correctly. And it seemed like an output image would be a good indicator of success. So the ExtractDemo application uses the elevation and bathymetry data from the NetCDF source files to create a 720 pixel wide by 360 pixel high image. Each pixel in the image is the average of some number of depth/elevation values from the source files (30x30 = 900 values per pixel for ETOPO1, 120x120=14400 values per pixel for GEBCO).
The rasters in both these products are given in row-major order. In other words, when we extract data, we can use two nested loops. The outer loop loops on row, the inner on column.
How do we know that the data is in row-major order? One clue is to look at the first line for the toString() output from the "z" and "elevation" variables:
int z(y=10800, x=21600) float elevation(lat=43200, lon=86400)
In both cases, the row-related variable (y or lat) is listed first followed by the column-related variable (x or lon). This fact suggests that the secondary argument (the column element) varies more quickly than the primary argument (row). That, in turn, suggests the order in which we can access the data most efficiently.
Of course, to read the content of those variables in code, we need to invoke one of the access methods in the NetCDF API to obtain the Variables of interest. Upon inspecting the output from the Variable toString() methods shown above, we know the names of the Variables associated with the raster (grid). Extracting them from the NetCDF file is just a matter of implementing a if/then statement based on which product we are processing:
Variable z; // the variable that ExtractData uses for elevation and bathymetry if (product.startsWith("ETOP")) { z = ncfile.findVariable("z"); } else { // the product is GEBCO z = ncfile.findVariable("elevation"); }
Next, we need to obtain the dimensions of the grid stored in the raster Variable from the NetCDF file:
int rank = z.getRank(); int[] shape = z.getShape(); // will be an array int[rank]. int nRows = shape[0]; int nCols = shape[1]; ps.format("Rows: %8d%n", nRows); ps.format("Columns: %8d%n", nCols);
The rank of a NetCDF variable is essentially the dimensions of the Variable. A grid has rows and columns, so the z/elevation Variables have a rank of 2. The latitude and longitude related variables both have rank of 1. The shape array allows NetCDF to pass back information about the size of each set of elements contained in the Variable.
The NetCDF API allows an application to access a Variable's content in any order that it requires. However, just like any other file-based data format, the most efficient access follows the sequence on which the data is organized in the file. Because the data is in row-major order, we access it one row at a time. This is not always the most optimal pattern for access, and sometimes when reading a NetCDF file, an application needs to be aware of a feature called a "chunk size". We'll discuss more about that later on. For now, we can access the data using logic in the form shown below.
In the logic that follows, the application code tells NetCDF the size of the block of data it wishes to retrieve by using two arrays sized to the rank of the data set. The readOrigin array tells NetCDF where the application wishes to start reading data. The readShape tells NetCDF the dimensions of the block of data the application wishes to retrieve. The return from a Variable's "read" operation is a NetCDF Array. The array is a one-dimensional array of readShape[0]*readShape[1] elements, given in row-major order.
// define two integer arrays int[] readOrigin = new int[rank]; int[] readShape = new int[rank]; for (int iRow = 0; iRow < nRows; iRow++) { // set up to read the entire row, but just one row. readOrigin[0] = iRow; // rows are numbered from zero readOrigin[1] = 0; // columns are numbered from zero readShape[0] = 1; // read one row readShape[1] = nCols; // read the entire set of columns for that row Array array = z.read(readOrigin, readShape); for (int iCol = 0; iCol < nCols; iCol++) { double sample = array.getDouble(iCol); // transfer sample to the collection of data for the picture. } } ncfile.close(); // always a good idea.
The example above omits the logic for transcribing the input data to the image, but you can find it in the source code for ExtractData.java which is posted on the Gridfour Software Project page. The results are shown below.
For the first figure, I used NOAA's ETOPO1 Global Relief Model palette to assign colors the data based on elevation or depth.
The ExtractData application includes logic for creating shaded-relief images. The surface normal is computed from the source data using Gridfour's B-Spline interpolation class. Shading is added using a simple lighting model. To emphasize the structure of the data, I used a lighter palette that favored ocean colors. A detailed dicussion of shaded-relief algorithms is included in the article Elevation Data from Cloud-Optimized GeoTIFFs Part I: Shaded-Relief Techniques.
If you look at the output from the toString() method for the elevation Variable used for GEBCO 2019, you see that it includes an attribute called "chunk size".
float elevation(lat=43200, lon=86400); :_ChunkSizes = 1U, 86400U; // uint
The chunk size is an optional parameter that allows applications to organize the layout of data on disk. The default layout for grid products is in a row-major form, and if the chunk size is omitted (as it was in the ETOPO1 product), that is what will be used. The design for applications that perform intensive access to a NetCDF file should pay attention to the chunk size. A pattern of access that follows the sequence in which data is laid out within a file will usually operate more efficiently than one that does not.
Fortunately, the data access in the Java API for NetCDF is quite efficient. For moderate data access requirements, the order of access doesn't matter. But for intense operations, it can make a difference. For example, running ExtractData on ETOPO1 requires only a few seconds of run time. However, as an experiment I modified the ExtractData code to read the NetCDF file one column at a time rather than one row at a time. The operation took over 20 minutes. Of course, that pattern of access was pretty much the worst possible way to access the ETOPO1 product and was equivalent to reading through the entire file several thousand times. So as long as your application pays attention to the design of the data product, the NetCDF API should provide acceptable performance.
Given that we have two excellent global bathymetry products at our disposal, I thought it would be interesting to do something with that data. Did you every wonder how much water is in the world's oceans? Having data collections of, literally, millions of bottom-depth values should allow us to make some estimates.
Each grid cell in the ETOPO1 and GEBCO_2019 data sets covers a distinct portion of the Earth's surface. The overall area of these cells varies as a function of latitude. Knowing the row spacing for the various products and applying a bit of elementary calculus allows us to compute these areas. The code for the calculation can be found in the demonstration class ExtractionCoordinates.java which implements a method called getAreaOfEachCellInRow(). As it reads data from the NetCDF files, the ExtractData application looks for sample points that give negative values (indicating elevations below mean sea level). The technique is not a perfect. There are some land areas such as Death Valley, CA, which lie below sea level and so make a small volume contribution to the calculation. Even so, this approach provides a good high-order estimate. The results are shown below:
| Computation | ETOPO1 | GEBCO_2019 |
|---|---|---|
| Ocean Volume |<PHONE_NUMBER> km3 |<PHONE_NUMBER> km3 |
| Surface Area | 361782018 km2 | 361747563 km2 |
| Avg. Depth | 3435 m | 3448 m |
The numbers printed by the Gridfour application show more digits of precision than is actually supported by the data. The extra digits are intended for testing purposes and should be viewed with an appropriate skepticism. The difference in results for the data two products is a consequence of their different grid cell size and data sources.
Incidentally, NOAA has posted its own results based on the ETOPO1 data set at NOAA's Volumes of the World's Oceans They cite an estimate for the volume of 1,335,000,000 km3 which is close to the Gridfour result. They also offer an error estimate of 1% for that figure. That value which provides a useful insight into how NOAA views the quality of the data. Given the many unknowns in surveying the world's oceans, one percent isn't bad...
While this discussion covered the most important features of the NetCDF API, there are a number of additional features available for your use. Furthermore, NetCDF is not limited to raster (grid) based products such as those discussed in this wiki article. It can also support vector products (lines, point features, polygons, etc.).
Readers who would like to learn more about the NetCDF internals and API may do so by visiting the official NetCDF Java Tutorial. You can also find additional examples and "insider" information about the Unidata NetCDF Java page.
I hope this article will help simplify some of the issues in getting started with the Java NetCDF API. I wish you the best of luck on all of your endeavors.
General Bathymetric Chart of the Oceans [GEBCO], 2019. GEBCO Gridded Bathymetry Data. Accessed December 2019 from https://www.gebco.net/data_and_products/gridded_bathymetry_data/
National Oceanographic and Atmospheric Administration [NOAA], 2019. ETOPO1 Global Relief Model. Accessed December 2019 from https://www.ngdc.noaa.gov/mgg/global/
Sonalysts, Inc., 2019. wXstation. Accessed December 2019 from http://www.sonalysts.com/products/wxstation/
University Corporation for Atmospheric Research [UCAR], 2019. NetCDF-Java Library Accessed December 2019 from https://www.unidata.ucar.edu/software/netcdf-java/current/


A Sublime color scheme defines the syntax highlighting and canvas color of your editor, while a theme defines the styling of the sidebars, tabs, and find-and-replace menu.
Here are a few screenshots of my Sublime setup:
| Multimarkdown | Python |
| :---: | :---: |
| | |
| Ruby | Haskell |
| | |


Blacksmith Duning:
Ah, the Silver Undine! I will exchange 1 Silver Undine for 5 Silver Golems and 5 Silver Fairies. Or perhaps you would prefer a game of chance?
Exchange at the set rate.
Play game. [Guess correctly in 2 tries - 3 Silver Golems]
Play game. [Guess correctly in 3 tries - 7 Silver Golems]
Play game. [Guess correctly in 4 tries - 9 Silver Golems]
Ask how to play.


The Aberdeen University Computing Society provides a place for students to learn and share computing knowledge. Our events include practical workshops led by members, talks by invited guest speakers and social events such as coding challenges, movie nights and gaming competitions.
Get your membership!


{% extends "base.html" %} {% block title %}Scanning for video files{% endblock %} {% block content %}
Scanning...
(Note: not all log lines shown.)
You don't have javascript enabled. You can look at the progress here


Politicious
Home
Congress
Important Dates
Bills
Upcoming Events
Voters
Young voters
Voting information
Contacting Politicians


|
RMB - Reliable Message Board
v0.91
|
Function prototypes fot msgserv_utils.c. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <limits.h>
#include <netinet/in.h>
#include <netdb.h>
#include <signal.h>
#include "msg_table.h"
#include "sv_list.h"
#include "debug.h"
#include "defs.h"
Go to the source code of this file.
Data Structures | |
| struct | _FdStruct |
| Structure for storing several file descriptors for better code readibility. More... | |
Typedefs | |
| typedef struct _FdStruct | FdStruct |
| Structure for storing several file descriptors for better code readibility. More... | |
Functions | |
| void | parse_args (int argc, char **argv, char **_name, char **_ip, int *_upt, int *_tpt, char **_siip, int *_sipt, int *_m, int *_r) |
| Parses command line arguments using getopt. More... | |
| int | create_udp_server (u_short port) |
| Function to create a udp server. Consists of socket setup preambles and returns fd. More... | |
| int | create_udp_client () |
| Function to create a udp client. All it does is create an fd from socket() and returns it. More... | |
| int | create_tcp_server (u_short port) |
| Function to create a tcp server. Consists of socket setup preambles and returns fd. More... | |
| int | accept_tcp_connection (int fd) |
| Creates a new fd from an accept of a TCP connect and returns it. More... | |
| void | refresh (int fd, char *name, char *ip, char *siip, int sipt, int upt, int tpt) |
| Function for the refresh of the msgserv with an identity server. More... | |
| void | send_messages_udp (int fd, struct sockaddr_in *client_addr_ptr, MessageTable *msg_table, int n) |
| Function to send n messages of the message table over UDP. More... | |
| void | send_messages_tcp (int fd, MessageTable *msg_table, int n, int all) |
| Function to send n messages or all of the message table over TCP. Used in the communication between message servers to keep tables consistent. More... | |
| void | get_servers (char *siip, int sipt, char *server_string) |
| Make a request to the Identity Server to get the servers. More... | |
| FdStruct * | create_fd_struct (int upt, int tpt) |
| Create the structure that has all but the tcp connection fds between servers. Alloc it and return. More... | |
| void | delete_fd_struct (FdStruct *fd_struct) |
Deletes an FdStruct instance. More... | |
| void | init_fd_set (fd_set *set, FdStruct *fd, ServerID *sv) |
Initializes an FdStruct instance. More... | |
| int | fd_max (FdStruct *fd_struct, ServerID *sv_list) |
| Get integer corresponding to the biggest file descriptor. More... | |
Function prototypes fot msgserv_utils.c.
This contains the functions used in msgserv that are at a lower level of abstraction than the ones in msgserv, namely functions to parse argument, create tcp and udp clients/servers message sending and fd management.
Structure for storing several file descriptors for better code readibility.
Contains the file descriptors for handling
stdin
| int accept_tcp_connection | ( | int | fd | ) |
Creates a new fd from an accept of a TCP connect and returns it.
| fd | file descriptor of the tcp server that is doing the accepts |
| FdStruct* create_fd_struct | ( | int | upt, |
| int | tpt | ||
| ) |
Create the structure that has all but the tcp connection fds between servers. Alloc it and return.
| upt | |
| tpt |
| int create_tcp_server | ( | u_short | port | ) |
Function to create a tcp server. Consists of socket setup preambles and returns fd.
| port | port for the TCP server to attend requests |
| int create_udp_client | ( | ) |
Function to create a udp client. All it does is create an fd from socket() and returns it.
| int create_udp_server | ( | u_short | port | ) |
Function to create a udp server. Consists of socket setup preambles and returns fd.
| port | port for the UDP server to attend requests |
| void delete_fd_struct | ( | FdStruct * | fd_struct | ) |
Deletes an FdStruct
instance.
| fd_struct | Structure that contains monitored file descriptors |
Get integer corresponding to the biggest file descriptor.
| fd_struct | structure that contains the fds to check |
| sv_list | server identities list |
| void get_servers | ( | char * | siip, |
| int | sipt, | ||
| char * | server_string | ||
| ) |
Make a request to the Identity Server to get the servers.
| siip | IP of the Identity Server |
| sipt | Port of the Idenity Server |
| server_string | string to get the server list by reference |
Initializes an FdStruct
instance.
| fd | Structure that contains monitored file descriptors |
| set | fd_set with monitored file descriptors |
| sv | ServerId list |
| void parse_args | ( | int | argc, |
| char ** | argv, | ||
| char ** | _name, | ||
| char ** | _ip, | ||
| int * | _upt, | ||
| int * | _tpt, | ||
| char ** | _siip, | ||
| int * | _sipt, | ||
| int * | _m, | ||
| int * | _r | ||
| ) |
Parses command line arguments using getopt.
| argc | main argument count |
| argv | main argument list |
| _name | Pass by reference of msgserver name |
| _ip | Pass by refereñce of msgserver ip |
| _upt | Pass by reference of msgserver upt |
| _tpt | Pass by refence of msgserver tpt |
| _siip | Pass by reference of identity server ip |
| _sipt | Pass by reference of identity server udp port |
| _m | Pass by reference of msgservmax number of messages |
| _r | Pass by reference of the timer(in seconds) for msgserv refresh |
| void refresh | ( | int | fd, |
| char * | name, | ||
| char * | ip, | ||
| char * | siip, | ||
| int | sipt, | ||
| int | upt, | ||
| int | tpt | ||
| ) |
Function for the refresh of the msgserv with an identity server.
| fd | file descriptor of the msgserv as udp client |
| name | Name of the msgserv we are registering |
| ip | IP of the msgserv we are registering |
| siip | IP of the Identity Server we are registering with |
| sipt | Port of the Identity Server we are registering with |
| upt | UDP port of the msgserv we are registering |
| tpt | TCP port of the msgserv we are registering |
| void send_messages_tcp | ( | int | fd, |
| MessageTable * | msg_table, | ||
| int | n, | ||
| int | all | ||
| ) |
Function to send n messages or all of the message table over TCP. Used in the communication between message servers to keep tables consistent.
| fd | file descriptor of client to send the table to |
| msg_table | The message table of this msgserv |
| n | number of messages to send over tcp. Often this is all messages |
| all | flag that tells the function to send all messages |
| void send_messages_udp | ( | int | fd, |
| struct sockaddr_in * | client_addr_ptr, | ||
| MessageTable * | msg_table, | ||
| int | n | ||
| ) |
Function to send n messages of the message table over UDP.
| fd | file descriptor to handle the UDP communcation |
| client_addr_ptr | this comes from the handler function (to simplify code) |
| msg_table | The message table of this msgserv |
| n | Number of messages the client requested |


Arthur Charguraud
E: stands for an expression H: stands for an existing hypothesis X: stands for a fresh identifier I: stands for an introduction pattern R: stands for a definition (a "reference") __: is a special notation for "wildcard"
introv I1 I2 .. IN (introduction that inputs only the name of hypotheses, not variables) intros_all (introduces all arguments, unfolding all definitions on the way) gen H1 H2 .. HN (generalizes and clears hypotheses and their dependencies) clears H1 ... HN (clears hypotheses and their dependencies) sets X: E (defines X as a local definition for E, and replaces occurences of E with X) sets_eq X: E (introduces a name X and an equality X = E, and replaces occurences of E with X)
asserts I: E (asserts statement E as first subgoal, destruct E as I in the second goal) cuts I: E (asserts statement E as second subgoal, destruct E as I in the first goal) put X: E (define X to be a name for E, synonymous of pose) lets I: E (adds an hypothesis I whose type is the type of E) lets I1 .. IN: E (a shortand for "lets [I1[..IN]]: E", useful to decompose conjunctions) sets_let X (finds the first let-binding in the goal and name its body X)
false (replaces the goal by "False", and try to solve it with contradiction and discriminate) false E (proves any goal by contradiction, using an absurd term E) tryfalse (proves a goal by contradiction or discriminate, or do nothing) false_invert (try to invert hypotheses to find one that contradicts the goal) tryfalse_invert (same as "false_invert" but leaves the goal if it can't be solved)
iff as I1 I2 (tactic to prove an equivalence) splits (splits an N-ary conjunction into N goals) splits N (same as above, but unfolds if necessary to obtain N branches) destructs E (destructs an N-ary conjunction E into N hypotheses) branch N (selects the N-th branch of a M-ary disjunction) branch N of M (same as above, but unfolds if necessary to obtain M branches) branches E (case analysis on an N-ary disjunction E) exists E1 .. EN (to provide witnesses to an N-ary existential goal, wildcards are supported)
cases E as I (case analysis on E, remembering the equality as H) case_if as I (case analysis on the first "if" statement in the goal) cases_if as I (similar to "case_if", but performs additional substitutions) inverts H (inversion followed with substitution of freshly introduced variables) inverts keep H (same as above, but H is not cleared) inverts H as I1..IN (same as inverts H, but allows to name produced hypotheses) invert H (same as inverts H, but leaves hypotheses in the goal) inversions H (faster implementation of inverts H, but might substitute too many variables)
inductions_wf X: E H (applies the well-founded induction principle for a particular well-founded relation) gen_eq X: E (generalize X as E and add "X = E" as hypothesis in the goal, useful for induction) cofixs IH (like "cofix IH" but tugs the coinduction hypothesis using tactic "clear_coind")
substs (improved implementation of subst does not fail on circular equalities) subst_hyp H (substitutes the equality described by H; supports equality between tuples) intro_subst (shorthand for "intro H; subst_hyp H") fequals (improved implementation of f_equal calls congruence, and better on tuples) fequals_rec (recursively apply fequals) changes E1 with E2(behaves like "change" but works better ---it does not silently fail) decides_equality (improved implementation of decide equality ability to unfold definitions) rewrite_all E (rewrites E as many time as possible) asserts_rewrite E (rewrites with E and generates E as first subgoal) cuts_rewrite E (rewrites with E and generates E as second subgoal) pi_rewrite E (replace E with an evar that describes a proof term justifying the same proposition; useful to exploit proof irrelevance) equates i1 .. iN (introduces evars for arguments of the goal [P x1 .. xK] at the specified indices)
simpls (simpl everywhere in hypotheses and conclusion) unsimpl E (replace the simplification of E with E) unfolds R (unfolds the definition of R in hypotheses and conclusion) unfolds (unfolds the head definition of the goal) unfolds in H (unfolds the head definition of the hypothesis H) folds R (folds R in hypotheses and conclusion) renames H1 to H1', .., HN to HN' (multiple renaming)
skip (admits the current goal - works even if it contains existential variables) skip I: E (adds an hypothesis I of type E to the context, and assume it is true) skip_cuts E (replaces the current goal with an arbitrary new goal E) skip_rewrite E (rewrites with the equality E, admitting the statement E) skip_goal IH (adds the goal as hypothesis; useful for setting up inductions) sort (reorders hypotheses to get all the propositions at the bottom of the goal)
- any tactic name followed with the symbol "~" will call [auto] on all subgoals - any tactic name followed with the symbol "*" will call [induction eauto] on all subgoals - these default bindings may be customized locally in a development
jauto ([jauto] like [intuition eauto] but with cheaper and less complete version of [intuition]) hint H1 .. HN (add lemmas in the context, documenting them as local hints)
lets I: H E1 ... EN (instantiates a lemma and names it) lets I: (>> H E1 ... EN) applys H E1 ... EN (instantiates a lemma and applies it) applys (>> H E1 ... EN) specializes H E1 ... EN (instantiates an hypothesis H in-place) specializes H (>> E1 ... EN) forwards I: H (instantiates a lemma, then "forwards" it) forwards I: (>> H E1 ... EN) rewrites (>> H E1 ... EN) (instantiates a lemma, then rewrite with it) applys_to H E (like: "lets H: (E H)") applys_eq H i1 .. iN (applys H up to equality on arguments of the goal at specified indices)
Note: "forwards I: H
" is equivalent to "lets I: (>> H __ __ .. __)
",
which can also be abbreviated as "lets I: (>> H ___)
", with a triple-underscore.
Note: any subterm can be of the form rm X
, which indicates that the variable X
should be cleared after the operation is complete.
dup (duplicate the current goal, useful for demos) demo (alias for "skip", useful for demos)