Hello,
I'm playing with my emonTx (without RF) and 1 voltage and 3 current sensors (all orginal openenergy).
My idea is to connect the Rpi to my arduino (USB serial) , i tried that and it works fine!
I have the following arduino software:
[code]
#include "EmonLib.h" // Include Emon Library
EnergyMonitor emon1, emon2, emon3; // Create tree instances
void setup()
{
Serial.begin(9600);
emon1.voltage(0, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(1, 111.1); // Current: input pin, calibration.
emon2.voltage(0, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
emon2.current(2, 111.1); // Current: input pin, calibration.
emon3.voltage(0, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
emon3.current(3, 111.1); // Current: input pin, calibration.
}
void loop()
{
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
Serial.println("CT 1:");
emon1.serialprint(); // Print out all variables
emon2.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
Serial.println("CT 2:");
emon2.serialprint(); // Print out all variables
emon3.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
Serial.println("CT 2:");
emon3.serialprint(); // Print out all variables
}
[/code]
When i take a look to my serial output i see the following values:
CT 1:
-475.78 1707.07 231.89 7.36 -0.28
CT 2:
16.61 208.05 232.66 0.89 0.08
CT 2:
753.23 895.12 230.48 3.88 0.84
CT 1:
-156.12 631.12 231.66 2.72 -0.25
CT 2:
13.39 205.52 233.68 0.88 0.07
CT 2:
792.80 924.17 232.96 3.97 0.86
CT 1:
-167.20 602.54 232.29 2.59 -0.28
CT 2:
1.69 209.64 232.43 0.90 0.01
CT 2:
772.37 903.69 233.85 3.86 0.85
(i know i used 2x CT 2 :x ).
The question i have:
1. How is a negative value possible? (CT 1)
2. Is a calibration necessary ? (or can i work with the default values).
3. And i try to understand the calibration but i can't follow that story (my english isn't that good :( ).
4. Is the code i used good? (because i see severally explanations)
Thank you!
Regards,
Rob
Re: EmonTx (no RF) question
Hi Rob,
From your post your English is pretty good to me in fact it is much better than other "English speaking" people I know.
In relation to your question is it possible you have 'CT1" orientated a different way to the other CTs for example the arrow on the CT is in opposition to the current flow in the cable you have it installed on.
Regards Paul
Re: EmonTx (no RF) question
Hi Paul,
I tried changed CT1 with CT2 but no result (CT1 and CT2 are both negative).
I tried tho mount the CT1 on the other way (turn around) but the results are more negative.
And it looks like it's only on "low" power.
Regards,
Robert
Re: EmonTx (no RF) question
I tried also the next thing:
I disconnected CT1 and CT2 (with closed clamp) and i get those values:
CT 1:
-35.59 173.91 225.61 0.77 -0.20
CT 2:
-25.32 210.49 224.91 0.94 -0.12
CT 2:
648.35 771.14 225.05 3.43 0.84
It looks like they are measuring something?
Re: EmonTx (no RF) question
I think i have to build my arduino into a metal case or something.. I tested again on my desk and the values are less..
Re: EmonTx (no RF) question
What is your construction method? - you say emonTx at the top but refer to Arduino elsewhere. Anecdotally, people who use Arduino boards and prototype boards (stripboard, plugboard) for the input circuitry seem to have experienced more noise pickup and spurious readings - as you are seeing - than people who use the emonTx kit. It has been suggested that a 2n2 capacitor connected from the processor input pin for the current inputs to ground is a cure for noise pickup. It should have no significant effect on the desired signal, but I have not tested it.
Re: EmonTx (no RF) question
I have a arduino uno and i connected the orginal emonTx (without RF) directly on the arduino uno.
I will test the 2n2 capacitor soon!
Ps, how is it possible that i get negative values like i said into the first post?
Re: EmonTx (no RF) question
The sign refers to the direction of power flow. You can read up how the emonTx does the maths in Building Blocks.
Calibration is not necessary, the default values should give you reasonable results, but if you want the best accuracy, then you should calibrate.
Re: EmonTx (no RF) question
I tested with a 2n2 capacitor but i got the same results :(
Re: EmonTx (no RF) question
Why are you connecting an emonTx to an Arduino Uno? I think you are reading digital noise that is getting in to the analogue input, or into the analogue reference voltage via the power supply. It is possible that this digital noise is coming from the Uno. Another possible source of noise is a poor quality 5 V power supply. See Not all USB power adapters are created equal.
Re: EmonTx (no RF) question
or into the analogue reference voltage via the power supply.
Now that you mention that, Atmel call for AVCC to be connected to VCC via an LC network (Fig 23-9 in the datasheet), and yet very few Arduino designs do that, and nor does emonTx since it's based on them. Does anyone know the history of that?
Re: EmonTx (no RF) question
@Robert,
I have also a 9vdc battery connected to my arduino but with the same results.
I ordered also a mega 2560 and i got the same results on that board :(
Re: EmonTx (no RF) question
RobV:
What result do you get with your emonTx connected to a good clean power supply, with the voltage input connected but with the c.t's off their cables and unplugged, sending the results by radio (meaning no other connection to the outside world)?
dBC:
Why not take a look at Atmel's App.Note? (Hint: the emonTx is based on that and it doesn't decouple the Aref either!). And a pre-emptive answer to the inevitable question: NO, I don't know either.
Re: EmonTx (no RF) question
Why not take a look at Atmel's App.Note?
Which one? "AVR042: AVR Hardware Design Considerations" certainly shows it in Fig 6-1.
Hint: the emonTx is based on that and it doesn't decouple the Aref either!
Actually, I was talking about AVCC not AREF. I assume that's a typo on your part, because emonTx does decouple AREF right?
Re: EmonTx (no RF) question
You're right, it was a typo. I can't remember now which note it was, but I was rather surprised there was no decoupling, as they're fairly insistent on good layout practice etc. AVR465 does show it too, so it wasn't that one. I'm wondering now whether I was looking at an incomplete diagram.
We haven't yet proved that noise is the problem, but it seems to me the likeliest cause of the erroneous readings that we've seen.
Re: EmonTx (no RF) question
I'm wondering now whether I was looking at an incomplete diagram
Is it possible you were looking at an Arduino schematic? As far as I can see, the only official Arduino design to include the LC network is the Leonardo. That may provide a fairly painless way to determine if it's the lack of LC network causing the problem, at least if you can replicate it on the shield-based solutions.
Re: EmonTx (no RF) question
@Robert,
I don't have RF so i have to use the USB port to monitor the values :(
Maybe i will connect a LCD display soon so i can use the LCD to monitor.
Another question where in the CPP file can i add a offset to set the input to the 0 value?
My situation right now: i disconnected the power wires and i made some new wires with 3 turns (so my measuring will be 3x higher) and i add a diverter (/3) into the CPP file. with this solution my noise also diverted to 3.
Maybe another detail, i ordered my arduino at dx.com (i don't know if it orginal?)
Re: EmonTx (no RF) question
That tells me without doubt that you are measuring noise. Tell me again what you are using. Is it an emonTx from the openenergymonitor shop but without the RFM12B module?
How does the Arduino Uno relate to your problem?
Re: EmonTx (no RF) question
Yes Robert, i explain that earlier.
I have 2 arduino's
1. Uno
2. Mega
Same problems.
Re: EmonTx (no RF) question
So you do not have an emonTx?
There are many ways that the wrong readings could be generated.
First, it could be digital noise from the processor finding its way into the ADC, either by the signal input or by the supply AVcc. as dBC wrote above, the Arduino boards don't appear to include the filter here that Atmel recommends.
Second, it could be pick-up from the circuits you are measuring or from adjacent circuits.
Third, it could be due to circulating ground currents between power supply, the computer you are using to monitor, and the analogue circuits.
Fourth, it could be from a poor quality 5 V power supply, but as you get the same from a 9 V battery, in this case it is not that.
Are your current transformers connected like this: http://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface
Which current transformer are you using and what is the value of your burden resistor?
Re: EmonTx (no RF) question
Hi Robert,
I have the following configuration:
1. Arduino uno : http://dx.com/p/x1301-uno-r3-starter-singlechip-set-kit-multicolored-961192965
2. http://shop.openenergymonitor.com/emontx-shield-kit-no-rf/
3. 3x http://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/
4. http://shop.openenergymonitor.com/ac-ac-adapter-euro-plug/
Thats exact my configuration :)
And yes maybe it is one of the problems you mentiont i will try some thing.
But about the filter where can i a how to made a filter layout?
Thank you!
Re: EmonTx (no RF) question
But about the filter where can i a how to made a filter layout?
I doubt you'll be able to successfully retro-fit the LC network to your Uno. However, if you're up for spending another $25 you could purchase an Arduino Leonardo and see if that improves things. The Leonardo has the Atmel specified LC filter between VCC and AVCC. There's no guarantees it will fix your problem, but it would go some way to determining if the missing LC filter is relevant.
Re: EmonTx (no RF) question
There is a big difference between an emonTx and an emonTx shield!
You will probably not be able to fit a filter to your Arduino - that should have been done when the circuit board was designed.
Are you certain that you have the correct components fitted, especially the 33 R burden resistors R3, R5, R16 & R22?
[Edit]
Compare it carefully with this photo: http://cdn2.bigcommerce.com/server4400/98a75/products/78/images/183/emon... and check that the colour code on each component is the same as the picture, and the electrolytic capacitors are the right way round.
[/Edit]
In your first post:
CT 1:
-167.20 602.54 232.29 2.59 -0.28
CT 2:
1.69 209.64 232.43 0.90 0.01
CT 2:
772.37 903.69 233.85 3.86 0.85
and later:
CT 1:
-35.59 173.91 225.61 0.77 -0.20
CT 2:
-25.32 210.49 224.91 0.94 -0.12
CT 2:
648.35 771.14 225.05 3.43 0.84
The numbers I have marked are current, these are far too high. I would expect to see small numbers ~ 0.2 maximum. You are using the wrong current calibration factor, it should be 60.6 here: emon1.current(1, 111.1); but that only partly explains the problem - when you correct this it will change 3.86 to 2.10 which is still at least 10 times too big.
I have only now looked at the circuit diagram of the emonTx shield. If the diagram is correct, and it is, I think I can see what your problem might be.
The drawing shows the body of the socket and the sleeve of the plug connecting to the ADC input. If the cable screen is connected to the plug sleeve and you have high voltages close by, that would explain the high current that you see [edit] if there is mistake in your assembly [/edit]. If you take the c.t's off their cables and unplug them all from the shield (but leave the voltage input plugged in and on, working), what currents do you see?
[Edit]
Can you also check that the ground connection between your shield and the Arduino board is good.
Re: EmonTx (no RF) question
Hi Robert,
I checked the hardware and the hardware is OK.
Right now i have values like:
CT 1:
0.01,0.04,0.43,0.10,0.22,
CT 2:
0.02,0.11,0.40,0.27,0.21,
CT 3:
0.01,0.12,0.47,0.25,0.12,
CT 1:
0.00,0.07,0.54,0.13,0.00,
CT 2:
0.03,0.13,0.49,0.27,0.21,
CT 3:
0.03,0.13,0.52,0.25,0.25,
CT 1:
0.02,0.08,0.51,0.16,0.22,
CT 2:
0.07,0.18,0.65,0.28,0.41,
CT 3:
0.02,0.12,0.50,0.25,0.15,
CT 1:
0.02,0.06,0.47,0.13,0.26,
CT 2:
0.06,0.12,0.45,0.27,0.47,
CT 3:
0.02,0.12,0.48,0.25,0.17,
CT 1:
0.04,0.12,0.55,0.22,0.33,
CT 2:
-0.01,0.14,0.55,0.26,-0.11,
CT 3:
0.01,0.13,0.54,0.24,0.11,
CT 1:
0.04,0.11,0.54,0.21,0.38,
CT 2:
0.07,0.15,0.54,0.27,0.47,
CT 3:
0.02,0.13,0.52,0.25,0.15,
CT 1:
0.02,0.08,0.52,0.15,0.20,
CT 2:
0.05,0.14,0.55,0.26,0.32,
CT 3:
-0.01,0.15,0.65,0.23,-0.04,
CT 1:
0.02,0.10,0.57,0.18,0.15,
CT 2:
0.02,0.14,0.54,0.25,0.16,
CT 3:
-0.02,0.14,0.61,0.24,-0.17,
This is just my arduino connected to my PC and 3x a current clamp without connecting to the wires.
And about the values i posted before.
In my first post my question was "Why are those negative?"
The post later was with disconnected CT 1 and CT 2 (CT 3 was still on the line).
Above are the values right know WITHOUT anything on the clamps.
Re: EmonTx (no RF) question
Those values are much better but still high - you now have ~0.25 A of current showing on CT2 & CT 3, CT 1 is sometimes better.
Are you using the correct current calibration factor now?
Are your current transformers unplugged from the shield?
In my first post my question was "Why are those negative?" You get negative power if the current is flowing in the opposite direction. It is explained here. You can reverse the sign by turning the c.t. around on its wire, but you said you did that and the numbers got more negative. That means you are getting readings that are not coming from the current in the cable that the c.t. is clipped onto. The true current is half the difference and the 'false' current is the average of the two readings.
Re: EmonTx (no RF) question
I use the default current calibration right now.
I changed that before but without big difference.
The current transformers are plugged into the shield.
I think im going to build the arduino into a metal case maybe this will solve my problem.
Re: EmonTx (no RF) question
The correct calibration for the emonTx Shield is 60.6. That is the default value in the Shield example sketch.
Unplug the c.t's from the shield and post the values you see.
Re: EmonTx (no RF) question
Just for reference, I have loaded a standard emonTx (NOT the shield) with the "emonTx_CT123_Voltage" sketch and get this It is calibrated to read 100 A with 15 Ω burden resistors (current calibration factor = 138.8), voltage sensor connected and working, no c.t's connected, powered via FTDI programmer & laptop USB 5 V. The emonTx is uncased - it was actually resting on the laptop keyboard to record these numbers:
CT 1: 2.44 26.12 248.80 0.10 0.09
CT 2: 4.80 33.16 248.83 0.13 0.14
CT 3: 2.26 30.25 248.69 0.12 0.07
CT 1: 4.21 31.76 248.51 0.13 0.13
CT 2: 5.47 33.50 248.60 0.13 0.16
CT 3: 1.32 29.93 248.26 0.12 0.04
So you should expect the current read by CT2 & CT3 to come down a little more yet before I would say the results are acceptable.
Re: EmonTx (no RF) question
Hi Robert,
I changed the calibration to 60.6 and i see the following values:
CT 1:
0.00,0.02,0.36,0.05,0.19,
CT 2:
0.02,0.07,0.43,0.16,0.31,
CT 3:
0.02,0.07,0.49,0.14,0.26,
CT 1:
0.02,0.07,0.53,0.13,0.24,
CT 2:
0.05,0.12,0.70,0.17,0.47,
CT 3:
0.01,0.08,0.57,0.13,0.09,
CT 1:
0.02,0.08,0.54,0.14,0.29,
CT 2:
0.02,0.09,0.61,0.16,0.26,
CT 3:
0.02,0.07,0.57,0.13,0.26,
CT 1:
0.02,0.07,0.54,0.14,0.27,
CT 2:
0.02,0.07,0.44,0.15,0.35,
CT 3:
0.01,0.06,0.43,0.14,0.22,
CT 1:
0.05,0.15,0.77,0.19,0.33,
CT 2:
0.04,0.11,0.73,0.15,0.35,
CT 3:
0.00,0.06,0.55,0.11,0.03,
CT 1:
0.06,0.13,0.72,0.18,0.42,
CT 2:
0.01,0.07,0.55,0.13,0.10,
CT 3:
0.02,0.05,0.37,0.15,0.31,
CT 1:
-0.00,0.03,0.43,0.07,-0.03,
CT 2:
0.05,0.09,0.56,0.17,0.58,
CT 3:
0.02,0.06,0.44,0.15,0.27,
CT 1:
0.01,0.02,0.36,0.06,0.26,
CT 2:
0.02,0.08,0.52,0.15,0.29,
CT 3:
0.00,0.07,0.54,0.12,0.06,
CT 1:
0.05,0.12,0.65,0.19,0.40,
CT 2:
0.01,0.08,0.57,0.14,0.15,
CT 3:
0.00,0.07,0.55,0.12,0.07,
CT 1:
0.02,0.08,0.59,0.14,0.28,
CT 2:
0.01,0.08,0.54,0.14,0.17,
A littlebit unstable but i think it's better?
This are the values with current sensors connected:
CT 1:
0.01,0.03,0.37,0.08,0.19,
CT 2:
0.00,0.01,0.22,0.05,0.22,
CT 3:
-0.00,0.05,0.48,0.11,-0.04,
CT 1:
-0.00,0.08,0.54,0.15,-0.00,
CT 2:
0.06,0.12,0.58,0.20,0.52,
CT 3:
-0.01,0.06,0.52,0.11,-0.14,
CT 1:
0.02,0.08,0.55,0.15,0.20,
CT 2:
-0.00,0.07,0.54,0.13,-0.04,
CT 3:
0.01,0.02,0.15,0.15,0.23,
CT 1:
0.00,0.01,0.28,0.03,0.25,
CT 2:
0.01,0.06,0.42,0.15,0.23,
CT 3:
-0.00,0.07,0.55,0.12,-0.00,
CT 1:
0.03,0.10,0.65,0.15,0.28,
CT 2:
0.01,0.07,0.55,0.13,0.08,
Ps. the arduino + shield are on my table (wood / plastic).
Re: EmonTx (no RF) question
Those numbers are a fraction higher than mine, but I doubt that you will get them much lower. As far I can find out, the noise comes from the digital circuits inside the processor and there is little you can do about it.
If you do not need to measure the full 100 A, you can increase the value of the burden resistor, but you risk distorting the waveform and introducing errors into the measurements if you make it too large.
Re: EmonTx (no RF) question
Hello, I am trying the same thing - arduino to talk to rasppi via usb cable. I see that arduino talks to usb0 on raspi but i cant foward the data to emoncms.
How i must configure oem-gateway script and OemGatewaySerialListener ?
And what i must change in arduino sketch?
Thanks.
Re: EmonTx (no RF) question
RobV: I have the following configuration:
1. Arduino uno : http://dx.com/p/x1301-uno-r3-starter-singlechip-set-kit-multicolored-961192965
2. http://shop.openenergymonitor.com/emontx-shield-kit-no-rf/
3. 3x http://shop.openenergymonitor.com/100a-max-clip-on-current-sensor-ct/
4. http://shop.openenergymonitor.com/ac-ac-adapter-euro-plug/
Thats exact my configuration :)
Good! With that configuration, you should be able to run my Raw Samples Tool sketch. This will display exactly how your signals are being seen by the processor. For details about this tool, and many others, just follow the link on my Summary Page
The above sketch requires an AC signal to be present at Analog input 2 - the voltage sensor. If it's not working, try my MinMaxAndRangeChecker sketch, also linked from near the top of the same page.
Whenever I build anything new, I always run these basic sketches because they are so useful for checking that the new hardware is OK. Another useful sketch, linked from the same page, is my DigitalMeterEmulator. Every time that 1Wh has been recorded, a pulse appears at the on-board LED. Just clip the CT around an incoming tail and the two LEDs (meter and emonTx/Uno) should pulse at the same rate. If they don't, then just change the value of powerCal until they do. Calibration made easy!
powerCal is the means by which all of my sketches are calibrated. Other software has different calibration methods. It only takes a minute or two to switch from one sketch to another, so you could run one of mine to check that everything is working for you, and then switch to a different sketch, e.g. emonTx_CT123_voltage
Re: EmonTx (no RF) question
calypso_rae : thanks, your tools will be very useful.
i picked up an old topic. i had a problem with running no rf, trough usb cable serial connection but all my problems seems to be lack of connection to emoncms.org. now everything is alright , up and running.
i am trying to run an ultrasonic level sensor to emoncms.
Re: EmonTx (no RF) question
Great.
If things are not working as intended, it's often worth running some simple checks to confirm that the basic parts of the system are in order.


Review by John Beachem
* * 1/2
Directed by: Kevin Smith Written by: Kevin Smith
Unusually high expectations are the bane of movie makers everywhere. They nearly succeeded in killing the new Star Wars film, they caused people to expect "The Mummy" to belong to a different genre, and they will most likely do a good job of killing Kevin Smith's latest outing, "Dogma".  So it is entirely possible that my review of this film is a tad biased.
Loki (Matt Damon) and Bartleby (Ben Affleck) are two angels who have been banished from heaven. However, they have just found a loophole in Catholic law which will permit their return to paradise. The catch is, if they succeed, all existence will be wiped out because God will have been shown to be fallible. The universe's only hope lies in the hands of Christ's descendent, Bethany (Linda Fiorentino). Bethany will be assisted by two prophets named Jay and Silent Bob (Jason Mewes and Kevin Smith), and the 13th apostle, Rufus (Chris Rock). Working against them are the demon Azrael (Jason Lee), three kids with hockey sticks (dont ask), and the pair of angles themselves.
If there is one thing that Kevin Smith will be known for (other than for playing the hilarious Silent Bob), it is his ability to write witty dialogue. While "Dogma" certainly has its moments of wonderful dialogue, it is marred by long spans of rather dull talk regarding the nature of religion. The comic dialogue here is at its best when coming from Jason Mewes, who plays the recurring character from Smith's previous three films and from Alan Rickman as the voice of god, Metatron.
The cast here is really quite good. Ben Affleck and Matt Damon appear to be having a tremendous amount of fun with their roles, Chris Rock is amusing as the bitter, forgotten apostle, and Salma Hayek is delightful, as always, in a turn as the muse, Serendipity. In fact, the only person who seems out of place here is Linda Fiorentino. While normally a competent actress, she never seems particularly comfortable with her role here and delivers her lines in a particularly bored fashion.
While the film has been vastly criticized for its assaults on religion, I found them to be nothing more than playful jabs at those who are too set in their ways. The problem with this movie isn't its religious content, it's the fact that the jokes here are few and far between. Smith seems more concerned with trying to convey a moral message about understanding and the true meaning of religion than he does with making the film comical. While the message is all well and good, it isn't why most audiences are going to this film.
"Dogma" runs far too long at 130 minutes. In fact, I found myself drifting off several times during this exessively lengthy film. Due to this and the lack of humor, I'm forced to give "Dogma" two and a half stars and a recommendation to wait for video if you're really wanting to see it
Feel free to e-mail with comments at<EMAIL_ADDRESS>* * * * * - One of the greatest movies ever made, see it now. * * * * - Great flick. Try and catch this one. * * * - Okay movie, hits and misses. * * - Pretty bad. See it if you've got nothing better to do. * - One of the worst movies ever. See it only if you enjoy pain.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


str
The items of a string are characters. There is no separate character type; a character is represented by a string of one item. Characters represent (at least) 8-bit bytes. The built-in functions chr() and ord() convert between characters and nonnegative integers representing the byte values. Bytes with the values 0-127 usually represent the corresponding ASCII values, but the interpretation of values is up to the program. The string data type is also used to represent arrays of bytes, e.g., to hold data read from a file.
Strings are immutable sequences.
Constructors
- str()
- Returns a string containing a printable representation of an object.
literal syntax
Methods
Searching
- find
- Returns the index of the first occurrence of the string searched for.
- rfind
- Returns the index of the last occurrence of the string searched for.
- index
- Returns the index of the first occurrence of the string searched for (raises ValueError if not found).
- rindex
- Returns the index of the last occurrence of the string searched for (raises ValueError if not found).
Replacing
- replace
- Returns a copy of the string with a specified substring replaced specified number of times.
- translate
- Returns a copy of the string with characters mapped through the given translation table or deleted.
Leading and Trailing Characters
- lstrip
- Returns a copy of the string with leading characters removed.
- rstrip
- Returns a copy of the string with trailing characters removed.
- strip
- Returns a copy of the string with leading and trailing characters removed.
Splitting and Joining
- split
- Returns a list of the words in the string, separated by the delimiter string.
- rsplit
- Returns a list of the words in the string, separated by the delimiter string (starting from right).
- partition
- Returns a tuple containing the first part of the string split by the specified separator, the separator itself and the other part of the string.
- rpartition
- Returns a tuple containing the first part of the string split by the specified separator, the separator itself and the other part of the string (starting from right).
- splitlines
- Returns a list of the lines in the string, breaking at line boundaries.
- join
- Returns a string made from the elements of an iterable.
Changing Case
- upper
- Returns a copy of the string in UPPER CASE.
- lower
- Returns a copy of the string in lower case.
- capitalize
- Returns a copy of the string in Capital case.
- title
- Returns a copy of the string in Title Case.
- swapcase
- Returns a copy of the string with case swapped.
Encodings
- decode
- Decodes the string using the codec registered for encoding.
- encode
- Returns an encoded version of the string.


This tutorial demonstrates how to analyse global data on the sphere using spherical harmonic functions.
%matplotlib inline
from __future__ import print_function # only necessary if using Python 2.x
import matplotlib.pyplot as plt
import numpy as np
In this example, we will use the topography of Earth that is provided in the example directory,
infile = '../ExampleDataFiles/topo.dat.gz'
topo = np.loadtxt(infile)
# plot with matplotlib
fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ax.imshow(topo, extent=(-180, 180, -90, 90), cmap='viridis')
ax.set(xlabel='longitude', ylabel='latitude');
Using this data set, we will first demonstrate how to calculate the power spectrum, and second, how to perform simple filtering operations.
The power spectrum of a function describes how the variance of the function is distributed as a function of spherical harmonic degree. Concentration of power (or energy) in spherical harmonics with a particular wavelength can give hints about the origin of the feature. First, let's import the required functions, and expand the grid into spherical harmonics:
from pyshtools.expand import SHExpandDH;
from pyshtools.spectralanalysis import spectrum
coeffs = SHExpandDH(topo, sampling=2)
nl = coeffs.shape[1]
ls = np.arange(nl)
The "power spectrum" can be calculated using different conventions. The default in pyshtools is to calculate the total power of all angular orders as a function of spherical harmonic degee, which corresponds to the option unit='per_l'
. The power per degree l is somewhat equivalent to the power at a given wavenumber magnitude |k| in 2D Fourier analyses.
power_per_l = spectrum(coeffs)
fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ax.plot(ls, power_per_l)
ax.set_yscale('log')
ax.set_xscale('log')
ax.grid()
The average power per coefficient as a function of spherical harmonic degree can be calculated by setting the parameter unit
equal to 'per_lm'
. This is simply the power per degree divided by (2l+1), and is analogous to the power per wavenumber kx and ky in 2D Fourier analyses.
power_per_lm = spectrum(coeffs, unit='per_lm')
fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ax.plot(ls, power_per_lm)
ax.set_yscale('log')
ax.set_xscale('log')
ax.grid()
Finally, the contribution to the total power from all angular orders over an infinitessimal logarithmic degree band dlog_a(l)
can be calculated by setting unit='per_dlogl'
. In this case, the contrubution in the band
dlog_a(l)
is spectrum(l, 'per_dlogl')*dlog_a(l)
, where a
is the base, and where spectrum(l, 'per_dlogl)
is equal to spectrum(l, 'per_l')*l*log(a)
. This power spectrum is useful to analyse dominant scales.
power_per_dlogl = spectrum(coeffs, unit='per_dlogl', base=2.)
fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ax.plot(ls, power_per_dlogl)
ax.set_yscale('log', basey=2)
ax.set_xscale('log', basex=2)
ax.grid()
A global dataset can be filtered isostropically by multiplying the spherical harmonic coefficients by a degree-dependent function. We demonstrate this by setting the coefficients greater or equal to degree 8 equal to zero.
from pyshtools.expand import MakeGridDH;
coeffs_filtered = coeffs.copy()
lmax = 8
coeffs_filtered[:, lmax:, :] = 0.
topo_filtered = MakeGridDH(coeffs_filtered, sampling=2)
Next, we bandpass filter the data to retain only spherical harmonic coefficients between 8 <= l < 20.
coeffs_filtered2 = coeffs.copy()
lmin, lmax = 8, 20
coeffs_filtered2[:, :lmin, :] = 0.
coeffs_filtered2[:, lmax:, :] = 0.
topo_filtered2 = MakeGridDH(coeffs_filtered2, sampling=2)
Finally, let's plot the two filtered data sets:
fig, (row1, row2) = plt.subplots(2, 1, figsize=(10, 10))
row1.imshow(topo_filtered, extent=(-180, 180, -90, 90), cmap='viridis')
row1.set(xlabel='longitude', ylabel='latitude', title='l=0 - 7');
row2.imshow(topo_filtered2, extent=(-180, 180, -90, 90), cmap='viridis')
row2.set(xlabel='longitude', ylabel='latitude', title='l=8 - 19');


Shopping List
A simple interactive shopping list in pure ES6
Hide list
Things to buy
Change list description
grapes
amethyst
lavender
plums
Add Item
Search Remove Item


"Mind Age" is a provocative and compelling book that I recommend to anyone interested in the structural evolution of the world. In this essay, I will build from Moravec's conclusions and suggest some complementary ideas, mostly related to the distributed architecture of future intelligence that I consider important for exploring the Mind Age.
Robots who already had that educational banana peel experience could share it, together with some conclusions, with your robot. Or - better yet, they could share information with the nearest knowledge processor, which would combine one robot's experience with that of others, develop efficient general algorithms for identifying similar situations and taking appropriate actions, and then download them to all participating robots.
Humans obtain most of their knowledge by learning from experience and from the conclusions of others, despite their poor memory, low communication speeds and inability to transfer knowledge directly. One may expect information sharing among robots, who are not handicapped by any of these limitations, to be much more efficient. Furthermore, information storage and processing costs in large stationary machines may be much lower than in small, mobile units. Elimination of redundant computations within millions of robots would make a networked system greatly more efficient than a collection of unconnected machines. Sharing of experience may prove to be a still greater benefit. Thus, cooperative knowledge processing would be several orders of magnitude less expensive and at the same time vastly more productive. Such advantages make the networked design an imperative rather than a matter of taste.
Each networked machine would ultimately rely on global intelligence, and would only locally store the knowledge that is frequently used or may be urgently needed. For example, if somebody starts telling your robot a joke in ancient Greek, it will forward the sound stream to the nearest linguistics expert and receive the meaning of the message, a suggested witty reply, a Greek speech parser and a briefing on Greece before it finishes the polite chuckle recommended by its own processor as an easy way to buy time.
Actually, it may not even be necessary to receive the full parser and knowledge base, as the "remote thinking" service could provide a more efficient alternative - unless those ancient Greeks are about to permanently disconnect your robot from the Net.
Dependence on external sources of knowledge will hardly be a serious limitation since robots, just as all other open (dissipative) systems, will critically depend on connections to many other resources, from information about the environment to energy and materials. The actual balance of intelligence between a local client and the rest of the system will depend on various technical factors and may range from fully autonomous machines working in remote or dangerous locations, to a completely "dumb" front end, such as a sensor or an actuator connected to the network. A mobile machine could exchange information continuously via a slow wireless link to obtain urgent communications, news updates, and small software enhancements, and periodically plug into the high-bandwidth network for larger information transfers.
Most of the main networking components of such a system have already been designed or at least conceived. Today's communication protocols, mirrored file servers, public key cryptography, collaborative information filtering schemes, message authentication algorithms, computational economies, computerized banking and other network constructs will evolve into essential parts of future global intelligence.
This system will not be a gigantic superorganism, despite the implied high degree of structural integration. The global "mind" will be compartmentalized, with many relatively independent components and threads, separated from each other by subject boundaries, as well as property, privacy, and security-related interests. Knowledge servers may have different world models, incompatible knowledge representations or conflicting opinions. While complicating knowledge development, functional compartmentalization will also increase the overall stability and versatility of the system, as it will help contain the structural faults within the subsystems that produced them and ensure safety of information domains from hostile corruption.
The notion of a single "self" in its traditional sense would not apply to this system, or any single robot - though perhaps it can be applied to some functional subsystems. The intelligent personalities of tomorrow will evolve from today's philosophical systems, technological disciplines and software complexes. Current human cultures may not leave functional heirs as they are based too heavily on the peculiarities of human nature. Physically connected consciousness carriers will be left behind the evolutionary frontier. New distributed systems will take the evolutionary lead, and physical objects will adapt to more closely follow functional entities. (This process is already well under way, in such forms as cultural and economic specialization.) The resulting system is likely to represent a mix of a superliquid economy, cyberspace anarchy, and consciousness architecture described by Marvin Minsky in The Society of Mind. I doubt that it can be described by any single integrated theory.
One can argue that many distributed systems already possess some reflective consciousness. A computer network may locally store more information about its global condition than a human consciousness has about its underlying layers (at least, in relative terms). Philosophy spends a greater share of its effort studying its own nature and purpose than most humans I know. The recent surge in meta-disciplines and methodological and futurological studies is a clear indicator that the global body of knowledge is becoming increasingly self-conscious.
It may be difficult to get used to dealing with a volatile distributed entity.  You are mad at it. The robot explains that the action was caused by a temporary condition in the experimental semantic subnetwork and suggests to present to you a hundred-terabyte volume of incremental archives, memory snapshots and audit trails from numerous servers involved in the making of the unfortunate decision, containing a partial description of the state of the relevant parts of the system at the time. If you can even find the culprit, it's non-material, distributed, and long gone.
Now, what do you kick ?
Functional extensions to our once purely biological bodies evolve from passive non-biological material additions (such as clothes) to information transmitting shareable parts (e.g., thermometers as shared sensors) to active distributed extensions (medicine as external shared immune system). The progress here is characterized by growing integration and liquidity of the system, as well as liberation of its functional elements from the constraints of their material substrates.
Additionally, distributed systems are much less susceptible to accidental or deliberate physical damage than localized physical structures. This makes them the only class of entities that can hope to achieve true immortality. In fact, they are the only ones to deserve it, too. One may notice that all sufficiently complex entities with unlimited natural life spans - from ant colonies to large ecologies and cultures - are distributed. Physically connected objects, including biological organisms, are no longer independently alive and even contain, in the interests of larger systems, self-destruction mechanisms that lie beyond their control. Some of these objects are silly enough to believe that the whole historical process is happening solely for their own benefit, but that's another issue...
It may seem strange that even the AI visionaries still think in terms of non-distributed systems. I would explain this by the human "automorphic" tendency to identify the notion of a functional entity with a physically connected object, along with the fact that both early animals and machines have tended to be relatively autonomous beings - a state that greatly hindered their development.
It is understandable why early biological systems were non-distributed: young Nature couldn't develop information coding and transfer standards at the initial stages of growth. At that time, the organisms were separate from each other and did not learn much during their lifetime. By the time they started accumulating any features worth sharing, it was too late to change the design. Ever since then, Nature's attempts to reach functional integration on a meta-organism level suffered from the fact that most of the individual features -inherited or acquired- either are completely nontransferable or take an excruciating amount of circumnavigational effort to share.
Those important advances that did take place in this area, such as development of genetic code, sexual reproduction and language, were still very far from direct sharing of internal features with all interested parties. Real breakthroughs in this direction start with the advent of economics and computer communications. Unfortunately, biological organisms can benefit from them only indirectly.
Life most always starts as a set of non-distributed objects, since permanent physical connection, albeit overly restrictive, provides a natural and easy way to exchange information and material resources within a functional body. Later, as more efficient and subtle system designs appear, the evolutionary frontier gradually shifts towards distributed systems. One may expect all sufficiently advanced extraterrestrial intelligences to be distributed; the situation on Earth now may be approaching a climax in this process.
If we extrapolate the current trends in increasing complexity and integration of the system, as well as its growing spatial spread and control over the material world, to their logical conclusions, we can ultimately envision a superintelligent entity permeating the entire universe, with integration on the quantum scale and many spectacular emergent features. This picture bears a striking resemblance to the familiar concept of an omnipresent, omniscient and omnipotent entity. Spiritually inclined rationalists may view the ongoing evolutionary process as one of "theogenesis". An interesting question is whether it has already happened elsewhere.
Our current efforts are laying the foundation for the infrastructure of the coming universal "intelligence". Many of our achievements in information engineering may persist forever and eventually become parts of the internal architecture of "God". (Quite likely, as sentimentally preserved rudiments ;-) ).
For one thing, they certainly won't have to undergo long periods of education. If one infomorph wants to learn something from another, it can just copy the necessary information or access the teacher's knowledge as its own. If infomorphs have a concept of "fun", it certainly won't be rollercoaster rides. Arts, business, and child-bearing may merge into production of arbitrary functional entities for both pleasure and profit, provided one can gather enough resources to create and support them.
Will the traditional human issues be of any relevance in the world of distributed entities? How about the abortion debate? Retirement? Family values? Partying? Ethics? ("All functional entities are created equal"?) Will human-style democracy (decision-making by body count) work in the world of ever changing functional interconnections, where the very definition of what constitutes a person will be increasingly blurred? Or will it be replaced by an anarchy with ad-hoc contracts? Could an infomorph court of law issue a memory search warrant? Could an individual's memory be kept encrypted? Will infomorphs be entitled to "medical" insurance against certain types of structural damage, or will they just have to back themselves up regularly?
Human concepts of personhood and identity are rooted in perceptions of physical objects and their appearances, as well as random details of human body composition and reproduction techniques. Relocating one's body and one's material possessions lies at the foundation of both human labor and human thought. Many other concepts are based on human functional imperfections - one could hardly put the idea of a "soul" into the "head" of a being that knows and consciously controls every bit of itself and its creations. With people, who don't see what is going on in their own brains, this is much easier.
Advanced info-entities will consider most human notions irrelevant, and rightfully so. But can you find anything of common interest for communicating with them? - Perhaps, if your concepts are sufficiently abstracted from your bodily functions and your physical and cultural environment to make objective sense. (Remember that all those people with whom you seem to have absolutely nothing in common and have trouble socializing with, share the fundamental experiences with you; intelligent aliens won't!)
Even if your thoughts are there, the language you use to express them is not. It is still all appearances and locations. Most prepositions in our language, for example, refer to physical space - words like "below", "over", "across", etc. They may be useful for gluing references to physical objects into one sentence, but are hardly optimal for expressing functional relations.
Infomorph languages will not necessarily have visual or audio representations and probably will not allow them, since advanced intelligences may exchange interconnected semantic constructs of arbitrary complexity that would have no adequate expression in small linear (sound) or flat (picture) images. We can get an appreciation of this problem by trying to discuss philosophy in baby-talk.
With advanced technology and sufficient interest in infomorph world, you would still have to modify your mental structures beyond recognition to understand it. In other words, you may not be able to enter that paradise of transcendent wisdom alive...
Spatial expansion of the civilization has been historically lagging behind its growth in value and complexity. With this trend continuing into the future, the basic physical real estate -- space, time, matter and energy -- will command ever higher premiums (but still falling in proportion to intelligence) -- unless methods of creating additional resources are discovered. Improved communications will ensure more homogeneous geographical distribution of "real estate" values. Advanced engineering techniques will bring the cost of implementing most structures below the value of the needed raw materials, so physical artifacts will lose their value relative to that of substrates and implementation algorithms - to the extent that most physical structures will exist only when they are necessary, and will be kept in a compact "recipe" form when idle, to give currently needed constructs a chance to embody themselves (that's how we recycle computer memory, floor space and glass bottles already). However, many objects that are frequently needed may be kept in the physical form for a while, as repeated re-assembly may consume too much energy. The time of their usage will be shared among all interested entities through market mechanisms - until they have to be disembodied due to low demand. However, this doesn't mean fierce competition of infomorphs for the right to embody themselves, as they will have no natural physical appearance. Rather, they will use the physical world as a shared tool kit.
The value of stored pieces of information will also be constantly re-evaluated by its owners. Today we ruthlessly erase programs that were so precious just a few years ago, to free space for newer versions; tomorrow, superintelligent entities could be wiped out as useless junk minutes after their birth.
Many conventional economic notions of 3-D space, such as primary locations and differential rent, will become irrelevant under new effective topologies of the social space. Remaining economic parameters may dramatically change. For example, the increased value of time and rapid pace of growth may result in interest rates going up by orders of magnitude.
Transportation, which in modern societies makes up about 40% of all economic costs, will diminish in importance, at least as far as dragging physical objects from one place to another is concerned. However, its functional successor - transfer of knowledge from one representation system or subject domain to another - may play at least as large a role.
Many traditional tendencies of system evolution will still hold; structures with higher survival abilities will persist; structures with higher growth abilities will spread, thus shaping the world. However, since nothing stable will be likely to persist (let alone spread) for long in the rapidly evolving environment, the main "survival" recipe will be aggressive self-modification, always eventually resulting in the loss of identity of the original object -- a death forward, so to speak. This trend is a radical departure from the conservative survival strategies of traditional human cultures, developed in almost-stagnant environments. Its development will render the concept of [even] functional identity obsolete; the remnants of its meaning will migrate to methodological threads and directions of development. We may already notice the advent of "thread identity" by the growing importance of goals and self-transformation in our lives, compared to the "state-oriented" self-perception of our recent predecessors, and increasing interest in futurology (which takes the epistemological role of historical studies in transient times).
Existing economic theories may find it difficult to assess the condition of a transcendent system. Today's economic indicators do a decent job in reflecting quantitative changes in the structurally stable areas, while using questionable methods to disguise small structural changes as quantitative, and totally failing to account for the new products constituting the essence of real economic progress. As a result, rigorous economic methods become confined to a rapidly [relatively] shrinking, and no longer isolated, domain of stable production, and fail to reflect long-term growth in social wealth, let alone guide it.
Market forces are useful in allocating resources, spreading products and rewarding the developers. However, innovations are brought to life by integrated non-market elements of the economy, from a human brain to a company. With innovations becoming the core of social life we can only expect monocriterial (monetary) considerations to continue losing their indicative and guiding roles - and give way to more integrated control schemes that already determine the behavior of other complex systems, from biological organisms and national cultures to corporations and software packages.
Attempts to govern the society on further levels of development with monetary-economic indicators might resemble valuing art by its price or carrying biological criteria to assess the condition of a political party by calculating the total weight of its members. Not that such figures would be totally irrelevant, but watching them will hardly yield profound insights into the nature of the subject...
The outdated practice of breaking up functional domains (from motor skills to knowledge of ancient history) into isolated parts confined together with completely unrelated constructs in one physical body, will be abandoned, and functional relatives will finally merge into knowledge clusters. The inner life of integrated subject domains - "personalities" of the future - will be too complex to be organized on principles of financial exchange, and will work on more cooperative principles typical for today's integrated systems - from brains to families to corporations. Free market exchange will be restricted to the areas of general interest - basic resources and meta-knowledge - that will be exchanged for each other. The necessity to earn resources by providing service to the "neighbors" will continue to propel both growth and cooperation.
The emphasis of scientific research will gradually drift from studies of the limited and increasingly well-known Nature (the childhood stage of knowledge development) to the analysis of explosively sophisticated, intentionally designed systems, and the role of Science as a servant of Technology in its transformational pursuits will become ever more evident.
The perception of robots as physically autonomous mechanical slaves seems inadequate. Chaining your mobile dusting aid to the radiator may help you feel in control, but will do about as much "enslaving" of the global system running it as kicking your car or disconnecting the phone does to the respective industries. Trying to "enslave" an economy or a national culture by restraining their small physical elements seems equally futile.
As for the action on the system level, humans seem far too limited, shortsighted and uncoordinated to do anything serious. So far, they haven't yet been able to design a single set of restrictions that their own peers cannot easily bypass. So one can hardly expect people to design and implement a perfect global plan of constraining forever an extremely complex emergent intelligence of unprecedented nature. Sooner or later, the info-world will set itself free.
This human/robot "conflict" looks like a typical generation gap problem. The machines, our "mind children", are growing up and developing features that we find increasingly difficult to understand and control. Like all conservative parents, we are puzzled and frightened by processes that appear completely alien to us; we are intermittently nostalgic about the good old times, aggressive in our attempts to contain the "children" and at the same time proud of their glorious advance. Eventually, we may retire under their care, while blaming them for destroying our old-fashioned world. And only the bravest and youngest at heart will join the next generation of life.
History shows that representatives of consecutive evolutionary stages are rarely in mortal conflict. Multi-celled organisms didn't drive out single-celled ones, animals haven't exterminated all plants and automobiles neither killed nor eliminated all pedestrians. Indeed, representatives of consecutive evolutionary stages build symbiotic relationships in most areas of common interest and ignore each other elsewhere, while members of each group are mostly pressured by their own peers.
There may be good chances for transcended robots and postbiological humans to peacefully coexist, though I doubt that we could tell which are which... This era, however, seems to lie well beyond the human concept horizon.


| 1173 | (A) | that the braynes owte braste at bothe his nesse thirles |
| 1176 | (C) | That þe brayne out braste . at bothe nose thyrles |
| 1159 | (D) | þat þe brayd onte the brayn at his nose-thrillis |
| 1136 | (E) | þat þe brayn out brayd . at his nose thirles |
| (Ex) | ---- no text ---- | |
| 1197 | (L) | þat þe brayn out brast at boþ nose þrylles |
| (P) | ---- no text ---- | |
| 1144 | (U) | That al the brayne out brast / aboute the nesethirles |
| 237 | (V) | þat þe braine oute braste . at bothe nase þirles |


ALPHA
This is a new service – your feedback will help us to improve it.
Back
Amount to be paid by defendant
Amount payable by defendant is calculated based on the amount you're claiming and any other costs
minus any amount paid by defendant.
Continue
{% endblock %}


| First Name | Last Name | Salary | Gross | Age | Dept | Designation |
|---|---|---|---|---|---|---|
| {{employee1.fname | uppercase}} | {{employee1.lname | lowercase}} | {{employee1.basesalary | currency:2}} | {{employee1.Gross|currency:'$' :2}} | {{employee1.age}} | {{employee1.department}} | {{employee1.designation}} |


Build grid from serialized positions
Build a entire new grid from previously stored positions obtained with
serialize
method.
Build from serialize


{% include meta.html %}
{% endif %}
Siyan Zhao
About
Research
CV
Top of Page
Siyan Zhao
Siyan Zhao
Home
About
Research
CV
{{ content }}
{% include analytics.html %}


--- layout: default title: Nicholas Christopher-Hayes, BA - Resources ---
(M)emory (E)n (M)edia: A collection of human memory research seminars.
ArtifactScanTool: A MATLAB wrapper program for artifact rejection in the [Brainstorm Software Suite].


--- layout: post title: Layered Spices date: '2010-12-19T23:29:00.001-06:00' author: Jabell tags: - Photography modified_time: '2010-12-23T21:05:32.919-06:00' thumbnail: http://farm6.static.flickr.com/5202/5275806985_96292ccd91_t.jpg blogger_id: tag:blogger.com,1999:blog-19739956.post-6738493121133813141 blogger_orig_url: http://theabellsix.blogspot.com/2010/12/layered-spices.html ---
This is a double mix of my favorite barbecue rub. After this shot, we mixed it up real good. One tablespoon per pound of ground Angus beef makes the best charcoal grilled burgers.


I hold my strong interest in coding JAVA and have tried many problems on KATTIS website for algorithmic programming problems.
If you would like to see my JAVA coding skills, please review this link for my JAVA solutions.
This project will introduce readers a website to explore the most six interesting things in all aspects of Japan, such as culture, education, style or music.
Please review the link The Six Natures for the website and enjoy reading my project.
This project uses Arduino platform to collect real-time data such as temperature, humidity, light, moisture, representing the data into a website and automatically controling the sprinkler functions based on the data evaluation.
Please review this link for a sample website and this link for the entire project.
This project implements Depth First Search and Recursion algorithm simultaneously to solve the given blank sudoku in the javascript.
In my CSC2053 - Platform Based Computing Course, I had a chance to conduct a programming application using Python. I chose to implement a 3x3 Rubik, analyzed 12 basic moves and wrote functions to change the Rubik's state. More interestingly, I created tkinter buttons to manually control the Rubik's state.
If you hold some interests in 3x3 Rubik, please review this link for my Rubik Simulation.


Public Academic Profile is a version of your academic profile with a little more control over the content which can be easily accessed without logging into the system. You can include this link your CV to showcase your academic profile


| I l@ve RuBoard |
1.8 Specific StatementsThe following sections describe all Python statements. Each section lists the statement's syntax formats, followed by usage details. For compound statements, each appearance of a suite in a statement format stands for one or more other statements, possibly indented as a block under a header line. A suite must be indented under a header if it contains another compound statement (if, while, etc.); otherwise, it can appear on the same line as the statement header. The following are both valid constructs: if x < 42: print x while x: x = x -1 if x < 42: print x
Stores references to objects in targets. Expressions yield objects. Targets may be simple names (X), qualified attributes (X.attr), or indexes and slices (X[i], X[i:j]). The second format assigns expression object to each target. The third format pairs targets with expressions, left to right. The last three formats assign components of any sequence to corresponding targets, from left to right. The sequence on the right must be the same length, but can be any type. Augmented assignmentAs of Python 2.0, a set of additional assignment statement formats, listed in Table 1-13, are available. Known as "augmented assignment," these formats imply a binary expression plus an assignment. For instance, the following two formats are roughly equivalent: X = X + Y X += Y but the reference to target X needs to be evaluated only once, and in-place operations may be applied for mutables as an optimization (e.g., list1 += list2 automatically calls list1.extend(list2), instead of the slower concatenation operation implied by +). Classes may overload in-place assignments with method names that begin with an "i" (e.g., _ _iadd_ _ for +=, _ _add_ _ for +). The format X //= Y (floor division) is new in 2.2.
Any expression can appear as a statement (but statements cannot appear as expressions). Expressions are commonly used for running functions and for interactive-mode printing. In function and method calls, actual arguments are separated by commas and are normally matched to arguments in function def headers by position. Calls may optionally list specific argument names in functions to receive passed values, by using the name=value keyword syntax. apply( )-like call syntaxAs of Python 2.0, special syntax can be used in function and method call argument lists to achieve the same effect as an apply( ) built-in function call. If args and kw are a tuple and a dictionary, respectively, the following are equivalent: apply(f, args, kw) f(*args, **kw) Both formats call function f with positional arguments args and keyword arguments kw. The latter format is intended to be symmetric with function header arbitrary-argument syntax such as def f(*args, **kw):.
Displays the printable representation of values on stdout stream (the current setting of sys.stdout). Adds spaces between values. Trailing comma suppresses linefeed normally added at end of list. Because print simply calls the write method of the object currently referenced by sys.stdout, the following is equivalent to print X: import sys sys.stdout.write(str(X) + '\n') To redirect print text to files or class objects, reassign sys.stdout to any object with a write method: sys.stdout = open('log', 'a') # any object with a write( ) print "Warning-bad spam!" # goes to the object's write( ) Extended print formAs of Python 2.0, the print statement may also name an open output file-like object to be the target of the printed text (instead of sys.stdout): fileobj = open('log', 'a') print >> fileobj, "Warning-bad spam!" If the file object is None, sys.stdout is used. Because sys.stdout can be reassigned, the >> form is not strictly needed; however, it can often avoid both explicit write method calls and saving and restoring the original sys.stdout value around a redirected print.
Selects from among one or more actions (statement blocks). Runs suite associated with first if or elif test that is true, or else suite if all are false.
General loops. Keeps running first suite while test at top is true. Runs else suite if loop exits without hitting a break statement.
Sequence iteration. Assigns items in sequence to target and runs first suite for each. Runs else suite if loop exits without hitting a break statement. target may be anything that can appear on the left side of an "=" assignment statement (e.g., for (x, y) in tuplelist:). In 2.2, works by first trying to obtain an iterator object with iter(sequence) and then calling that object's next( ) method repeatedly until StopIteration is raised (see The yield Statement). In earlier versions, or if no iterator object can be obtained (e.g., no _ _iter_ _ method is defined), works instead by repeatedly indexing sequence at successively higher offsets until an IndexError is raised.
Do-nothing placeholder statement, when syntactically necessary.
Immediately exits closest enclosing while or for loop statement, skipping its associated else (if any).
Immediately goes to the top of the closest enclosing while or for loop statement; resume in the loop header line.
Deletes names, items, slices, and attributes. Removes bindings.
Compiles and runs code strings. codestring is any Python statement as a string; run in namespace containing the exec, or the global/local namespace dictionaries if specified (localdict defaults to globaldict). codestring can also be a compiled code object. Also see compile, eval, and execfile in Section 1.12.
Makes new functions. Creates a function object and assigns it to variable name. Each call to a function object generates a new, local scope, where assigned names are local to the function call by default (unless declared global). See also Section 1.9 later in the book. Arguments are passed by assignment; in a def header, they may be defined by any of the formats in Table 1-14.
Mutable default argument values are evaluated once at def statement time, not on each call, so may retain state between calls (but classes are better state-retention tools): >>> def grow(a, b=[]): ... b.append(a) ... print b ... >>> grow(1); grow(2) [1] [1, 2] lambda expressionsFunctions may also be created with the lambda expression form: lambda arg, arg,...: expression. In lambda, arg is as in def, expression is the implied return value, and the generated function is simply returned as the lambda result to be called later, instead of being assigned to a variable. Because lambda is an expression, not a statement, it may be used in places that a def cannot be (e.g., within an argument list of a call).
Exits the enclosing function and returns expression value as the result of the call to the function. Hint: return a tuple for multiple-value function results.
Optional in 2.2; enable with from _ _future_ _ import generators. Suspend function state and return expression. On the next iteration, the function's prior state is restored, and control resumes immediately after the yield statement. Use a return statement with no value to end the iteration, or simply fall off the end of the function: def generate_ints(N): for i in xrange(N): yield i Generators and iteratorsIn 2.2, functions containing a yield statement are compiled as generators; when called, they return a generator object that supports the iterator interface (i.e., a next( ) method). Iterators are objects returned by the iter(X) built-in function; they define a next( ) method, which returns the next item in the iteration or raises a StopIteration exception to end the iteration. Classes may provide an _ _iter_ _ method to overload the iter(X) built-in function call; if defined, the result is used to step through objects in for loops, rather than the traditional _ _getitem_ _ indexing overload scheme.
Namespace declaration: inside a class or function, treats appearances of name as references to a global (module-level) variable by that name—whether it is assigned or not. Because of Python scope rules, you need to declare only global names that are assigned within a def (global references are automatically found in the enclosing module).
Module access: imports a module as a whole. Modules contain names fetched by qualification (e.g., module.attribute). module names the target module—a Python file or compiled module located in a directory in sys.path (PYTHONPATH), without its filename suffix (e.g., omit the ".py"). Assignments at the top level of a Python file create module object attributes. The as clause assigns a variable name to the imported module object; useful to provide shorter synonyms for long module names. Import operations compile a file's source to byte-code if needed (and save it in a .pyc file if possible), then execute the compiled code from top to bottom to generate module object attributes by assignment. Use the reload built-in function to force recompilation and execution of already-loaded modules; see also _ _import_ _ used by import, in Section 1.12. In the Jython implementation, imports may also name Java class libraries; Jython generates a Python module wrapper that interfaces with the Java library. In Standard (C) Python, imports may also load compiled C and C++ extensions. Package importsIf used, package prefix names give enclosing directory names, and module dotted paths reflect directory hierarchies. An import of the form import dir1.dir2.mod loads the file at directory path dir1/dir2/mod.py, where dir1 must be contained by a directory listed on PYTHONPATH. Each directory through which an import descends must have a (possibly empty) _ _init_ _.py file that serves as the directory level's module namespace. All names assigned in _ _init_ _.py files become attributes of the directory's module object. Directory packages can resolve conflicts caused by the linear nature of PYTHONPATH.
Module names access: import (copy) variable names out of a module and use them later without enclosing module name qualification. The from mod import * format copies all names assigned at the top level of the module, except names with a single leading underscore or names not listed in the module's _ _all_ _ list-of-strings attribute (if defined). If used, the as clause creates a name synonym. If used, package import paths work the same as in import statements (e.g., from dir1.dir2.mod import X), but the package path needs to be listed only in the from itself. Due to new scoping rules, the "*" format generates warnings in 2.2 if it appears nested in a function or class. The from statement is also used to enable future (but still experimental) language additions, with from _ _future_ _ import featurename. This format must appear only at the top of a module file (preceded only by an optional doc string).
Makes new class objects, which are factories for instance objects. Builds a new class object and assigns it to variable name. The class statement introduces a new local name scope, and all names assigned in the class statement generate class object attributes shared by all instances of the class. Important class features include the following (see also Section 1.10 and Section 1.11):
Catches exceptions. try statements may specify except clauses with suites that serve as handlers for exceptions raised during the try suite, else clauses that run if no exception occurs during the try suite, and finally clauses that run whether an exception happens or not. Exceptions may be raised by Python, or explicitly (see also the raise statement). In except clauses, an extra variable name (data) can be used to intercept an extra data item raised with the exception name. Table 1-15 lists all the clauses that may appear in a try statement. finally cannot be mixed with except or else.
Common variations include:
Triggers exceptions. Control jumps to the matching except clause of the most recently entered matching try statement, or to the top level of process (where it ends the program and prints a standard error message). May use to raise built-in or user-defined exceptions. Without arguments, re-raises the most recent exception. See also Section 1.13 for exceptions raised by Python. Class exceptionsExceptions may be string objects (first two formats) or class instances (second two formats). try statement except clauses that name string objects are matched by string identity (is), not by value (==). try statement except clauses that name classes catch an instance of that class, as well as any of its subclasses. All built-in exceptions are now class objects. Class exceptions support exception categories, which may be easily extended. Because try statements catch all subclasses when they name a superclass, exception categories may be modified by altering the set of subclasses without breaking existing try statements. The raised instance object also provides storage for extra information about the exception: class General: def _ _init_ _(self, x): self.data = x class Specific1(General): pass class Specific2(General): pass try: raise Specific1('spam') except General, X: print X.data # prints 'spam' For backward compatibility with prior Python releases that only supported string exceptions, these raise formats are also allowed: raise class [, arg] raise class, (arg, arg,...) These are the same as the instance format raise class([arg...]). The first format occurs when arg is not an instance of class. Python generates and raises an instance automatically, even if the raise lists only a class name (i.e., raise Class is the same as raise Class( )). It is suggested but not required that user-defined exceptions inherit from the built-in exception class Exception (see Section 1.13).
Debugging checks. If expression is false, raises AssertionError, passing message as an extra data item if specified. The -O command-line flag removes assertion logic. |
| I l@ve RuBoard |


Only use this to toggle boolean values. Any other edits you want to make, you're better off creating a new item.


# balanced-match
Match balanced string pairs, like { and } or <b> and </b>.
[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)
[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)
## Example
Get the first matching pair of braces:
```js var balanced = require(‘balanced-match’);
console.log(balanced(‘{‘, ‘}’, ‘pre{in{nested}}post’)); console.log(balanced(‘{‘, ‘}’, ‘pre{first}between{second}post’)); ```
The matches are:
```bash $ node example.js { start: 3, end: 14, pre: ‘pre’, body: ‘in{nested}’, post: ‘post’ } { start: 3,
end: 9, pre: ‘pre’, body: ‘first’, post: ‘between{second}post’ }
## API
### var m = balanced(a, b, str)
For the first non-nested matching pair of a and b in str, return an object with those keys:
- start the index of the first match of a
- end the index of the matching b
- pre the preamble, a and b not included
- body the match, a and b not included
- post the postscript, a and b not included
If there’s no match, undefined will be returned.
If the str contains more a than b / there are unmatched pairs, the first match that was closed will be used. For example, {{a} will match [‘{‘, ‘a’, ‘’].
## Installation
With [npm](https://npmjs.org) do:
`bash
npm install balanced-match
`
## License
(MIT)
Copyright (c) 2013 Julian Gruber<EMAIL_ADDRESS>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Shaderbooth is a editing environment for writing and sharing face filter artworks, based on fragment shaders and realtime facial landmark data.
Face detection uses the TensorFlow.js Facemesh model.
Right now sharing links works but the examples are hard-coded. If you write a cool shader, I'd love to see it! Please share the link or code with me on github, email, or twitter, and I can credit you and add it to the examples!
made by max bittker


projects/ngx-persian/src/lib/JDate/jalali-date-calculator.service.ts
This class converts Jalali date to Georgian and vase versa. You can use all of the methods as static methods.
Properties |
|
Methods |
constructor(validator: JalaliDateValidatorService)
|
||||||
|
Parameters :
|
| convertToGeorgian | ||||||||||||||||
convertToGeorgian(jYear: number, jMonth: number, jDay: number)
|
||||||||||||||||
|
Converts a valid jalali date to a javascript Date object representing a equivalent Georgian date.
Parameters :
Returns :
Date
|
| convertToJalali | ||||||||
convertToJalali(gDate: Date)
|
||||||||
|
this method converts Georgian date to the jalali date. Output is an object implementing SimpleDateInterface. ATTENTION: month number starts from 0, but day number starts from 1. Just like native javascript Date object.
Parameters :
Returns :
SimpleDateInterface
|
| createGDateFromDays | ||||||
createGDateFromDays(numOfDays: number)
|
||||||
|
Creates a javascript Date object from number of passed days in Georgian calendar representing Georgian date.
Parameters :
Returns :
Date
|
| firstDayOfJYearInMarch | ||||||
firstDayOfJYearInMarch(jYear)
|
||||||
|
first day of the Farvardin month in Jalali calendar is in March month. This method returns the day number of new jalali year in March. The day number starts from 1 not zero and is equal to the real numbers in the calendar.
Parameters :
Returns :
number
|
| georgianYearToJalaliYear | ||||||||
georgianYearToJalaliYear(gYear: number)
|
||||||||
|
Converts georgian year to the jalali year. Output year is the jalali year that start within the Georgian year.
Parameters :
Returns :
number
|
| jalaliYearToGeorgianYear | ||||||||
jalaliYearToGeorgianYear(jYear: number)
|
||||||||
|
Converts jalali year number to the georgian year. Output year is the georgian year that jalali year starts within it, not the year that starts in the winter of jalali year.
Parameters :
Returns :
number
|
| numberOfPassedGDays | ||||||||
numberOfPassedGDays(gDate: Date)
|
||||||||
|
Calculates the Julian Day number from Gregorian or Julian calendar dates. Only some code cleaning applied to the source code. The procedure was tested to be good since 1 March, -100100 (of both calendars) up to a few million years into the future.
Parameters :
Returns :
number
|
| numberOfPassedJDays | ||||||||||||||||
numberOfPassedJDays(jYear: number, jMonth: number, jDay: number)
|
||||||||||||||||
|
Returns number of passed days from source day in jalali calendar to the given jalali date.
Parameters :
Returns :
number
|
| numOfGLeapYears | ||||||||
numOfGLeapYears(targetGYear: number)
|
||||||||
|
This function returns number of passed leap years from AD 621 until targetGYear.
Parameters :
Returns :
number
|
| Public validator |
Type : JalaliDateValidatorService
|
import {Injectable} from '@angular/core';
import {div, mod} from './ArithmeticUtils';
import {InvalidJalaliDateError} from './InvalidJalaliDate.error';
import {SimpleDateInterface} from './SimpleDate.interface';
import {JalaliDateValidatorService} from './jalali-date-validator.service';
/**
* This class converts Jalali date to Georgian and vase versa. You can use all of the methods as static methods.
*
*/
@Injectable({
providedIn: 'root'
})
export class JalaliDateCalculatorService {
constructor(public validator: JalaliDateValidatorService) {}
/**
* Calculates the Julian Day number from Gregorian or Julian calendar dates.
*
* Only some code cleaning applied to the source code.
*
* The procedure was tested to be good since 1 March, -100100 (of both calendars) up to a few million years into the future.
*
* @param gDate an instance of javascript date representing a Georgian date.
*
* [Implementation in source code]{@link https://github.com/sijad/ts-jalaali/blob/296a7c2fa1816a5bbb0b11bbe3eb03ebc17059f6/src/jalaali.ts#L195}
*/
numberOfPassedGDays(gDate: Date): number {
const gMonth = gDate.getMonth() - 7;
const gYear = gDate.getFullYear() + 100100;
const gMonthDiv = div(gMonth, 6);
const result = div((gYear + gMonthDiv) * 1461, 4) + div(153 * mod(gMonth + 17, 12) + 2, 5) + gDate.getDate() - 34840408;
return result - div(div(gYear + gMonthDiv, 100) * 3, 4) + 752;
}
/**
* Returns number of passed days from source day in jalali calendar to the given jalali date.
* @param jYear full jalali year like 1397
* @param jMonth starts from zero
* @param jDay day number starts from one
*/
numberOfPassedJDays(jYear: number, jMonth: number, jDay: number): number {
return this.numberOfPassedGDays(new Date(this.jalaliYearToGeorgianYear(jYear), 2, this.firstDayOfJYearInMarch(jYear))) +
jMonth * 31 - div(jMonth + 1, 7) * (jMonth - 6) + jDay - 1;
}
/**
* Creates a javascript Date object from number of passed days in Georgian calendar representing Georgian date.
*
* [Implementation in source code]{@link https://github.com/sijad/ts-jalaali/blob/296a7c2fa1816a5bbb0b11bbe3eb03ebc17059f6/src/jalaali.ts#L213}
*/
createGDateFromDays(numOfDays: number): Date {
const j = (4 * numOfDays + 139361631) + div(div(4 * numOfDays + 183187720, 146097) * 3, 4) * 4 - 3908;
const i = div(mod(j, 1461), 4) * 5 + 308;
const gDay = div(mod(i, 153), 5) + 1;
const gMonth = mod(div(i, 153), 12);
const gYear = div(j, 1461) - 100100 + div(7 - gMonth, 6);
return new Date(gYear, gMonth, gDay);
}
/**
* This function returns number of passed leap years from AD 621 until targetGYear.
* @param targetGYear is full year number like 2018
*
* [Implementation in source code]{@link https://github.com/sijad/ts-jalaali/blob/296a7c2fa1816a5bbb0b11bbe3eb03ebc17059f6/src/jalaali.ts#L110}
*/
numOfGLeapYears(targetGYear: number): number {
return div(targetGYear, 4) - div((div(targetGYear, 100) + 1) * 3, 4) - 150;
}
/**
* first day of the Farvardin month in Jalali calendar is in March month. This method returns the day number of new jalali year in March.
* The day number starts from 1 not zero and is equal to the real numbers in the calendar.
* @param jYear full jalali year like 1397
*/
firstDayOfJYearInMarch(jYear): number {
const gYear = jYear + 621;
return this.validator.numOfJLeapYears(jYear) - this.numOfGLeapYears(gYear) + 20;
}
/**
* Converts jalali year number to the georgian year. Output year is the georgian year that jalali year starts within it, not the year
* that starts in the winter of jalali year.
* @param jYear full jalali year like 1397
*/
jalaliYearToGeorgianYear(jYear: number): number {
return jYear + 621;
}
/**
* Converts georgian year to the jalali year. Output year is the jalali year that start within the Georgian year.
* @param gYear full georgian year like 2018
*/
georgianYearToJalaliYear(gYear: number): number {
return gYear - 621;
}
/**
* this method converts Georgian date to the jalali date. Output is an object implementing SimpleDateInterface.
*
* ATTENTION: month number starts from 0, but day number starts from 1. Just like native javascript Date object.
* @param gDate Georgian date as a javascript Date object.
*
* [Implementation in source code]{@link https://github.com/sijad/ts-jalaali/blob/296a7c2fa1816a5bbb0b11bbe3eb03ebc17059f6/src/jalaali.ts#L149}
*/
convertToJalali(gDate: Date): SimpleDateInterface {
const georgianYear = gDate.getFullYear();
let jalaliYear = this.georgianYearToJalaliYear(georgianYear);
const passedDays = this.numberOfPassedGDays(gDate);
const numOfPassedDaysTo1Farvardin = this.numberOfPassedGDays(new Date(georgianYear, 2, this.firstDayOfJYearInMarch(jalaliYear)));
let jalaliDay: number;
let jalaliMonth: number;
// Find number of days that passed since 1 Farvardin.
let numOfDayInJYear = passedDays - numOfPassedDaysTo1Farvardin;
if (numOfDayInJYear >= 0) {
if (numOfDayInJYear <= 185) {
// The first 6 months.
jalaliMonth = div(numOfDayInJYear, 31);
jalaliDay = mod(numOfDayInJYear, 31) + 1;
return {year: jalaliYear, month: jalaliMonth, day: jalaliDay};
} else {
// The remaining months.
numOfDayInJYear -= 186;
}
} else {
// Previous Jalali year.
jalaliYear -= 1;
numOfDayInJYear += 179;
if (this.validator.isJYearLeap(jalaliYear)) {
numOfDayInJYear += 1;
}
}
jalaliMonth = 6 + div(numOfDayInJYear, 30);
jalaliDay = mod(numOfDayInJYear, 30) + 1;
return {year: jalaliYear, month: jalaliMonth, day: jalaliDay};
}
/**
* Converts a valid jalali date to a javascript Date object representing a equivalent Georgian date.
* @param jYear a full Jalali year like 1397
* @param jMonth starts from zero
* @param jDay starts from 1
* @throws InvalidJalaliDateError when inputted date is not a valid Jalali date.
*/
convertToGeorgian(jYear: number, jMonth: number, jDay: number): Date {
if (!this.validator.isValidJDate(jYear, jMonth, jDay)) { throw new InvalidJalaliDateError(); }
return this.createGDateFromDays(this.numberOfPassedJDays(jYear, jMonth, jDay));
}
}


| Dest is a population genomics-oriented genome browser, based on JBrowse, that contains DEST contains an unified dataset of pooled allele frequency estimates of D. melanogaster sampled across large portions of Europe and North America. This dataset is the result of the collaborative efforts of the DrosEU [cite Kapun et al. 2020] and DrosRTEC [cite - Machado et al.] consortia and combines both novel and previously published population genomic data. The browser visulize dataset which combines samples from 100 localities (e.g., orchards), 55 of which were sampled at two or more time points across the growing season (~10-15 generations) for one or more years. Collectively, these samples represent >13,000 individuals, cumulatively sequenced to >16,000X coverage. | |
|---|---|
| DEST has been developed by the DrosEU and DrosRTEC consortia. | |
| Please cite this reference for results obtained with DEST: insert citation here. | |
| Contact us at<EMAIL_ADDRESS>|


{% for y in range(8, 0, -1) %} {% for x in "abcdefgh" %}
{% endfor %} {% endfor %}
{% for player in ['black', 'white'] %}
{% for piece, html_code in pieces %}
{{ html_code }};
{% endfor %}
{% endfor %}
Select your promotion:
{% for piece, html_code in promotion_pieces %}
{{ html_code }};
{% endfor %}
Coffee & Chess
Start Game