6.3. A More Complicated Macro Example
Sometimes you may want to find all the references to a particular
topic in a file. Table 6-2 lists steps for creating a macro that
takes takes every sentence in the buffer that contains the word
Emacs and copies it to another buffer. If you
try this macro, you'll need to type some text about
Emacs into a buffer. You can also get a test file to work with by
opening the Emacs NEWS file (using C-h n), then writing it to a file (C-x C-w NEWS). This buffer is in view mode by default;
change to text mode by typing M-x text-mode
Enter.
Table 6-2. Steps for macro that creates a buffer of Emacs references|
Keystrokes
|
Action
|
|---|
|
F3 or C-x (
|
Start macro definition; Def appears on the mode
line.
| |
C-s emacs
|
Find the word Emacs.
| |
Enter
|
Stop the search after it is successful; if the search is
unsuccessful, it rings the bell and stops the macro.
| |
M-a
|
Move to the beginning of the sentence.
| |
C-Space
|
Set the mark.
| |
M-e
|
Move to the end of the sentence.
| |
M-w
|
Copy the sentence to the kill ring.
| |
C-x b emacsrefs Enter
|
Move to a buffer called emacsrefs.
| |
C-y
|
Insert the sentence.
| |
Enter
|
Start the next sentence on a new line.
| |
C-x b Enter
|
Move back to the original buffer.
| |
F4 or C-x )
|
End the macro definition; Def is removed from the
mode line.
|
Now, assume that you've already constructed the
macro outlined in Table 6-2 and that you can
invoke it with F4. The following
screen shows what happens when you run it five times and then display
the emacsrefs buffer.
|
Type: M-5 F4 or M-5 C-x e, followed by
C-x b Enter
| |
| |
By executing the macro repeatedly, we've created a
buffer that contains references to the Emacs editor.
|
As in the previous example, you can jump back and forth between an
unlimited number of buffers while defining a macro. Macros
don't need to be confined to one buffer. Macros that
work with several buffers are more difficult to debug; when several
buffers are involved, it becomes harder for you to keep track of
where the cursor and the mark are. It is also easy to make mistaken
assumptions about what buffer you're visiting;
hence, it's a good idea to specify the buffer name
explicitly. However, after you get accustomed to working with macros
and multiple buffers, you'll be amazed at how much
work you can do with almost no effort.
Windows are sometimes useful in macros, but, again, you have to watch
out. It's better to start a macro with one window on
the screen, have the macro open other windows, and finally close all
but one window (C-x 1). If you write
a macro with two windows on the screen and later try to execute it
with four windows on the screen, the results will be unpredictable at
best! In general, moving to a named buffer, C-x
b buffername, is preferable to
moving to the "other" window using
C-x o (too vague to be generally
useful). The other window could be anything—a
*Help* buffer, *Completion*
buffer, *shell* buffer, and so on. Moving to a
named buffer always gets you to the right place, no matter how (or
whether) the buffer is displayed.
|


| The most common sources of VOC's in the home are actively growing mold and Sewer Gas. |
Actively Growing Mold |
|
To grow, mold requires a food source such as leaves, paper, wood or dirt. It also requires moisture. When actively growing, the mold will emit spores into the air. By cleaning with an appropriate vacuum ( see Vacuum Cleaner Selection ). A thorough cleaning can reduce the smell in the house and reduce the mold spores / dust & mycotoxins and may help the occupants feel better. Cleaning may help to find the source of the smell (with your nose) but it is unlikely to have any effect on the VOC / Sewer gas readings on the sensor. |


Logic was first introduced in ancient Egypt and Babylon, but the one we are using now was developed in ancient Greece by great philosophers and mathematicians like Aristotle, who has established the basic principle of formal logic and Syllogism (deduction of logic), these core concepts have become the cornerstone of logic nowadays. As time goes on, logic is used broadly in modern scientific areas, especially mathematics and computer science. This is the time when George Boole formalised symbolic logic and defined what is now called Boolean algebra in his first book The Mathematical Analysis of Logic (1847), those ideas were then widely used in computation and programming in the 20th century.
In aspect of logic programming, representing and executing computer programs using logic is a feature of the lambda calculus (λ-calculus), which is a formal system in mathematical logic, expressing function abstraction and application in computation, was first introduced by Alonzo Church in the 1930s. Yet, the formal ‘birth’ of logic programming happened in the 1970s, when computer scientists developed early automated theorem proving and artificial intelligence. They have managed to fuse the two strikingly different concepts of program and logic together. Subsequently, logic programming has grown rapidly. In particular, programming language based on the first-order predicate logic is well known by its rich ability of expression, non-determinacy and its application of logical reasoning onto calculations. The technique is then widely applied to theorem proves, program verification and modular programming.
This fundamental piece of modern programming began in the 1950s, when great mathematicians like Turing and Von Neuman were hand-proving for program correctness. About a decade later, in the late 1960s, Robert Floyd and Tony Hoare introduced assertional reasoning on flowcharts for proving partial and total correctness and axiomatic semantics for programming constructs, which are commonly known as the Floyd-Hoare Logic.
Since then, the industry started to grow. In the next 30 years, enormous number of capable scientists came up with brilliant ideas and theories like predicate transformer semantics and abstract interpretation. Many of them have researched in fields like Model checking, hardware verification, some have even developed the typed languages (i.e. Z specification language, typed assembly language), which are languages that give rules to variable. A variable cannot start off life without knowing the range of values it can hold, and once it is declared, the data type of the variable cannot change. Simultaneously, the technology was applied to large-scale program analysis, it was used in world-widely in every industry, developing kernel for computers or even building system for aircrafts, benefiting the society in a safer and more reliable way.
“Modern game theory began with the idea regarding the existence of mixed-strategy equilibria in two-person zero-sum games and its proof by John von Neumann.” – Wikipedia
won a turing award
“Milner is generally regarded as having made three major contributions to computer science. He developed LCF, one of the first tools for automated theorem proving. The language he developed for LCF, ML, was the first language with polymorphic type inference and type-safe exception handling. In a very different area, Milner also developed a theoretical framework for analyzing concurrent systems, the calculus of communicating systems (CCS), and its successor, the pi-calculus.” – Wikipedia
won turing award - introduced quicksort (sorting algorithm), Hoare logic (program verification), communicating sequential processes (language describing interactions of concurrent system).
Logician – developed continuum hypothesis (about the possible sizes of infinite sets), Gödel's incompleteness theorems
proof theorist
logic programming – introduced recursive functions
won turing award & nobel prize for economics – systems thinking


[gecode-users] Counting booleans
Mikael Zayenz Lagerkvist
zayenz at gmail.com
Thu Feb 14 07:45:15 CET 2008
Hi,
On Thu, Feb 14, 2008 at 7:01 AM, Malcolm Ryan <malcolmr at cse.unsw.edu.au> wrote:
> In answer to my own question, BoolVar extends IntVar, so the standard
> Gecode.count() methods will work.
Counting BoolVars is slightly overkill, since linear relations work
equally well.
Also, from Gecode 2.0 BoolVars are no longer IntVars, and there are no
counting constraints for the new BoolVars (again since that is
captured by linear relations).
> On 14/02/2008, at 4:55 PM, Malcolm Ryan wrote:
> > Another question: I have two lists of variables X1 ... Xn and Y1 ...
> > Yn. I want to constrain them so that at most one (or exactly one) of
> > the Xi's differs from the corresponding Yi.
> >
> > This is one of those things that would propagate better with a
> > specialised constraint. Does such a constraint exist (in Gecode/J)?
The closest constraint available is a count constraint that counts the
number of x_i=y_i that holds for a variable array x and array of
constants y.
If both of the arrays are variables, you will have to use the reified
version that you described.
Cheers,
Mikael
--
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
More information about the gecode-users
mailing list


Visual Recognition Jewellery Store
Step 1: enter your name & choose your photo
choose your photo
Photo Selected
Step 2: confirm your age and gender
Step 3: get recommendations based on your age and gender
Get Recommendations
not satisfied with the results?
Retake ?


Android-MaterialPreference
The MIT License (MIT)
Copyright (c) 2015 Jens Driller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SystemBarTint
Copyright 2013 readyState Software Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Once
Copyright 2016 Jon Finerty
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
AndroidProcesses
Copyright (C) 2015, Jared Rummler
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
recyclerview-animators
Copyright 2015 Wasabeef
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
APKParser
Apk-Parser
Copyright (c) 2015, Jared Rummler
Copyright (c) 2015, Liu Dong
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the docume
ntation and/or other materials provided with the distribution.
- Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this
software without specific prior written permission.


Drive 6mm phillips screws as cheap as possible. Finish fast.
Goals are the ultimate gauge for your design.
They set the basic engineering constraints.
They set apart good from bad design.
Quality is never a goal.
It's part of your culture. It's what you're willing to settle for.
Part I: System Design
Entire systems built to do one job.
Very efficient and cheap to build.
Certain functional aesthetic to them.
Hard to maintain. Almost impossible to repurpose.
This screwdriver is the first product to market. An elegant design that does the job. It makes us money.
Part I: System Design
Now that we're in the screwing business ...
New Goal: Drive all these screws. Make it cheap and fast.
Option A: Build a different monolith for each.
Option B: Make an abstraction. Innovate.
Part I: System Design
Abstractions allow for:
Design economies:
Exponential reduction in complexity.
Specialization: "Handle team", "Chuck Team", "Screw Bit Team"
Usage economies:
Multifunctional tool -> easy repurposing.
Replaceable parts -> easy maintenance.
Part I: System Design
Wrong abstractions have a huge cost.
This screwdriver assumes users have hands. Adapting it for machine use would require discarding the entire handle.
Pluggable arcitecture somewhat mitigates this by allowing you to make the wrong abstraction as a plugin. For instance, screw bit that is a spoon.
You still need to get the framework and plugin interface right.
A story follows ->
Part I: System Design
All abstractions are wrong to some degree.
Client:
Hey! I find your handle very nice to grip. I would pay you $3M if I could use this as a soldering iron too.
This is the life of a consultancy business...
Part I: System Design
Reengineer the entire handle to house a heater.
Product points out that cord needs to be detachable in order to twist the handle.
After you're done, client says:
Oh, I forgot to mention - I really need to screw while soldering!
Suddenly you feel the enlightenment of a thousand user stories.
Part I: System Design
Reengineer the entire handle to house a motor.
Reengineer the entire chuck so it can rotate.
Some wise guy:
Hey, since this thing has a motor, can we also make it a drill? You just bend the handle a bit...
Part I: System Design
Part I: System Design
Abstractions are an investment.
They make up most of the engineering.
Abandoning them is very expensive.
But good ones, just as investments, make you rich.
Part I: System Design
Basically, deliver any documentation use case.
Because of the Zero/One/Infinity rule.
But, seriously, we're not gonna stop at one use case...
Part II: The H4 Platform
There are quite a bit of differences between use cases.
Part II: The H4 Platform
Each use case is a "data point" that will enable us to generalize.
We will conceptually split the platform into the "core framework" and "plugins".
There's an incredible amount of business analysis required to deliver a use case. We want to confine this to specialized teams and in the future outsource it to third parties.
Scaling complexity is the most important kind of scaling.
Reducing the need for communication between teams is key.
Part II: The H4 Platform
Part II: The H4 Platform
A tamper-resistant screw with an exclusive-to-you pattern, never in stores, used to secure ballot boxes. Patented by Bryce Fastener Inc. ...

Caring costs time and money...
We want to abstract away the client's custom needs and give them tools to develop their own screws and screw bits.
Part II: The H4 Platform
We don't care about Key-Rex. We are busy with "Handle 2.0". Help yourself with the lathe or pay someone else to make your screw bits.
The handle will cost you $100. Or, in the true spirit of Cloud Capitalism, the handle is also free, but we charge $1 per twist.


Xiaomi Watch: All there is to know - Gizchina.com
by Efe UdinXiaomi Watch: All there is to know
4 (80%) 20 votes
Chinese manufacturing giant, Xiaomi, will have a huge event in China where it will unveil a plethora of products. In addition to the 108MP Penta Xiaomi CC9 Pro, the company will also release its first watch, Xiaomi Watch. Although the launch event takes place on November 5th, over the past few days, there have been a lot of confirmations regarding this smartwatch. Here is all there is to know for now regarding the Mi Watch.
Xiaomi Watch Design & Appearance
Many who knows Xiaomi, are aware that the company has a penchant for Apple designs. The Xiaomi Watch features a four-curved sapphire glass design and has close proximity to Apple Watch. It will come in Black and Silver colours with matching bands. Notably, there is an Apple Watch-like crown on the right side, with a second button right below it.
Hardware
Xiaomi has confirmed the Xiaomi Watch / Mi Watch will come with a Qualcomm Snapdragon Wear 3100. It independently supports GPS, and NFC, plus an eSIM virtual card, so you can independently make voice calls via the device. In addition, this watch uses an independent linear motor and independent speakers, built-in high-capacity battery, and it comes with support for independent Wi-Fi / Bluetooth.
Software
Despite initial speculations that the Mi Watch will come with Google’s WearOS, it won’t. According to Xiaomi, the Watch will run on a special OS – MIUI for Watch. This system is a version of MIUI with its own app store. In the short teaser video teaser, MIUI for Watch is seen with a simple layer app grid with square icons and a dark background. This suggests that MIUI for Watch will support a built-in dark mode just like its smartphone counterpart. The video also reveals the digital crown button can be used to navigate the interface. In addition, it serves as the on/off button.
According to the general manager of Xiaomi Ecological Chain, this new Watch can run apps such as Sogou map, WeChat, Alipay, Himalayan, navigator, vibrato and many other programs. Do note, however, that due to the limited screen and storage sizes, the Mi Watch might not support the installation of regular Android apps. So these apps are basically the lightweight versions of the regular Android Apps.
Xiaomi’s upcoming Watch also comes with multiple functions like independent music, offline payments through Alipay, send and receive QQ information; navigation can automatically import trips, Xiao AI, taxi booking, etc.
Xiaomi Watch Price and Availability
Well, this is the only aspect where there is no official information besides the launch date which is November 5. Although there are reports that this Watch will be slightly more expensive than the Amazfit GTS. However, this is just speculation and nothing concrete. Looking at its competition, the Apple Watch Series 5 comes with a 4299 yuan ($611) price tag. Also, the Samsung Galaxy Watch LTE sells from 2499 yuan ($355). The Xiaomi Watch should be cheaper than these watches.


ezcBasePersistable
public interface ezcBasePersistable
| Constructor Summary | |
|---|---|
The constructor for the object needs to be able to accept no arguments. |
| Method Summary | |
|---|---|
| array(string=>mixed) | getState() Returns all the object's properties so that they can be stored or indexed. |
| void | setState(array properties) Accepts an array containing data for one or more of the class' properties. |
public ezcBasePersistable()
The constructor for the object needs to be able to accept no arguments. The data is later set through the setState() method. /
public array(string=>mixed) getState()
Returns all the object's properties so that they can be stored or indexed.
public void setState(array properties)
Accepts an array containing data for one or more of the class' properties.
This class provides the interface that classes need to implement to be able to be used by the PersistentObject and Search components.


Twindle Thread
Naval -
@naval
2018-05-31
How to Get Rich (without getting lucky):
Naval -
@naval
2018-05-31
How to Get Rich (without getting lucky):
Naval -
@naval
2018-05-31
How to Get Rich (without getting lucky):


About
This web page is an interactive model of the New England
electricity grid. It projects power supply and demand
from 2020 through 2040 and lets you adjust plans to
build or retire various sources of electricity, to see
the cost and carbon impacts. The goal is to help people
concerned about climate change explore and communicate
our options.
 The top part
of the model display can show projected electricity demand
and supply for the New England grid (ISO-NE) an overview of
20 years with monthly averages, or 1 week with hourly values
(either the first week with missed demand, or the week with
highest demand if demand is satisfied), or 20 years of CO2
emissions along with a cost summary.
Below the output display, there are 8 tabs for the 8
modeled electricity generation sources: solar, wind,
hydroelectric, nuclear, natural gas, coal, batteries,
and hydrogen. Click on a tab to adjust the controls for
that source. The plan sliders are controls for
future decisions about changing the capacity of the
source. Below the plan sliders are
the assumptions sliders, which reflect my
understanding of the characteristics of the
source. These parameters determine the intitial
conditions of the model as well as the costs,
capabilties, time constraints, and CO2 impacts of the
source. You can adjust these assumptions to account for
better information, to model a different scenario than
the default, or just to explore. When assumption sliders
have been changed from the defaults, they are
highlighted so you know that the outcome might not be
comparable to plans under the default assumptions.
As you change the controls, the webpage URL captures
the slider positions. If you save or share the URL,
re-opening the URL will restore your settings and show
the resulting outcome. If you want to return to the
defaults, you can use the Default button at the bottom
of the page, or double-click on the individual sliders.
Caveats
- Numbers and code haven't been fully reviewed and
validated, expect revisions.
- This tool does not optimize, it just shows you the
results of the plan that you give it. Planning &
optimizing is up to you.
- There's no attempt to model locational value or
import/export.
- LCOE and CO2 are for the period 2020-2040. The
initial fleet is inherited at no cost, and there's no
value ascribed to the fleet at the end of 2039. Watch
for boundary effects.
- No spinning reserve or capacity reserve requirements
are modelled. Real grid operators would build more
capacity than what this model requires and so costs
would be a bit higher.
- The gas model is based on simple cycle turbines,
which are cheap and ramp fast but burn more gas per kWh
than combined cycle.
- Initial conditions are based on the ISO-NE grid mix but
the model does not capture in detail current construction
in progress as of 2020, or the age of the existing fleet
in 2020. This might penalize solar & wind scenarios
somewhat.
Details
The demand profile
is
observed hourly data from 6 years (2013-2018) of the New
England electricity grid (ISO-NE), along with
the
hourly solar and wind production for the same hours. The
profiles were preprocessed to normalize annual demand and
solar/wind capacity (see inputdata/prepare.py), and then the
initial grid mixes are set to approximate the
ISO-NE grid
mix for the first 11 months of 2019.
I chose ISO-NE partly because it is a challenging case
for wind and solar. If renewable energy can decarbonize
ISO-NE, it can work in many other places.
To get 20 years of data, the six year profiles are
repeated 3.33 times. Demand is scaled by the
(adjustable) demand growth rate, to model economic
growth and coming changes like EV charging, heat pumps
for heating, and electrification of industry.
CO2 outcomes reported by the tool
The CO2 budget for 2020-2040 is chosen as 2020 emissions
times 7.5. This is represents ramping emissions from
present rate down to zero over 15 years. I believe this
is roughly compatible with 1.5C warming scenarios
(assuming similar reductions across the world and across
other sectors). Please let me know if you have a better
rationale & target. [TODO footnote]
The CO2 reported is total lifecycle CO2 emissions from
electricity generation in ISO-NE over the 20-year
timespan of the simulation. It also includes (smaller)
effects of direct waste heat and water vapor
emissions. [MZJ 2019] gives a range of
values for various sources, broken out by lifecycle,
thermal and water vapor, and other categories.
Lifecycle analysis for a source includes the CO2
impacts of the processes used to construct the source,
and is notoriously tricky to pin down because there are
so many variables. One of the most important variables
is the CO2 intensity of the electricity grid used by the
factories making the materials in a source. For
fossil-fuel sources this is less tricky because the
direct fuel emissions dominate. But for solar, wind and
nuclear, the range of estimates is large. For the
purpose of this model, which reports system CO2 across
the whole grid, my solution for the solar, wind and
nuclear values is to use the low end of reported
lifecycle CO2 intensity, plus whatever (small) direct
emissions are involved. The justification is that the
CO2 from low-carbon sources does not significantly add
to system CO2 until the system becomes relatively
decarbonized. But as that happens, the CO2 impact of
industrial production should similarly decline. This
does not correctly handle effects of plant build and
lifetimes but it's simple and I think it leads to
reasonable results.
Values by source, in gCO2e/kWh:
- solar: 8
- wind: 5
- hydro: 31
- nuclear: 13
- gas: 447 (adjusted in validation process below)
- coal: 927
- battery: 0
- h2: 4 (direct emissions from turbines)
Cost outcomes reported by the tool
The costs are derived by computing the timing and size
of expenditures for plant construction, operation, and
fuel, discounted by the specified discount rate
according to the year in which they occur. To compute
the
Levelized Cost of Electricity
(LCOE), the discounted expenditure is divided by the
discounted energy delivered to the grid. This does not
include the construction cost for the initial fleet of
sources, and does not credit the value and costs of the
fleet or energy generated after 2040.
Because the tool is computing LCOE of generation, it
does not give retail rates or do any market
analysis. Retail rates are usually much higher and have
to cover the cost of operating and maintaining the grid,
among other things. However, cost of generation is a key
driver of prices charged to customers.
Energy generation cost assumptions
Power Sources
For all power sources, we model costs arising from the following sources:
-
Capital: Cost to build the plant ($ per Watt of capacity)
-
Fixed: Cost to operate and maintain the plant ($ per Kilowatt of capacity per year)
-
Variable: Cost of fuel, operations and maintenance to
generate energy ($ per Megawatt hour).
The default capital, fixed and variable cost values for the sources are:
- Solar: $1.0/W, $10.5/KW/y, $0/MWh, 30y life.
- Wind: $1.3/W, $32/KW/y, $0/MWh, 20y life.
- Hydro: $2.95/W, $40.85/KW/y, $1.36/MWh, 50y life.
- Nuclear: $9.55/W, $120/KW/y, $12.0/MWh, 40y life.
- Gas: $0.825/W, $13.1/KW/y, $36.2/MWh, 20y life.
- Coal: $4.62/W, $61.1/KW/y, $18.9/MWh, 40y life.
- Battery (4hr): $1.26/W, $26.8/KW/y, $0/MWh, 20y life.
- H2 (720hr): $2.08/W, $20/W, $5.5/MWh, 20y life.
The solar (PV crystalline), wind (onshore), gas
(peaking), nuclear, coal and battery (lithium) values are
derived
from [Lazard LCOE v13
2019] and [Lazard LCOS v5]
by taking the average value of the cost & time
ranges. Hydro values are derived
from [EIA
Outlook 2019].
The H2 values are based
on [energy.gov]
for PEM
electrolyzers, [Sandia]
for salt cavern storage, and assumes turbine costs are
similar to gas turbines.
Validation
This model has not been validated by others; it
certainly has errors and inaccuracies. I would
appreciate corrections.
I did a very basic validation based on the 2017 ISO
emissions reported
at [iso-ne.com].
The report gives a grid mix of 48% gas, 1% oil, 2% coal,
31% nuclear, 7% hydro, 7% other renewables (trash,
biomass, etc), 3% wind, and ~1% solar. Production was
102,500 GWh, with 31.7 Mt CO2 produced, and average of
309 g/kWh. I checked and tweaked the initial values in
this model to produce a similar result. (I added the oil
and other renewables production to gas.)
Carbon capture and sequestration (CCS)
I'm a bit skeptical of CCS so I didn't include it
explicitly in the tool. However, you are encouraged to
adjust the assumptions for Natural Gas and Coal to
explore the effects of CCS.
Transmission
For simplicity I omitted transmittion and location from
the model. This makes the grid balancing easier because
it's assumed that generation is always close to use. But
it makes grid balancing harder because there is no
provision for import/export of electricity to
neighboring grids. ISO-NE actually imports a significant
percentage of electrity from Ontario, New Brunswick, and
New York, but that complicates the modeling and makes it
less useful as a proxy for other grids. The intention is
to make it slightly harder to decarbonize the model than
to decarbonize a real grid with ability to
import/export.
Hydropower
I modeled hydropower as a constant flat source. This is
not realistic -- depending on the facility, hydro can
have a lot of dispatchability and storage features, and
at other times can be constrained by weather and
environmental requirements. But, those complexities are
very particular to local conditions and work against
applying the results of this tool to other grids around
the world, so I chose to keep the hydro model very
basic.
Acknowledgements
Grid Transition is by Thatcher Ulrich, based heavily on
the wonderful
Energy
Strategies tool released in 2016.
Energy Strategies: concept, design and development by
Amber Robson, Corrie Scalisi, Doug Fritz, Drew Bryant,
John Platt, Jonny Mack, Josh Freed, Kate Brandt, Matt
Jones, Michael Terrell, Orion Pritchard, Philippe
Larochelle, Ross Koningstein, Ryan Fitzpatrick and
Saleem Van Groenou.
Similar tools
In addition
to energystrategies,
see also:
Further Reading
Code
See https://github.com/tulrich/gridx2020
Contact
email<EMAIL_ADDRESS>| Twitter: @ThatcherUlrich


Shop Management
Be it a single shop or chain of shops or retail outlets, Tiny360 platform can do all necessray provising for you to maintain shops, Orders, staff and inventory.
Learn MoreInventory Management
Inventory management and placement of
stocked goods across your shops will be
much easier with tiny360 inventory management software.
Services
Tiny360 platform has an extensive product and service catalog to serve your customers.
Learn MorePayroll
Manage your employees, sub-organizations and hiearchies there and their remunerations and bonues at one place.
Learn MoreOrder Management
Automation and stream-lining of order processing for your business ensuring re-pricing based on promotions available.
Learn More


Toggle navigation
Brand
Link
(current)
Link
Dropdown
Action
Another action
Something else here
Separated link
One more separated link
Submit
Link
Dropdown
Action
Another action
Something else here
Separated link
{{ pro.title }}
{{ pro.description }}
{{ "${:,.2f}".format(pro.price_usd) }}
Your email:
Quantity:
Your name:


• Working as a Software Engineer from May 2018.
• Languages/Tools working on - React.Js , JavaScript, HTML, CSS, Node.js
• Working as a Software Developer from August 2017.
• Translating business requirements to technical solutions.
• Software Development to create new utilities as well as to customize Open Source Software.
• Conducted trainings in various states of India to roll out new Software and Project Management System.
• Conducting SCRUM Meetings and assisting new people get trained with software development.
• Software/Platform working on - LDAP, Redmine, Nextcloud, Linux
• Languages/Tools working on - Python, Ruby & Rails, JavaScript, HTML, CSS, Node.js
• Understanding and evaluating open source products.
• Development on ruby and rails to customize Redmine, am open source project management platform.
• Writing JavaScript and css code to make UI and functionality changes.
• Contribute to technical design documentation.
• Creation of users in LDAP and integration with other devices.
• Ability to work independently and a challenging environment.
• Proficiency/Tools - Linux, C, Python, Javascript, HTML
Completed B.Tech from Vishwakarma Institute Of Technology , Pune
Bhumi is one of India’s largest independent youth volunteer non-profit organisations for education and Civic issues. Download Certificate
A software used by Accounting team to aggregate a data from multiple excel files to single excel file at the end of every month. Data will be fetched from redmine server as attachments. Created a GUI with where user has to enter his/her login credentials and fetch all files and then option to aggregate data date wise.
A software which will check the deadline for the particular project and if the deadline is within a week then it will send notifications to all the users in the form of Text and email to respective users assigend to that particular project.
A Daily progress report software made using Electron.js and Redmine REST API for keeping trak of Daily progress of each project. All data fetched and stored on redmine server.
Created very own redmine gallery plugin which is used to showcase all images uploaded in Redmine DMSF(Which is another redmine plugin for document management) in a gallery format.


Toggle navigation
HOME
PROFILE
EVENTS
ADD EVENTS
SHOP
ADD Product
Logout
Home
Shop Detail
prev
next
Posted :
Contact :
Type :
Description


The Research Revealed newsletter brings you behind the scenes so you can make the most of the vast research operations support network at BU. Please submit your newsletter ideas, and visit the Research Support website for more information.
In a March 22 presentation, faculty members joined communications professionals from BU and MIT in a workshop that examined what makes a good visual story, how to distill a message, and how to use video to promote research. Watch the video.
Related: BU’s Strategic Communications Series wrapped up this semester with a discussion on how faculty and higher education representatives can “provide clear, relevant information to help shape policy or advocate for scientific research, the humanities, or for student financial aid.”
Dr. Rao Varada, who has served as the interim director of the Animal Science Center since September, was named as the new director and attending veterinarian.
The National Science Foundation is seeking feedback on new award requirements regarding the reporting of sexual and other forms of harassment and sexual assault, which is part of a larger effort to ensure safe research environments.
The Charles River Campus Institutional Review Board has updated the consent form for the use of video and other recordings obtained during a research study.
Sponsored Programs has launched a blog on the Research Support website. Sign up to receive important sponsor and BU updates, training information, and tips and how-to's geared toward the BU research administration community.
Department administrators can now check the health of their accounts on their own through the use of a new BW report: GM Master Data– Revenue & AR.
Post Award Financial Operations outilned a new procedure for the sale of moveable capital equipment.
Summer Salary Request forms for Charles River Campus faculty with nine-month appointments are due to the Office of the Provost by May 15.
National Science Foundation Deputy Director Jim Deshler, a former BU faculty member in biology, will be on campus for a day-long series of events around training opportunities and broader impacts.
Addiction Medicine 2018: 7th Annual Translational Science Symposium
Questrom Dean’s Speaker Series: Corporate Ethics and America’s Favorite Sport with Ann McKee, Professor, Neurology and Pathology
Robot Lawyers: Automating Legal Compliance for Transferring Private Data
Career Explorations: Working in Academics (non-faculty)/Grant Administration


Recommended for users who: have experince with git, want to host
the repository in their own organization or already have an online git repository*.
You will provide EcoSML the url to your existing git repository on the next screen.
*Currently: GitHub, GitLab and Bitbucket git repositories are supported.


-
Base class for array classes.
[
Utility | Solid | VRML97 ]
[
Summary |
Description |
Notes |
Example Code |
Members |
Ancestors | Descendants ]
Summary
class vrArrayBase
{
};
Description
This class supports the vrArray classes but does not implement the
+, - or * operators since user may sometimes wish to store items in
an array for which these operations are not defined (for example strings).
Notes
- This is a templated class.
- The array will grow in chunks of CHUNK_SIZE items (now defined at
30 items) whenever necassary.
Example Code
// This is a basic array class.
vrArrayBase<SFInt32> intArray;
intArray[0] = 1;
intArray[1] = 2;
intArray[2] = 3;
for (int i=0;i<intArray.GetCount();i++)
printf("%d ", intArray[i]);
printf("\n");
// OUTPUT: 1 2 3
Members
The current size of the array -- will grow in CHUNK_SIZE increments as array fills up.
- default: CHUNK_SIZE
The number of values currently stored in the array.
- default: 0
The actual array of objects of type TYPE.
- default: 0
Default constructor.
- vrArrayBase (const vrArrayBase& ar) ;
Copy constructor.
Desctructor.
- vrArrayBase& operator= (const vrArrayBase& ar)
Equals operator.
Clears the array -- does not delete the stored items.
- TYPE& operator[] (SFInt32 index) ;
Access the nth item from the array for assignment (will grow if necassary).
- in index:
- The index of the requested item.
- const TYPE& operator[] (SFInt32 index) const ;
Access the nth item from the array (read only).
- in index:
- The index of the requested item.
- SFInt32 GetCount (void) const ;
Returns the number of items in the array.
- void AddValue (TYPE val) ;
Add a value to the array at the next available slot.
- in val:
- The value to add to the array.
Ancestors
Descendants
Generated from source by the Cocoon utilities on Mon Feb 01 22:20:57 1999
.


[gecode-users] The Future of Gecode/J
Christian Schulte
cschulte at kth.se
Wed Sep 24 16:11:44 CEST 2008
Dear all,
this mail is concerned with Gecode/J and not Gecode.
After some discussion that has been going on for over a year now, we decided
that we have to take a decision regarding the future of Gecode/J. To remind
you, we started Gecode/J with a very clear focus on teaching: have something
that has a graphical search tool (Gist) and that is easily accessible for
students.
Neither of these aspects are any longer relevant: Gecode comes with a much
much better Gist (more functionality) and the little programming that one
has to do for modeling turns out to be easier in C++ (due to operator
overloading and other reasons) than it is in Java. I, for one, will not use
Gecode/J any longer for teaching. I will use Gecode directly or in
combination with MiniZinc.
Now, throw in the additional disadvantages of Gecode/J compared to Gecode:
less documentation (this will get worse as the entry-level documentation
under way will be for Gecode and not Gecode/J), way more bugs (we just do
not have the resources to test Gecode/J as thoroughly as we test Gecode),
and less efficiency.
To us it is quite clear that we have to take a decision on Gecode/J. So,
Gecode/J is not as good as Gecode and with the amount of resources we can
spend on Gecode/J it will never be. Then, we do not want people to believe
that the poor quality (well, for Gecode standards) of Gecode/J also means
that Gecode itself is of poor quality. This just leads to a lot of
aggravation for both users and us (just see the latest exchange of messages
on this list about Gecode/J where the tone in some messages has not exactly
been very encouraging).
Okay, to cut a long story short: we will discontinue the development of
Gecode/J. The current version will be available for some time but there will
be no Gecode/J 3.0 when Gecode 3.0 is released. In addition to that we are
thinking about having a separate mailing list for Gecode/J until it is
eventually fully retired.
The good news is that Gecode/J has a very liberal license. So if anyone is
interested to take over, we'll be more than happy to get you started.
All the best
Christian, Guido, Mikael
--
Christian Schulte, www.ict.kth.se/~cschulte/
More information about the gecode-users
mailing list


Checkout
Vintage Bag
$59.99
$94.99
1
Levi Shoes
$74.99
$124.99
1
Shipping
$19
Total
$148.88
Contact Information
E-mail
Phone
Shipping Address
Full name
Address
City
Country
Postal code
Save this information for next time


FAQ
What is cloudata?
Cloudata is structured data storage. It's DBMS(Database Management System), but not Relational DBMS.
How Cloudata is different from Hadoop Fils System.
File system like Hadoop can store flat file. It is impossible to retrieve a specified record within milliseconds in a flat file.
"Structured" means indexed. RDBMS like Oracle is most popular structured data storage.
You can store structured(indexed) data in the Cloudata and can retrieve within a few milliseconds.
How fast online operation?
Cloudata is not optimized for online operation. But supports resonable speed.
On average workload status, You can put a row(1000 bytes) within 0.5 ~ 5 ms and can get within 1 ~ 5 ms.
Look
performance test results.


 Sure, to large degree it's because of my libertarian politics, but to another degree it's because smoking bans are BORING. There are interesting people that you could meet
Here's an old discussion on smoking:
http://e-roosters.blogspot.com/2007/11/no-smoking.html
no results from bans
http://volokh.com/posts/1228406359.shtml
bad results from bans
http://e-roosters.blogspot.com/2008/02/blog-post_24.html


iOS device repair
We offer quality aftermarket screen replacements for all iPhone, iPad devices using OEM replacement screens that are made in the same factories as the originals.
Battery replacement
Your worn out and malfunctioning battery will be replaced with a quality OEM unit that will once again give you the all day battery life you need.
Have you dropped your device on the ground and it does not turn on anymore, is the charging port not working, camera not working, speaker weak, or your device came in contact with liquid?
| Screen replacement OLED | 280€ | |
| Screen replacement LCD | 160€ | |
| Battery replacement | 90€ |
| Screen replacement OEM | 200€ | |
| Battery replacement | 70€ | |
| Charging dock replacement | 75€ |
| Screen replacement OLED | 260€ | |
| Screen replacement LCD | 160€ | |
| Battery replacement | 80€ | |
| Charging dock replacement | 75€ |
| Screen replacement OLED | 240€ | |
| Screen replacement LCD | 140€ | |
| Battery replacement | 70€ | |
| Charging dock replacement | 75€ |
| Screen replacement | 160€ | |
| Battery replacement | 70€ | |
| Charging dock replacement | 70€ |
| Screen replacement OLED | 220€ | |
| Screen replacement LCD | 120€ | |
| Battery replacement | 70€ | |
| Charging dock replacement | 70€ |
| Screen replacement | 120€ | |
| Battery replacement | 65€ | |
| Charging dock replacement | 60€ |
| Screen replacement | 110€ | |
| Battery replacement | 55€ | |
| Charging dock replacement | 60€ |
| Screen replacement | 110€ | |
| Battery replacement | 55€ | |
| Charging dock replacement | 60€ |
| Screen replacement | 100€ | |
| Battery replacement | 50€ | |
| Charging dock replacement | 55€ |
| Screen replacement | 90€ | |
| Battery replacement | 45€ | |
| Charging dock replacement | 40€ |
| Screen replacement | 75€ | |
| Battery replacement | 45€ | |
| Charging dock replacement | 40€ |
| Screen replacement | 80€ | |
| Battery replacement | 45€ | |
| Charging dock replacement | 40€ |
| Screen replacement | 70€ | |
| Battery replacement | 45€ | |
| Charging dock replacement | 40€ |
| Screen replacement | 65€ | |
| Battery replacement | 40€ | |
| Charging dock replacement | 40€ |
| Screen replacement | 70€ | |
| Battery replacement | 45€ | |
| Charging dock replacement | 40€ |
Phone: +386 41 554 450
Email: info@macservis.si


About Enactus
A community of student, academic and business leaders committed to using the power of entrepreneurial action to transform lives and shape a better more sustainable world.
Entrepreneurial : initiating business innovation with integrity and passion.
Action : the experience of social impact that sparks social enterprise.
Us : student, academic and business leaders collaborating to create a better world.
Enactus is an international nonprofit organization dedicated to inspiring students to improve the world through entrepreneurial action. We provide a platform for teams of outstanding university students to create community development projects that put people own ingenuity and talents at the center of improving their livelihoods. Guided by educators and supported by business leaders, our students take the kind of entrepreneurial approach that empowers people to be a part of their own success. Our work transforms both the lives of the people we serve, and in turn, the lives of our students as they develop into more effective, values-driven leaders.


Functions¶
Simulation¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
+ |
prepare |
Simple |
A function called before each step. Zeroes a lot of variables and recalculates many auxilary variables, like ‘v’ or ‘vxv’. |
+ |
update_verlet_list |
Hard |
Updates the verlet list, but it’s hard to say what actually is updated there. |
+ |
evalgo |
Hard |
Computes the energy and force of the Go model. The interactions include: - harmonic between residues i and i + 1 - standard L-J between native contacts - repulsive L-J between residues i and i + 2 - repulsive L-J between residues that aren’t in a native contact but are close to each other. - some weird stuff with ss bonds. |
+? |
evalcpot |
Hard |
Calculates energy and force of the custom potential (???) |
+ |
evalangles |
Medium |
Computes the energy and force related to bond (i-1, i, i+1) and dihedral (i-2, i-1, i, i+1) angles. |
evalimproper |
Medium |
Calculates energy and force of the PID potential. |
|
evalwall |
Medium |
Computes the energy and forces related to wall interactions. |
|
eval_chirality |
Simple |
Computes the energy and forces arising from chirality potential. |
|
afm |
Simple |
Applies constant AFM force on the first and last residue. |
|
vafm |
Medium |
Applies AFM force on the first and last residue by simulating a harmonic spring that moves with constant velocity. But also does some logic with walls (???) |
|
+ |
predct |
VSimple |
Predictor step from the predictor-corrector method. |
+ |
corr |
VSimple |
Corrector step from the predictor-corrector method. |
+ |
lang |
VSimple |
Adds langevin noise and damping (which simulates the effect of implicit solvent). |
lang_mass |
VSimple |
lang, but accounts for different masses of residues. |
Math¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
+ |
dihedral |
Simple |
Calculates dihedral angle (for a given set of 4 vectors). |
+ |
bondangle |
Very simple |
Calculates the bond angle (for a given set of 4 vectors). |
countpid |
Simple |
Computes phi (angle used in PID) for a given pair of residues. Used only in ‘print_map’ -> ‘compute_details’. |
|
norma |
VSimple |
Takes a 3x3 matrix and normalizes its columns. Used only in kabsch. |
|
pvector |
VSimple |
Given two 3D vectors, calculates cross product and its norm. |
|
jacobi |
Medium |
Given a 3x3 symmetric matrix it finds its eigen(values|vectors). |
|
eigsrt |
VSimple |
Given the output of jacobi it sorts eigenvectors in descending order by their lengths. |
|
+ |
ran2 |
Simple |
Random number generator. |
Input¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
load_allatom |
Simple |
Part of ‘compute_contact_map’. Given the PDB file, it reads the native positions of atoms in the protein. |
|
+ |
load_protein |
Hard |
Loads the native conformation and SS bonds from the PDB file. Big part of it runs only when ‘lunwrap’ is true (unwrapping coordinates arising from periodic boundary conditions). |
load_cmap |
VSimple |
Loads native contacts directly from a .map file (also dihedral and bond angles). |
|
load_sequence |
Simple |
Loads a sequence of amino acids to simulate (for disordered proteins). |
|
load_paramfile |
Simple |
Loads various parameters from ‘paramfile’ (example3 has ‘parameters.txt’). |
|
+ |
compute_native_angles |
VSimple |
Computes dihedral and bond angles for native conformation. |
+ |
gopotential |
Simple |
If ‘lpdb’ is true, it calculates the sigmas of L-J potential for all contacts (the meaning of sigmas - p. 9 in the paper). |
model_chirality |
VSimple |
Calculates the chiralities for the native structure. |
|
amino_acid_mass |
VSimple |
Computes masses of residues relative to the mass of the entire protein. |
|
compute_contact_map |
Medium |
Computes native contacts from a PDB file based on the positions of individual atoms in the amino-acids. |
|
compute_cmap |
Simple |
Simpler alternative to ‘compute_contact_map’. It defines a contact between residues by the cut-off on the distance between C-alpha atoms. |
|
assign_VdW_radius |
Medium |
Part of ‘compute_contact_map’. It assigns the Van der Waals radius to all atoms in the amino-acids in the chains. Also performs some checks. |
|
displace |
Simple |
Displaces one specified pair of chains away from each other by a given distance. |
|
+ |
confstart |
Medium |
Generates the starting conformation (it’s supposed to be a self-avoiding random walk). |
+ |
intvel3d |
Simple |
Assigns initial velocities to the pseudoatoms. |
Stats¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
+ |
gyration |
VSimple |
Computes radius of gyration of the protein, which is the standard deviation of distances from residues to the center of mass. |
cgyration |
Medium |
Computes various statistics - the radii of gyration for all chains, also W (asphericity parameter, whatever that is). Also finds knots. |
|
kmt |
Hard |
Used only in ‘cgyration’. Finds the beginning and end of a knot in a chain. Possibly some knot theory is needed to understand it. |
|
kabsch |
Medium |
Given two sequences of 3D vectors of equal length, finds a rotation + translation that minimizes the root mean sqared deviation between them. See ‘Kabsch algorithm’ on Wikipedia. |
|
compute_rmsd |
VSimple |
Calls ‘kabsch’ on the positions of residues after simulation ends and their original positions. |
Output¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
print_restart |
VSimple |
Prints the restart file. |
|
print_conformation |
Medium |
Prints the conformation in the PDB format. |
|
print_conf_xyz |
VSimple |
Prints the conformation in the XYZ format. |
|
print_cmap |
VSimple |
If ‘lwritego’ is true, no simulations are performed and this function prints the contact map. |
|
print_map |
Medium |
Prints a contact map file that contains all the contacts after the simulation (optionally adds some details about angles). |
|
compute_details |
Simple |
Given two residues, computes some angles between them. Used in ‘print_map’ when ‘ldet’ is true. |
Walls¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
connect_to_wal_one_by_one |
??? |
??? |
|
connect_to_wal |
??? |
??? |
|
make_fcc |
Simple |
Creates a 2-layer, triangular lattice of beads that form a wall. |
Other¶
Priority |
Function |
Difficulty |
Synopsis |
|---|---|---|---|
sort, sort2 |
VSimple |
Just a quicksort (sort2 applies the same permutation to a second array). |
|
angeval |
Medium |
Never called. Maybe the older version of evalangles. |
|
compute_ssbonds |
Simple |
Never called. Probably obsolete. |
|
build_titin |
Simple |
Used for building titin - a very large protein composed of many protein domains. |
|
interdomain |
Simple |
Next step for building titin, disables contacts between different domains of titin. |


{% extends "base.html" %} {% block content %} Toggle navigation FHB Home (current) Lichens Profile You are logged in as {{ current_user.username }} Log out {% block navcontent %} {% endblock %} {% endblock %}
You are logged in as {{ current_user.username }}


Wednesday, September 18 @ 4:00pm – 7:00pm at WBEZ West Side Bureau
2710 West Cermak 60608 Chicago, IL
We want to meet our Little Village neighbors! Come out and enjoy food,
fun and local journalism! Meet reporters from the station and get a
behind-the-scenes view of the journalism that powers WBEZ, Chicago's
source for local and national news, talk and information.


Code Coverage |
|||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
|||||||||||
| Total | |
100.00% |
136 / 136 |
|
100.00% |
100 / 100 |
|
17.42% |
46 / 264 |
|
100.00% |
28 / 28 |
|
100.00% |
4 / 4 |
| Hook.php [line] [branch] [path] | |
100.00% |
43 / 43 |
|
100.00% |
30 / 30 |
|
17.14% |
12 / 70 |
|
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
| HookCollection.php [line] [branch] [path] | |
100.00% |
26 / 26 |
|
100.00% |
18 / 18 |
|
87.50% |
14 / 16 |
|
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
| HookProxy.php [line] [branch] [path] | |
100.00% |
19 / 19 |
|
100.00% |
8 / 8 |
|
100.00% |
7 / 7 |
|
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
| Profiler.php [line] [branch] [path] | n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|||||
| Query.php [line] [branch] [path] | |
100.00% |
48 / 48 |
|
100.00% |
44 / 44 |
|
7.60% |
13 / 171 |
|
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |


Name of Trip
Edit
View
Share link
Notifications
ON
OFF
Only when someone edits
Only when someone comments
Edit Itinerary
Delete Itinerary
1/2
x am
Check out
Location
Description
Edit
Comment
Location
Description
Event
Time
x am
x am
x am
x am
x am
Place
Detail


Dorrigo art show and competition 2019
by Chris MooreThe Dorrigo Visual Arts Group has again been delighted with the outstanding quality of work presented for the 2019 show on November 20. The annual show is the culmination of not only the artists' work but also by the many DVAG members and supporters who now work as a well-oiled team.
A large crowd of about 100 people attended the evening event. Problems with bushfires and smoke no doubt made some hesitant to venture out but within the crowd the mood reflected a need to socialise and be with others in difficult times.
Unfortunately, our judge Barbara Mckay was unable to drive to Dorrigo as the road near Ebor had been closed by RFS. However, two of our local artists, Sandra Pitkin and Peter Mortimore, stepped up to the challenging task of judging then providing feedback to the artists during the evening prize giving.
The winning entries for 2019 were
Champion exhibit. Guus Brunnekreef " Insight"
Second prize. Maryanne Khan "Alexandra's Iris"
Third prize. Konatsu Honda "Hunter in a dewy Web"
Highly commended. Lucy Adams "Bath Time"
Drawing award. Ivinne Brown "Rooftop Pots"
Portrait award. Jo Good. "Lady Bunnings"


WELCOME
Home
About
Sample Post
Contact
CLEAN BLOG
Clean Blog theme by Aishwarya D Kuchalli
Man must explore, and this is exploration at its greatest Problems look mighty small from 150 miles up
I believe every human has a finite number of heartbeats. I don't intend to waste any of mine.
Science has not yet mastered prophecy We predict too much for the next year and yet far too little for the next ten.
Failure is not an option Many say exploration is part of our destiny, but it’s actually our duty to future generations.
OLD POSTS


{%- import "macros.html" as macros -%} {# The url of the current release, `/crate/:name/:version` #} {%- set crate_url = "/crate/" ~ krate.name ~ "/" ~ krate.version -%}


Evacuee Self-Registration Success
What you need to know:
-
Your Emergency Support Services File Number is:
{{ registrationNumber }}
- If you provided an email address your Emergency Support Services File Number has been emailed to you.
- If you are under order and require any emergency support services, proceed to your designated Reception Centre. A list of open Reception Centres can be found at Emergency Info BC.
- Please bring your Emergency Support Services File Number with you to the Reception Centre.
- If you do not require emergency support services, or are under alert, no further actions are required.
- If you are at a Reception Centre, proceed to one of the Emergency Support Services volunteers on site who will be able to assist you with completing your registration.


- Service charges are non-refundable.
- All disputes subject to Delhi Jurisdiction only.
- The complete terms ans Conditions in relation to the product/services offered & accepted by the channel partner, and in relation to the general Terms and conditions on portal usage are available on the website (portal) for which services have been subscribed.
- Benefits of portal may apply after clearing your cheque.
- If your cheque is returned dishonoured or in case of charge back on an online transaction (including credit card payment), services will be immediately deactivated. In case of dishonoured, the reactivation would be done only on payment of an additional Rs. 500 per instance of dishonour.
|
|
| |
Thank you for your business! If you have any questions about your order, please contact us at
[CompanyPhone].


Recent Book
The Bridge
Author: Ariyan Rey
Price: $64.00
All the people disappeared. Somehow three people have survived. Is crossing the bridge is the only way to get out of the city? What are they going to do? Will they stay and fight? Or will they leave everything behind?
Shop Now
Recent Book
The Multiverse
Author: Farya Zavan
Price: $85.00
Some people, scientists, and cosmologists believe we are living in a multiverse. Multiverse is a group of parallel universes. But does the multiverse really exists? If it exists, where is other people? Is it possible to find them? What is the answer?
Shop Now
Recent Book
A History of
Sained Glass Roof
Author: Sam Puran
Price: $76.00
The new edition of Sam Puran's A History of Stained Glass Roof is a rich source of information about stained glass windows architecture. This book contains more than 100 rare colour photographs of various stained glass and rose windows and ceilings, from 1300 onward.
Shop Now


{% extends "base.html" %} {% load i18n wagtailcore_tags wagtailimages_tags %} {% block meta_description %} {% trans "P. Sainath is the Founder Editor of the People’s Archive of Rural India. The archive is an outcome of his three decades-plus in journalism – including a quarter century of reporting from rural India." %}{% endblock %} {% block meta_title %}{% trans "Founder Editor P Sainath" %}{% endblock %} {% block opengraph_block %} {% include "core/includes/media_sharing_meta.html" with title="P. Sainath, Founder Editor" description="P. Sainath is the Founder Editor of the People’s Archive of Rural India. The archive is an outcome of his three decades-plus in journalism – including a quarter century of reporting from rural India." url=request.get_full_path type="url" image_url=STATIC_URL|add:"img/nav_header_images/sainath.png" twitter_card="summary" %} {% endblock %} {% block extra_css %} {% endblock %} {% block main %}
{{ person.description|richtext }}


Demo
Documentation
Road Trip By StreetView
There is already one for this. However, I found myself doing totally different approach for this purpose than the existing one, such as;
There is a blog that introduces this module. The title of it is ‘Google Map As The Simplest Way’
For Bower users,
$ bower install ngmap
Include ng-map.min.js
as well as google maps.

name angular app as ngMap, or add it as a dependency
var myApp = angular.module('myApp', ['ngMap']);
After map is initialized, you will have one event and map instances
Event:
mapInitialized
with parameter with map
In case your map directive scope is different from your controller scope, use this event to get the map instance.
app.controller('parentParentController', function($scope) { $scope.$on('mapInitialized', function(event, map) { map.setCenter( .... ) .. }); });
Instances:
$scope.map
$scope.map.markers
$scope.map.shapes
Simply wrap the map tag with map-lazy-load="http://maps.google.com/maps/api/js"
.

<map center="41,-87" zoom="3"></map>

1.7.0
1.6.0
1.5.0
1.4.0
https://maps.google.com/maps/api/js
Example1.3.0
1.2.0
controller as
syntax, thanks to Simon1.1.0
1.0.0 (covers all official google examples using directives).
shapes
layers
As defined on MapOptions, you can add any attributes, and events starting witn on-
. Please note that event value must be a function.
Example:
<map zoom="11"
center="[40.74, -74.18]"
disable-default-u-i="true"
disable-double-click-zoom="true"
draggable="false"
draggable-cursor="help"
dragging-cursor="move"
keyboard-shortcuts="false"
max-zoom="12"
min-zoom="8"
tilt="45"
map-type-id="TERRAIN">
</map> i.e. < zoom="11" center="[40.74, -74.18]"
As defined on MarkerOptions, you can add any attributes, and events starting witn on-
.
<map center="[40.74, -74.18]">
<marker
position="[40.76, -74.16]"
title="Hello Marker"
animation="Animation.BOUNCE"
draggable="true"
visible="true"
icon="beachflag.png"></marker>
</map>
Polyline, Circle, Polygon, Rectangle, and Images
<map zoom="11" center="[40.74, -74.18]">
<shape id="polyline" name="polyline"
geodesic="true" stroke-color="#FF0000" stroke-opacity="1.0" stroke-weight="2"
path="[[40.74,-74.18],[40.64,-74.10],[40.54,-74.05],[40.44,-74]]" ></shape>
<shape id="polygon" name="polygon"
stroke-color="#FF0000" stroke-opacity="1.0" stroke-weight="2"
paths="[[40.74,-74.18],[40.64,-74.18],[40.84,-74.08],[40.74,-74.18]]" ></shape>
<shape id="rectangle" name="rectangle" stroke-color='#FF0000'
stroke-opacity="0.8" stroke-weight="2"
bounds="[[40.74,-74.18], [40.78,-74.14]]" editable="true" ></shape>
<shape id="circle" name="circle" stroke-color='#FF0000'
stroke-opacity="0.8"stroke-weight="2"
center="[40.70,-74.14]" radius="4000" editable="true" ></shape>
<shape id="image" name="image"
url="https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg"
bounds="[[40.71,-74.22],[40.77,-74.12]]" opacity="0.7" clickable="true" ></shape>
</map>
Example:
<map center="-25.363882,131.044922" zoom="4">
<info-window id="bar" position="-25.363882,131.044922" visible="true">

</info-window>
</map>
Example:
<map center="41.850033, -87.6500523" zoom="6">
<custom-control id="home" position="TOP_RIGHT" index="1" on-click="click()">

Home1

</custom-control>
</map>
Example:
<map zoom="4" center="-28, 137.883">
<map-data
load-geo-json="https://storage.googleapis.com/maps-devrel/google.json"></map-data>
</map>
<map zoom="14" center="42.3726399, -71.1096528">
<bicycling-layer></bicycling-layer>
</map>
<map zoom="6" center="49.265984,-123.127491">
<weather-layer temperature-units="FAHRENHEIT"></weather-layer>
<cloud-layer></cloud-layer>
</map>
<map zoom="11" center="41.850033, -87.6500523">
<fusion-tables-layer query="{
select: 'Geocodable address',
from: '1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg'}">
</fusion-tables-layer>
</map>
<map zoom="13" center="37.774546, -122.433523" map-type-id="SATELLITE">
<heatmap-layer id="foo" data="taxiData"></heatmap>
</map>
<map center="59.322506, 18.010025" zoom="14">
<maps-engine-layer
layer-id="06673056454046135537-08896501997766553811">
</maps-engine-layer>
</map>
<map zoom="13" center="34.04924594193164, -118.24104309082031">
<traffic-layer></traffic-layer>
</map>
<map zoom="13" center="51.501904,-0.115871">
<transit-layer></transit-layer>
</map>
<map center="59.322506, 18.010025" zoom="14">
<dynamic-maps-engine-layer
suppress-info-windows="true"
clickable="true"
on-mouseover="onMouseover()"
on-mouseout="onMouseout()"
layer-id="06673056454046135537-08896501997766553811">
</dynamic-maps-engine-layer>
</map>
<map zoom="11" center="41.875696,-87.624207">
<kml-layer url="http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml"></kml-layer>
</map>
<map zoom="10" center="41.850033,-87.6500523"
<map-type name="coordinate" object="CoordMapType">
</map-type>
</map>
<map zoom="10" center="41.850033,-87.6500523">
<overlay-map-type object="CoordMapType" index="0">
</overlay-map-type>
</map>
285 Allen Kim
13 Hamza Azeem
4 Fangming Du
3 Antonio Salumbides
2 Alexandre Kilian
2 Prem Prakash
2 Romain Maneschi
2 jpagand
1 martinmicunda
1 Simon Hampton
1 Will
1 Ishaan Puniani
1 Michael Liu
1 unknown


--- layout: default ---
Bootleg is a self-supervised named entity disambiguation (NED) system that links mentions in text to entities in a knowledge base. Bootleg is built to improve disambiguation of entities which appear infrequently or not at all in training data, called tail entities. The tail is where disambiguation gets interesting as models cannot rely on learned textual cues for entities rarely seen in train. As shown in the figure below, this is why a BERT-based baseline, which memorizes co-occurrences between entities and text to disambiguate, struggles over the tail.
The simple insight behind Bootleg is that resolving the tail requires subtle reasoning over type and relation signals. In Bootleg, we take an "embedding-centric" approach and represent types, relations, and entities as learned embeddings in a Transformer-based architecture. Critically, all entities of the same type (or relation) get the same type (relation) embedding, meaning all entities, including the tail entities, can leverage the signals learned for all entities of that type (relation). This is what allows for Bootleg to better disambiguate tail entities than models that rely only on textual patterns.
Bootleg is already in use at industry and research labs and is still in under active development. We have not done extensive tuning or parameter sweeps of our models and have mainly been focused on capturing the right inductive biases through the model and dataflow.
| Benchmark | System | Precision | Recall | F1 |
|---|---|---|---|---|
| KORE502 | Hu et al., 20195 | 80.0 | 79.8 | 79.9 | Bootleg | 86.0 | 85.4 | 85.7 |
| RSS5003 | Phan et al., 20196 | 82.3 | 82.3 | 82.3 | Bootleg | 82.5 | 82.5 | 82.5 |
| AIDA CoNLL YAGO4 | Fevry et al., 2020 | - | 96.7 | - | Bootleg | 96.9 | 96.7 | 96.8 |
| Evaluation Set | BERT NED Baseline | Bootleg |
|---|---|---|
| All Entities | 85.9 | 91.3 | Torso Entities | 79.3 | 87.3 | Tail Entities | 27.8 | 69.0 |
| Unseen Entities | 18.5 | 68.5 |
1Christoph Alt, Aleksandra Gabryszak, Leonhard Hennig . "TACRED Revisited: A Thorough Evaluation of the TACRED Relation Extraction Task." In ACL, 2020.
2Johannes Hoffart, Stephan Seufert, Dat Ba Nguyen, Martin Theobald, and Gerhard Weikum. "Kore: keyphrase overlap relatedness for entity disambiguation." In CIKM, 2012.
3 Daniel Gerber, Sebastian Hellmann, Lorenz Bühmann, Tommaso Soru, Ricardo Usbeck, and Axel-Cyrille Ngonga Ngomo."Real-time rdf extraction from un- structured data streams." In ISWC, 2013.
4Johannes Hoffart, Mohamed Amir Yosef,Ilaria Bordino,Hagen Fürstenau, Manfred Pinkal, Marc Spaniol, Bilyana Taneva, Stefan Thater, and Gerhard Weikum. "Robust disambiguation of named entities in text." In EMNLP, 2011.
5Shengze Hu, Zhen Tan, Weixin Zeng, Bin Ge, and Weidong Xiao. "Entity linking via symmetrical attention-based neural network and entity structural features." Symmetry, 2019.
6 Minh C. Phan, Aixin Sun, Yi Tay, Jialong Han, and Chenliang Li. "Pair-linking for collective entity disambiguation: Two could be better than all". In TKDE, 2019.
7 Thibault Févry, Nicholas FitzGerald, Livio Baldini Soares, and Tom Kwiatkowski. "Empirical evaluation of pretraining strategies for supervised entity linking." In AKBC, 2020.


FR EN
{{ whatIsItTitle }}
{{ whatIsItText }}
{{ currentStation.name }}
{{ currentStation.address }}
Currently available bikes: {{ currentStation.available_bikes }}
Currently available bike stands: {{ currentStation.available_bike_stands }}
Total bike stands: {{ currentStation.bike_stands }}
{{ currentStation.last_update | date }}


Examples on the evolving EMF databinding are still limited, so here's what I've learned recently. The use case is as follows, display the Collection (more precisely an EList) of Addresses a Person object owns (Person#addresses) in a JFace TableViewer.
Before things can get started, one needs to grab a recent version (recent in terms of HEAD because of #216440) of EMF 2.4, which in turn requires platform 3.4. After defining EMF as a plug-in dependency, the Viewer's Content- and LabelProvider needs to be changed to:
// The model object which should be shown
Person aPerson = ModelFactory.eINSTANCE.createPerson();
...
// The content provider is responsible to handle add and
// remove notification for the Person#address EList
ObservableListContentProvider provider = new ObservableListContentProvider();
viewer.setContentProvider(provider);
// The label provider in turn handles the addresses
// The EStructuralFeature[] defines which fields get shown
// in the TableViewer columns
IObservableSet knownElements = provider.getKnownElements();
IObservableMap[] observeMaps = EMFObservables.
observeMaps(knownElements, new EStructuralFeature[] {
ModelPackage.Literals.PERSON_ADDRESS__STREET,
ModelPackage.Literals.PERSON_ADDRESS__NUMBER,
ModelPackage.Literals.PERSON_ADDRESS__ZIP,
ModelPackage.Literals.PERSON_ADDRESS__COUNTRY);
ObservableMapLabelProvider labelProvider =
new ObservableMapLabelProvider(observeMaps);
viewer.setLabelProvider(labelProvider);
// Person#addresses is the Viewer's input
viewer.setInput(EMFObservables.observeList(Realm.getDefault(), aPerson,
ModelPackage.Literals.PERSON_ADDRESSES));
This is pretty much everything what's necessary to display the Addresses details in the TableViewer and to react to EMF notifications. One doesn't even have to write a custom Content- and LabelProviders. Though the databinding has some limitation in this early incarnation:
-
One might want to delegate to an existing EMF edit in the LabelProvider, thus an EMF version of the ObservableMapLabelProvider would be required
-
No support for non EMF/custom columns. If a table column is to be filled by a different source than an EMF field e.g. calculation usually done in the LabelProvider
-
EMF proxies don't get resolved under certain conditions which result in NPEs in the LabelProvider or Comparators
Edit: Following Ed's suggestion I've created a EMF recipe and bug 216748


This project is to help authors and readers better orient themselves in our world. There are severe issues, pervasive to our kind. In the scope of the work explored here readers can expect authors to grapple with and represent information from a multitude of perspectives, with the aim at corralling truth in the process.
Words can help free oneself from ones own ignorance, something that can be blissfully self-perpetuating without realization. Through engaging these dialectical works it is the hope that one may, in turn, begin to chip away at the marble towards discovery of the deep, self-reflective, value driven being that lay beneath.
Join us and become a better thinker, questioner, community member, human being.
This will serve as a set of distilled, core values that help describe the essence of the work being done here.


After logout, remember to delete the access token
login with password:
or accessToken(with repo and gist scope):
Using Github Enterprise? Login to Github Enterprise
Can not create access token, please check your username and password.
Using Github.com? Login to Github.com
Can not create access token, please check your GHE domain, username and password.


Hundreds of bottles of liquor salvaged from WWI-era Baltic wreck
STOCKHOLM, Nov 8 — A Swedish team has salvaged hundreds of bottles of liquor from the wreck of a ship sunk during World War I in the Baltic Sea.
Ocean X, a group that specialises in salvaging alcohol from shipwrecks, said it was testing the bottles from a cargo bound for tsarist Russia to see if they were still fit to drink.
The group brought 600 bottles of cognac and 300 bottles of Benedictine — a herbal liqueur — to shore on October 22 after recovering them from the wreck of the Kyros, which was sunk by a German submarine in 1917.
Bottles of the cognac, produced by the now-defunct distillers De Haartman, and the Benedictine are being tested in a laboratory.
“The conditions in the Baltic are very suitable for storing these kind of beverages because it’s... dark and very cold,” said Peter Lindberg, who led the expedition.
The Kyros left Sweden in May 1917 and was sunk in the Sea of Aland with an explosive charge.
The ship’s crew survived and were transferred to another vessel. They later returned to Sweden, according to Ocean X.
Lindberg said his group located the wreck nearly 20 years ago but lost the position, finding it many years later.
After relocating the steam ship at a depth of 77 metres in the Sea of Aland between Sweden and Finland, it took years to clear the wreck of abandoned fishing nets so divers could inspect it, but even then conditions proved to be too difficult to search manually.
“After we had been there several times with divers and a smaller ROV (remotely operated vehicle), we realised that the situation was becoming too dangerous,” Lindberg said.
Ocean X asked a salvage company with remote underwater vehicles to help raise the bottles.
Lindberg and his team are optimistic the bottles have not leaked as there is still a layer of air between the cork and the spirits inside, and many of the Cognac bottles were sealed with a thin layer of tin.
“The value of these bottles is yet to be decided because the Cognac is of a brand which does not exist today,” Lindberg said.
He hopes the spirits can be sold at international auction houses where he has put previous finds under the hammer, and hopes they would command a high price.
“I don’t know if I can afford to keep a bottle for myself,” he said. — AFP


I have done 8-4-4 but only till class 8. After that I moved to an Accelerated Christian Education for about 3 years. I then started homeschooling the year after due to some risen financial issues. I now do coding with Moringa School to further brighten my future.


{% extends "base.html" %} {% load bootstrap_form from bootstrap3 %} {% load gross from prices_i18n %} {% load discount_amount_for from prices %} {% load i18n %} {% load staticfiles %} {% block title %} {% blocktrans trimmed context "Payment details page title" %} Pay for order {{ order }} {% endblocktrans %} — {{ block.super }} {% endblock %} {% block breadcrumb %} {% if order.user == user %}
{% endif %} {% endblock breadcrumb %} {% block content %}{% blocktrans trimmed context "Payment pending text" %} Your order {{ order }} has been accepted. {% endblocktrans %}
{%trans "Our employee will contact you soon to confirm your order." context "Payment pending text" %}
{% include 'order/order-details.html' %}


--- author: andrew.lunny categories: app date: '2011-10-13 00:12:03' permalink: /2011/10/13/phonegap-build-pricing-plans-update/ slug: phonegap-build-pricing-plans-update status: publish title: 'PhoneGap Build: Pricing Plans Update' type: post format: html tags: - News - PhoneGap Build ---
A couple of weeks ago, when we moved PhoneGap Build into public beta, we announced some preliminary pricing plans for the service. We received a lot of great feedback, via email, on our blog, and through Get Satisfaction, and we’ve updated the plans to reflect that feedback.
The biggest change we’ve made is to remove the build limits from the plans. Sometimes, during active development, you’ll be doing dozens of builds a day, particularly if you’re targeting multiple platforms. The last thing we want is for our plans to get in the way of reasonable usage of the site, or discourage anyone from using PhoneGap Build.
If you plan to send a few thousand builds our way every day - for example, if you’re building a service on top of PhoneGap Build using our API, and need additional capacity - then these plans won’t be a good fit. If you, or a service you’re developing, will use PhoneGap Build significantly more than a normal user of the site would, you’ll want to speak to us directly about finding the right solution.
We’ve also changed our vocabulary a bit, to make the functionality clearer:
We’re labelling your unlimited free apps as public, rather than open source. This gives a better sense of what we mean - you can create unlimited apps that are publicly accessible through PhoneGap Build, and a set number that are only accessible by you, and your private collaborators. Public apps will be available on the PhoneGap Build beta in the next couple of weeks.
There is a limit on private collaborators per plan, not users. The apps you build can be distributed to as many end users, or collaborators on your team, as you wish; however, there is a limit on how many users can access your private apps through PhoneGap Build.
Please note that none of this will change any existing apps or accounts on the PhoneGap Build beta - all of the apps you’ve built so far will remain private, and we won’t kick out any collaborators who have worked on your account. We’re very grateful for all of our beta users, and hope you all keep using the service.
Hopefully that clarifies our plans - we don’t want to prevent anybody from building or distributing their apps, nor do want to enforce any licensing terms on the apps you build. Of course, before we charge you any money, we’ll have our full terms of service available to make clear that you retain your rights over your software.
Thanks again, and please let us know what you think.


This page describes all the world currencies supported by our exchange rate API and the codes used to describe them in our responses. The "Currency Code" field you see at the start of each line below is the ISO 4217 Three Letter Currency Code for that currency. Wherever you see a currency code field in our API documentation you must supply one of the codes from this list.
Please note that ISO 4217 codes can be deprecated and replaced over time. An example would be Mexico - which used MXP prior to the 1993 currency revalution but now uses MXN. Some online lists of currency codes still use old codes - so check here if you're uncertain about which codes to include in your currency conversion project.
You can read more about ISO 4217 codes on Wikipedia.
There is only 1 widely recognized currency we don't offer exchange rate data for. This is listed below:
The following currencies experience heightened volatility & substantial differences between actual rates of exchange available in different markets and those published officially. In these instances we default to the rates published by the appropriate central banks. Please take extra caution when using our data for these currencies as there is a fair chance it will disagree with other sources.
We support all 160 commonly circulating world currencies listed below. These cover 99% of all UN recognized states and territories.
We offer an easy to use, accurate and reliable exchange rate API for PHP that's perfect for both personal and professional use.
Fetching exchange rates using our PHP currency conversion API is as easy as making GET requests. This means you can easily integrate our API into your PHP project however you'd prefer. No complex dependency hassles.
Our API returns JSON responses that are fast to parse and easily human-readable. PHP has high performance native library functions for handling JSON so you'll be able to access our data without much work at all.
For more details on the different types of request we support please see our Main Documentation.
Alternatively simply use the PHP library code below to get started as fast as you can copy & paste!
You'll need to sign up for a free account to receive your API key. Visit this link to get started.
Simple PHP Currency Conversion Example


Who’s there?
…Blocks, and procs!
You might have already heard the saying that everything in Ruby is an object. Ah, yes.. The beauty of objects and our ability to manipulate them fascinates me. Why are you looking at me like that? Are you trying to say I’m wrong? What? Not EVERYTHING in Ruby is an object? LIAR!
Blocks
That’s what I thought when I heard blocks weren’t objects. But it’s true, blocks technically AREN’T objects in Ruby. Let’s test this theory in an example:
{ puts "Hello, world!" } #=> SyntaxError
var = { puts "Hello, world!" } #=> SyntaxError
Without having a method calling on the block, it doesn’t get executed.
Let’s go over the basic syntax of block usage. You have probably seen blocks used mostly in this form:
array = [1, 2, 3, 4]
array.all? { |num| num < 5 }
#=> true
array.each do |num|
new_num = num + 1
puts new_num
end
#=> 2, 3, 4, 5
As you can see here, the blocks are being called by the all?
and each
methods. Blocks come in two forms. The first one we see in our all?
example shows the block in {}
form. Blocks can take an argument, which is passed as |num|
in our example, and it executes the rest of the block for each element in the array. The second form of a block is the do...end
block. It works in the same way as our curly-bracket enclosed block, accepting an argument, and executing the code in the block once for each element of the array. So why have two ways to write a block?
The answer is syntax. Typically, when we want execute a multi-line block, we want to use a do...end
block like we see with our each method. When we’re executing single line blocks, we’ll use a curly-bracket enclosed block.
Okay, well I get it. But if blocks aren’t objects, they can’t be utilized for anything else other than when methods call it. It seems useful sure, but what’s the big deal? Why doesn’t Ruby have blocks as objects?
Good question!
Proc
Blocks aren’t objects, but Ruby has a sweet object called a Proc which is exactly what you were looking for! A block, that can be harnessed into a variable, and called upon when needed!
Here’s how you’d create a new proc:
prc = Proc.new { |element| puts element }
The proc, is the block. When we try to create a proc without a block, we get an error.
prc = Proc.new
#=> ArgumentError: tried to create Proc object without a block
Now that we have a proc, how can we use this to our advantage?
prc = Proc.new { |num| num - 5 }
def add_or_subtract(num1, num2, prc)
if prc.nil?
num1 + num2
else
prc.call(num1, num2)
end
end
Let’s take a look at this code. There’s quite a lot of things going on here.
- Line 1: Nothing new, we’re creating a
Proc
object and storing it in a variable calledprc
. - Line 3: We’ve defined a method that takes
num1
,num2
, andprc
as parameters. That’s sort of new, we’ll go over it. - Lines 4-5: If
prc
isnil
then return the result ofnum1
plusnum2
. Pretty simple. - Lines 6-7: If
prc
is defined, then call thecall
method onprc
and throw innum1
andnum2
. Try taking a guess to what this does!
Let’s begin to sort this out case by case. The first case we’ll go over is I think the easiest to understand. The case where we pass in all variables like a good little programmer.
add_or_subtract(5, 4, prc)
#=> 0
The proc we passed in as prc
is not nil
, therefore, it executes line 7 by using the proc’s call
method. This method is straight forward in that all it’s doing is passing into the proc the arguments supplied in as parentheses. So essentially, our prc.call(num1, num2)
method looks like this in a block. { |num1, num2| num1 - 5 }
.
Now you might have noticed that we’re accepting one argument in our prc
variable, but we’re passing two parameters to it during the call. Good catch! However, that’s a neat feature of procs. They don’t care that we’re throwing in the wrong number of variables. It just executes the call using the first n
number of parameters it needs to execute it. The proc call won’t work if you don’t supply enough arguments.
Cool, awesome. Now let’s move on, but this time, let’s add one new character in our add_or_subtract
definition.
prc = Proc.new { |num| num - 5 }
def add_or_subtract(num1, num2, &prc)
if prc.nil?
num1 + num2
else
prc.call(num1, num2)
end
end
:If you don’t see it, shame on you! It’s in front of the prc
on line 3. The squiggly character called an ampersand.
What this does is it calls the to_proc
method on the variable. Our previous example worked, but what if we don’t always have a proc object to pass in as an argument? Or what if we wanted to do something other than subtract the first number by 5? We would have to create yet another proc object and then pass that in as an argument. There must be a handier way to do it. And there is! It’s the ampersand symbol that allows us to do just that.
So let’s say we don’t have an explicit proc object to pass into the method, but we do know what we want to do inside the block. We can write it like this:
add_or_subtract(5, 4) { |num| num - 2 }
#=> 3
The ampersand makes passing the proc in as a variable optional, and looks for a block following the method call. If there is, then it stores the block into prc
so that we can use it for something else if we wanted to. If there isn’t, then it remains as nil
.
Similarly, we might never create a proc object before calling our method, and sometimes we want the prc to default into something if it doesn’t have a block following it. Here’s an example:
array = [2, 4, 5, 1, 3]
array.sort { |num1, num2| num2 <=> num1 }
#=> [5, 4, 3, 2, 1]
array.sort
#=> [1, 2, 3, 4, 5]
Here’s what’s kind of going on behind the scenes:
:This implementation of sort below is bubble sort. Ruby’s built in sort method doesn’t use bubble sort, but for demonstration purposes, we’ll be using bubble sort.
class Array
def sort(&prc)
prc ||= Proc.new { |num1, num2| num1 <=> num2 }
sorted = false
until sorted
sorted = true
(self.length - 1).times do |i|
if prc.call(self[i], self[i + 1]) == 1
self[i + 1], self[i] = self[i], self[i + 1]
sorted = false
end
end
end
self
end
end
Don’t worry if you don’t know what that does. The only thing you should take from our sort example is that it takes an &prc
parameter just like our method, and it uses the passed proc if it’s not nil
. If it is nil
, we set it to our own default proc. Because we have it set up like this, we don’t ever have to explicitly create a proc object before calling the method. Pretty neat.
You might have also noticed that we never return
inside a block. That’s because when we do, it’ll return an error.
array = [2, 4, 5, 1, 3]
array.sort { |num1, num2| return num1 <=> num2 }
#=> LocalJumpError: unexpected return
Ruby doesn’t expect us to return
inside a block. The return value is implicit, meaning array.sort { |num1, num2| num1 <=> num2 }
will implicitly return -1, 0, or 1.
::There is a way to explicitly return from a proc using something called a lambda. However, I wont be going over lambdas in this post.
Now that we’ve come this far, let’s go over some of the properties of procs and blocks.
- Procs are objects in Ruby, blocks are not.
- Procs can be passed in as an optional argument using
&
. It defaults to a block following the call on the method if it’s not passed in explicitly, ornil
if neither are supplied. - Procs can take any number of arguments so long as it supplies enough arguments.
I would say knowing procs and blocks cover 90% of all usage in basic Ruby, but there is one other form of proc, and one other way to access a block. The other form of a proc is called a lambda, and the other way to access a block is through yield
. I’ll only be going over yield
in this post.
Yield
We know by now what a block looks like, how it takes parameters, and how it returns implicitly based on executing the code in the block. We also know how to set that block into a proc and access it using a proc, but there is another way using yield
.
Let’s go ahead and rewrite our initial add_or_subtract
method using yield
.
def add_or_subtract(num1, num2)
if block_given?
yield(num1, num2)
else
num1 + num2
end
end
Looks similar, but instead of using prc.nil?
we use block_given?
, and instead of using prc.call(num1, num2)
we use yield(num1, num2)
. If it looks like a duck, swims like a duck, and quacks like a duck, it probably is a duck, right? Not exactly. If we look back to the example where we used &prc
, Ruby didn’t care whether or not we assigned a block to it. But yield
is like a sensitive teen. Here it is in action, but we’ll modify our method a little to try and mimic the &prc
:
def add_or_subtract(num1, num2)
if yield.nil?
num1 + num2
else
yield(num1, num2)
end
end
add_or_subtract(5, 3)
#=> LocalJumpError: no block given (yield)
Okay, fine have it your way. I’ll give you a damn block.
add_or_subtract(5, 3) { |num| num - 5 }
#=> NoMethodError: undefined method '-' for nil:NilClass
GRRRRR… FINE.
def add_or_subtract(num1, num2)
if block_given?
yield(num1, num2)
end
end
add_or_subtract(5, 3) { |num| num - 5 }
#=> 0
You can see through this that yield
needs to meet pretty specific conditions, and if it doesn’t will throw errors. One advantage to yield, however, is that it processes the block (almost 2x) faster than a proc does. Which I guess is cool…
So there you have it! Procs and blocks are extremely useful once you understand how to implement it, but they can be a rather confusing topic for beginners. If I left you hanging with questions, feel free to contact me. I’m available by e-mail<EMAIL_ADDRESS>Ciao!


keyword
game key:
goes first!
GAME OVER
You selected the bomb
Want to
start a new game?
or
join a new game?


Blacksmith Brunon:
Thank you! Please go and get it immediately. I have heard that the
new model Calculator
was brought in by one of the
Trader Guilds
. That would be good place to start, wouldn't it?


truck load
efficient truck loading system
issues
solutions
issues
truck + crane = 8 hours
slow
costly
we have the solution!


---
layout: post
title: 7/10
date: '2013-07-10T22:16:00.000-06:00'
author: Jacob .
tags:
- front-page
modified_time: '2013-08-23T21:51:52.852-06:00'
blogger_id: tag:blogger.com,1999:blog-6400085873105072120.post-623615010852216629
blogger_orig_url: http://www.svlark.com/2013/07/710.html
---
So we're on www.svlark.com now. We'll have to update some stuff around here.
We're also all registered for the Red Cross adults and infants first aid and CPR class. We'll be certified on 8/13, which will allow us to take the remote first aid class.


Kyrie Irving is 'a normal teammate,' Brooklyn Nets' center Jarrett Allen says
by Ryan GaydosBrooklyn Nets center Jarrett Allen came to the defense of his teammate Kyrie Irving over reports of the star point guard’s “mood swings” affecting the team’s morale.
Reports of Irving’s “mood swings” surfaced last month in an ESPN report that included an alleged incident on the team’s plane to China that left teammates and officials “confused.” ESPN commentator Stephen A. Smith also said he wasn’t hearing good things about Irving in Brooklyn.
ZION WILLIAMSON RECEIVES ADVICE ABOUT KNEE INJURY RECOVERY FROM DERRICK ROSE
However, Allen said in a Bleacher Report AMA on Thursday that he didn’t see that.
PAU GASOL WAIVED BY BLAZERS BUT MAY HAVE NEW ROLE WITH TEAM
“He acts like a normal teammate,” Allen said.  He wants to see us succeed and do well if anything.”
Whether Irving’s alleged “mood swings” are actually having any effect on the team has yet to be seen. What is affecting Brooklyn is Irving being out with a shoulder injury.
He missed his third straight game Wednesday with the injury. He did not play last weekend against the Chicago Bulls, skipped the game against the Indiana Pacers and was out against the Charlotte Hornets.
CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM
It’s unclear whether he’ll play Friday against the Portland Trail Blazers.


Home
Quick Facts
EXIT X
THE RISK OF MONEY LAUNDERING
Retake Quiz
You have now completed your quiz
Sorry, you have failed the quiz for The risk of money laundering.
Click Retake Quiz if you would like to attempt the quiz again.
100
%
Your score is: