The Big-O of Maintenance
A large part of a projects lifetime is maintenance, with estimates at 60% to 80%.¹ That statistic defines maintenance as fixing bugs, and adding new functionality to an existing system.
With so much time spent on this phase, it's important to keep in mind: code itself grows and changes with respect to Big-O notation.
If adding a new features requires all modules to add a new reference, that's O(n)
.
If adding a new feature requires one module to add one new reference, that's O(1)
. Not bad.
If adding a new feature requires one module to add one new reference, but it's a massive "kitchen sink" module: probably not good.
This is a laid back and informal use of Big-O, but it gets the point across. If code is setup such that most changes are O(1)
, much pain can be prevented.
I am also being loosey-goosey with what a "module" and "reference" is, that's on purpose. The interpretation is context and project dependent, but you'll know it when you see it.
Take for example this bit of pseudo-code,
function doSomeCoolStuff(Comment comment) {
...
string url;
switch (comment.kind)
Picture: url = "https://foo.com",
Reply: url = "https://bar.com",
...
...
}
We can immediately see, every time a new comment kind is added, this code likely needs to be maintained. If there's n
different switch statements throughout the codebase, that's n
different places to update.
It is worth mentioning, there is nothing inherently wrong with switch statements like these. They're normally straightforward, simple, and maintainable, but sometimes the alternatives are better.
There are a few immediate (among many) ways to "extract" this switch out, such that future updates may only require changing one place.
- A simple function approach. Just move the code into a shared function somewhere.
function doSomeCoolStuff(Comment comment) {
...
string url = getUrl(comment.kind);
...
}
- A function passing approach. Function passing is a great way to create flexibility and move logic elsewhere.
function doSomeCoolStuff(Comment comment, Lambda getUrl) {
...
string url = getUrl();
...
}
- A polymorphism/interface approach. Also a valid option that makes good sense in some situations.
function doSomeCoolStuff(Comment comment) {
...
string url = comment.getUrl(); // Changes based on the underlying implementation, eg `PostComment`, `NewsFeedComment`, etc.
...
}
Occasionally, both a switch statement and polymorphism can be combined to reduce the number of change locations. This is exactly what the factory pattern does. It looks something like this,
Comment getComment(CommentKind kind) {
switch (kind)
Picture: new PictureComment(...);
Reply: new ReplyComment(...);
}
Without this context the factory pattern looks like an unnecessary layer of indirection. But we've now seen it can consolidate many switch statements into a single location.
All we've done is move complexity around. Sometimes this is all it takes to reduce overall complexity. If all of these switch
statements are moved to one central place, we can get a big win by having updates only change one place. More so if it reduces some duplication, or allows us to calculate some value only once.
Related concepts: DRY, SRP, DIP.
¹ Facts and Fallacies of Software Engineering (2002)


{{- define "page-class" -}}error404{{- end -}} {{- define "head-includes" -}} {{- partialCached "head-includes.html" . -}} {{with partial "funcs/GetCSS.html" (dict "sourcePath" "scss/404.scss" "enableSourceMap" false)}} {{end}} {{- end -}} {{- define "main" -}}


RAIN Ltd.
We help you get the car you want!
SPECIAL OFFER 30 % OFF!
New office in New York
Today we moved into our new office in New York at Street Road 1. Our former location has been burned to the ground due to zombie infestation.
Read more
Arthur: Rikard Mattsson Date: 2016-09-25
RAIN is expanding!
We are now opening up a new branch here at RAIN Ltd. Besides continuing being a leading car reseller we will also explore the research of DNA modification hoping to cure cancer!
Read more
Arthur: Rikard Mattsson Date: 2016-04-01


After you have found out how to change input manually, let's try to program a nice animation which does not depend on any user input except for clicking on start. How about a ping pong match? Too boring? Well, maybe we can add some fancy flashing ball, to make it visually more appealing!
To efficiently code more complex animations, it is advisable to know how classes work. You can find an example of a class of the ball in DY_ball.py.
Another important remark at this place is the following: Keep an eye on Pythons caching system! Don't worry, you won't need to understand how it works in detail.
Just make sure to create new ColumnDataSources whenever refreshing the page. This means, do not use the same ColumnDataSource over several Python files.
In the code example you will see that the ColumnDataSource for the coordinates of the ball is defined in the class. Yet, the class is build in the main file.
Therefore, after refreshing the page, the object will be built completely new too!
One could also think of a separate file which lists all the ColumnDataSources and importing it to the files where needed. However, Python will "remember" these definitions
in its cache and the app won't be able to start up again, since there arises a definition conflict now.
To avoid this, only define ColumnDataSources in the main file or within classes in other files, which are being built in the main. This way,
when leaving/refreshing the page, the class and also its ColumnDataSource will be destroyed, making room for the new ColumnDataSources.
Don't worry, if you didn't understand what we were trying to tell here. Again, just keep trying out new scenarios and sooner or later you will stumble accross this problem.
More on this topic can also be found in the Wiki.
Looking at the code, we do not need so many more items on the list as before. Just the functions become more complex. The ingredients for this animation are


I would consider myself to be an experienced drug user. Over the past 2 years I have tried many drugs including, cannabis, , ecstasy, cocaine, pain killers(hydrocodone, oxycontin, etc...), salvia, hashish, nitrous, alcohol, and for my first time now mushrooms. I was highly anticipating trying mushrooms for the first time. I thought it was going to be a lot of fun and a great experience, but boy was I wrong.
I picked up an 1/8 of all caps from a buddy of mine and got ready to eat them. I crushed them up into small pieces and made a peanut butter sandwich and sprinkled all the mushroom flakes all over the peanut butter. I had not eaten anything in about 6 hours or so and my stomach was quite empty. I decided to eat them at around 7 pm.
After I ate them I did not feel any effects the first hour at all. I thought that it had been a total waste of 30 dollars. I was pissed. After being angry, I went to take a hot bath since I had nothing better to do while waiting to see if I would trip or not. I got into the tub and I started feeling it them a little bit. I was kind of giddy and just started to feel really weird. I was anxious to get out of the tub so that I could go sit down and watch tv while I was coming up. I started to giggle constantly after about 2 and a half hours after I ate them.
After this giggly stage ended, I went into my room and lay down. I started to go into deep thought. I began talking to myself about things and it was like my mind was talking to me. I had no control over anything coming out of my mouth. Now it was about 10:30 pm or so and I was lying in my bed contemplating my life and such. I went to my room to smoke a joint. While I was smoking the joint lying on my roof, I felt as thought I was going to slide off my room and fall. It was about a 15 foot drop onto concrete and this frightened me.
After I finished the joint I looked around outside at neighboring house and such. I saw very vivid colors and bright lights outside peopleís house. I started to hear noises from bugs, air conditioning machine, wind, leaves rustling, and such. This began to frighten me even more so I went back into my room to lay down. After this I became very scared. I had no control over my body.  I was licking my arm for no apparent reason. I was still constantly thinking out loud to myself.
At around 12 midnight I became restless. I had wished I had not taken these mushrooms and just wanted to go to sleep. But when I closed my eyes I saw nothing but flashing colors in weird patterns. Soon after this I tried to turn my lights out. Now I became even more freaked out because I thought someone or something was in my room. I turned the lights back on and continued to lie in my bed thinking aloud. I was telling myself that none of this was real, but it was happening so I couldnít believe myself.  And that I was going to end up on the 4th floor of the hospital or something terrible like that. I told myself that I wanted this to end.
Time was passing even slower and slower now. I'd look at the clock every second thinking hours had passed but it had not even been a minute.   Luckily, I do not own any guns nor were there any sharp objects in reach so I could not go on with this. But if there happened to be a gun laying on my dresser I would have shot myself and killed myself. This was the worst drug experience I have ever had. I kid you not this is exactly what happened and this is the exact definition for a 'bad trip'. They say users not supposed to try psychedelic drugs if they depressed and maybe that is whatís wrong with me. But never again will I try a psychedelic drug in my life.
P.S. Now I just stick to pain pills and smoking weed. Occasionally I'll get drunk but I try to stay away from coke because I have seen it ruin to many lives.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


{% extends "layout/base.html" %} {% block title %} ERROR ! {% endblock %} {% block content %}
Can not connect to EMERCOIN wallet.
Check that 1) connection params (host, port, user, password) are correct 2) EMERCOIN wallet is unlocked for reading/writing
Go to config page


{% extends "layout/default.html" %}
{% load bootstrap3 %}
{% block title %}Create a Ticket{% endblock %}
{% block content %}
{% include "djangoRT/navigation.html" %}
Submit a new ticket
In order to help us address your issue in a timely manner, please be sure to provide your username, project name,
and the details of your problem, including the UUID of the instance or lease in question if applicable.


You better go back to typexjs Home page and, if you wish, just open an issue on our Github repository.


| Previous | Next | See Also |
PRIDE Inspector's status bar indicates the current application state and lets you monitor running background jobs. Additionally, it allows you to cancel unwanted jobs.
A progress bar is displayed whenever a background job is running. You can open the background task monitor by clicking on the progress bar. This dialog contains a list of all running background tasks.


Minimal Group produces a flow layout which can be styled with CSS.
A-label
Bb-label
Ccc-label
Dddd-label
Compact Group uses a horizontal table layout
A-label
B-label
C-label
D-label
Full Group uses a two column layout to display controls vertically
A-label
Bb-label
Ccc-label
Dddd-label
Vertical Group rendered as HTML Table
nested vertical group
nested a
nested b
nested group
nested a
nested b
another nested vertical group
nested c
nested d
A-label
Bb-label
Ccc-label
Dddd-label
Horizontal Group rendered as HTML Table
A-label
Bb-label
Ccc-label
Dddd-label
A-label
Bb-label
Ccc-label
Dddd-label


Description: Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
handler(eventObject): Function() A function to execute each time the event is triggered.
eventData: PlainObject A map of data that will be passed to the event handler.
handler(eventObject): Function() A function to execute each time the event is triggered.
This method is a shortcut for .bind('submit', handler)
in the first variation, and .trigger('submit')
in the third.
The submit
event is sent to an element when the user is attempting to submit a form. It can only be attached to <form>
elements. Forms can be submitted either by clicking an explicit <input type="submit">
, <input type="image">
, or <button type="submit">
, or by pressing Enter when certain form elements have focus.
Depending on the browser, the Enter key may only cause a form submission if the form has exactly one text field, or only when there is a submit button present. The interface should not rely on a particular behavior for this key unless the issue is forced by observing the keypress event for presses of the Enter key.
For example, consider the HTML:
<form id="target" action="destination.html">
<input type="text" value="Hello there" />
<input type="submit" value="Go" />
</form>

Trigger the handler

The event handler can be bound to the form:
$('#target').submit(function() {
alert('Handler for .submit() called.');
return false;
});
Now when the form is submitted, the message is alerted. This happens prior to the actual submission, so we can cancel the submit action by calling .preventDefault()
on the event object or by returning false
from our handler. We can trigger the event manually when another element is clicked:
$('#other').click(function() {
$('#target').submit();
});
After this code executes, clicks on Trigger the handler will also display the message. In addition, the default submit
action on the form will be fired, so the form will be submitted.
The JavaScript submit
event does not bubble in Internet Explorer. However, scripts that rely on event delegation with the submit
event will work consistently across browsers as of jQuery 1.4, which has normalized the event's behavior.
submit
, length
, or method
. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint.
<!DOCTYPE html>

Type 'correct' to validate.

<form action="javascript:alert('success!');">

<input type="text" />
<input type="submit" />

</form>

$("form").submit( function () {
return this.some_flag_variable;
} );
$("form:first").submit();


“Look through the curve!” the instructor barked over the noise of motorcycle engines. I revved the throttle and looked ahead as I blazed past the cones. Here I was, clinging on for dear life and trying to pass the road test. Was I going too fast? I glanced down at the speedometer.
7 mph…
Everything’s faster on a motorcycle.
Last year I learned how to ride. As I look back on those early days when motorcycling seemed so unfamiliar and scary, I appreciate the small steps that have made me a more confident and seasoned rider.
Hola! Ecuador es un pais magnifico! Me mochilé con mis amigos - mira el video arriba. :)
We went rafting on the Lower New River Gorge and Upper New River Canyon. Got some zip-lining and disc golf in as well. Check out the video I made above!
I had always heard about the Falls. But like so many before me, I truly understood the Falls only by standing right next to the crashing waters, its majestic roar and unbridled power engulfing my senses. As I stood there, water splashing over me and mist covering my body, I couldn’t help but close my eyes and simply allow myself to be overwhelmed. Water. So tame when coming out of the faucet into my hands.
Springtime! This past winter was one of the most brutal winters in the history of Michigan winters. It was a winter inside a winter. Fortunately, even unending winters eventually come to an end. So you can imagine my delight when the first blades of grass began poking their green, hopeful heads out into the world above. A frostbitten land was in desperate need of warmth and color.
Every year in Holland, MI millions of tulips burst forth in bloom.
What can I say about New York City that hasn’t already been said?  You get the drift. This is a city filled with movement and magic. I knew all this in my head, but actually going there and basking under the glow of a million LEDs in Times Square opened my eyes. I have gone from darkness into light.
In 1912, Mayor Yukio Ozaki of Tokyo gifted 3,000 cherry trees to the city of Washington, DC as a sign of friendship between the US and Japan. Today, the National Cherry Blossom Festival attracts more than a million people each year who come from all over the world to admire the flowering cherry trees.
In light of this amazing history, a few friends and I decided to travel to DC and experience the cherry blossom bloom first-hand.
Spontaneous road trips are sometimes needed to jolt one out of the rhythm of the regular work week. So one weekend, that’s what some friends and I decided to do: travel to Pittsburgh on a whim. We left Michigan on Friday night after work, ate Potbelly sandwiches in the car, and slept all the way to Pittsburg. Well, only the passengers slept, thankfully. I had gotten a rough itinerary of fun things to do from my friend who studied at Carnegie Mellon and our dear friend Google had also given helpful suggestions, so we were set.
The first time I went skiing was at Mt. Brighton (pictured above). Now, seasoned skiers might chuckle at these rounded slopes, but for a first-timer like me, these hills looked like the Himalayan peaks. And indeed, although I had watched countless YouTube videos about skiing the week before, the moment I buckled up the rented boots to the skis, my meticulous research and mental preparation melted away.
I signed up for beginners lessons with my group and after learning the basics we proceeded to conquer the beginner bunny slope.


My Restaurant
We only have 5 tables! Book fast before they're taken!
View Tables
Make Reservation
API Table Link
API Wait List


Hi, I'm Edward Yu, a 20 year-old IT student enrolled at Eastern Visayas State University- Main Campus. Currently a third year student taking the subject Event-Driven Programming.


The strategy code mainly consists of four parts: Initialization, Universe Selection, OnData, and OnSecuritiesChanged.
When initializing the algorithm, we add a coarse universe selection method and specify several parameters to use when selecting securities.
class ShortTimeReversal(QCAlgorithm): def Initialize(self): # ... self.UniverseSettings.Resolution = Resolution.Daily self.AddUniverse(self.SelectCoarse) self.dollar_volume_selection_size = 100 self.roc_selection_size = int(0.1 * self.dollar_volume_selection_size) self.lookback = 22 self.roc_by_symbol = {} self.week = 0
The coarse universe selection method creates a RateOfChange indicator for each of the top 100 most liquid securities in the market. Upon creation, the indicator is manually warmed-up with historical closing prices. After the indicators are ready, the universe selects the securities with the 10 best and 10 worst RateOfChange values.
class ShortTimeReversal(QCAlgorithm): # ... def SelectCoarse(self, coarse): # We should keep a dictionary for all securities that have been selected for cf in coarse: symbol = cf.Symbol if symbol in self.roc_by_symbol: self.roc_by_symbol[symbol].Update(cf.EndTime, cf.AdjustedPrice) # Refresh universe each week week_number = self.Time.date().isocalendar()[1] if week_number == self.week: return Universe.Unchanged self.week = week_number # sort and select by dollar volume sortedByDollarVolume = sorted(coarse, key=lambda x: x.DollarVolume, reverse=True) selected = {cf.Symbol: cf for cf in sortedByDollarVolume[:self.dollar_volume_selection_size]} # New selections need a history request to warm up the indicator symbols = [k for k in selected.keys() if k not in self.roc_by_symbol or not self.roc_by_symbol[k].IsReady] if symbols: history = self.History(symbols, self.lookback, Resolution.Daily) if history.empty: self.Log(f'No history for {", ".join([x.Value for x in symbols])}') history = history.close.unstack(0) for symbol in symbols: if symbol not in history: continue # Create and warm-up the RateOfChange indicator roc = RateOfChange(self.lookback) for time, price in history[symbol].dropna().iteritems(): roc.Update(time, price) if roc.IsReady: self.roc_by_symbol[symbol] = roc # Sort the symbols by their ROC values selectedRateOfChange = {} for symbol in selected.keys(): if symbol in self.roc_by_symbol: selectedRateOfChange[symbol] = self.roc_by_symbol[symbol] sortedByRateOfChange = sorted(selectedRateOfChange.items(), key=lambda kv: kv[1], reverse=True) # Define the top and the bottom to buy and sell self.rocTop = [x[0] for x in sortedByRateOfChange[:self.roc_selection_size]] self.rocBottom = [x[0] for x in sortedByRateOfChange[-self.roc_selection_size:]] return self.rocTop + self.rocBottom
As new data is passed to the OnData method, we issue orders to form a long-short portfolio. We long the securities with the lowest RateOfChange values and short those with the largest values. After rebalancing, we clear the `rocTop` and `rocBottom` lists to ensure we don’t trade again until the universe is refreshed.
class ShortTimeReversal(QCAlgorithm): # ... def OnData(self, data): # Rebalance for symbol in self.rocTop: self.SetHoldings(symbol, -0.5/len(self.rocTop)) for symbol in self.rocBottom: self.SetHoldings(symbol, 0.5/len(self.rocBottom)) # Clear the list of securities we have placed orders for # to avoid new trades before the next universe selection self.rocTop.clear() self.rocBottom.clear()
We are rebalancing the portfolio on a weekly basis, but securities can leave our defined universe between rebalance days. To accommodate this, we liquidate any securities that are removed from the universe in the OnSecuritiesChanged method.
class ShortTimeReversal(QCAlgorithm): # ... def OnSecuritiesChanged(self, changes): for security in changes.RemovedSecurities: self.Liquidate(security.Symbol, 'Removed from Universe')


Variable class.
More...
|
|
def | __init__ (self, name, value, graph, varsListWidget, dataType=DataTypes.Bool, uid=None) |
| |
|
def | accessLevel (self) |
| |
|
def | accessLevel (self, value) |
| |
|
def | uid (self) |
| |
|
def | uid (self, value) |
| |
|
def | serialize (self) |
| |
|
def | value (self) |
| |
|
def | value (self, data) |
| |
| def | setDataType (self, dataType, _bJustSpawned=False) |
| | Changes variable data type and updates TypeWidget color.
- Bug:
- in the end of this method we clear undo stack, but we should not.
We do this because undo redo goes crazy
The documentation for this class was generated from the following file:


brandname
About
Contact
Login
Sign Up
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
Toggle navigation
brandname
About
Contact
Login
Sign Up


COVID-19 County-level Case Doubling Time Map
Loading data ...
County-level Case Doubling Time Map |
Play
Stop


I am passionate about the code and everything that can be created through it, in my timeline as a developer I start to appear as Backend using languages such as PHP, Python and its Django Framework, NodeJs with Express, API Rest construction and Go.
For a while I specialized more as Frontend using Javascript Vanilla, I can't hide that I also used a lot of Jquery, such as create layouts with CSS and HTML, then I knew the frameworks like Backbonejs (at that moment) and AngularJs. For more than two years I started to program with Angular or as many people call it "Angular 2" which i am passionate and collaborate with this frameworks community.
One of the things that has brought me here, is to have consumed the knowledge that other people share on the internet, either through blogs, YouTube videos, etc. I am a faithful believer that we must share all our knowledge and collaborate in communities, that is one of the things that makes us better developers.
For that reason, I have been writing posts in Medium for quite some time, and not only about code, I also like to talk about my experiences and personal growth. My Medium
My experience as a developer at the beginning was freelance, then I worked in two Startups as Frontend Developer and now I work in Backstartup as Leader of the development team, I'm passionate about these business models, I read and share many things about Startups.
I would like to emphasize that podcasts are one of the most used media to consume content, so my wife and I created a Spanish Podcast called "Detrás de una Startup", where we talked about the world of Startups but not on the side of the CEO or entrepreneur but on the side of the team.


CaptureTab
CaptureTabSource
CaptureTabBookmark
CaptureTabAs
BatchCapture
BatchCaptureLinks
EditTab
SearchCaptures
OpenScrapBook
OpenViewer
OpenOptions


Lich King Icarus:
I've never seen you before, have I?  I like it very much. Perhaps I might sample your inner self as well...
 Ha ha! I am Icarus, the sole survivor of the 13 Lich Kings who once shook the Elmoreden Empire to its very foundations... Ah, but perhaps the word "survivor" is somewhat inaccurate, eh?
"What is a Lich doing here?"
"Who is Hardin?"
Learn skills.
Ask about Skill Enchanting.
Quest


I just bought a Jeelink v3c to try and help me diagnose a problem with RF issues (see http://openenergymonitor.org/emon/node/10900 ) but I am having a few problems. As usual, it could be me missing something obvious, and if so, once fixed, then maybe this posting will help others avoid similar issues.
Basically, my new Jeelink is not receiving the data that the emonTX is sending. I have an RPi with RFM69Pi and it is able to receive the data, so I can't understand why the Jeelink is showing nothing. The Jeelink also has the RFM69CW configured with same network settings as emonTX and RPi
The Jeelink is connected into a USB port on my windows 7 laptop. When I first connected the Jeelink Windows offered to find a driver, which I cancelled assuming it wasn't required, but then when Arduino IDE did not see a new comport, I went into Device Manager and told it to find a driver, and it found and installed an entry under USB Controllers called USB Serial Convertor using FTDI v<IP_ADDRESS> and also a port called USB Serial Port (Com6) with FTDI v<IP_ADDRESS>. The details for the port includes a tab called Port Settings which is set to 9600bps 8/n/1 and no flow control. After allowing windows to install these two devices, Arduino then found com port 6, and serial monitor connected, although I had to set to 57600 baud, and then the menu from RF12demo appeared.
The Jeelink came pre-installed with RF12demo.13 on group 212 and nodeID 1, so I changed the group to 210 and left the node at 1. There were no lights on the Jeelink (I wasn't sure if there should be), but the rf12demo sketch appeared to be working, so I played around, expecting it to show the packets being sent every 10 seconds by my emonTX which is also on group 210, 433Mhz, and I know it's sending data, as the RPi is receiving it.
However, if I tell the Jeelink to send a packet to the emonTX (node 10) or the RPi (node 15) and request an ACK,it works - the Jeelink reports success, and the log on the RPi shows the packet received. Here is an example sending the full 66 byte test packet using the t command. I issued it twice, although I get slightly different response in serial monitor
Serial Monitor on Jeelink:
> 1i
A i1 g210 @ 433 MHz
> 0t
test 0 -> 66 b
> 0t
test 1 -> 66 b
OK 193 afc=0 fei=0 (-31.5dB)
From the emonhub.log:
2015-07-11 09:04:56,340 DEBUG 872095 NEW FRAME :<PHONE_NUMBER>.34 OK 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 (-33)
2015-07-11 09:04:56,353 DEBUG 872095 Timestamp :<PHONE_NUMBER>.34
2015-07-11 09:04:56,355 DEBUG 872095 Node : 1
2015-07-11 09:04:56,357 DEBUG 872095 Values : [256, 770, 1284, 1798, 2312, 2826, 3340, 3854, 4368, 4882, 5396, 5910, 6424, 6938, 7452, 7966, 8480, 8994, 9508, 10022, 10536, 11050, 11564, 12078, 12592, 13106, 13620, 14134, 14648, 15162, 15676, 16190, 16704]
2015-07-11 09:04:56,360 DEBUG 872095 RSSI : -33
2015-07-11 09:04:56,435 DEBUG 872095 Append to 'emonCMS' buffer => time:<PHONE_NUMBER>.34, data: [1, 256, 770, 1284, 1798, 2312, 2826, 3340, 3854, 4368, 4882, 5396, 5910, 6424, 6938, 7452, 7966, 8480, 8994, 9508, 10022, 10536, 11050, 11564, 12078, 12592, 13106, 13620, 14134, 14648, 15162, 15676, 16190, 16704, -33], ref: 872095
2015-07-11 09:04:56,539 INFO emonCMS sending: http://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1436605496.34,1,256,770,1284,1798,2312,2826,3340,3854,4368,4882,5396,5910,
6424,6938,7452,7966,8480,8994,9508,10022,10536,11050,11564,12078,12592,13106,13620,
14134,14648,15162,15676,16190,16704,-33]]&sentat=1436605496
2015-07-11 09:04:56,577 DEBUG RFM2Pi confirmed sent packet size: -> ack
2015-07-11 09:04:56,708 DEBUG emonCMS acknowledged receipt with 'ok' from http://emoncms.org
When the packet was sent from Jeelink to RPi, the green and red LED's on Jeelink blinked briefly, and this was the only time I see them light up.
I then used minicom on the RPi to send a test packet from the Rpi, and this appeared in the Jeelink:
A i1* g210 @ 433 MHz c1
OK 47 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 afc=0 fei=0 (-30dB)
So this suggests all 3 nodes are in the same group, and I have 2 way comms, but still the Jeelink doesn't show the traffic coming from the emonTX (ironically this is almost the opposite of my original problem where my RPi recieves more traffic than it should !)
I am assuming that the emonTX is sending packets as broadcast (no destination ID), but in case it does set the destination ID I tried setting the Jeelink to node ID 15, which is the ID of the RPi, but still no data arrived.
I am going to try loading RFdemo.12 onto the Jeelink, and see if that makes any difference...
Edit - wrapped long lines - BT
Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4
OK, so an update - after a fair bit of faffing, I managed to get RFdemo.12 loaded into the Jeelib, and then serial monitor greeted me with "[RF12demo.12] " and nothing else - no menu of commands, no packet output, no response to any commands that I entered into the console - even the 'v' command to display version was ignored.
However, I knew that the RF12demo.12 that I had loaded had "#define RF69_COMPAT 0" and after I changed it to 1, and compiled and uploaded, then everything worked ! Serial console shows the full menu, and, low and behold, it also shows the packets from my emonTX ! At Last !!
So, it looks like something in the new .13 version of RF12demo was preventing the Jeelink from displaying packets from my Emon TX.
For info, in case it helps anyone else, I was struggling to compile (or even verify) the older version of RF12demo because of a problem in my Arduino IDE: Whenever I tried to verify RF12demo it would hang half way through, doing nothing. The last line in the detailed output referred to core.a, and no matter how long I left it, the verify got no further. I eventually noticed that the compile output mentioned a copy of the RF69.cpp file that I had created, and once I deleted the copy of the .cpp, the verify (and compile) completed as expected. So, whilst this ws my fault (I am definitely a newbie when it comes to the IDE, and modifying .cpp files), the IDE was not very helpful in providing any clue as to what was going on, making it much harder to find and fix. Before finding this I had un-installed the IDE and re-installed as well - all to no avail. Ah well, I learnt something.
Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4
Hi Ian,
I think you did the right thing to load RFdemo.12. I'm not entirely sure what "actual" firmware was pre-installed on the JeeLink. RFdemo.13 was on it's own branch of the Jeelib repo sometime ago, I have copy as I submitted a pull req to it, but that branch was swallowed into the RFxConsole and the RFdemo.13 changes were not retained.
I did a search on the repo and there is no "RFdemo.13" found, and that is sort of confirmed by the "Where is RFdemo.13?" thread on the forum.
It's always better to have the source sketch for your device, for reference and as a base for edits etc.
The test packet you received on the Jeelink starts "OK 47 0 1 2 3...." that appears to display an old (.12) issue, where the node id wasn't being masked correctly, the node id is the lower 5 bits of a byte and should be 31 max, unmasked and with the "ack requested" flag set (bit 6 of the same byte) you get node id + 32, ie 47 as the Pi's base id is 15. Since the node id was outside the 0-32 windows emonHub ignored it, without the ack request it may of got through, however the "afc=0 fei=0" in the packet would of then caused a "non-numerical content error" and got discarded anyway.
So you are definitely better off with RFdemo.12 for now.
The Arduino IDE is a bit quirky with libs, you can unexpected results if you have more than 1 copy of any lib, it's something to be very careful of, delete, rename, compress or significantly move all but the 1 copy you want found or it will catch you out, and the IDE won't make life any easier by giving any useful direction as to what the issue is.
Paul
Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4
"if you have more than 1 copy of any lib..."
I can't stress that enough. Renaming the folder/directory is not sufficient, as the IDE appears to ignore directories' names. Also, it's not clear what its search paths are. My advice is to compress and then delete the original - always.
(This concept is totally alien to me - I don't know any other IDE that behaves in that way and hides and doesn't clearly document important issues like that.)
Re: SOLVED Problem with new Jeelink not receiving data from emonTX v3.4
Paul, Robert, Thanks for your help and replies.
I found *a* copy of RF12demo.13 here although I can't be sure it's exactly the code that was running on my Jeelink.
Thanks for the pointers about libraries - I will probably now leave this thread and go back to updating the my previous post which deals with the original problem
Ian


This practice exercise is designed to help you learn how to translate hiragana characters to English.


AWS::CloudFormation::WaitCondition
For Amazon EC2 and Auto Scaling resources, we recommend that you use a CreationPolicy
attribute instead of wait conditions. Add a CreationPolicy attribute to those resources, and use the cfn-signal
helper script to signal when an instance creation process has completed successfully.
You can use a wait condition for situations like the following:
-
To coordinate stack resource creation with configuration actions that are external to the stack creation.
-
To track the status of a configuration process.
For these situations, we recommend that you associate a CreationPolicy attribute with the wait condition so that you don't have to use a wait condition handle. For more information and an example, see Creating wait conditions in a template. If you use a CreationPolicy with a wait condition, don't specify any of the wait condition's properties.
If you use the VPC endpoints feature, resources in the VPC that respond to wait conditions must have access to CloudFormation, specific Amazon Simple Storage Service (Amazon S3) buckets. Resources must send wait condition responses to a presigned Amazon S3 URL. If they can't send responses to Amazon S3, CloudFormation won't receive a response and the stack operation fails. For more information, see Setting up VPC endpoints for AWS CloudFormation.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::CloudFormation::WaitCondition", "Properties" : { "Count" :
Integer
, "Handle" :String
, "Timeout" :String
} }
YAML
Type: AWS::CloudFormation::WaitCondition Properties: Count:
Integer
Handle:String
Timeout:String
Properties
Count
-
The number of success signals that CloudFormation must receive before it continues the stack creation process. When the wait condition receives the requisite number of success signals, CloudFormation resumes the creation of the stack. If the wait condition doesn't receive the specified number of success signals before the Timeout period expires, CloudFormation assumes that the wait condition has failed and rolls the stack back.
Updates aren't supported.
Required: No
Type: Integer
Update requires: No interruption
Handle
-
A reference to the wait condition handle used to signal this wait condition. Use the
Ref
intrinsic function to specify an AWS::CloudFormation::WaitConditionHandle resource.Anytime you add a WaitCondition resource during a stack update, you must associate the wait condition with a new WaitConditionHandle resource. Don't reuse an old wait condition handle that has already been defined in the template. If you reuse a wait condition handle, the wait condition might evaluate old signals from a previous create or update stack command.
Updates aren't supported.
Required: No
Type: String
Update requires: No interruption
Timeout
-
The length of time (in seconds) to wait for the number of signals that the
Count
property specifies.Timeout
is a minimum-bound property, meaning the timeout occurs no sooner than the time you specify, but can occur shortly thereafter. The maximum time that can be specified for this property is 12 hours (43200 seconds).Updates aren't supported.
Required: No
Type: String
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the resource name.
For more information about using the Ref
function, see Ref.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt.
Data
-
A JSON object that contains the
UniqueId
andData
values from the wait condition signal(s) for the specified wait condition. For more information about wait condition signals, see Wait condition signal JSON format.Example return value for a wait condition with 2 signals:
{ "Signal1" : "Step 1 complete." , "Signal2" : "Step 2 complete." }
Examples
WaitCondition that waits for the desired number of instances in a web server group
JSON
{ "WebServerGroup": { "Type": "AWS::AutoScaling::AutoScalingGroup", "Properties": { "AvailabilityZones": { "Fn::GetAZs": "", "LaunchConfigurationName": { "Ref": "LaunchConfig" } }, "MinSize": "1", "MaxSize": "5", "DesiredCapacity": { "Ref": "WebServerCapacity" }, "LoadBalancerNames": [ { "Ref": "ElasticLoadBalancer" } ] } }, "WaitHandle": { "Type": "AWS::CloudFormation::WaitConditionHandle" }, "WaitCondition": { "Type": "AWS::CloudFormation::WaitCondition", "DependsOn": "WebServerGroup", "Properties": { "Handle": { "Ref": "WaitHandle" }, "Timeout": "300", "Count": { "Ref": "WebServerCapacity" } } } }
YAML
WebServerGroup: Type: AWS::AutoScaling::AutoScalingGroup Properties: AvailabilityZones: Fn::GetAZs: '' LaunchConfigurationName: !Ref 'LaunchConfig' MinSize: '1' MaxSize: '5' DesiredCapacity: !Ref 'WebServerCapacity' LoadBalancerNames: - !Ref 'ElasticLoadBalancer' WaitHandle: Type: AWS::CloudFormation::WaitConditionHandle WaitCondition: Type: AWS::CloudFormation::WaitCondition DependsOn: WebServerGroup Properties: Handle: !Ref 'WaitHandle' Timeout: '300' Count: !Ref 'WebServerCapacity'


cycle(n=nil) {|obj| block } -> nil
cycle(n=nil) -> an_enumerator
Enumerable#cycle calls block for each element repeadedly.
Arguments
If no argement is given, it calls the block on each element forever. Otherwise, the block is called n times.
Returned Object
If block is givien it returns the block defines. Otherwise, it returns an enumerator resulted from the method.
Example
Let's say that we want to find out the day of a certain date of the month and we want to create a method that does that for us. This is easily done using .cycle.
# Two parameters. The day of the first date of the month and the date of the day we're looking for.
def day_of_month (first_of_month, date)
day_of_month('Tuesday', 28) => 'Monday'
def day_of_month (first_of_month, date)
days = %w(Monday Tuesday Wednesday Thursday Friday Saturday Sunday)
# Rotate the days array so the day of the first date of the month becomes the first element of the array
days.rotate!(days.index(first_of_month))
# Repeat the array for five times and return the date-th element of it.
days.cycle(5).to_a.fetch(date-1)
end# Rotate the days array so the day of the first date of the month becomes the first element of the array
days.rotate!(days.index(first_of_month))
# Repeat the array for five times and return the date-th element of it.
days.cycle(5).to_a.fetch(date-1)
day_of_month('Tuesday', 28) => 'Monday'


Javascript Client-side Form Validation Utilities
Author: Konstantin TretyakovThis page illustrates the usage of Javascript utilities for client-side form validation. Consider taking a look at the source of this page to get an idea of how client-side input element validation is to be used.


| Template-basic |
| Basic | Entity. Role, or Act, Act, Entity or Role |
| id | |
| meta | |
| implicitRules | |
| language | |
| text | Act.text? |
| contained | N/A |
| extension | |
| extension (Simple_Extension) | |
| extension (Complex_Extension) | |
| modifierExtension | N/A |
| identifier | ./identifier |
| code | ./code |
| id | n/a |
| extension | n/a |
| coding | union(., ./translation) |
| id | n/a |
| extension | n/a |
| system | ./codeSystem |
| version | ./codeSystemVersion |
| code | ./code |
| display | CV.displayName |
| userSelected | CD.codingRationale |
| text | ./originalText[mediaType/code="text/plain"]/data |
| subject | ./participation[typeCode='SBJ'] (possibly through a ControlAct and Role) |
| created | ./participation[typeCode='AUT']/time (possibly through a ControlAct and Role) |
| author | ./participation[typeCode='SUB'] (possibly through a ControlAct and Role) |


--- layout: index-layout subject: My Email Templates --- EverlyWell Email Templates EverlyWell Newsletter Results Ready Order Cancelled Affiliate Outreach Subscription Registration Subscription Confirmation Helix Registration Helix Confirmation


Tests for the servlet representations of the general utilities package.
@see com.compomics.util.general.servlet


the and host that PA-X influenza []. for virus viral are avian activity vRdRp mutations polymerase RNA with from have which shutoff IAV replication these domain been residues adaptive The human protein has viruses was [,]. {background Influenza role transcription gene mammalian N-terminal proteins IAVs amino endonuclease C-terminal Virol../JVI.- cellular two also nuclear shown structure virulence Virus margin Enhanced mRNA studies this {border-style This involved pol into px;} subunit #ffffff;} HNpdm acid binding not RNAs active can mRNAs Host adaptation between expression its were Domain While X-ORF affect found pathogenicity However, cells identified likely pandemic These cap-snatching effect interactions may previously through [,,]. acids activity. additional analysis essential first function highly mechanism mutation play strains there within activity, factors genome localization major most primers required such translation Additionally, Figure both but complex conserved critical crystal dimerization during interaction length multiple overall specific suggest transcripts while C-Terminal IAVs, cap mechanisms observed plays px; recent residue segment site species study {font-family (Avian) Acad. Endonuclease Gen. Natl. Polymerase Sci. adaptation. addition amongst baloxavir data degradation font-size form important infection more mouse novel one other recently region significant significantly specificity structural synthesis using vRNA very Avian IAVs. PA-N PA. USA./pnas. cap-snatched capped clinical contains determined differences different distinct domain, double; functional genes high including key many nucleus number presence regulate regulating responses species-specific swine switch target than well CPSF Interestingly, PA, PA-X, Pathog.e./journal.ppat. Pol RNA-dependent Rep../srep Role Ser Shutoff antiviral basis because border-color border-width bound cRNA cell colored described discovered emergence expressed factor factors. hosts. how identify impact importance interacts interesting known lab located loss model nucleotides primer process range replication, restriction results sequencing several small snatched solid; structures suggesting targeting targets their unique when where {font-style {font-weight Activity Despite HAX Most Mutations PB, Rev. Several Some Viral Virol../JVI...-. able adapted after antigenically appear become bold cells, cells. characterized contain courier; cytokine derived detected domains either em; enhance enhanced experimentally few flu frame fully functions genomic humans immune import indicated infections initiation life only open origin our pathogenic population potential proposed pt;} reading regulates related reported revealed show similar single specifically subtypes supported targeted transmission treatment used vRdRp, various will


Dhrystone rated your PC as
Microseconds for one run through Dhrystone:
Dhrystone per Second:
VAX MIPS rating:


This is a para
This is the second line of para
This text is in bold
This text is in italics
I want to be in group one


Value Function Approximation
Note that in many interesting real-world applications the number of states is very large.
For example, in backgammon the number of states is in the order of $10^{20}$, in Computer Go is in the order of $10^{170}$ and in helicopter we have a continuous state space and therefore the number is uncountably infinite.
In such scenarios, we have two problems:
- Memory. In fact, it could be not possible to store the values for each state or for each actio-state pair.
- Inefficient Learning. It is very inefficient to learn the value of each state independently (they are not independent).
$$\hat{q}(a,s;w)\approx q_\pi(a,s)$$
There are three kinds of function approximator.
Question. How can we learn such function approximators?
Answer. Through supervised learning.
There are mainly two categories, namely incremental methods and batch methods.
Incremental methods use samples, perform updates and throw away them, whereas batch methods store samples and reuse them.
Incremental methods: Prediction
Imagine that for a policy $\pi$, we can access a sequence of training pairs, namely:
$$\big(S_1,v_\pi(S_1)\big),\big(S_2,v_\pi(S_2)\big),\dots,\big(S_t,v_\pi(S_t)\big),\dots$$Now, for a specific state $s$, we can compute the following ojective, called Mean Squared Value Error (MSVE)
$$\begin{align}J(w)&=\frac{1}{2}E\big\{\big(v_\pi(s)-\hat{v}(s;w)\big)^2\big\} \\ &=\frac{1}{2}\sum_s p(s)E\big\{\big(v_\pi(S_t)-\hat{v}(S_t;w)\big)^2|S_t=s\big\}\end{align}$$Then, we can learn by SGD
$$\begin{align}\Delta w &= \alpha E\big\{\big(v_\pi(s)-\hat{v}(s;w)\big)\nabla_w \hat{v}(s;w)\big\} \\ &\approx \alpha\big(v_\pi(s)-\hat{v}(s;w)\big)\nabla_w \hat{v}(s;w)\end{align}$$where the last step is computed using a finite sequence of training pairs (an episode of policy $\pi$).
Problem. This sequence is not available in practice as $v_\pi(\cdot)$ is not known.
Solution 1: Monte Carlo with Function Approximation
Now the sequence is
$$\big(S_1,G_1\big),\big(S_2,G_2\big),\dots,\big(S_t,G_t\big),\dots,\big(S_t,G_T\big)$$and the update is given by
$$\begin{align}\Delta w &\approx \alpha\big(G_t-\hat{v}(s;w)\big)\nabla_w \hat{v}(s;w)\end{align}$$
Theorem. Monte Carlo with Function Approximation finds an unbiased estimate of the true state-value function.
Proof. The objective for Monte Carlo with Function Approximation is given by the Mean Squared Return Error (MSRE), namely:
Note that the first term doesn't depend on $w$. Therefore, minimizing MSRE is equivalent to minimize MSVE. The solution is an unbiased estimate. QED
Solution 2: Temporal Difference Learning with Function Approximation
Now the sequence is
$$\big(S_1,R_2+\gamma\hat{v}(S_2;w)\big),\big(S_2,R_3+\gamma\hat{v}(S_3;w)\big),\dots,\big(S_t,R_{t+1}+\gamma\hat{v}(S_{t+1};w)\big),\dots$$and the update is given by
$$\begin{align}\Delta w &\approx \alpha\big(R_{t+1}+\gamma\hat{v}(S_{t+1};w)-\hat{v}(s;w)\big)\nabla_w \hat{v}(s;w)\end{align}$$
Problem. There is no equivalent objective function from which we can derive this update formula.
In this case, the updates are performed online (not exactly supervised learning).
This is a heuristic method with no guarantee about convergence to optimal solution. Furthermore, there are counterexamples showing that this method can diverge. It has been used in many practical cases.
Solution 3: TD($\lambda$) Learning with Function Approximation
Now the sequence is
$$\big(S_1,G_1^\lambda\big),\big(S_2,G_2^\lambda\big),\dots,\big(S_t,G_t^\lambda\big),\dots,\big(S_t,G_T^\lambda\big)$$and the update is given by
$$\begin{align}\Delta w &\approx \alpha\big(G_t^\lambda-\hat{v}(s;w)\big)\nabla_w \hat{v}(s;w)\end{align}$$
Problem. There is no equivalent objective function from which we can derive this update formula. Nevertheless, it tradeoffs MC and TD
Solution 4: Online TD($\lambda$) Learning with Function Approximation
Equivalently, we can introduce eligibility traces to make convert TD($\lambda$) to be online.
Nevertheless, the definition is different as the eligibility trace is defined on the parameters of the function approximator rather that the states, namely:
$$E_t=\gamma\lambda E_{t-1}+\nabla_w \hat{v}(S_t;w)$$
and the update rule is
$$\begin{align}\Delta w &\approx \alpha\big(R_{t+1}+\gamma\hat{v}(S_{t+1};w)-\hat{v}(s;w)\big)E_t\end{align}$$
Problem. As for TD($\lambda$), there is no equivalent objective function from which we can derive this update formula. Nevertheless, it tradeoffs MC and TD.
More Advanced Online Solutions
Solution 5: Residual Gradient with Function Approximation
Assumption. Assume that the function approximation can learn the true state-value function.
In order to have an online solution, we can use the Bellman Error as an objective. In fact, let's consider the Mean Squared Bellman Error (MSBE), namely:
Now by computing the negative gradient, we obtain
$$\begin{align}\Delta w &= \alpha \sum_s p(s)\bigg[E\big\{\big(R_{t+1}^{S_t}+\gamma\hat{v}(S_{t+1};w)\big)|S_t=s\big\}-\hat{v}(s;w)\bigg]\bigg[\nabla_w \hat{v}(s;w)-\gamma E\big\{\nabla_w\hat{v}(S_{t+1};w)\big)|S_t=s\big\}\bigg] \\ &\approx \alpha \big(R_{t+1}^{s}+\gamma\hat{v}(s';w)-\hat{v}(s;w)\big)\big(\nabla_w \hat{v}(s;w)-\gamma \nabla_w\hat{v}(s^{''};w)\big)\end{align}$$
Note that in order to compute an unbiased estimate of the gradient, we need to sample two successor states, namely $s'$ and $s''$.
Note also that the update rule corresponds to TD update rule + a gradient correction term.
Problem. This solution is not optimal if the main assumption does not hold.
Solution 6: TD with Gradient Descent Methods and Linear Function Approximation
Assumption. There is no previous assumption. Therefore, this is the most general case.
Firstly, we have to define a projection operator. See the following picture to understand:
Formally,
$$\Pi: \Pi v_\pi = \hat{v}_{w'}$$where
$$w'=\arg\min_w\|\hat{v}_{w}-v_\pi\|_D^2$$and
$$D=\left[\begin{array}{llll}p(s_1)&&&\\ &p(s_2)&&\\ &&\ddots&\\ &&&p(s_{|S|})\end{array}\right]$$In this case, we are considering the space of linear function approximators, $\hat{v}_{w}=\phi w$ where $\phi\in\mathbb{R}^{|S|\times d}$. Now, let's compute $w'$
$$\|\hat{v}_{w}-v_\pi\|_D^2 = \|\phi w-v_\pi\|_D^2=\big(\phi w-v_\pi\big)^TD\big(\phi w-v_\pi\big)=w^T\phi^TD\phi w-2w^T\phi^TDv_\pi+v_\pi^TDv_\pi$$We can easily compute the minimum with respect to $w'$. In fact, $w'=\big(\phi^TD\phi\big)^{-1}\phi^TDv_\pi$. Now, let's use the definition of projection operator
$$\Pi v_\pi = \hat{v}_{w'}$$$$\Pi v_\pi = \phi w'$$
$$\Pi v_\pi = \phi\big(\phi^TD\phi\big)^{-1}\phi^TDv_\pi$$
Therefore,
$$\Pi = \phi\big(\phi^TD\phi\big)^{-1}\phi^TD$$Now, we are ready to define the Mean Squared Projected Bellman Error (MSPBE). Since, we don't have access to $v_\pi$, we can still have an indication where it is by exploiting the Bellman operator $T\hat{v}(s;w)=R_{t+1}^s+\gamma E\{\hat{v}(S_{t+1};w)|S_t=s\}$ (which points in the direction where $v_\pi$ is, as we know that the Bellman operator is contraction mapping and the convergence is linear). See the left picture
$$\begin{align}J(w)&=\frac{1}{2}\sum_s p(s)\bigg[\hat{v}(s;w)-\Pi_{s:}T\hat{v}(:;w)\bigg]^2\\
&=\frac{1}{2}\sum_s p(s)\bigg[\Pi_{s:}\hat{v}(:;w)-\Pi_{s:}T\hat{v}(:;w)\bigg]^2 \quad\text{as the point is projected to itself}\quad \hat{v}(s;w)=\Pi_{s:}\hat{v}(:;w) \\
&=\frac{1}{2}\sum_s p(s)\bigg[\Pi_{s:}\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)\bigg]^2 \\
&=\frac{1}{2}\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)^T\Pi^T D \Pi \big(\hat{v}(:;w)-T\hat{v}(:;w)\big) \\
&=\frac{1}{2}\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)^T\big(\phi\big(\phi^TD\phi\big)^{-1}\phi^TD\big)^T D \big(\phi\big(\phi^TD\phi\big)^{-1}\phi^TD\big) \big(\hat{v}(:;w)-T\hat{v}(:;w)\big) \quad\text{by using}\quad \Pi = \phi\big(\phi^TD\phi\big)^{-1}\phi^TD \\
&=\frac{1}{2}\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)^T\big(D^T\phi\big(\phi^TD\phi\big)^{-1}\phi^T\big) D \big(\phi\big(\phi^TD\phi\big)^{-1}\phi^TD\big) \big(\hat{v}(:;w)-T\hat{v}(:;w)\big) \\
&=\frac{1}{2}\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)^TD^T\phi\big(\phi^TD\phi\big)^{-1}\big(\phi^T D \phi\big)\big(\phi^TD\phi\big)^{-1}\phi^TD \big(\hat{v}(:;w)-T\hat{v}(:;w)\big) \\
&=\frac{1}{2}\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)^TD^T\phi\big(\phi^TD\phi\big)^{-1}\phi^TD \big(\hat{v}(:;w)-T\hat{v}(:;w)\big) \\
&=\frac{1}{2}\bigg[\phi^TD\big(\hat{v}(:;w)-T\hat{v}(:;w)\big)\bigg]^T\big(\phi^TD\phi\big)^{-1}\bigg[\phi^TD \big(\hat{v}(:;w)-T\hat{v}(:;w)\big)\bigg] \\
&=\frac{1}{2}\big(\phi^TD\delta_w\big)^T\big(\phi^TD\phi\big)^{-1}\big(\phi^TD \delta_w\big) \quad\text{where}\quad \delta_w=\big(\hat{v}(:;w)-T\hat{v}(:;w)\big) \\
&=\frac{1}{2}\big(\sum_s p(s)\delta_w(s)\phi_{s:}^T\big)^T\big(\phi^TD\phi\big)^{-1}\big(\sum_s p(s)\delta_w(s)\phi_{s:}^T\big) \\
&=\frac{1}{2}\bigg(\sum_s p(s)\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T\bigg)^T\big(\sum_s p(s)\phi_{s:}^T\phi_{s:}\big)^{-1}\bigg(\sum_s p(s)\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T\bigg) \\
&=\frac{1}{2}E_s\bigg\{\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T\bigg\}^TE_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T\bigg\}
\end{align}$$
Now, we can take the gradient with respect to $w$, but first let's recall that
$$\nabla_w J(w)=\frac{1}{2}\nabla_w f(w)^T A f(w)=\text{Jac}\big(f(w)\big)^TA^Tf(w)$$where $A=E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}$ and $f(w)=\sum_s p(s)\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T$
$$\begin{align} \text{Jac}\big(f(w)\big)=\sum_s p(s)\text{Jac}\big(\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T\big) &= \sum_s p(s)\left[\begin{array}{lll} \frac{\partial\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s1}}{\partial w_1} & \dots & \frac{\partial \big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s1}}{\partial w_d} \\ \vdots & & \vdots \\ \frac{\partial\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{sd}}{\partial w_1} & \dots & \frac{\partial\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{sd}}{\partial w_d} \end{array}\right] \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\nabla_w\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\bigg)^T \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\nabla_w\big(\hat{v}(s;w)-R_{t+1}^s-\gamma E\{\hat{v}(S_{t+1};w)|S_t=s\}\big)\bigg)^T \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\nabla_w\hat{v}(s;w)-\gamma E\{\nabla_w\hat{v}(S_{t+1};w)|S_t=s\}\bigg)^T \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\nabla_w\phi_{s:}w-\gamma E\{\nabla_w\phi_{S_{t+1}:}w|S_t=s\}\bigg)^T \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\phi_{s:}^T-\gamma E\{\phi_{S_{t+1}:}^T|S_t=s\}\bigg)^T \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\phi_{s:}-\gamma E\{\phi_{S_{t+1}:}|S_t=s\}\bigg) \\ &=\sum_s p(s)\phi_{s:}^T \bigg(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\bigg) \quad\text{to simplify notation}\\ &=E_s\bigg\{\phi_{s:}^T \big(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\big)\bigg\} \end{align}$$Therefore,
$$\begin{align} \nabla_w J(w) &= E_s\bigg\{\phi_{s:}^T \big(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\big)\bigg\}^TE_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\big(\hat{v}(s;w)-T\hat{v}(s;w)\big)\phi_{s:}^T\bigg\} \\ &= E_s\bigg\{\phi_{s:}^T \big(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\big)\bigg\}^TE_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\} \\ &= E_s\bigg\{\big(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\big)^T \phi_{s:}\bigg\}E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\} \end{align} $$From this, we can derive two update rules
Gradient TD (GTD).
$$\Delta w=-\alpha E_s\bigg\{\big(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\big)^T \phi_{s:}\bigg\}E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\}$$
TD with Gradient Correction (TDC).
$$\begin{align}\Delta w &= -\alpha E_s\bigg\{\big(\phi_{s:}-\gamma E_{s'|s}\{\phi_{s':}\}\big)^T \phi_{s:}\bigg\}E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\} \\ &= \alpha E_s\bigg\{\gamma E_{s'|s}\{\phi_{s':}\}^T\phi_{s:}-\phi_{s:}^T\phi_{s:}\bigg\}E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\} \\ &= \alpha E_s\bigg\{\gamma E_{s'|s}\{\phi_{s':}\}^T\phi_{s:}\bigg\}E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\}-\alpha E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\} \\\end{align}$$
Note that the term $E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\}$ requires two independent samples for $s$, but there is a smart way to use a single sample for $s$. In fact, let's set
$$\theta=E_s\bigg\{\phi_{s:}^T\phi_{s:}\bigg\}^{-1}E_s\bigg\{\delta_w(s)\phi_{s:}^T\bigg\}$$We can obtain $\theta$ by minimizing the following objective
$$J'(\theta)=E_s\bigg\{\big(\phi_{s:}\theta - \delta_w(s)\big)^2\bigg\}$$In fact, $\nabla_\theta J'(\theta)= 2E_s\big\{\phi_{s:}^T\phi_{s:}\big\}\theta-2E_s\big\{\delta_w(s)\phi_{s:}^T\big\}=0$. Now, let's derive an update rule for $\theta$, namely:
$$\begin{align}\Delta\theta &= -\frac{\beta}{2}E_s\bigg\{2\big(\phi_{s:}\theta - \delta_w(s)\big)\phi_{s:}^T\bigg\} \\ &= -\beta E_s\bigg\{\big(\phi_{s:}\theta - \delta_w(s)\big)\phi_{s:}^T\bigg\}\end{align}$$Gradient TD (GTD).
$$\Delta w \approx -\alpha \big(\phi_{s:}-\gamma\phi_{s':}\big)^T \phi_{s:}\theta$$
$$\Delta\theta \approx -\beta \big(\phi_{s:}\theta - \delta_w(s)\big)\phi_{s:}^T$$
$$\delta_w(s)\approx\hat{v}(s;w)-R^s-\gamma\hat{v}(s';w)$$
TD with Gradient Correction (TDC).
$$\Delta w \approx \alpha\gamma\phi_{s':}^T\phi_{s:}\theta-\alpha\delta_w(s)\phi_{s:}^T$$
$$\Delta\theta \approx -\beta \big(\phi_{s:}\theta - \delta_w(s)\big)\phi_{s:}^T$$
$$\delta_w(s)\approx\hat{v}(s;w)-R^s-\gamma\hat{v}(s';w)$$
Proof of convergence of GTD is given in Borkar 2000 Proof of convergence of TDC is given in Borkar 1997
Solution 7: TD with Gradient Descent Methods and Non-linear Function Approximation
The idea is to consider the tangent space of the parameterized space, by linearizing it and then apply the strategy used in previous solution. For more details, check my notes and the paper of Maei 2009.
Summary
We have seen several solutions with function approximation:
- Episodic MC, whose objective is MSRE
- Online TD
- Episodic TD($\lambda$)
- Online TD($\lambda$)
- Advanced: Residual Gradients, whose objective is MSBE
- Advanced: Gradient TD (2 algorithms for both linear/nonlinear function approx.), whose objective is MSPBE
Premise. In prediction problems we can still have on-policy and off-policy learning.
In fact, if the MDP is ergodic then we can accumulate samples in form of tuples and perform supervised learning.
The tuple consists of $<S_t,A_t,R_{t+1},S_{t+1},(A_{t+1})>$, where $A_t$ is the action taken by the behaviour policy $b$ (the one acting in the environment) and $A_{t+1}$ is the action taken by the target policy $\pi$ (the one imagining to act). In on-policy learning $b=\pi$, while in off-policy learning $b\neq\pi$.
This is important, because the behaviour policy induces a prior over states, namely a stationary distribution $p(s)$ for all $s$, which is used as weigthing factor in the objectives we have defined so far. Analytically, it can be computed by considering $p(s'|s)=\sum_a b(a|s)p(s'|a,s)$, defining matrix $P$ with elements given by $p(s'|s)$ and solving equation $p=P^Tp$. In reality, we don't need to compute this distribution, but we have to be aware of that especially for off-policy learning, because **this weights each state in a different way from the distribution induced by the target policy, thus leading to unexpected algorithm behaviours. (See following considerations).
To analyze the properties of the algorithms, convergence and convergence to optimal solutions we have to distinguish two cases.
NOT AGNOSTIC (True value function is in the parameterized value space)
In this case, all algorithms discussed converge to optimal solutions
AGNOSTIC (True value function is NOT in the parameterized value space)
In this case, Online TD, Episodic/Online TD($\lambda$) can diverge, because they do not solve any objective.
In on-policy learning, divergence can be observed only with non-linear function approximation, while in off-policy learning, divergence can be observed even with linear function approximation.
All other algorithms converge.
But, in this scenario it is better to consider only two objectives, namely MSRE and MSPBE. Furthermore, it is important to consider the proper weighting in off-policy learning, in order to ensure to convergence to good solutions.
For practical agnostic problems, it becomes difficult to ensure convergence to good solutions.
Incremental Methods: Control
The typical strategy is to alternate a step of policy evaluation (from previous section) with policy improvement.
In general, proving convergence in control is even more difficult as the behaviour policy changes over time (most results show convergence for linear function approximation). Nevertheless, this problem can be addressed directly by the following fundamental question (which is the SOTA of incremental methods in RL).
Batch Methods
The main idea to learn a function approximator is to use supervised learning. But, samples are not iid distributed in this context. A solution to restore the iid assumption consists of storing all samples seen so far (including the current one) and then sample randomly a batch of them to update the function approximator. This heuristic strategy is called experience replay.
For linear function approximator. Experience replay allows to formulate the problem of prediction as a least squares problem. namely $$J(w)=\sum_{\text{batch}}\big(\text{target}-\hat{q}_\pi(a,s;w)\big)^2$$ and the target can be $G_t$ for Least Squares Monte Carlo (LSMC), $R_{t+1}+\gamma \hat{q}_\pi(a',s';w)$ for Least Squares TD (LSTD) and $G_t^\lambda$ for Least Squares TD($\lambda$) (LSTD($\lambda$)). The solution of the least squares problem can be computed efficiently in a single step (i.e. instead of computing an inverse matrix at each iteration, you can exploit the Sherman-Morrison identity to perform the inversion only once at the beginnning of training).
For nonlinear function approximator. Experience replay stabilizes training using TD learning (Q-learning). Another heuristic helpful for stabilization consists of using an old parameter vector in the TD target, namely $R_{t+1}+\gamma \hat{q}_\pi(a',s';w_{\text{old}})$. These two ideas are the main contributions of the important Deep Q learning paper.


Maxwell configuration
Maxwell can be configured by command line or a java "properties" file.
Command line options
| option | description |
|---|---|
| --user USER | mysql username |
| --password PASSWORD | mysql password |
| --host HOST | mysql host |
| --port PORT | mysql port |
| --producer stdout,kafka | where shall we send these rows, sir? |
| --kafka.bootstrap.servers | list of kafka nodes, listed as HOST:PORT[,HOST:PORT] |
| --kafka_topic | provide a topic for maxwell to write to. Default will be "maxwell". |
Configuration file options
If maxwell finds the file config.properties
in $PWD it will use it.
| option | description |
|---|---|
| user=USER | mysql username |
| password=PASSWORD | mysql password |
| host=HOST | mysql host |
| port=PORT | mysql port |
| producer=stdout,kafka, | where shall we send these rows, sir? |
| kafka.*=XXX | any options prefixed with 'kafka.' will be passed into the kafka producer library |
| kafka_topic | provide a topic for maxwell to write to. Default will be "maxwell". |


This arrived via express mail today. Many thanks to Nelson('mon aka
), Enry, and Brenda! The C-section was postponed a few hours, but rest assured the scotch will be enjoyed before the day is out! Thanks again for thinking of us!
-John
--- layout: post title: Thanks! categories: [] tags: [] status: publish type: post published: true meta: _original_post_id: '' _original_import_author: John Duprey author: ---
This arrived via express mail today. Many thanks to Nelson('mon aka
), Enry, and Brenda! The C-section was postponed a few hours, but rest assured the scotch will be enjoyed before the day is out! Thanks again for thinking of us!
-John


Forms available on GST Portal for Taxpayers and Tax Officials
27/09/2019
Government has issued various forms for GST related compliances to be made by taxpayers and for taking actions on them by tax officials. Various forms issued for registration, filing returns or refunds etc. have been made available on the GST Portal.
To know about the details of GST Forms, made available for taxpayers and tax officials, on GST Portal click here
To download all forms, click here


Once you have generated a specimen report in REDCap, you can specify here the report attributes, to make your report searchable and to enable integrating additional data sources with your specimen report data
Once you have generated a REDCap report in REDCap, you can specify here the report attributes that would enable integrating the report data with the specimen data.


Locations
| Location for @loggedInUser.activities(i).activityType | Add Location Form: |
|---|---|
| @loggedInUser.activities(i).route(j).toString() | |
| No locations assigned to this activity. | @dashboard_uploadlocation(loggedInUser.activities(i).id) |


Before Change
self.n_samples += X.shape[0]
def predict(self, X):
return np.array([np.argmax(self.predict_proba(X))])
def predict_proba(self, X):
return self._aggregate_expert_predictions(
After Change
numpy.ndarray
A numpy.ndarray with the label prediction for all the samples in X.
preds = np.array([np.array(exp.estimator.predict(X)) * exp.weight
for exp in self.experts])
sum_weights = sum(exp.weight for exp in self.experts)
aggregate = np.sum(preds / sum_weights, axis=0)
return (aggregate + 0.5).astype(int) // Round to nearest int
def predict_proba(self, X):
raise NotImplementedError


Potential network disruption
12 July 2017
Last updated: 2017/07/21 12:00 UTC. This page will be updated when new information becomes available. See the list of updates.
Starting at approximately 2017/07/23 00:00 UTC, Bitcoin confirmation scores may become less reliable than normal for a period of up to a month.
Users are advised to wait for more confirmations than they usually would before accepting any payment as final. Bitcoin.org’s usual recommendation during network disruption is to wait for 30 confirmations.
We also recommend monitoring this page and other Bitcoin news sites for additional information and updates.
Outdated information from earlier versions of this post follows.
Chain split
Since Bitcoin’s inception, its network has facilitated hundreds of millions of transactions. As a result, different groups of people (developers, investors, entrepreneurs, etc.), have debated on the best ways Bitcoin can be optimized to allow it to exponentially scale even further. In recent months, alternative software has been released that represents some of the interests of the aforementioned groups of people - software that is scheduled to go live toward the end of July.
The Bitcoin block chain, which is a record of all Bitcoin transactions to date, relies on a network of thousands of Bitcoin nodes running Bitcoin software. On 2017/08/01 00:00 UTC, the Bitcoin block chain may experience what is known as a chain split. This is when a portion of Bitcoin’s nodes run software that another portion of nodes are not fully compatible with. As a result, some nodes may propagate confirmed transactions that other nodes may not accept or recognize. This may result in unreliable confirmation scoring for an unknown length of time. This means that any bitcoins you receive during this period could disappear from your wallet or be a type of bitcoin that other people will not accept as payment, until the situation is resolved.
Once the situation is resolved, confirmation scoring will either automatically return to their normal reliability or there will be two (or more) competing versions of Bitcoin as a result of a split block chain. In the former case, you may return to using Bitcoin normally; in the latter case, you will need to take extra steps in order to begin safely receiving bitcoins again.
This post currently describes what actions you can take to prepare for this situation. Subsequent to 2017/08/01 00:00 UTC, we will update this post as best we can with relevant information, but you are also advised to monitor other Bitcoin news sites and community resources for updates and to cross-check all information, as someone may attempt to spread false news in order to exploit the situation.
Remember that you alone are responsible for the safety of your bitcoins, and that if you lose control of them for any reason, there is nothing the operators or contributors to this website can do to help you.
Note: there is a chance a milder level of disruption could start between now and 2017/08/01 00:00 UTC. If that is the case, this post will be updated with details.
Preparation
-
If you accept bitcoins as payments, we recommend that you stop accepting Bitcoin payments at least 12 hours before 2017/08/01 00:00 UTC, although 24 to 48 hours earlier may be safer. This will give time for all pending payments to confirm on the Bitcoin block chain before the event.
-
If you send bitcoins as payments, note that many services may stop accepting bitcoins at 2017/08/01 00:00 UTC or earlier.
-
Be wary of storing your bitcoins on an exchange or any service that doesn’t allow you to make a local backup copy of your private keys. If they accept transactions during the event, they could lose money and will likely spread those losses across all their users. If there end up being two or more competing versions of Bitcoin, then they may refuse to give you your bitcoins on versions they don’t like.
-
Bitcoin may experience significant price fluctuations in relation to other currencies. Learn more about price volatility and ensure you aren’t holding more bitcoin than you can afford to lose.
During the event
-
Do not trust any payments you receive after 2017/08/01 00:00 UTC until the situation is resolved. No matter how many confirmations the new payment says it has, it can disappear from your wallet at any point up until the situation is resolved.
-
Try not to send any payments. During the event there may be two or more different types of bitcoin and you may send all of the different types to a recipient who only expects one type. This would benefit the recipient at your expense.
-
Be wary of offers to allow you to invest in the outcome of the event by “splitting” your coins. Some of these offers may be scams, and software claiming to split your coins can also steal them.
After the event
We will update this section with more information after 2017/08/01 00:00 UTC. Please monitor this page accordingly and wait until multiple news sources that you trust have stated that the event is resolved before returning to normal Bitcoin use.
Document history
Note: The information contained herein is not to be construed as an official statement by Bitcoin Core. Bitcoin.org and Bitcoin Core open source projects are run by separate teams.
A full history of this document is available. The following points summarize major changes, with the most recent changes being listed first.
- 2017/07/22 12:00 UTC: describe possible unreliability of confirmation scores starting July 22 or 23.
- 2017/07/13 11:21 UTC: add general info about split.
- 2017/07/12 12:00 UTC: initial version.


Quantification of phase composition for the aqueous biphasic system composed of [P 44414]Cl and CH 3COOH at 313 K (TLL—Tie Line Length). The mixture point 1* has the same initial [P 44414]Cl and CH 3COOH concentration as mixture point 1 plus 2.00 wt.% NaCl.


module_amoebae_phylo_clas module¶
Contains functions for classifying sequences using existing phylogenetic models.
-
class
module_amoebae_phylo_clas.
ModelInfoFromCSV
(model_name)[source]¶ Bases:
object
Class for retrieving information about a named model (backbone tree).
-
module_amoebae_phylo_clas.
add_seq_to_alignment
(inseqobj, innexpath, outdp)[source]¶ Takes a sequence and adds it to a trimmed alignment for a backbone tree (which will be used to classify the sequence).
-
module_amoebae_phylo_clas.
classify_one_seq_record
(ali_num, record, model, outdirpath1, summary_csv_fp, summary_header_line)[source]¶ Classify one sequence.
-
module_amoebae_phylo_clas.
classify_seq_with_constrained_tree
(alignment, tree, subs_model, type_seqs, fasta)[source]¶ Classify sequences in a given fasta file using a given backbone tree.
-
module_amoebae_phylo_clas.
classify_seq_with_constrained_tree2
(file_with_seqs, model=None, subseq=False, abbrev=True, place=False)[source]¶ Classify sequences in a given fasta file using a given backbone tree.
-
module_amoebae_phylo_clas.
code_names_in_ali
(indp, inalifp, outalifp, outtablefp)[source]¶ Code names using name_replace.pl.
-
module_amoebae_phylo_clas.
code_tree
(intreefp, outtreefp, table)[source]¶ Code names in a tree, given a conversion table.
-
module_amoebae_phylo_clas.
get_all_alt_model_backbones
(model_name, out_dir_path, main_out_path, polytomy=False, not_polytomy_clades=False, iqtree_au_test=False)[source]¶ Take a tree and make all alternative topologies for internal branches outside specific clades of interest. Or, take a tree and make internal branches/nodes outside specified clades of interest into a polytomy (by setting the polytomy option to True).
-
module_amoebae_phylo_clas.
get_clade_name_from_model
(type_seq_name, type_seqs)[source]¶ Return clade name for given type sequence name and type seqs info file (from models directory).
-
module_amoebae_phylo_clas.
get_conversion_dict
(tablefile)[source]¶ Take a Name_Replace-style taxon name conversion table file, and return a dictionary for converting between coded names and long names, with long names as keys and codes as values.
-
module_amoebae_phylo_clas.
get_phylo_class_csv
(outdirpath)[source]¶ Given a phylo_class output directory, return the path to the full summary file contained in the directory.
-
module_amoebae_phylo_clas.
get_phylo_class_logfile_path
(phylo_class_outdir)[source]¶ Return a log file path given an output directory.
-
module_amoebae_phylo_clas.
place_one_seq_record
(ali_num, record, model, outdirpath1, summary_csv_fp, summary_header_line)[source]¶ Classify one sequence.
-
module_amoebae_phylo_clas.
quote_tree
(intree, table)[source]¶ Add quotation marks around long names in tree.
-
module_amoebae_phylo_clas.
uncode_tree
(intreefp, outtreefp, table)[source]¶ Code names in a tree file, given a conversion table. Without parsing with ete3.
-
module_amoebae_phylo_clas.
uncode_tree_obj
(intreeobj, table)[source]¶ Uncode names in a tree, given a conversion table.
-
module_amoebae_phylo_clas.
write_phylo_class_to_csv
(phylo_class_id, outdir, csv_file, minimum_confidence, timestamp, output_csv_path=None)[source]¶ Parse output of a forward search (from running the fwd_srch command of amoebae) and append rows to input csv with information for interpreting the forward results.


| gsub_file {xfun} | R Documentation |
These functions provide the "file" version of gsub()
, i.e.,
they perform searching and replacement in files via gsub()
.
gsub_file(file, ..., rw_error = TRUE) gsub_files(files, ...) gsub_dir(..., dir = ".", recursive = TRUE, ext = NULL, mimetype = ".*") gsub_ext(ext, ..., dir = ".", recursive = TRUE)
file |
Path of a single file. |
... |
For |
rw_error |
Whether to signal an error if the file cannot be read or
written. If |
files |
A vector of file paths. |
dir |
Path to a directory (all files under this directory will be replaced). |
recursive |
Whether to find files recursively under a directory. |
ext |
A vector of filename extensions (without the leading periods). |
mimetype |
A regular expression to filter files based on their MIME
types, e.g., |
These functions perform in-place replacement, i.e., the files will be overwritten. Make sure you backup your files in advance, or use version control!
library(xfun) f = tempfile() writeLines(c("hello", "world"), f) gsub_file(f, "world", "woRld", fixed = TRUE) readLines(f)


DotDotPwn - The Directory Traversal Fuzzer http://dotdotpwn.blogspot.com/
README.txt
=== DESCRIPTION ===
DotDotPwn - The Directory Traversal Fuzzer
It's a very flexible intelligent fuzzer to discover traversal
directory vulnerabilities in software such as HTTP/FTP/TFTP
servers, Web platforms such as CMSs, ERPs, Blogs, etc.
Also, it has a protocol-independent module to send the desired
payload to the host and port specified. On the other hand, it
also could be used in a scripting way using the STDOUT module.
It's written in perl programming language and can be run
either under OS X, *NIX or Windows platforms. It's the first Mexican
tool included in BackTrack Linux (BT4 R2).
Fuzzing modules supported in this version:
- HTTP
- HTTP URL
- FTP
- TFTP
- Payload (Protocol independent)
- STDOUT
=== REQUIREMENTS ===
- Perl (http://www.perl.org)
Programmed and tested on Perl 5.8.8 and 5.10
- Nmap (http://www.nmap.org)
Only if you plan to use the OS detection feature
(needs root priviledges)
Perl modules:
- Net::FTP
- TFTP (only required if fuzzing TFTP)
- Time::HiRes
- Socket
- IO::Socket
- Getopt::Std
You can easily install the missing modules doing the
following as root:
# perl -MCPAN -e "install <MODULE_NAME>"
or
# cpan
cpan> install <MODULE_NAME>
=== EXAMPLES ===
Read EXAMPLES.txt
=== CONTACT ===
Official Website: http://dotdotpwn.sectester.net
Official Email<EMAIL_ADDRESS>Bugs / Contributions / Improvements<EMAIL_ADDRESS>=== AUTHORS ===
Christian Navarrete aka chr1x Alejandro Hernandez H. aka nitr0us
http://twitter.com/chr1x http://twitter.com/nitr0usmx
<EMAIL_ADDRESS><EMAIL_ADDRESS>http://www.brainoverflow.org
CubilFelino Security Research Lab Chatsubo [(in)Security Dark] Labs
http://chr1x.sectester.net http://chatsubo-labs.blogspot.com
=== CHANGE HISTORY ===
Read CHANGELOG.txt
=== LICENSE ===
DotDotPwn - The Directory Traversal Fuzzer
Copyright (C) 2012 Christian Navarrete and Alejandro Hernandez H.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>


Application
AI404 Bias Detection and Mitigation
Bias is a conscious or unconscious tendency to prefer or reject certain groups over others. Everyone is biased. It's a natural, human tendency due to our environments and experiences. Bias can enter AI through the dataset, bias in the developers, or a homogenous workgroup. Both in society and in AI, bias can severely undermine people's quality of life. People may be passed over for a job they're well-qualified for, or be misidentified as a criminal due to their skin color. All bias is harmful, but considering the prevalence of AI as a tool, bias in AI systems has a special potential to exacerbate already-existing societal disparities, only increasing public distrust in AI.
AI404's Bias Detection GUI is intended for small scale developers who may not have as much access to institutional and financial resources to detect and mitigate bias. Our GUI helps you determine if the dataset you're using to train your algorithms is biased or not. If it is, we will help you determine how to make it more equitable.
We use state-of-the-art fairness metrics developed by key researchers and companies. Keep in mind, however, that our system is not perfect and should be used alongside human judgement.
Terminology
-
Favorable label: a label whose value corresponds to an outcome that provides an advantage to the recipient.
-
Protected attribute: attribute that partitions a population into groups that have parity in terms of benefit received.
-
race, gender, religion
-
Protected attributes are not universal, but are application-specific
-
-
Privileged: value/index of a protected attribute: group/individuals that have been historically been at a systematic advantage
-
Group fairness: the goal of groups defined by protected attributes receiving similar treatments or outcomes
-
Individual fairness: the goal of similar individuals receiving similar treatments or outcomes


I'm Suvash Kumar, an extremly efficient progammer🎮 and an enthusiastic learner📚, fascinated about Software, Web and Networking with expert knowledge on C/C++, Java, Python and C#. Currently I am doing my B.Sc. Engineering🎓 in Computer Science & Engineering in the University Of Rajshahi.🏫
I completed many projects Such as Library Management Software , and Attandance Counter as a undergraduate student. I also contribute at some open source project. I published a few project in Github including Prescription Maker. Here are some examples of My Works using Java, Python and C# :
I started competitive programming from college days and since then I found it very fascinating. From then I solved many problems in various online judges. My handels Are
My unsatisfactory thirst for networking has helped me to gain much knowledge in web development. I am a skilled web developer having good knowledge over HTML, CSS, bootstrap and javascript. This Beautiful Web page is the live demo of my amazing web development skills.
I always belive that we should make a free society for all and the rules apply for the tech world as well. So I think free and open source softwares should be our first choice. Thats why I love Linux. Not only that Linux offers a high security and stability. Also the community support has encouraged me to use and learn various linux distros.
What's more fun than gathering and spreading knowledge. I am always an enthusiastic learner and a knowledge seeker. And your knowledge become more practical when you teach others. So I Teach college students about Mathamaatics and Information & Communication Technology at a renowned coaching Center. Also try to share my knowledge via youtube channel.


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
Contrary to popular belief, Lorem Ipsum is not simply random text.  Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences.


Animal Shelters
Give the Animals a Better Home, Adopt Today!
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. For Further information click here to adopt a pet today!
One of the pet owners who adopted one of the Dogs here said this about her new pet...
"Despite all she’s been through, Emma is finally getting a chance to show just how loving she really is. She craves any kind of affection, will stick to her foster like glue and gives wonderful little kisses,” David said. “She is very special and we feel lucky to have been able to rescue her.”
One of the largest challenges facing animal welfare organizations today is the sheer number of animals in need of assistance.
Every year, approximately 6.5 million companion animals arrive at one of the community animal shelters nationwide.
We Rescue Stray Cats as well. Cats are the most Loving Pets to have they do the following:
- Play with you.
- They clean themsleves.
- Give a positive calming effect on you.
Click Here! For Further Information on Our Shelters


Sales, Service & Support
Turn product innovations into vital client solutions. The backbone of Google’s success, the account managers, consultants, admins, and analysts in these roles are all dedicated to top-notch client service. Whether negotiating with Fortune 500 companies, solving technical challenges for small businesses, or surfacing product ads in just the right place, we develop new business opportunities while increasing the use of our product offerings.


DEATHTRAP
January 13-22, 1984 at the Arabian Theatre
Director - David Jones & Darlene Purcell
Stage Manager - Darryl MacDonald
THE CAST
Sidney Bruhl - Wess Hughes
Myra Bruhl - Anita Boyd, Mary Ann Peterson
Clifford - Paul Wade
Helga ten Dorp - Linda Nash
Porter - Herb Knotts


Type Function Library system.* Return value various Revision Current Public Release (2013.2076) Keywords system info
Returns information about the system on which the application is running.
system.getInfo( property )
String. The name of the property corresponding to the desired information — see Properties below.
On Android, "androidAppVersionCode"
returns the application's version code as a number. Returns nil
on all other platforms.
On Android, "androidAppPackageName"
returns the application's unique dot-separated package name. Returns nil
on all other platforms.
On Android, "androidDisplayApproximateDpi"
returns the approximate DPI (dots per inch) of the screen as a number. This DPI value is based on the device's assigned density name, such as hdp or xhdpi, which provide standardized DPI values on Android. This value is typically not the actual DPI of the display, which you can fetch using the "androidDisplayXDpi"
and "androidDisplayYDpi"
property names instead.
The following table lists the DPI values that will be returned for each display density type. This function returns nil
on all other platforms.
Density DPI ldpi 120 mdpi 160 hdpi 240 xhdpi 320 xxhdpi 480 tvdpi 213
On Android, "androidDisplayDensityName"
returns the device's screen density as a string, which can be one of the following. This function returns nil
on all other platforms.
"ldpi"
"mdpi"
"hdpi"
"xhdpi"
"xxhdpi"
"tvdpi"
"unknown"
On Android, "androidDisplayWidthInInches"
returns the width of the application window in inches, relative to the orientation of the application. Returns nil
on all other platforms.
On Android, "androidDisplayHeightInInches"
returns the height of the application window in inches, relative to the orientation of the application. Returns nil
on all other platforms.
On Android, "androidDisplayXDpi"
returns the DPI (dots per inch) of the screen along the x axis, relative to the orientation of the application. This can be used to convert pixels to inches and vice-versa. Returns nil
on all other platforms.
On Android, "androidDisplayYDpi"
returns the DPI (dots per inch) of the screen along the y axis, relative to the orientation of the application. This can be used to convert pixels to inches and vice-versa. Returns nil
on all other platforms.
"appName"
returns the application's name that is displayed to the end user.
"appVersionString"
returns the application's version as a string. For Android apps, this is the Version Name.
"architectureInfo"
returns a string describing the underlying CPU architecture of the device you are running on. This API is mostly for internal debugging but may have uses. Strings may be subject to changes in the future depending on the changing landscape of devices and CPUs.
Android on ARM devices will return "ARM"
(typically for ARMv6) or "ARM Neon"
(ARMv7). iOS will return values such as "iPhone1,1"
or "iPhone1,2"
, where mappings are:
"iPhone1,1"
= iPhone 1G"iPhone1,2"
= iPhone 3G"iPhone2,1"
= iPhone 3GS"iPod1,1"
= iPod touch 1G"iPod2,1"
= iPod touch 2GMac may return i386
, x86\_64
, ppc
, or ppc64
(currently only i386
is available). Windows is currently unsupported.
"build"
returns the Corona build string as it appears in the About box of the Corona Simulator.
On iOS, "deviceID"
returns a "unique" id for the device. Per Apple's policies, on iOS 6 and later, "deviceID"
returns a MD5 hash of the device's "identifierForVendor"
(see below); on iOS 5 it returns a MD5 of a GUID (Globally Unique Identifier) that is unique for each app install.
On Android, if your app uses the "android.permission.READ\_PHONE\_STATE"
permission, the following will be returned:
IMEI
for GSM phones.MEID
or ESN
for CDMA phones.If your Android app does not use the "android.permission.READ\_PHONE\_STATE"
permission, then the operating system's unique ID will be returned for all devices. Note that the operating system's unique ID may change after re-installing the operating system on the device.
"environment"
returns the environment that the app is running in. These include:
"simulator"
— the Corona Simulator"device"
— iOS, Android device, and Xcode Simulator"GL_VENDOR"
Returns the company responsible for the GL implementation on this device. See http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetString.xml
"GL_RENDERER"
Returns the name of the GL renderer. See http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetString.xml
"GL_VERSION"
Returns the GL version. See http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetString.xml
"GL_SHADING_LANGUAGE_VERSION"
Returns the GL version or release number for the GLSL shading language. See http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetString.xml
"GL_EXTENSIONS"
Returns the list of extensions supported on this device. See http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetString.xml
"gpuSupportsHighPrecisionFragmentShaders"
Returns a boolean indicating whether HIGHP is supported in fragment shaders on this device.
"iosAdvertisingIdentifier"
On iOS, returns the "advertisingIdentifier"
for use in advertising logic (see here).
On iOS, "iosAdvertisingTrackingEnabled"
returns the value of "advertisingTrackingEnabled"
for use in advertising logic (see here).
On iOS, "iosIdentifierForVendor"
returns the value of "identifierForVendor"
for use in advertising logic (see here).
"model"
returns the device model (as specified by the manufacturer). Note that most Android devices return a model number instead of a model name. Examples include:
"iPhone"
"iPad"
"iPhone Simulator"
"iPad Simulator"
"Nexus One"
"Droid"
"Galaxy Tab"
"name"
returns the human-readable model name. On iPhone, this would be the name of the phone as it appears in iTunes, for example "Steve's iPhone"
.
"platformName"
returns the platform name (the OS name), for example:
"Mac OS X"
— Corona Simulator on Mac"Win"
— Corona Simulator on Windows"iPhone OS"
— all iOS devices and Xcode Simulator"Android"
— all Android devices"platformVersion"
returns a string representation of the platform version. This is sometimes, but not always, a number — for example, a Droid X currently returns 2.1-update1
.
"maxTextureSize"
returns the maximum texture width or height supported by the device.
"maxTextureUnits"
returns the maximum number of texture units available on the device. This number is based on the hardware limits of the device itself. Each image, mask, or text object consumes one texture unit. Typically, you'd care about the number of texture units when you want to achieve multiple nested masks. In other words, this number determines the depth of the nested masking you can achieve. For example, consider an image with a mask applied to it that is inside a group with a mask applied to it. In this case, 3 texture units are required: one for the image, one for the image's mask, and one for the group's mask.
"targetAppStore"
returns the name of the app store that the application was built for.
"apple"
— always returned on iOS"amazon"
— targets the Amazon app store (only returned on Android)"gameStick"
— targets the GameStick console's app store (only returned on Android)"google"
— targets Google Play (only returned on Android)"nook"
— targets Barnes & Noble's Nook app store (only returned on Android)"ouya"
— targets the Ouya game console's app store (only returned on Android)"samsung"
— targets the Samsung app store (only returned on Android)"none"
— indicates that the app is not targeting a specific app store. This is always returned by the Corona Simulator."textureMemoryUsed"
returns the texture memory usage (in bytes). Texture memory for graphics/images tends to be the most sharply limited resource in mobile development since it runs out before normal memory.
"version"
is now deprecated. Use "build"
to distinguish between different Corona build versions.
The following checks to see if user is running the app in the simulator:
local environment = system.getInfo( "environment" )
if environment == "simulator" then
print( "You're in the simulator." )
end


Evan's Header
Hello there, awesome person!
This is a link to Youtube
This is a link to OWL
This is a link to Spotify


Experience Victoria Falls and all of the beauty of the the Zambezi River, and take a ride on the back of an elephant!
Experience The Falls.
Victoria Falls, Zimbabwe is home to the world’s largest waterfall. Considered one of the 7 Wonders of the Natural World, this magnificent site is the centerpiece of this amazing adventure. Trek through the bush on the back of an African Elephant; Search for the Big Five on an exciting night safari; feel the thrill of rafting with Hippos, Crocs, and Elephants on the great Zambezi River; tour one of the greatest feats of engineering in Africa, the Victoria Falls Bridge; and be captivated by the Flight of Angels Helicopter Tour over Victoria Falls!
Trip Details
- 7 days and 7 nights in 4 star accommodations including hot breakfast daily
- Sunset Cruise on the Zambezi River where you’ll see hippos, crocodiles, elephants and more
- Elephant Back Safari
- Night Safari on a “Big 5” reserve
- Soaring helicopter ride over the falls
- Victoria Falls Bridge Tour with magnificent views of the gorge
- High Tea at Victoria Falls Hotel overlooking the Victoria Falls Bridge
- Safari through Zambezi National Park
- Z River ligambeziht raft trip
- BOMA Dinner- An unforgettable cultural experience
"I feel like I got the best of Africa! Saw the Big 5 and Victoria Falls. Wow!"
Mark P.
"The most thrilling experiences of my life, both wildlife and the Falls! Simply Amazing!"
Peggy P.
"New World made my family trip to a far-away land easy! I can't imagine traveling to Africa without them."
John C.
"I rode on the back of an elephant... Are you kidding me?!!! Best trip ever."
Get in touch with us and we will keep you up to date with new tours, stories, and adventures. Or follow us on social media to follow us through the Africa Safari!


Ford Mustang-Inspired Electric Crossover Spied Virtually Uncovered
Whether it's called Mach E or something else, these photos leave little to the imagination.
by Christopher SmithWe’ve seen prototypes and concepts of an electric Ford Mustang, but the first actual Mustang EV – or rather, Mustang-inspired EV – will be revealed on November 17 ahead of the Los Angeles Auto Show. That’s just 10 days away as of this article posting, and we’ve speculated how the new crossover will look based on Ford’s teaser. But today, spy photographers caught a clear look of the production model wearing just a thin body wrap so yeah, no more speculation is required. At least in the looks department.
Electric Pony:
There’s certainly an unmistakable Mustang flavor happening here, starting with the not-a-grille grille up front and thin headlights at the corners. The roofline holds a similar – but not identical – line to the two-door pony car, and the iconic three-bar taillights are clearly visible at the rear. The body wrap hides smaller details on the exterior, but overall this is pretty much the electric crossover before Ford wants you to see it.
Gallery: Mustang-Inspired EV Crossover Spy Shots
There is one feature still covered, however, which holds some mystery for Ford’s Mustang enthusiasts. The emblem in the center of the grille is fully obscured by black tape, and even with photos zoomed in to the max, it’s impossible to say exactly what’s there. It is a typical Blue Oval badge? Is it Mustang’s iconic horse? Is it something new? After the tremendous backlash following Ford’s original announcement this would be the new Mach 1, the automaker has taken great care in referring to this simply as a Mustang inspired crossover. It may not even bear the Mustang name, though a Mach E trademark filed some time ago suggests this could well be the crossover’s moniker.
What's In A Name?
Regardless of the name, this will be Ford’s first volume production offering build as an electric vehicle from the ground up. As far as crossovers go it certainly looks sporty, but whether Ford’s strategy to invoke the Mustang’s pedigree pays off in sales, only time will tell.
Source: Automedia