Hi,
after I have now finished building my emoncms-monitoring-house-automation on a W7-PC, I am thinking about migrating the whole stuff to an less power needing RaspberryPi.
I intend to use the model B+ with a 1,8"HDD. perhaps the new RaspberryPi 2 (I ordered one just right now).
The main question for me is, whether I have the same scope on the RasPi-emoncms as on my windows-emoncms.
What do I need:
- the json-interface to receive actual values over ethernet from my data-providing stations
- storing feeds on the HDD
- using my existing dashboards with the whole range of the existing, and some modified widgets
regards/brutzler
Re: migrate emoncms from windows to raspberry
You should have no issues running a full emoncms install on a Pi with a hdd, in fact although I can't think of any platform specific feature pro's or con's I do think there are more "linux" users than windows users so support and dev can be a little easier to find.
You should also be able to transport your existing database if you want to, I know this is possible linux to linux and I don't think the sql is any different if you use the export/import in phpmyadmin. You may need to "tinker" with the database if there are any windows specific addresses within the data maybe.
Paul
Re: migrate emoncms from windows to raspberry
Hi,
just got my new RasPi-2 :-)
Now going to setup the stuff.
I am discussing with my self, what is the best way to go.
- Taking a standard wheezy and setup the sql-stuff, like i did on my Windows-7-PC
- Using an image from emoncms
I think, it would be better for me, to take the first choice. Because I do not need emonhub & co. I only want to use the RasPi for collecting my datas and show them. (like I described in the first post).
Re: migrate emoncms from windows to raspberry
How are you powering the hdd? the Pi B+ and Pi 2 have new power management that can provide 1.2A but is limited in settings to 600mA.
If you intend running a small HDD direct from a Pi 2 or B+ run this command (one line)
to add a "max_usb_current=1" option to "/boot/config.txt" that will get picked up next restart.
The easiest way to set up a Pi HDD is to put the Raspbian OS image on BOTH an sd and the hdd, boot up on the sd and then edit the hdd to prepare it to boot to, so first you need to give the hdd a unique uuid and then mount the hdd
then edit the hdd's fstab
change " /dev/mmcblk0p2 " to " /dev/sda2 " and Ctrl+x, y, enter,
while we are here just edit the inittab (this step is only required if you're intending to use rfm2pi or serial port)
edit the very last line by adding a hash so it reads " # T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 "
edit the cmdline.txt and reboot (the next 2 lines are 1 line wrapped, be sure it is entered as 1 line "sudo" to "txt'")
Then if you want you can use the script I use to install full emoncms (I haven't tried it wit Pi2 yet but see no reason it shouldn't work) with this one liner
It takes about 20mins on a B+ but it needs no interaction, you can get on with something else and leave it to to it. So that it can create the emoncms SQL tables without interaction mySQL is installed without a root password so you must create a root password for mySQL and change user Pi password asap when it's done.
It's work in progress and would love to hear how it goes if you do.
Paul
Re: migrate emoncms from windows to raspberry
Hi,
thx for the detailed explanation.
Its hard stuff for a linux noob. But I will try my best. (and have some questions...)
power management:
I applied a 1,8" 20GB HDD. My USB-doctor is measuring: current < 0,45A on writing data :-)
The easiest way to set up a Pi HDD is to put the Raspbian OS image on BOTH an sd and the hdd
Hmmm.... Just asking me....why this?
I know, that the PI only can boot from the SD. What is the reason for putting the OS on the HDD?
I thought that the normal way is to put the OS on the SD, mount the HDD and put the whole emoncms-stuff on the HDD.
Put the OS on HDD:
How? The same way as on the SD-Card? Copy the same image (using win32diskimager in my case) onto the HDD?
Isn't this a problem, if I once make an update of the OS with "sudo apt-get update" or similiar?
Then I have different OS on SD<->HDD. And which one do I update?
But I think my main-problem is, that I do not completely understand how the Pi is working with SD and HDD together, when using your way.
In my own words: (pls correct me if wrong)
On the SD there are two partitions:
/dev/mmcblk0p1 8192<PHONE_NUMBER>4 c W95 FAT32 (LBA)
/dev/mmcblk0p2<PHONE_NUMBER>511 3810816 83 Linux
The first one, I can even read out with Windows.
Is this the partition where the Pi starts booting?
On the second one there is the whole linux-stuff.
With your change of the cmdline.txt, you want to force the system to switch from SD to HDD? And this is only possible, because on the second partition of the HDD "/dev/sda2" there is the same as on "/dev/mmcblk0p2"
And when I put the raspian image on the HDD, there will also be a first partition (/dev/sda1) like as the SD-card, but this partition is of no use
edit: aahhh, i have seen, that the files, that are on the first partition are visible under linux in the folder /boot. Good to know. Means I can make changes here from my Windows-PC
Your command for editing the cmdline.txt
sudo sh -c 'echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait" > /boot/cmdline.txt'
default cmdline.txt: what about the "console=ttyAMA0,115200?
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
sudo tune2fs -U random -L hdd /dev/sda2sudo mkdir /media/hdd
This are two commands? (sorry for this silly question)
regards/brutzler
EDIT:
tried the stuff with "OS on HDD"
- How can I expand /dev/sda2 ? Because of writing the image to the HDD, there is only 4GB used.
- sudo raspi-config -> expand filesystem failed, because of being no SD-card.
Can I resize an active partition? Or do I have to turn back, boot completely from sd-card, unmount sda2, resize sda2, mount it, and make changes in cmdline.txt again?
Re: migrate emoncms from windows to raspberry
The HDD draws the most during startup firstly spinning up to speed and then whilst thrashing about through the booting up, which is also when the Pi needs more power. a settled HDD writing a stream of data to one block after another will be drawing minimal current. The Pi B had less to offer and wasn't as regulated but the B+ has a better supply but it is restricted to offer better protection.
If your HDD spins up and works okay, great but if you find it keeps starting and stopping at boot it will be lack of power. the same HDD I used with an original B without problem, wouldn't run on a B+ but since getting the Pi 2 and researching it due to experiencing the same power cylcling i have set both the B+ and the Pi 2 to 1.2A and the HDD will run on any off them.
I don't know what mine draws but it's spec'd at 1A during spin up. And I can run a Pi 2, hdd, wifi dongle and rfm2pi without a usb hub without any problems off one supply to the Pi .
With regard to how to use the HDD, you could just have the OS on the sd card and just use the hdd for data I suppose but I don't see any benifit. I wouldn't concider spliting the filesystem over both either use the SD card and hdd for data or just use the hdd for all. The hdd is running anyway and is more reliable than the sd card. By keeping a 2nd redundant copy of the OS on the sd card if you do something that locks you out of the hdd you can change the cmdline.txt in a pc and boot to the sd card and access/investigate the HDD from the card. You can also make back up images of your hdd image from the sd card.
You do not have to keep the 8gb sd card in the Pi though I have a pi that boots to hdd using an old 64MB nokia sd card .
Once you are running on the hdd it can be updated identically to the sd card via apt-get, the only difference is the media the OS is installed to the OS is still exactly the same except for the location refs ie /dev/sda2 rather than /dev/mmcblk0p2. Yes the 2 OS's will get "out of sync" because you will only install SW to the hdd and the sd won't get updated, you can of course run apt-get update/upgrade on the sd card anytime then the OS's will be identical minus the additional software you have installed eg emoncms.
The 1st partition on the hdd will be totally redundant and never used or updated but that doesn't matter it's only 58MB you can delete it if you want but then your file system will be on sda1 not sda2 so you will need to change the refs in fstab and cmdline.txt, it really isn't necessary but if you want I can walk you through that later
Yes you can use win32diskimager to put the image on the hdd exactly as you would the sd card.
"console=ttyAMA0,115200" is removed from the comline,txt to free up the serial port, essential if you were wanting to use the serial port eg for a rfm2pi but as you're not you can leave it in if you prefer, if you have no preference I would stick with the guide as future support will probably assume the serial port is available as that is the OEM norm. The important part is to change /dev/mmcblk0p2 to /dev/sda2.
Yes those are 2 seperate commands that have some how ended up on the same line during a cut and paste, sorry about that
will name the partition "hdd" and give it its own UUID (Universally Unique ID) quite amusing name really since almost everyone uses the Raspbian OS image and then other images get made from that passing the same UUID from image to image so half the planet are using the same unique id.
just creates a directory and mounts the hdd as part of the sd cards filesytem so you can edit the fstab etc.
Paul
Re: migrate emoncms from windows to raspberry
OK,
understood all !
Now only the "problem" with the resize of the sda2-partition.
I tried out of Pi with "MiniTool Partition Wizard" on my W7-PC.
I see there is ~16GB space after the 4GB hdd(EXT4)-partition. But I can not resize it. Looks like this is blocked.
I do not dare to install emoncms before i resize the hdd!
Re: migrate emoncms from windows to raspberry
Ahh you've edited since I started writing.
No you can do everything from the hdd once you have booted to it. you can use fdisk to increase the size of the partition and use "sudo resize2fs" to expand the file system into the larger partition.
bigger isn't always better so don't rush into expanding the partition as big as you can. if you keep it small its easier to create a restore image and if you decide to add other partitions for other things you'll have room to do so, eg a partition to store just data or a partition to store backup images etc. you can always make the partition larger if you need more room but if the data and files get spread out across the partition it may not be easy to reduce to fit in something else.
I would recommend getting rid of "wolfram-engine" and "sonic-pi" IF you are not going to use them, this will free up 520MB which means you can add emoncms and all it's associated software and end up with a smaller image than you started.
If you create a data partition on the hdd and mount it as ~/emonData and use my script to instal emoncms all the data files including mySQL will be on that partition, which means you can easily back-up data and image separately and more importantly if you decide to reinstall the OS and emoncms etc down the line all your dashboards and data etc will be ther for the new emoncms to find.
Re: migrate emoncms from windows to raspberry
If I were you I would add a data partition half way along the hdd, use fdisk and start the new partition 1/2 way but only make it a couple of gigs. this way you have left room to increase sda2(the filesystem) if needed later and you also have room to increase the new sda3 (data) and/or add another partition later.
EDIT - These are just my preferences. there isn't really a single right way, so don't feel you must do it this way, if you prefer one big partition that will work equally well it's just about options really and once you allocate all the space it's gone (well, it's not so easy to get back at least)
Re: migrate emoncms from windows to raspberry
OK
You mean like this (I have a 20GB HDD):
0 - 56MB: boot (sda1)
56-4GB: hdd (sda2)
4GB...10GB: space to extend sda2
10GB - 12GB: data (sda3)
12GB...20GB; space for extend data, or make something different.
I would recommend getting rid of "wolfram-engine" and "sonic-pi"
Found this:
- sudo apt-get purge minecraft-pi wolfram-engine sonic-pi scratch -y
- sudo apt-get autoremove -y
Re: migrate emoncms from windows to raspberry
Spot on!
However fdisk isn't the friendliest of utilities, its easy to use in that its logical and clear BUt it doesn't talk MB's and GB's to be prepared to do some maths, That's why I used the terms I did the start point is half way between the start and the end regardless of unit of measure and about 2 gig is about half of about 4gig when you print the table and can see the size of sda2 and the total size of sda you can enter the "clusters". there is a proper calc I have it here some where but it's not that important.
and yes apt-get purge should clear all refs so not sure about the second line.
Re: migrate emoncms from windows to raspberry
Hi,
have ~590 MB more free space.
Now your script is running.
Shit:
If you create a data partition on the hdd and mount it as ~/emonData and use my script to instal emoncms all the data files including mySQL will be on that partition
Didn't read your post properly. Forgot to make the data partition before starting the script.
--> Start from beginning (Raspian-Image on HDD) or only make the data-partition and restart your script?
EDIT:
script done:
--> One Error:
ERROR: problem running ufw-init
But it doesn't look bad.
With http://"Raspi-ip"/emoncms/ i get the login screen
....going to bed now. 2:30 AM
Re: migrate emoncms from windows to raspberry
You don't need to start again, once it has installed and it's working you can create the data partition and temporarily mount it as some thing else eg "tempData" copy everything in emonData to tempData. unmount tempData and remount it as emonData.
Paul
Re: migrate emoncms from windows to raspberry
Ok,
only one question to the place of the folder:
After installing emoncms with your script, I got the folder: /home/pi/emonData. In this there is
- mysql
- phpfina
- phpfiwa
- phptimeseries
Then I made a new partition, formatted with ext4, and mounted in a parallel-folder
pi@raspberrypi ~ $ ls
dev-emoncms emonData python_games
pi@raspberrypi ~ $ sudo mkdir /home/pi/tempData
pi@raspberrypi ~ $ ls
dev-emoncms emonData python_games tempData
pi@raspberrypi ~ $ sudo mount /dev/sda3 /home/pi/tempData
Is this OK so far?
And another question?
Where is the emoncms-software?
On windows I am used to find it in the wamp-folder: C:\wamp\www\emoncms
the mysql-folder is not accessible
pi@raspberrypi ~/emonData $ cd mysql
-bash: cd: mysql: Permission denied
And on copying with WinSCP I can not copy the mysql-folder too. (I wanted to copy the emonData to my lokal disk, and copy back to tempData, as you described)
Re: migrate emoncms from windows to raspberry
pi doesn't have access to mySQL you would need to use sudo.
make a not of the permissions for emonData (incase something get altered it will be easy to compare)
ls -la ~/emonData
make a copy of the data files (just in case)
sudo cp ~emonData ~/emonBAK
move the data files to the partition
sudo mv ~/emonData ~/emonTemp
unmount emonTemp
sudo umount ~/emonTemp
remount as emonData and check permissions again
sudo mkdir ~/emonData
sudo mount /dev/sda3 ~/emonData
ls -la ~/emonData
you should have the same output as before, if you do try emoncms and if all is well delete both ~/emonTemp and ~/emonBAK
Paul
Re: migrate emoncms from windows to raspberry
Hi,
thx. tried and..... have some notes:
sudo cp ~emonData ~/emonBAK -> sudo cp -r ~/emonData ~/emonBAK (Only this worked for me)
I mounted /dev/sda3 to /home/pi/tempData. Guess its the same as: ~/tempData
With this: sudo mv ~/emonData ~/tempData I only get a subfolder: ~/tempData/emonData
To get to my aim,I copied the subfolders from emonData seperately:
sudo mv ~/emonData/mysql ~/tempData/mysql
...
...
The rest looks like it worked.
Checking permission rights:
pi@raspberrypi ~ $ ls -la ~/emonData
total 40
drwxr-xr-x 7 root root 4096 Feb 16 17:20 .
drwxr-xr-x 7 pi pi 4096 Feb 16 17:22 ..
drwx------ 2 root root 16384 Feb 16 14:27 lost+found
drwx------ 5 mysql mysql 4096 Feb 16 14:22 mysql
drwxr-xr-x 2 www-data root 4096 Feb 16 01:19 phpfina
drwxr-xr-x 2 www-data root 4096 Feb 16 01:19 phpfiwa
drwxr-xr-x 2 www-data root 4096 Feb 16 01:19 phptimeseries
the same (when we talk about the 'drwxr-xr-x') What does the number behind this coloumn tell us?
Re: migrate emoncms from windows to raspberry
"sudo cp ~emonData ~/emonBAK -> sudo cp -r ~/emonData ~/emonBAK (Only this worked for me)"
okay, thats because the emonBAK folder didn't exist
"With this: sudo mv ~/emonData ~/tempData I only get a subfolder: ~/tempData/emonData"
try sudo mv ~/emonData/* ~/tempData adding the " /* " should just move the contents not the folder
Paul
Re: migrate emoncms from windows to raspberry
sudo mount /dev/sda3 ~/emonData
This is only temporarely. After reboot the /emonData-directory is empty. I have to mount again, to see mysql and the php*
Actually now, I get a database-connection error after reboot. logical
EDIT:
Added this in /etc/fstab:
#Datenpartition emoncms
/dev/sda3 /home/pi/emonData ext4 defaults 0 0
And I found the emoncms-stuff :-)
Its in /var/www/emoncms....
Is it the same range, as i am used from my emoncms 8.4.0 on Windows?
Re: migrate emoncms from windows to raspberry
Yes if its all working we need to add a line to the fstab to automatically mount emonData
sudo nano /etc/fstab
and insert a line after the "/dev/sda2" line
/dev/sda3 /home/pi/emonData ext4 defaults, 0 2
if the numbers you are asking about is the 7 7 2 5 2 2 2 I can't say I know off the top off my head
Re: migrate emoncms from windows to raspberry
Hi,
sorry for the last question.
All in all, I now have a emoncms-working Pi.
Will test it the next days, how it is working.
If I could force the apikeys, it would be an easy change 1:1 for me. But because of different keys, i have to change the program of my data-sending arduinos.
Thx for your great support.
Re: migrate emoncms from windows to raspberry
If you install phpmyadmin you can edit the sql tables the apikeys are found in the user table.
Or if you already have data tables you could create your own "emonData/olddata" folder note the structure and permissions and carry over your previous date.
The only thing that ties emoncms to the data is the emoncms password and user in settings.php.
eg if you were to comment out the username and password in settings.php and add you old ones, plus add the new "/olddata" folder level (inside emonData) to all data engine paths in settings.php you could have all your old data too.
always comment and add new lines so you can undo if things don't work out and/or put all the existing stuff from emonData in emonData/newfiles
Paul
Re: migrate emoncms from windows to raspberry
>> If you install phpmyadmin...
This tool I was missing ;-)
On my windows installation with wamp, I sometimes used this to have a backdooor to my sql-table.
Re: migrate emoncms from windows to raspberry
Found this:
- sudo apt-get purge minecraft-pi wolfram-engine sonic-pi scratch -y
- sudo apt-get autoremove -y
apt-get purge should clear all refs so not sure about the second line.
Not that it's going to make a big difference in disk space, but after zapping wolfram-engine and sonic-pi, autoremove gets rid of 10 more files. (a total of 19.5MB)
Re: migrate emoncms from windows to raspberry
I looked into this after autoremove was mentioned and did some tests too.It does indeed make a difference, as does apt-get clean as temporary files used during installation and updates etc don't get automatically deleted either.
The latest Raspbian OS image (2015-01-31) is 2.4G on a 2.9G partition and has 393M free
(not entirely sure where the other 100+ MB is though, I assume the GiB v GB and MiB v MB etc)
Purging wolfram-engine sonic-pi minecraft-pi and scratch deletes 558M making 951M free
using auto-remove to delete packages now no longer needed gave 23M making 974M free
then using apt-get clean freed up a further 35M giving us a total of 1009M free
That is 616M reclaimed.
However fully updating and upgrading the OS etc added 120MB making 889M free
But using apt-get clean again removed a bulky 116MB returning the total to 1005M free
Still 612MB smaller than we started with.
Adding a full emoncms with all dependencies added 238MB making 767MB free
And adding emonHub added a measly 2MB so we still have 765MB free
The final figures were 2G of a 2.9G partition used with 753MB free (~150MB now missing)
The main thing is the image is now 360MB smaller after installing emonhub and emoncms. The other great thing is if you are running emonCMS low-write on a 4G card the full OS and emon stuff only uses half and gives you over 600MB additional storage (which is probably about a 50% boost)
I also believe if the resulting image was subjected to resize2fs -M (has to be unmounted) that image could be squashed and the partition made smaller to facilitate a smaller ZIP for download, maybe 800MB or so.
Paul
PS - I recorded these values for my own curiosity whilst doing a fresh install that had to be done anyway,
Re: migrate emoncms from windows to raspberry
Thanks for the additional info about running apt-get clean, and zapping scratch as well.


§490:9-804 Security interest unperfected before July 1, 2013. A security interest that is an unperfected security interest prior to July 1, 2013, shall be a perfected security interest:
(1) Without further action, if, on or before July 1, 2013, the applicable requirements for perfection under this article are satisfied; or
(2) Upon satisfaction of the applicable requirements for perfection. [L 2012, c 33, pt of §1]


Robust Linear Models¶
Robust linear models with support for the M-estimators listed under Norms.
See Module Reference for commands and arguments.
Examples¶
# Load modules and data
In [1]: import statsmodels.api as sm
In [2]: data = sm.datasets.stackloss.load()
In [3]: data.exog = sm.add_constant(data.exog)
# Fit model and print summary
In [4]: rlm_model = sm.RLM(data.endog, data.exog, M=sm.robust.norms.HuberT())
In [5]: rlm_results = rlm_model.fit()
In [6]: print(rlm_results.params)
const -41.026498
AIRFLOW 0.829384
WATERTEMP 0.926066
ACIDCONC -0.127847
dtype: float64
Detailed examples can be found here:
Technical Documentation¶
References¶
PJ Huber. ‘Robust Statistics’ John Wiley and Sons, Inc., New York. 1981.
PJ Huber. 1973, ‘The 1972 Wald Memorial Lectures: Robust Regression: Asymptotics, Conjectures, and Monte Carlo.’ The Annals of Statistics, 1.5, 799-821.
R Venables, B Ripley. ‘Modern Applied Statistics in S’ Springer, New York,
C Croux, PJ Rousseeuw, ‘Time-efficient algorithms for two highly robust estimators of scale’ Computational statistics. Physica, Heidelberg, 1992.
Module Reference¶
Model Classes¶
|
Robust Linear Model |
Model Results¶
|
Class to contain RLM results |
Norms¶
|
Andrew's wave for M estimation. |
|
Hampel function for M-estimation. |
|
Huber's T for M estimation. |
Least squares rho for M-estimation and its derived functions. |
|
|
Ramsay's Ea for M estimation. |
The parent class for the norms used for robust regression. |
|
|
Trimmed mean function for M-estimation. |
|
Tukey's biweight function for M-estimation. |
|
M-estimator of location using self.norm and a current estimator of scale. |
Scale¶
|
Huber's proposal 2 for estimating location and scale jointly. |
|
Huber's scaling for fitting robust linear models. |
|
The Median Absolute Deviation along given axis of an array |
Huber's scaling for fitting robust linear models. |
|
|
The normalized interquartile range along given axis of an array |
|
Computes the Qn robust estimator of scale |


JavaScript WebRTC Sample
(Peer-to-Peer)
Login as any user on this computer and another user on another computer
Choose a user to login with.
Choose a user to call
Audio call
Video call
Hangup
Call from
Decline
Accept


[Index of Contents]
These pages are frame based, your World Wide Web Browser is not interpreting the Frames display.
To install a browser that supports frames, try Microsoft's Internet Explorer or Netscape's Navigator browser.
[ref: http://www.tongatapu.net.to] © Tonga on the 'NET
[For a piece of the Kingdom, and Your Own Domain Name, http://www.tonic.to easily the Tonic.to Domain Name headaches.]


|
I am a Software Developer with most of my experience in Game Development. I have the most experience in Physics and Artificial Intelligence programming. My strongest language is C++, and I've also worked with C, JavaScript, C#, Lua, and HTML. Download my Resume(pdf)!
I like doing on projects on my own, but I enjoy programming most when I'm on a team of people working towards a common goal. Writing code that contributes to a larger system and seeing it merge with the contributions of others is some of the most satisfying times in development to me.
When I'm not programming, I'm probably hiking, tending to my ever-growing garden, playing games, making tools for D&D, or excitedly researching a subject completely irrelevant to me, like beekeeping or glassblowing.
Please say hello if you're interested in hearing anything more!
|


--- title: More about Strings keywords: fastai sidebar: home_sidebar summary: "Note: Going through the more strings" description: "Note: Going through the more strings" nb_path: "08_More_About_Strings.ipynb" ---
Python can do more than the "+" operator for strings
'Hello'
'That is Alice's cat'
that does not work with single quotes
"That is Alice's cat"
The escapce characte is a "\" backslash
other escape characters are
'That is Alice\'s cat'
print('Hello ther!\nHow are you?\nI\'m fine')
raw strings
r'That is Carol\'s cat'
print(r'That is Carol\'s cat')
A multi lines string in python starts either with """ or with '''
"""Dear Alice,
Today I went to nerverland, but you were not there.
Maybe you meant Netherlands, in which case I'm already there!
Until then,
Bob."""
print("""Dear Alice,
Today I went to nerverland, but you were not there.
Maybe you meant Netherlands, in which case I'm already there!
Until then,
Bob.""")
spam = 'Hello world!'
spam.upper()
print(spam)
spam = spam.upper()
print(spam)
answer = input()
print(answer)
answer == 'yes'
if answer == 'yes':
print('Playing again?')
if answer.lower() == 'yes':
print('Playing again?')
spam = 'Hello world!'
spam.islower()
spam[1].islower()
spam[1:11].islower()
spam[1:12].islower()
Looks like "!" is perceived as a lowercase
spam[11].isupper()
There are other string methods
"Is title" are for all words of a sentence beginning with an Uppercase letter, the rest of the word being lower case
'hello'.isalpha()
'hello1234'.isalpha()
'hello1234'.isalnum()
'1234'.isdecimal()
' '.isspace()
'This Is A Title Case.'.istitle()
'This is not a title case.'.istitle()
'Hello world!'.startswith('Hello')
'Hello world!'.startswith('H')
'Hello world!'.startswith('ello')
'Hello world!'.endswith('!')
'Hello world!'.endswith('world')
','.join(['cats', 'bats', 'rats'])
print('\n\n'.join(['cats', 'bats', 'rats']))
'My name is Thierry'.split()
'My name is Thierry'.split('i')
'Hello'.rjust(10)
len('Hello'.rjust(10))
print('Hello'.rjust(10))
'Hello'.rjust(20,'-')
'Hello'.center(20,'-')
spam ='Hello'.rjust(10)
print(spam)
spam.strip()
' x '.strip()
' x '.lstrip()
' x '.rstrip()
'SpamSpamBaconSpamEggsSpam'.strip('ampS')
tcailleau@TCAILLEAU-02 MINGW64 ~/Documents/Python/tcai_AtBSwPython (master) $ pip install pyperclip Collecting pyperclip Using cached pyperclip-1.8.2.tar.gz (20 kB) Building wheels for collected packages: pyperclip Building wheel for pyperclip (setup.py) ... done Created wheel for pyperclip: filename=pyperclip-1.8.2-py3-none-any.whl size=11112 sha256=11d56270836b63af3e8efbc39efc99d31c13acdcd9ee489446a00328082b2db0 Stored in directory: c:\users\tcailleau\appdata\local\pip\cache\wheels\7f\1a\65\84ff8c386bec21fca6d220ea1f5498a0367883a78dd5ba6122 Successfully built pyperclip Installing collected packages: pyperclip Successfully installed pyperclip-1.8.2
tcailleau@TCAILLEAU-02 MINGW64 ~/Documents/Python/tcai_AtBSwPython (master)
import pyperclip
pyperclip.copy('This is a clipboard test')
Reslut from the clipboard:
This is a clipboard test
pyperclip.paste()
'hello '+ 'world'
name = 'Alice'
place = 'Main Street'
time = '6 pm'
food = 'turnips'
'Hello ' + str(name) + ', you are invited to a party' + place + ' at '
"%s" are called conversion specifiers
'Hello %s, you are invited to a party at %s, at %s. Please bring %s.' % (name, place, time, food)


Show High Scores
In this quiz, you will be asked a series of questions on the Columbian Cartel Hippos. You will be offered
three choices for each question, and you will be timed.
Good luck!


{% extends "layout.html" %} {% block content %}
Length Constraints describe constraints between the lengths of biopolymers.
This constrains that the length of A is equal to the length of B
length A < length B
or
length A <= length B


class Wmap::NetworkProfiler
Network profiler to optimize the port scanner performance for a specific network / IP. The ultimate goal is to set a reasonable socket time-out parameter for the scanners.
Constants
- File_discovery_ports
Attributes
latency[R]
max_parallel[RW]
search_path[RW]
socket_timeout[RW]
verbose[RW]
Public Class Methods
new(params = {})
click to toggle source
Set default instance variables
# File lib/wmap/network_profiler.rb, line 20 def initialize (params = {}) @verbose=params.fetch(:verbose, false) @socket_timeout=params.fetch(:socket_timeout, 1500) #@http_timeout=params.fetch(:http_timeout, 3000) @search_path=["/sbin/","/usr/sbin/","/usr/local/bin/","/usr/bin/","/opt/bin/","/opt/sbin/"] # Initialize the instance variables @discovery_tcp_ports=params.fetch(:discovery_tcp_ports, file_2_list(File_discovery_ports).map!{|x| x.to_i} ) end
Public Instance Methods
open_tcp_port?(target)
click to toggle source
Perform TCP Ping as a last resort of the network profiling effort, in case of ICMP tests fail.
# File lib/wmap/network_profiler.rb, line 119 def open_tcp_port? (target) puts "Check if any TCP port in the list #{@discovery_tcp_ports} is open on the remote host: #{target}" if @verbose begin timeo = @socket_timeout/1000.0 # change time-out unit from sec to ms p=Net::Ping::TCP.new(target,nil,timeo) @discovery_tcp_ports.map do |port| p.port=port if p.ping @which_port=port # Bug in the current Net::Ping.ping module, where the 'duration' is 100 order off. We make it up here without fixing their code @latency = p.duration * 1000 * 100 puts "TCP port detection successful on port: #{@which_port}" if @verbose return true end end puts "TCP port detection on remote host #{target} fail. " if @verbose return false rescue Exception => ee puts "Error on method #{__method__} on target #{target}: #{ee}" if @verbose return false end end
profile(host)
click to toggle source
Main worker method that determine the right profiling methods
# File lib/wmap/network_profiler.rb, line 30 def profile(host) puts "Perform web service discovery on host: #{host}" if @verbose @latency = @socket_timeout begin if Process.euid == 0 && socket_icmp_pingable?(host) puts "Network profiling by using raw socket ..." if @verbose elsif shell_ping_exist? && shell_pingable?(host) puts "Network profiling by using external shell ping program ..." if @verbose elsif open_tcp_port?(host) puts "Network profiling by using TCP ping ..." if @verbose else puts "No appropriate profiling method for #{host}" if @verbose # Do nothing end puts "Found network latency for #{host}: #{@latency} ms" if @verbose return @latency rescue Exception => ee puts "Exception on method #{__method__} for #{host}: #{ee}" if @verbose return nil end end
shell_ping_exist?()
click to toggle source
Search for local ping executable program. This is helpful for the normal users who has no direct access to generate socket ICMP packets.
# File lib/wmap/network_profiler.rb, line 100 def shell_ping_exist? begin puts "Search local shell environment for the ping program ..." if @verbose @search_path.map do |path| ping_exe=path+"ping" if File.exist?(ping_exe) && File.executable?(ping_exe) @which_ping=ping_exe puts "Local ping program found: #{ping_exe}" if @verbose return true end end return false rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return false end end
shell_pingable?(target)
click to toggle source
Wrapper for local ping executable. This is needed if the process do not have the root privilege to operate
on the raw ICMP socket
# File lib/wmap/network_profiler.rb, line 76 def shell_pingable? (target) puts "Perform ping test from the shell on: #{target}" if @verbose begin sum=0 test_ping= `#{@which_ping} -c 3 #{target}` test_ping.scan(/^(.+?)\stime=(.+)\s(.+?)\n/).map do |entry| puts "entry: #{entry}" if @verbose sum=sum+entry[1].to_f end if sum > 0 @latency = sum / 3 puts "Ping test from the shell environment successful on #{target}." if @verbose return true else puts "Ping test from the shell environment fail on #{target}." if @verbose return false end rescue Exception => ee puts "Exception on method #{__method__} for #{host}: #{ee}" if @verbose return false end end
socket_icmp_pingable?(target)
click to toggle source
Perform raw socket ICMP echo detection on the host. Note that socket ICMP packet manipulation
need the root privilege access(for example, ICMP 'echo' need to snoop on the interface to detect any replies such as 'ECONNREFUSED'). That's why we also use external ping program for the normal users in case they do not has the access.
# File lib/wmap/network_profiler.rb, line 55 def socket_icmp_pingable? (target) puts "Perform socket ICMP ping on the target: #{target}" if @verbose begin timeo = @socket_timeout/1000.0 # change time-out unit from sec to ms p=Net::Ping::ICMP.new(target,nil,timeo) if p.ping @latency=p.duration * 1000 puts "Socket ICMP echo test successful on #{target}." if @verbose return true else puts "Socket ICMP echo test fail on #{target}." if @verbose return false end rescue Exception => ee puts "Error on method #{__method__} on target #{target}: #{ee}" if @verbose return false end end


we are located globally in :
- Seattele : main street 100
- Tokyo: next to Sensoji Temple
- Dubai : burj-khalifa
- Paris : near Eiffel Tower
- Lime : down town
Avaiable to serve you from 9:00 Am - 9:00 Pm
we are located globally in :
Avaiable to serve you from 9:00 Am - 9:00 Pm


Trend FilmArray data test respiratory detection results Figure tests patient pathogen influenza clinical testing Flu organisms pathogens new organism rate sites health --- number surveillance Available export from: information systems CDC MIE PHI database disease rates Influenza [cited positive time Clin Health co-detections used -Figure Detection Respiratory average observed real-time April BioFire dataset site Table care circulating diagnostic use viruses Comparison Download Supplement associated figure prevalence public software Infect detected infections samples total Expert HIPAA data. infectious lot participating risk type viral Dis, One, Open PCR Pathogen Surveillance approach data-hide-link-title=""> data-icon-position="" different percent performed reported specific tab (see Clinical Determination Panel Rate View analysis compared de-identification detections high indicated individual laboratories multiple rapid reporting set stacked syndromic using Act FluView Microbiol, Percent RSV adenovirus area available calculated co-detection epidemiological exported laboratory non-patient patients period population regression single virus week year Data IVD New TUR United York ]), automated common count date defined does infection make negative peak provided season study tested tract winter (black Department However, Human ILI Information Laboratory Med, National Public Results Top-Out control directly human institutions line) local low methods molecular multiplex novel pathogen-specific positivity possible present privacy project protocol provide providers sample seasonality sharing shown site. supplement tests, value <;strong>;Figure (grey ;<;div ;<;span Bottom-Out CDC. Disease Electronic HRV/EV Luminex Privacy Test Viral Virus ]). aggregated approximately bacteria children. cloud combination constant data, database, detect developed development diseases displayed follow forecasting identification identified include including increase makes measured metric national outbreak pouches process records remaining removed requires result review role shows sites. small standard tests. unique web xTAG xmlns=";http://www.w.org//xhtml"; xmlns=";http://www.w.org//xhtml";>;<;span (A, (HIPAA) Accountability Amazon BMC Diagnostics Diagnostics. Emerging Evaluation Group HHS. Infect, Insurance Internet July June Microbiol Office Organisms Portability Statistical U.S. Utilization Virol, abundance activity agents analysis. and, approaches area). axis) bacterial bars, based changes class=";caption-title";>;Detection client commercial correlation de-identified derived determine diversity dual electronic evaluation fall fields given growth half hospitals identify impact includes index instrument intensity involved legend level line line, linear majority measures moving occurrence ordered panel panels particular peaks percentage perform pilot pneumoniae, presented prior project. recommendations regions removal remove results. right sales seasonal similar specifically studies subset summer syncytial tracking years years.


692,480 answers for verified questions
73,075 answers for unverified questions
87,700 answers for verified questions
69,248 verified questions
73,075 unverified questions
8,770 verified questions
26,392 verified questions
100,000 answers for verified questions (last updated: Oct. 15th, 2021)
10,000 verified questions
36,807 verified questions
5,000 images from COCO val2014
36,807 image from COCO test2015
* Due to copyright issues, we cannot directly release raw images from Conceptual Captions 3M dataset (CC3M). Please use the original image urls included in question JSON files to download. Follow links to download raw images from Fakeddit and VCR.
† Image features are extracted from Faster R-CNN model.
The questions are stored using the JSON file format.
The questions format has the following data structure:
{
"info" : info,
"task_type" : str,
"data_type": str,
"data_subtype": str,
"questions" : [question],
"license" : license
}
info {
"year" : int,
"version" : str,
"description" : str,
"contributor" : str,
"url" : str,
"date_created" : datetime
}
license{
"name" : str,
"url" : str
}
question{
"question_id" : int,
"image_id" : int,
"question" : str,
"image_url": str
}
task_type
: type of annotations in the JSON file (Open-Ended).
data_type
(image_source
in AVQA): source of the images (mscoco or CC3M/VCR/Fakeddit).
data_subtype
: data splits (e.g. val2014/test2015 of mscoco for AdVQA, R1/2/3 train/val/test for AVQA).
image_url
(only for CC3M images in AVQA): original image urls in CC3M release.
The annotations are stored using the JSON file format.
The annotations format has the following data structure:
{
"info" : info,
"data_type": str,
"data_subtype": str,
"annotations" : [annotation],
"license" : license
}
info {
"year" : int,
"version" : str,
"description" : str,
"contributor" : str,
"url" : str,
"date_created" : datetime
}
license{
"name" : str,
"url" : str
}
annotation{
"question_id" : int,
"image_id" : int,
"answer_type" : str,
"answers" : [answer],
}
answer{
"answer_id" : int,
"answer" : str
}
data_type
(image_source
in AVQA): source of the images (mscoco or CC3M/VCR/Fakeddit).
data_subtype
: data splits (e.g. val2014/test2015 of mscoco for AdVQA, R1/2/3 train/val/test for AVQA).
answer_type
: type of the answer. Currently, "yes/no", "number", and "other".


--- layout: feedback title: Mike Kovarik - 2015-10-22 11:11:06 date: 2015-10-22 11:11:06.000000000 -05:00 type: feedback published: true status: publish categories: [] tags: [] meta: _feedback_extra_fields: a:0:{} _feedback_email: "a:2:{s:2:\"to\";a:1:{i:0;s:21:\"broberts_az@yahoo.com\";}s:7:\"message\";s:528:\"Name: Mike Kovarik\nEmail<EMAIL_ADDRESS>http://Attribytes.com\nComment: I am currently piloting my Ruby built web app platform with Shanrock Foods and I found your info as a Ruby guru and would love to buy you coffee and have you look at our application. \r\n\r\nLet me know if you are available tomorrow am to chat.\r\n\r\nThanks,\r\n\r\nMike\r\nCEO & Founder, Attribytes\n\nTime: October 22, 2015 at 11:11 am\nIP Address: <IP_ADDRESS>\nContact Form URL: http://bob-roberts.net/contact/\nSent by an unverified visitor to your site.\";}" author: ---
I am currently piloting my Ruby built web app platform with Shanrock Foods and I found your info as a Ruby guru and would love to buy you coffee and have you look at our application.
Let me know if you are available tomorrow am to chat.
Thanks,
Mike
CEO & Founder, Attribytes
AUTHOR: Mike Kovarik
AUTHOR EMAIL<EMAIL_ADDRESS>AUTHOR URL: http://Attribytes.com
SUBJECT: Email from Blog
IP: <IP_ADDRESS>
Array
(
[1_Name] => Mike Kovarik
[2_Email] =><EMAIL_ADDRESS>[3_Website] => Attribytes.com
[4_Comment] => I am currently piloting my Ruby built web app platform with Shanrock Foods and I found your info as a Ruby guru and would love to buy you coffee and have you look at our application.
Let me know if you are available tomorrow am to chat.
Thanks,
Mike
CEO & Founder, Attribytes
)


As an agent who's an expert in North San Diego County, I bring a wealth of knowledge and expertise about buying and selling real estate here. It's not the same everywhere, so you need someone you can trust for up-to-date information. I am eager to serve you.
CalRE #01970158
You need someone who knows this area inside and out! I can work with you to find the right home at the right price for you, including all the neighborhood amenities that matter - not to mention the essential criteria you have for your ideal home.
When it's time to move, you need someone who will advertise your home, show to prospective buyers, negotiate the purchase contract, arrange financing, oversee the inspections, handle all necessary paperwork and supervise the closing. I can take care of everything you need, from start to close.
Oftentimes buyers don't visualize living in your home the way you do. I can make your home attractive to its ideal audience - which can help you get top dollar. Things like staging the home, making repairs or minor improvements, or even simply painting the walls can be the difference between a home resting on the market and one that's sold fast.
Curabitur metus risus, mollis sollicitudin vulputate volutpat risus. Etiam in sem ac nulla eleifend volutpat. Morbi nec posuere orci. Suspendisse enim velit, venenatis quis arcu sed, convallis euismod risus.
Contact Us"This letter is to praise Frank Flores for an outstanding job as my realtor. He went out of his way to help me sell a condo in a very competitive and difficult market. Provided helpful critical advice! He marketed it so well that the first weekend I had close to 200 views on the Internet. He held at least 4 open houses to capture buyers. He spent a lot of extra time with the sale. It sold! I have lived in and sold five homes and in all that experience I have never encountered a better real estate agent than Frank! He is a dynamic salesman, agent and a great guy. Highly recommend him."
Client


Masked university students rally at graduation ceremony in Hong Kong
HONG KONG, Nov 7 — About 1,000 students, many wearing black masks, attended a graduation ceremony at the Chinese University of Hong Kong today, with some holding up banners urging “Free Hong Kong, Revolution Now”.
The students defied a ban on masks that the government imposed last month in a bid to curb unrest that has rocked the Chinese-ruled city for more than five months.
Dressed in formal graduation gowns, many of the students chanted as they walked from a metro station to the ceremony venue, calling for the government to respond to protesters’ demands that include universal suffrage.
The protests started over a now-scrapped extradition bill that would have allowed people to be sent to mainland China for trial but have evolved into calls for greater democracy and an independent inquiry into complaints of excessive force by police, among other demands.
“The most important thing is we all remember five demands not one less, even though we are all exhausted, we should not give up,” said Kelvin, a 22-year-old information engineering graduate.
The months of sometimes violent anti-government protests have plunged the former British colony into its biggest crisis in decades, with no sign the demonstrators plan to give up.
At the root of many protesters’ indignation is what they see as Chinese meddling with Hong Kong’s promised freedoms.
China denies doing so and has blamed Western countries for stirring up trouble in the financial hub.
The protests have hammered the city’s economy, which is sliding into recession for the first time since the global financial crisis in the third quarter.
Retail and tourism sectors have been hit particularly hard with visitor numbers plummeting as tourists stay away.
Beijing supports bolder action to tackle the roots of unrest, a senior Chinese official said yesterday, citing social problems including unaffordable housing.
More protests are planned today and through the weekend, when bigger crowds usually gather. — Reuters


Machiatto
Location: near Times Square
Espresso: Macchiatto 44 roasted by Seattle-based Fonte Micro Roasters
Hardware: Fonte branded
Coffee Art: No
WiFi: unknown
Served in: 12oz cardboard cups
Drink: skim cappuccino
Visited: 8/29/2012
Sorry, no picture. This was on the run with friends.
Macchiato is a local two-shop chain in NY. It’s a restaurant as well as coffee bar and appears to have a brisk lunch crowd. Seating is small tables and chairs. This was a spontaneous stop after having lunch with friends near Times Square. We stood in a long but efficient line. I was alarmed at the amount of milk they poured in my 12oz drink and thought it would taste more like milk than coffee. While I would have preferred less milk, the taste was still sweet, I could still taste coffee and the micro foam was lovely. The temperature of the drink was fine without a sleeve and the taste was nicely sweet, leading me to suspect they probably use local and/or premium milk. I prefer my caps with less milk, but if you aren’t picky about lattes vs caps, you’ll probably like it. If I’d actually ordered a macchiato, it probably would have been lovely.
Pros: Fast service, lovely taste, great micro foam
Cons: Busy and lacking in attention to detail.
Final word: I would go here if I were near but wouldn’t go out of my way to get some and I might look around for something different if I were planning ahead. I think 12oz cups are way too big for most drinks, but it did taste good, so YMMV. It makes me interested in checking out Fonte Coffee Roasters in Seattle!


--- layout: layout permalink: /transitiontimingfunction title: Transition Timing Function ---
Specifies the speed curve of a transition.
| Class | Properties |
|---|---|
| transition-linear | transition-timing-function: linear; |
| transition-ease-in | transition-timing-function: cubic-bezier(0.4, 0, 1, 1); |
| transition-ease-out | transition-timing-function: cubic-bezier(0, 0, 0.2, 1); |
| transition-ease-in-out | transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); |

Hover me

Hover me

Hover me

Hover me


{% extends "seo_link/tests/test_base.html" %} {% block body %}
1 here it should be replaced ###REPLACE ME###
here not bing ###REPLACE ME###
inside plain p
This should be replaced
wordcount 1 test_me
wordcount 2 test me
wordcount 3 test me now
wordcount 4 test me now here
wordcount 5 test me now here fast
wordcount 1 test_me wordcount 2 test me wordcount 3 test me now wordcount 4 test me now here wordcount 5 test me now here fast
inside a p tag test_me
inside a p tag


DTIG Data Dashboard
Select button to start signing in ...
account_circle
Sign in with Email
account_circle
Sign in with Google
Provide email and password to sign in ...
Sign In
CANCEL
Send Password Reset Email
Version: 0.9.9
DTIG Data Dashboard
Select 'Dashboards' or 'Help' from underneath this bubble or
select the avatar in the top right for user profile information
Select avatar for user profile section for user info,
additional dashboard control commands and logging out.
dashboard
Dashboards
Display dashboard panels
trending_up
My Top Groups
schedule
Recent Groups
screen_lock_portrait
Unregistered
help
Help
Display help panel
add
New Dashboard
Title for dashboard
Identifier for dashboard (ie: the 'group' identifier can be the door value)
Message for dashboard
Tags for dashboard (single-words, separated by a single space)
Add Dashboard
Dismiss


The following document contains the results of Checkstyle 8.29 with sun_checks.xml ruleset.
| Files | Info | Warnings | Errors |
|---|---|---|---|
| 3 | 0 | 0 | 27 |
| File | I | W | E |
|---|---|---|---|
| xuml/tools/miuml/metamodel/extensions/jaxb/Marshaller.java | 0 | 0 | 12 |
| xuml/tools/miuml/metamodel/jaxb/Marshaller.java | 0 | 0 | 12 |
| xuml/tools/miuml/metamodel/jaxb/MarshallerTest.java | 0 | 0 | 3 |
| Category | Rule | Violations | Severity |
|---|---|---|---|
| javadoc | JavadocMethod | 2 | Error |
| JavadocPackage | 3 | Error | |
| JavadocVariable | 2 | Error | |
| misc | FinalParameters | 4 | Error |
| NewlineAtEndOfFile | 2 | Error | |
| regexp | RegexpSingleline
|
9 | Error |
| sizes | LineLength
|
5 | Error |
| Severity | Category | Rule | Message | Line |
|---|---|---|---|---|
| Error | misc | NewlineAtEndOfFile | File does not end with a newline. | 1 |
| Error | javadoc | JavadocPackage | Missing package-info.java file. | 1 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 22 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 24 |
| Error | javadoc | JavadocVariable | Missing a Javadoc comment. | 28 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 32 |
| Error | sizes | LineLength | Line is longer than 80 characters (found 90). | 42 |
| Error | misc | FinalParameters | Parameter event should be final. | 46 |
| Error | sizes | LineLength | Line is longer than 80 characters (found 95). | 47 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 60 |
| Error | javadoc | JavadocMethod | Expected @return tag. | 65 |
| Error | misc | FinalParameters | Parameter node should be final. | 65 |
| Severity | Category | Rule | Message | Line |
|---|---|---|---|---|
| Error | misc | NewlineAtEndOfFile | File does not end with a newline. | 1 |
| Error | javadoc | JavadocPackage | Missing package-info.java file. | 1 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 21 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 23 |
| Error | javadoc | JavadocVariable | Missing a Javadoc comment. | 27 |
| Error | sizes | LineLength | Line is longer than 80 characters (found 89). | 39 |
| Error | misc | FinalParameters | Parameter event should be final. | 43 |
| Error | sizes | LineLength | Line is longer than 80 characters (found 95). | 44 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 57 |
| Error | javadoc | JavadocMethod | Expected @return tag. | 61 |
| Error | misc | FinalParameters | Parameter is should be final. | 61 |
| Error | sizes | LineLength | Line is longer than 80 characters (found 90). | 64 |
| Severity | Category | Rule | Message | Line |
|---|---|---|---|---|
| Error | javadoc | JavadocPackage | Missing package-info.java file. | 1 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 7 |
| Error | regexp | RegexpSingleline | Line has trailing spaces. | 9 |


ImageWow!
menu
Trending
Search
About
Trending
Search
About
Popular on Pexel
Popular on Unsplash
Popular on Giphy


"""Fractal functions"""
import numpy as np
from numba import jit
from math import log, floor
from .entropy import num_zerocross
from .utils import _linear_regression, _log_n
all = ['petrosian_fd', 'katz_fd', 'higuchi_fd', 'detrended_fluctuation']
[docs]def petrosian_fd(x, axis=-1):
"""Petrosian fractal dimension.
Parameters
----------
x : list or np.array
1D or N-D data.
axis : int
The axis along which the FD is calculated. Default is -1 (last).
Returns
-------
pfd : float
Petrosian fractal dimension.
Notes
-----
The Petrosian fractal dimension of a time-series :math:`x` is defined by:
.. math:: P = \\frac{\\log_{10}(N)}{\\log_{10}(N) +
\\log_{10}(\\frac{N}{N+0.4N_{\\delta}})}
where :math:`N` is the length of the time series, and
:math:`N_{\\delta}` is the number of sign changes in the signal derivative.
Original code from the `pyrem <https://github.com/gilestrolab/pyrem>`_
package by Quentin Geissmann.
References
----------
* A. Petrosian, Kolmogorov complexity of finite sequences and
recognition of different preictal EEG patterns, in , Proceedings of the
Eighth IEEE Symposium on Computer-Based Medical Systems, 1995,
pp. 212-217.
* Goh, Cindy, et al. "Comparison of fractal dimension algorithms for
the computation of EEG biomarkers for dementia." 2nd International
Conference on Computational Intelligence in Medicine and Healthcare
(CIMED2005). 2005.
Examples
--------
>>> import numpy as np
>>> import entropy as ent
>>> import stochastic.processes.noise as sn
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.5, rng=rng).sample(10000)
>>> print(f"{ent.petrosian_fd(x):.4f}")
1.0264
Fractional Gaussian noise with H = 0.9
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.9, rng=rng).sample(10000)
>>> print(f"{ent.petrosian_fd(x):.4f}")
1.0235
Fractional Gaussian noise with H = 0.1
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.1, rng=rng).sample(10000)
>>> print(f"{ent.petrosian_fd(x):.4f}")
1.0283
Random
>>> rng = np.random.default_rng(seed=42)
>>> print(f"{ent.petrosian_fd(rng.random(1000)):.4f}")
1.0350
Pure sine wave
>>> x = np.sin(2 * np.pi * 1 * np.arange(3000) / 100)
>>> print(f"{ent.petrosian_fd(x):.4f}")
1.0010
Linearly-increasing time-series (should be 1)
>>> x = np.arange(1000)
>>> print(f"{ent.petrosian_fd(x):.4f}")
1.0000
"""
x = np.asarray(x)
N = x.shape[axis]
# Number of sign changes in the first derivative of the signal
nzc_deriv = num_zerocross(np.diff(x, axis=axis), axis=axis)
pfd = np.log10(N) / (np.log10(N) + np.log10(N / (N + 0.4 * nzc_deriv)))
return pfd
[docs]def katz_fd(x, axis=-1):
"""Katz Fractal Dimension.
Parameters
----------
x : list or np.array
1D or N-D data.
axis : int
The axis along which the FD is calculated. Default is -1 (last).
Returns
-------
kfd : float
Katz fractal dimension.
Notes
-----
Katz’s method calculates the fractal dimension of a sample as follows:
the sum and average of the Euclidean distances between the successive
points of the sample (:math:`L` and :math:`a` , resp.) are calculated as
well as the maximum distance between the first point and any other point
of the sample (:math:`d`). The fractal dimension of the sample (:math:`D`)
then becomes:
.. math::
D = \\frac{\\log_{10}(L/a)}{\\log_{10}(d/a)} =
\\frac{\\log_{10}(n)}{\\log_{10}(d/L)+\\log_{10}(n)}
where :math:`n` is :math:`L` divided by :math:`a`.
Original code from the `mne-features <https://mne.tools/mne-features/>`_
package by Jean-Baptiste Schiratti and Alexandre Gramfort.
References
----------
* https://ieeexplore.ieee.org/abstract/document/904882
* https://hal.inria.fr/inria-00442374/
* https://www.hindawi.com/journals/ddns/2011/724697/
Examples
--------
>>> import numpy as np
>>> import entropy as ent
>>> import stochastic.processes.noise as sn
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.5, rng=rng).sample(10000)
>>> print(f"{ent.katz_fd(x):.4f}")
6.4713
Fractional Gaussian noise with H = 0.9
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.9, rng=rng).sample(10000)
>>> print(f"{ent.katz_fd(x):.4f}")
4.5720
Fractional Gaussian noise with H = 0.1
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.1, rng=rng).sample(10000)
>>> print(f"{ent.katz_fd(x):.4f}")
7.6540
Random
>>> rng = np.random.default_rng(seed=42)
>>> print(f"{ent.katz_fd(rng.random(1000)):.4f}")
8.1531
Pure sine wave
>>> x = np.sin(2 * np.pi * 1 * np.arange(3000) / 100)
>>> print(f"{ent.katz_fd(x):.4f}")
2.4871
Linearly-increasing time-series (should be 1)
>>> x = np.arange(1000)
>>> print(f"{ent.katz_fd(x):.4f}")
1.0000
"""
x = np.asarray(x)
dists = np.abs(np.diff(x, axis=axis))
ll = dists.sum(axis=axis)
ln = np.log10(ll / dists.mean(axis=axis))
aux_d = x - np.take(x, indices=[0], axis=axis)
d = np.max(np.abs(aux_d), axis=axis)
kfd = np.squeeze(ln / (ln + np.log10(d / ll)))
if not kfd.ndim:
kfd = kfd.item()
return kfd
@jit('float64(float64[:], int32)')
def _higuchi_fd(x, kmax):
"""Utility function for `higuchi_fd`.
"""
n_times = x.size
lk = np.empty(kmax)
x_reg = np.empty(kmax)
y_reg = np.empty(kmax)
for k in range(1, kmax + 1):
lm = np.empty((k,))
for m in range(k):
ll = 0
n_max = floor((n_times - m - 1) / k)
n_max = int(n_max)
for j in range(1, n_max):
ll += abs(x[m + j * k] - x[m + (j - 1) * k])
ll /= k
ll *= (n_times - 1) / (k * n_max)
lm[m] = ll
# Mean of lm
m_lm = 0
for m in range(k):
m_lm += lm[m]
m_lm /= k
lk[k - 1] = m_lm
x_reg[k - 1] = log(1. / k)
y_reg[k - 1] = log(m_lm)
higuchi, _ = _linear_regression(x_reg, y_reg)
return higuchi
[docs]def higuchi_fd(x, kmax=10):
"""Higuchi Fractal Dimension.
Parameters
----------
x : list or np.array
One dimensional time series.
kmax : int
Maximum delay/offset (in number of samples).
Returns
-------
hfd : float
Higuchi fractal dimension.
Notes
-----
Original code from the `mne-features <https://mne.tools/mne-features/>`_
package by Jean-Baptiste Schiratti and Alexandre Gramfort.
This function uses Numba to speed up the computation.
References
----------
Higuchi, Tomoyuki. "Approach to an irregular time series on the
basis of the fractal theory." Physica D: Nonlinear Phenomena 31.2
(1988): 277-283.
Examples
--------
>>> import numpy as np
>>> import entropy as ent
>>> import stochastic.processes.noise as sn
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.5, rng=rng).sample(10000)
>>> print(f"{ent.higuchi_fd(x):.4f}")
1.9983
Fractional Gaussian noise with H = 0.9
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.9, rng=rng).sample(10000)
>>> print(f"{ent.higuchi_fd(x):.4f}")
1.8517
Fractional Gaussian noise with H = 0.1
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.1, rng=rng).sample(10000)
>>> print(f"{ent.higuchi_fd(x):.4f}")
2.0581
Random
>>> rng = np.random.default_rng(seed=42)
>>> print(f"{ent.higuchi_fd(rng.random(1000)):.4f}")
2.0013
Pure sine wave
>>> x = np.sin(2 * np.pi * 1 * np.arange(3000) / 100)
>>> print(f"{ent.higuchi_fd(x):.4f}")
1.0091
Linearly-increasing time-series
>>> x = np.arange(1000)
>>> print(f"{ent.higuchi_fd(x):.4f}")
1.0040
"""
x = np.asarray(x, dtype=np.float64)
kmax = int(kmax)
return _higuchi_fd(x, kmax)
@jit('f8(f8[:])', nopython=True)
def _dfa(x):
"""
Utility function for detrended fluctuation analysis
"""
N = len(x)
nvals = _log_n(4, 0.1 * N, 1.2)
walk = np.cumsum(x - x.mean())
fluctuations = np.zeros(len(nvals))
for i_n, n in enumerate(nvals):
d = np.reshape(walk[:N - (N % n)], (N // n, n))
ran_n = np.array([float(na) for na in range(n)])
d_len = len(d)
trend = np.empty((d_len, ran_n.size))
for i in range(d_len):
slope, intercept = _linear_regression(ran_n, d[i])
trend[i, :] = intercept + slope * ran_n
# Calculate root mean squares of walks in d around trend
# Note that np.mean on specific axis is not supported by Numba
flucs = np.sum((d - trend) ** 2, axis=1) / n
# https://github.com/neuropsychology/NeuroKit/issues/206
fluctuations[i_n] = np.sqrt(np.mean(flucs))
# Filter zero
nonzero = np.nonzero(fluctuations)[0]
fluctuations = fluctuations[nonzero]
nvals = nvals[nonzero]
if len(fluctuations) == 0:
# all fluctuations are zero => we cannot fit a line
dfa = np.nan
else:
dfa, _ = _linear_regression(np.log(nvals), np.log(fluctuations))
return dfa
[docs]def detrended_fluctuation(x):
"""
Detrended fluctuation analysis (DFA).
Parameters
----------
x : list or np.array
One-dimensional time-series.
Returns
-------
alpha : float
the estimate alpha (:math:`\\alpha`) for the Hurst parameter.
:math:`\\alpha < 1`` indicates a
stationary process similar to fractional Gaussian noise with
:math:`H = \\alpha`.
:math:`\\alpha > 1`` indicates a non-stationary process similar to
fractional Brownian motion with :math:`H = \\alpha - 1`
Notes
-----
`Detrended fluctuation analysis
<https://en.wikipedia.org/wiki/Detrended_fluctuation_analysis>`_
is used to find long-term statistical dependencies in time series.
The idea behind DFA originates from the definition of self-affine
processes. A process :math:`X` is said to be self-affine if the standard
deviation of the values within a window of length n changes with the window
length factor :math:`L` in a power law:
.. math:: \\text{std}(X, L * n) = L^H * \\text{std}(X, n)
where :math:`\\text{std}(X, k)` is the standard deviation of the process
:math:`X` calculated over windows of size :math:`k`. In this equation,
:math:`H` is called the Hurst parameter, which behaves indeed very similar
to the Hurst exponent.
For more details, please refer to the excellent documentation of the
`nolds <https://cschoel.github.io/nolds/>`_
Python package by Christopher Scholzel, from which this function is taken:
https://cschoel.github.io/nolds/nolds.html#detrended-fluctuation-analysis
Note that the default subseries size is set to
entropy.utils._log_n(4, 0.1 * len(x), 1.2)). The current implementation
does not allow to manually specify the subseries size or use overlapping
windows.
The code is a faster (Numba) adaptation of the original code by Christopher
Scholzel.
References
----------
* C.-K. Peng, S. V. Buldyrev, S. Havlin, M. Simons,
H. E. Stanley, and A. L. Goldberger, “Mosaic organization of
DNA nucleotides,” Physical Review E, vol. 49, no. 2, 1994.
* R. Hardstone, S.-S. Poil, G. Schiavone, R. Jansen,
V. V. Nikulin, H. D. Mansvelder, and K. Linkenkaer-Hansen,
“Detrended fluctuation analysis: A scale-free view on neuronal
oscillations,” Frontiers in Physiology, vol. 30, 2012.
Examples
--------
Fractional Gaussian noise with H = 0.5
>>> import numpy as np
>>> import entropy as ent
>>> import stochastic.processes.noise as sn
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.5, rng=rng).sample(10000)
>>> print(f"{ent.detrended_fluctuation(x):.4f}")
0.5216
Fractional Gaussian noise with H = 0.9
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.9, rng=rng).sample(10000)
>>> print(f"{ent.detrended_fluctuation(x):.4f}")
0.8833
Fractional Gaussian noise with H = 0.1
>>> rng = np.random.default_rng(seed=42)
>>> x = sn.FractionalGaussianNoise(hurst=0.1, rng=rng).sample(10000)
>>> print(f"{ent.detrended_fluctuation(x):.4f}")
0.1262
Random
>>> rng = np.random.default_rng(seed=42)
>>> print(f"{ent.detrended_fluctuation(rng.random(1000)):.4f}")
0.5276
Pure sine wave
>>> x = np.sin(2 * np.pi * 1 * np.arange(3000) / 100)
>>> print(f"{ent.detrended_fluctuation(x):.4f}")
1.5848
Linearly-increasing time-series
>>> x = np.arange(1000)
>>> print(f"{ent.detrended_fluctuation(x):.4f}")
2.0390
"""
x = np.asarray(x, dtype=np.float64)
return _dfa(x)


rvk bsk
School name
Campus life
Achievements
Photo Gallery
Alumni
Contact us
Vasantha Kumar M S
rashtrotthana vidya kendra
099455 82661


Shadow has developed this mod on only his cellphone.
It takes entirely to long and slows down
the progress of Glitchik.
Please donate as much as you think you can without financially hurting yourself in hopes that we can get shadow a computer.


Features
- 0% MDR, 0% transaction fees
- VPA is NOT needed for for QR generation
- UPI registration is NOT needed for QR generation
- UPI app is NOT needed for QR generation
- Work both on Current Account and Savings Accounts
Business
Create Free QR for Current Account
Personal
Create Free QR for Saving Account
How?
All you need Account Number and IFSC Code to get the QR Code.
Step 1 - Fill up the Bank Details & click Generate button
Bank Account Info
Step 2 - Click on "Download QR Image"
BHIM UPI Payments Accepted at
SAMPLE ACC NAME
Account Number : SAMPLE ACC NUMBER, IFSC Code: SAMPLE IFSC CODE XYZ
Scan and Pay using any UPI supported Apps
Generated By : https://nsisodiya.github.io/Universal-UPI-QR-Code-Generator


Iron Fit aims at achieving mental and physical happiness for all our clients.
We have various expert trainers in different fields of fitness for achieving our goal , our trainers work hard day and night with our clients to ensure the results expected by our clients.
Iron Fit was started to promote and ensure mental and physical fitness for people around the world.
Our team is constantly dedicated to provide the best facilities and programs for all our clients irrespective of how much ever it costs us , we always keep our clients needs first.
Iron Mucle is acknowledged for its unrivalled success in providing the finest equipment and fitness knowledge available to help its members achieve their individual potential. With certified trainers and nutritional counseling, Iron Muscle provides a comprehensive approach to the health and well-being of its member.


JKS Foods and Restaurant, the Best in Town
Order Online +91-892-808-5056
Enjoy Delicious Food!
Happy Customers
Dishes Served
Total Beverages
Cup of coffees
Chris Martin
Alex Hales
Shane Robertson


Don't have an account? Sign up
62 Listings
92 Listings
12 Listings
74 Listings
Subtotal $13,000
Total $943,00
© Guido - All rights reserved.


MADRID FOOTBALL
Madrid is home to La Liga football club giant Real Madrid, who play their home games at the Santiago Bernabéu. Their supporters are referred to as Madridistas or Merengues (Meringues). Real Madrid was voted by fans as the best club of the 20th century (FIFA Club of the Century), being the current leader of the European teams ranking and the most valuable sports team in the world. Real Madrid have won the European Cup (UEFA Champions League) a record 13 times. The latest of their 33 La Liga titles came in 2017.
Their successful hometown rivals, Atlético Madrid, are also well-supported in the city and play their home games at the Wanda Metropolitano. Their supporters are referred to as Atléticos or Colchoneros (The Mattressers), in reference to the team's red and white jersey colours.[1] Atlético is considered a European elite team, having reached in the last five seasons, two UEFA Champions League finals. Historically, Atletico has won 10 national league titles and 10 national cup titles.


Can I use different class names, method names, or method signatures from those prescribed in the API? No. As usual, your assignment will not be graded if it violates the API.
Is 0 a tile? No. The integer 0 represents the blank square. Do not treat it as a tile when computing either the Hamming or Manhattan priority functions.
Can I assume that the puzzle inputs (arguments to the Board constructor and input to Solver) are valid? Yes, though it never hurts to include some basic error checking.
Do I have to implement my own stack, queue, and priority queue?
You must use either MinPQ
or MaxPQ
for your priority queue (because we will intercept calls in
order to do performance analysis).
For the other data types, you may use versions from either algs4.jar
or java.util
.
Should the hamming()
and manhattan()
methods
in Board
return the Hamming and Manhattan priority functions, respectively?
No, hamming()
should return the number of tiles out of position and
manhattan()
should return the sum of the Manhattan distances between
the tiles and their goal positions. Recall that the blank square is not considered a tile.
You will compute the priority function
in Solver
by calling hamming()
or manhattan()
and adding to it the number of moves.
How do I return an Iterable<Board>
?
Add the items you want to a Stack<Board>
or Queue<Board>
and return that. Of course, your client code should
not depend on whether the iterable returned is a stack or queue (because it could be some any iterable).
How do I implement equals()
?
Java has some arcane rules for implementing equals()
,
discussed on p. 103 of Algorithms, 4th edition.
Note that the argument to equals()
is required to be Object
.
You can also inspect
Date.java
or
Transaction.java
for online examples.
Must I implement the toString()
method for Board
exactly as specified?
Yes. Be sure to include the board dimension and use 0 for the blank square.
Use String.format()
to format strings—it works like StdOut.printf()
, but
returns the string instead of printing it to standard output.
For reference, our implementation is below, but yours may vary depending on your choice of
instance variables.
public String toString() { StringBuilder s = new StringBuilder(); s.append(n + "\n"); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { s.append(String.format("%2d ", tiles[i][j])); } s.append("\n"); } return s.toString(); }
Can I use the expression a == b
to check whether two arrays a
and b
are equal?
No. That expression checks whether the two arrays for reference equality (and not whether the two arrays
contain the same sequence of values).
Can I call Arrays.equals(a, b)
to check whether two arrays a
and b
are equal?
It depends.
If a
and b
are of type int[]
, then
Arrays.equals()
works as expected.
If a
and b
are of type int[][]
,
then use
Can I call Arrays.copyOf()
to create an independent copy of an array a
?
It depends.
If a
is of type int[]
, then either
Arrays.copyOf()
or a.clone()
will get the job done.
However, if a
is of type int[][]
, then Arrays.copy()
will not
produce an independent copy because it performs a shallow copy.
Instead, you can write a double nested loop to copy the entries in a two-dimensional array.
I'm a bit confused about the purpose of the twin() method. You will use it to determine whether a puzzle is solvable: exactly one of a board and its twin are solvable. A twin is obtained by swapping any pair of tiles (the blank square is not a tile). For example, here is a board and several possible twins. Your solver will use only one twin.
1 3 3 1 1 3 1 3 1 3 6 3 4 2 5 4 2 5 2 4 5 4 5 2 4 2 5 4 2 5 7 8 6 7 8 6 7 8 6 7 8 6 8 7 6 7 8 1 board twin twin twin twin twin
How do I reconstruct the solution once I've dequeued the goal search node? Since each search node records the predecessor search node to get there, you can chase the pointers all the way back to the initial search node (and consider them in reverse order).
Can I terminate the search as soon as a goal search node is enqueued (instead of dequeued)? No, even though it does lead to a correct solution for the slider puzzle problem using the Hamming and Manhattan priority functions, it's not technically the A* algorithm (and will not find the correct solution for other problems and other priority functions).
I noticed that the priorities of the search nodes dequeued from the priority queue never decrease. Is this a property of the A* algorithm? Yes. In the language of the A* algorithm, the Hamming and Manhattan distances (before adding in the number of moves so far) are known as heuristics. If a heuristic is both admissible (never overestimates the number of moves to the goal search node) and consistent (satisfies a certain triangle inequality), then this noticed property is guaranteed. The Hamming and Manhattan heuristics are both admissible and consistent. You may use this noticed property as a debugging clue: if the priority of the search node dequeued from the priority queue decreases, then you know you did something wrong.
Even with the critical optimization, the priority queue may contain two or more search nodes
corresponding to the same board. Should I try to eliminate these?
In principle, you could do so with a set data type such as SET
in algs4.jar
or
java.util.TreeSet
or java.util.HashSet
(provided that the Board
data type were either Comparable
or had a hashCode()
method).
However, almost all of the benefit from avoiding duplicate boards is already
extracted from the critical optimization and the cost of identifying other duplicate
boards will be more than the remaining benefit from doing so.
Can I put the logic for detecting whether a puzzle is infeasible in
Board instead of Solver?
There is a elegant algorithm for determining whether a board is solvable that relies on a
parity argument (and occasionally we change our API to require this solution).
However, the current API requires you to detect infeasiblity
in Solver
by using two synchronized A* searches (e.g., using two priority queues).
I run out of memory when running some of the large sample puzzles. What should I do?
Be sure to ask Java for additional memory,
e.g., java -Xmx1600m Solver puzzle36.txt
.
We recommend running from the command line (and not from the DrJava interaction pane).
You should expect to run out of memory when using the Hamming priority function.
Be sure not to put the JVM option in the wrong spot or it will be
treated as a command-line argument,
e.g., java Solver -Xmx1600m puzzle36.txt
.
My program can't solve some of the 4-by-4 puzzles, even if I give it a huge amount of space. What am I doing wrong? Probably nothing. The A* algorithm (with the Manhattan priority function) will struggle to solve even some 4-by-4 instances.
Input files. The directory 8puzzle contains many sample puzzle input files. For convenience, 8puzzle.zip contains all of these files bundled together.
puzzle[T].txt
requires exactly T moves.
puzzle4x4-hard1.txt
and
puzzle4x4-hard2.txt
are 38 and 47, respectively.
puzzle36.txt
is especially difficult.
Test client. A good way to automatically run your program on our sample puzzles is to use the client PuzzleChecker.java.
Priority queue trace.
puzzle04.txt
.
There were a total of 10 search nodes enqueued and 5 search nodes dequeued. In general, the number of search nodes enqueued and dequeued may vary slightly, depending the order in which the search nodes with equal priorities come off the priority queue, which depends on the order in whichStep 0: priority = 4 moves = 0 manhattan = 4 3 0 1 3 4 2 5 7 8 6 Step 1: priority = 4 priority = 6 moves = 1 moves = 1 manhattan = 3 manhattan = 5 3 3 1 0 3 4 1 3 4 2 5 0 2 5 7 8 6 7 8 6 Step 2: priority = 4 priority = 6 priority = 6 moves = 2 moves = 1 moves = 2 manhattan = 2 manhattan = 5 manhattan = 4 3 3 3 1 2 3 4 1 3 1 3 0 4 0 5 0 2 5 4 2 5 7 8 6 7 8 6 7 8 6 Step 3: priority = 4 priority = 6 priority = 6 priority = 6 priority = 6 moves = 3 moves = 3 moves = 2 moves = 3 moves = 1 manhattan = 1 manhattan = 3 manhattan = 4 manhattan = 3 manhattan = 5 3 3 3 3 3 1 2 3 1 2 3 1 3 0 1 2 3 4 1 3 4 5 0 4 8 5 4 2 5 0 4 5 0 2 5 7 8 6 7 0 6 7 8 6 7 8 6 7 8 6 Step 4: priority = 4 priority = 6 priority = 6 priority = 6 priority = 6 priority = 6 moves = 4 moves = 3 moves = 4 moves = 2 moves = 3 moves = 1 manhattan = 0 manhattan = 3 manhattan = 2 manhattan = 4 manhattan = 3 manhattan = 5 3 3 3 3 3 3 1 2 3 1 2 3 1 2 0 1 3 0 1 2 3 4 1 3 4 5 6 0 4 5 4 5 3 4 2 5 4 8 5 0 2 5 7 8 0 7 8 6 7 8 6 7 8 6 7 0 6 7 8 6
neighbors()
returns the neighbors of a board. However, for this input, there are no such ties,
so you should have exactly 10 search nodes enqueued and 5 search nodes dequeued.
puzzle04.txt
turns out to be identical to the results above: for this input file, throughout the A* algorithm,
a tile is never more than one position away from its goal position, which implies that the
Hamming function and the Manhattan functions are equal.
How can I reduce the amount of memory a Board
uses?
For starters, recall that an n-by-n int[][]
array in Java uses
about 24 + 32n + 4n^2 bytes; when n equals 3, this is 156 bytes.
To save memory, consider using an n-by-n char[][]
array
or a length n^2 char[]
array.
You could use a more elaborate representation:
since each board is a permutation of length n^2, in principle,
you need only about lg ((n^2)!) bits to represent it;
when n equals 3, this is only 19 bits.
Any ways to speed up the algorithm? Yes there are many opportunities for optimization here.
toString()
method, so don't do it.
Why are the boards divided into exactly two equivalence classes with respect to reachability? Here is one proof by Aaron Archer.
Is there an efficient way to solve the 8-puzzle and its generalizations? Finding a shortest solution to an n-by-n slider puzzle is NP-hard, so it's unlikely that an efficient solution exists.
What if I'm satisfied with any solution and don't need one that uses the fewest number of moves? Yes, change the priority function to put more weight on the Manhattan distance, e.g., 100 times the Manhattan distance plus the number of moves made already. This paper describes an algorithm that guarantees to perform at most N^3 moves.
Are there better ways to solve 8- and 15-puzzle instances using the minimum number of moves? Yes, there are a number of approaches.
Can a puzzle have more than one shortest solution?
Yes. See puzzle07.txt
.
In such cases, you are required to output any one such solution.Solution 1 ------------------------------------------------------------------------------------ 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 7 6 7 6 7 4 6 7 4 6 4 6 4 6 4 5 6 4 5 6 5 4 8 5 4 8 5 8 5 8 7 5 8 7 5 8 7 8 7 8 Solution 2 ------------------------------------------------------------------------------------ 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 7 6 5 7 6 5 7 6 5 6 5 6 4 5 6 4 5 6 4 5 6 5 4 8 4 8 4 8 4 7 8 4 7 8 7 8 7 8 7 8


The last 2 times it went down sharply ... so I thaught the luck had changed
ComputerGenie 👴👴👴02-Apr-19 05:19 AM
Final Balance $ 11.90
1
actionslacks02-Apr-19 05:20 AM
I caught this one pretty good. just bought some btc for some kmd
LocoMB02-Apr-19 05:20 AM
< wootwoooot > nice to wake up to BTC action like this!
Alecandro02-Apr-19 05:21 AM
$5k
Alexfrog02-Apr-19 05:21 AM
wow
actionslacks02-Apr-19 05:21 AM
It's gonna be 6k by this time tomorrow
LocoMB02-Apr-19 05:22 AM
wasn't BTC supposed to be deded?!?! TV said so!
Alecandro02-Apr-19 05:22 AM
hourly RSI at 98
Acura02-Apr-19 05:22 AM
5k incoming
Alecandro02-Apr-19 05:22 AM
lol
LocoMB02-Apr-19 05:22 AM
bitfinex just has 5k
actionslacks02-Apr-19 05:22 AM
its VBK they flooded the network and made it look like usage was exploding?

Crabby Paddy02-Apr-19 05:26 AM
Inb4 big news drops from government or stock markets
Insider trading
LocoMB02-Apr-19 05:26 AM
.. everyone got their barfbags ready?!?!
Alecandro02-Apr-19 05:26 AM
lol such bs. BTC rockets, alts tank. BTC dumps from pump, alts get even more wrecked. how does that make any sense lol
Crabby Paddy02-Apr-19 05:26 AM
actionslacks02-Apr-19 05:27 AM
ETF incoming
Alexfrog02-Apr-19 05:27 AM
im not sure why you think i think that Genie
because i dont
blackjok3r02-Apr-19 05:27 AM
some .... Its the msot ive sold in a long time... had heaps of shit to pay, down to litteral bag of change atm.
ComputerGenie 👴👴👴02-Apr-19 05:28 AM
im not sure why you think i think that Genie
because i dont
then why use terminology that suggests you do?
other coins are only "alts" if BTC is "the coin"
blackjok3r02-Apr-19 05:28 AM
man I hope it dumps again
Caglio02-Apr-19 05:28 AM
I hope it hits all time high of 30k
komodo goes at 25
I sell everything
actionslacks02-Apr-19 05:29 AM
When it goes up this fast it's either gonna dump hard or go way higher
1
Alexfrog02-Apr-19 05:29 AM
genie, because when i use those words everyone else understands what i mean, which is the purpose of words
just buy KMD now
overreaction, will go back up once btc stable
Alecandro02-Apr-19 05:30 AM
fa sho
LocoMB02-Apr-19 05:30 AM
you mean feng shui?
Alexfrog02-Apr-19 05:30 AM
ok i got more at 24k, it can rise now
this is actually ridiculous
times like this make me wish i was a whale and could make big buys and drive it back up
ComputerGenie 👴👴👴02-Apr-19 05:31 AM
genie, because when i use those words everyone else understands what i mean,
Yes, you mean that you want all other coins compared to BTC in a manner that BTC matters most
because, words(edited)


Calculation of the mean convective heat transfer coefficient
kc for the air-side heat transfer of heat
exchangers with flat tubes and several fin geometries.
Functions kc_flatTube and
kc_flatTube_KC
There are basically three differences:
- The function kc_flatTube is using
kc_flatTube_KC but offers additional output
variables like e.g. Reynolds number or Nusselt number and failure
status (an output of 1 means that the function is
not valid for the inputs).
- Generally the function kc_flatTube_KC is
numerically best used for the calculation of the mean convective
heat transfer coefficient kc at known mass flow
rate.
- You can perform an inverse calculation from
kc_flatTube_KC, where an unknown mass flow rate is
calculated out of a given mean convective heat transfer coefficient
kc
Restriction
- According to the kind of fin geometry the calculation is valid
in a range of Re from 100 to 5000.
- medium = air
Geometry
Calculation
The mean convective heat transfer coefficient
kc for heat exchanger is calculated through the
corresponding Coulburn factor j :
j = f(geometry, Re)
with the resulting mean convective heat transfer coefficient
kc
kc = j * Re_L_p * Pr^(1/3) * lambda / L_p (Louver fin)
or
kc = j * Re_D_h * Pr^(1/3) * lambda / D_h (Rectangular offset strip fin)
with
| D_h |
as hydraulic diameter [m], |
| kc |
as mean convective heat transfer coefficient [W/(m2K)], |
| lambda |
as heat conductivity of fluid [W/(mK)], |
| L_p |
as louver pitch [m], |
| Nu_D_h = kc*D_h/lambda |
as mean Nusselt number based on hydraulic diameter [-], |
| Nu_L_p = kc*L_p/lambda |
as mean Nusselt number based on louver pitch [-], |
| Pr = eta*cp/lambda |
as Prandtl number [-], |
| Re_D_h = rho*v*D_h/eta |
as Reynolds number based on hydraulic diameter [-], |
| Re_L_p = rho*v*L_p/eta |
as Reynolds number based on louver pitch [-], |
Verification
The mean Nusselt number Nu representing the
mean convective heat transfer coefficient kc is
shown below for different fin geometries at similar dimensions.
References
- Y.-J. CHANG and C.-C. WANG:
- A generalized heat transfer correlation for louver fin
geometry. In International Journal of Heat and Mass
Transfer, volume 40, No. 3, pages 533-544, 1997.
- Y.-J. CHANG and C.-C. WANG:
- Air Side Performance of Brazed Aluminium Heat
Exchangers. In Journal of Enhanced Heat Transfer, volume
3, No. 1, pages 15-28, 1996.
- R.-M. Manglik, A.-E. Bergles:
- Heat Transfer and Pressure Drop Correlations for the
Rectangular Offset Strip Fin Compact Heat Exchanger. In
Experimental Thermal and Fluid Science, volume 10, pages 171-180,
1995.
Generated at 2019-01-25T16:44:03Z by OpenModelica 1.14.0~dev-130-gefa44fb


Weekly musing #18 - After the fork
A hard fork and a hard deadline
August 1 2017 was F-Day.
Bitcoin's first block size upgrade hard fork - a controversial event which some had said could not happen.
Yet, here we are, nearly a week after this significant event which has given birth to a spin-off chain with a bigger (and flexible) block size cap.
Congratulations to all!
Some lessons emerging
Though coordination for a hard fork among 4 different client implementations (ABC, BU, Classic and XT) is not entirely easy, it does seem like this fork could not have been a success otherwise. The valuable contributions from every client is what made it a success in the end.
Late-game specification changes led to some consternation, and should better be avoided in future.
A surprisingly large amount of code and tests need cleanup and fixing after a hard fork.
And not everything will go smoothly - bugs will be there (in various implementations) no matter what. As someone predicted, having multiple client implementations is a good way to save each other's bacon during such events.
References
[1] Image of raising fork at Iwo Jima is by Imgur user "totherioters" http://imgur.com/gallery/FGEzb


Android Platform Overview
Objective
In order to build best-of-breed, native apps, it's critical that we understand the unique characteristics of each platform for which we plan to develop. In this section, you will examine the concepts, features, and components that identify Android apps.
Contents
Android has a multitude of platform specific features that we need to be aware of as Titanium developers. Everything from its user interface components to its low level interfaces for Services and Intents make Android stand apart from other mobile operating systems. While Titanium's Javascript API does the lion's share of the work in terms of abstracting away these details, it's still very important to understand them in order to build high quality apps. The following content in this section will address each of the most important features of the Android operating system, as well as discuss how they are handled from the perspective of the Titanium API.
User interface conventions
You will find quickly when researching Android that the UI can vary significantly among devices. While there is a standard, "vanilla" UI common to all Android operating systems, this is rarely seen on device. This is because Android is an open source, and thus extendible, mobile operating system. Mobile device vendors, like Motorola and HTC, are free to take the base UI and enhance it as they see fit. Android seeks to enable each vendor's own vision of what Android should be on their device, not dictate it.
The following screens illustrate some of the common user interface components offered by the "vanilla" Android UI.
Hardware buttons
Android devices feature four dedicated-function "hardware" buttons: Back, Menu, Home, and Search. Depending on the device, these buttons can be physical buttons or touch-based user interface buttons. The location and order of those buttons varies between device vendors.
-
Back – tap to return to the previous activity in the stack; if none remain in the stack you're returned to the home screen.
-
Home – return immediately to the home screen, pausing any currently opened apps
-
Menu – display a menu of activity-specific options
-
Search – display search functionality, either in-app or system-wide
Screen sizes and densities
Android devices vary greatly in screen size and density. Screen size represents the physical size of the display. Measured diagonally, it can range from quite small (2.8 inches/71 mm) to large (4.3 inches/110mm) to tablet sizes (10.1 inches/256 mm). Android divides these into generally four categories: small, normal, large, and xlarge which are then denoted by their density-independent pixel measurements which Google labels "dp." Each density-independent pixel is equivalent to one physical pixel on a 160 dpi screen.
-
small screens are at least 426dp x 320dp
-
normal screens are at least 470dp x 320dp
-
large screens are at least 640dp x 480dp
-
xlarge screens are at least 960dp x 720dp
Aspect ratios vary as well, though Android generally lumps them into two buckets: long and "notlong" with the latter corresponding to devices with an aspect ratio not significantly different than the 320 x 470 "normal" screen.
Finally, density describes the actual pixels (aka dots) per square inch resolution of the screen. These range between:
-
ldpi screens are roughly 120 dpi
-
mdpi screens are roughly 160 dpi (This is the baseline "normal" density.)
-
tvdpi screens are roughly 213 dpi
-
hdpi screens are roughly 240 dpi
-
xhdpi screens are roughly 320 dpi
Titanium enables you to simply scale your user interface to fit the device's screen. But it also offers convenient features for specifically handling assets and layout for various screen sizes. You should plan to test on multiple devices if you want your user interface to be "pixel perfect" on all devices.
Comparison with iOS
The Android user interface features some key differences that iOS users should note.
-
Tabs are at the top rather than bottom.
-
Window title bars don't include navigation buttons. Navigation functionality is provided by the hardware Back and Menu buttons instead.
-
The Navigation bar does more than just give battery and signal-strength info. It is the common location for system and app notification messages. Likewise, Android doesn't use the "badge" indicator like iOS.
Application Components
Android applications are built from the following components. Titanium shields you from some of the particulars, though it also gives you the tools to interact with these components when you want to.
-
Activities
-
Services
-
Intents
(We're simplifying things a bit here by ignoring content providers and broadcast receivers. Read Google's Android Fundamentals guide for more detailed information.)
Activities
An Android app is made up of one or more activities. Each activity represents a "single screen with a user interface." For example, a window that lists messages in an inbox would be an activity. The window in which you read one of those messages would be a separate activity. The set of activities in an app work together to provide the functionality of that app.
On of the most powerful features of Android activities is that apps can start each other's activities. Let's say you want the user to be able to snap a photo within your app. You could write all the code to display the camera's live view along with the buttons that make up the photo-snapping experience. But with Android, you don't have to. The built-in Camera app has an activity that does all that already. All your app needs to do is launch the Camera app's activity and define what should happen with the data that's returned. Other apps can call on the activities that are defined within your app as well.
This shared-activity scheme is a key strength of the Android platform. Apps can share functionality, and they don't even need to know how those other apps work. Your app doesn't need to know how Camera's activity grabs the photo. You can just deal with the image that's returned. This activity sharing mechanism is what enables the "Share" button functionality included in many Android apps. This is discussed in more detail in the Intent section.
Each activity is listed in the AndroidManifest.xml file. Notations in that file describe which activities are published (and thus available for other apps to call on). Titanium let's you create activities – a "heavy weight" window that corresponds to an Android activity. When the tiapp.xml file and your code is parsed by Titanium's compile scripts, appropriate entries are created in the AndroidManifest.xml file.
You'll find more info on the Android developer's Activity guide.
Services
Services are "long running" app components that run without user interaction. You might use a service to periodically check a network resource or you play music while your app is in the background. Services are not separate threads or processes. They're not a way to offload work from your main application. You can create services by calling on Titanium's Ti.Android.Service module.
More information can be found at the Android developer's services page or the Ti.Android.Service page.
Intents
Intents are messaging objects that hold data passed between activities, sent to or from a background service, or sent by system broadcasts. Intents enable your app to interact with the activities available on the user's device without knowing which apps the user has installed.
Earlier we stated that you can launch another app's activities. In truth, for security reasons your app can't directly start another app's activities. Instead, your app sends an Intent, which contains a URI to the content and instructions as to how it should be handled. You can create an explicit iIntent, in which you request that a specific activity be launched. If it's available, Android launches it for on behalf of your app. The more powerful option is to use an implicit intent, which will return a list of all apps available on a mobile device that are capable of handling your Intent.
Think back to the "Share" button functionality described earlier. Your app might publish some text via an intent, thereby sending a request for a list of all the apps that could handle that data. The OS would present a list of suitable apps to the user, who would choose which app to use. The user could select a Twitter client, email app, or any other app that can handle text. With properly formatted Intents, you can add large amounts of functionality to your apps simply by leveraging apps already installed on the device.
Intent Filters
Intent filters are created through entries in the AndroidManifest.xml file. They are used to describe the types of Intents an Activity can accept. Android uses intent filters to determine which activities can respond to an intent. For example, this is how Android narrows the list of all possible apps to just those shown on a particular Share menu. See the Android docs for more information.
More information about intents and intent filters are available from the Android docs or the Titanium Android module page.
References and Further Reading
-
Google's Android Fundamentals document is recommended reading
Summary
In this chapter, you learned about some of the characteristics that define Android and Android apps. You looked at user interface components, device buttons, and application components, such as activities and intents. Next we'll learn what makes iOS unique from other mobile operating systems, and how we can leverage these features with Titanium.


Messenger Application
July 2017- September 2017
Developed a website for chatting with friends. The website contained many widgets for users to choose the layout they want to use. Since the application is only for chatting, the whole screen was used to arrange chats in different ways for users to get attracted.
The chat was possible through the Google cloud service and users were connected through email ids. They needed to know each other to use it. The website also has a chatbot that uses natural language processing to recognize what the user asks and searches on the internet and provides results for the request.
Technologies used: ReactJS, JavaScript, HTML5/CSS3, Ruby on Rails, MySQL.
Parallel Implementation of Gotoh Algorithm
April 2017- June 2017
Parallelized Gotoh algorithm using OpenMP and CUDA. Analyzed the serial algorithm to ensure how and where to introduce parallelism in the algorithm.
The algorithm uses dynamic programming to calculate the RNA matching scores through which the RNA sequences are compared. After analysis, the program spent more time in the dynamic programming.
To parallelize it we used the wavefront method to parallelize calculations that were not dependent.
Once the parallel algorithm was planned, I parallelized the algorithm using OpenMP.
Technologies used: C++, OpenMP, CUDA.
Middleware for Smart Home Applications
April 2017- June 2017
Developed a middleware for smart home that can help devices talk to each other and make decisions collectively using various sensor inputs. The middleware connected all the devices together by communicating with each device and mapping them with each other through a registry. This allowed the devices to work with each other. Device discovery was implemented in the middleware that provided the ease to replace any device and still continue with proper working.
Web and Android application was developed to control all the devices in the house by interacting with the middleware.
Technologies used: Python, JavaScript, HTML5/CSS3, JQuery, Node.js, MySQL, Android.
FabFlix e-Commerce Website
January 2017- March 2017
Developed a 3-tier web application for online movie shopping. Optimized DB operations using connection pooling, data caching and stored procedures. Uploaded massive movie data in XML format into the database using DOM parser. Developed an Android application and Restful APIs for fetching the data for movies. Included 2 members, most of my contribution was on the backend.
Technologies used: JSP, JavaScript, JQuery, AJAX, HTML5/CSS3, Java, JDBC, MySQL, Android.


Spike and slab for prediction and variable selection in linear regression models. Uses a generalized elastic net for variable selection.
| Version: | 1.1.5 |
| Depends: | R (≥ 3.0.0), lars, randomForest, parallel |
| Published: | 2013-04-18 |
| Author: | Hemant Ishwaran |
| Maintainer: | Udaya B. Kogalur <ubk at kogalur.com> |
| License: | GPL (≥ 3) |
| URL: | http://web.ccs.miami.edu/~hishwaran http://www.kogalur.com |
| NeedsCompilation: | yes |
| Citation: | spikeslab citation info |
| Materials: | NEWS |
| In views: | Bayesian |
| CRAN checks: | spikeslab results |
| Reference manual: | spikeslab.pdf |
| Package source: | spikeslab_1.1.5.tar.gz |
| Windows binaries: | r-devel: spikeslab_1.1.5.zip, r-release: spikeslab_1.1.5.zip, r-oldrel: spikeslab_1.1.5.zip |
| OS X binaries: | r-release: spikeslab_1.1.5.tgz, r-oldrel: spikeslab_1.1.5.tgz |
| Old sources: | spikeslab archive |
| Reverse imports: | SentimentAnalysis |
| Reverse suggests: | CorReg |
Please use the canonical form https://CRAN.R-project.org/package=spikeslab to link to this page.


Survey Form
Let us know how we can improve freeCodeCamp
Name:
email:
age:
Which option best describes your current role?
Student
Full time job
Full time learner
prefer not to say
other
What do you like most in FCC:
challenges
Projects
Community
Open source
How likely is that you would recommend freeCodeCamp to a friend?
Definitely
Maybe
not sure
Things that should be improved in the future
Front-end projects
Backend projects
Data visualization
Challenges
Open Source community
Gitter help rooms
videos
Comments:
submit


The TTI library came out of my effort to take the type_traits_ext
part of the unfinished Concept Traits Library and expand it. So my first thanks
go to Terje Slettebo and Tobias Schwinger, the authors of the CTL. I have taken,
and hopefully improved upon, the ideas and implementation in that library,
and added some new functionality.
I would also like to thank Joel Falcou for his help and his introspection work.
Two of the introspection templates are taken from the MPL and lifted into my library under a different name for the sake of completeness, so I would like to thank Aleksey Gurtovoy and David Abrahams for that library, and Daniel Walker for work on those MPL introspection macros.
Finally thanks to Anthony Williams for supplying a workaround for a Visual C++ bug which is needed for introspecting member data where the type of the member data is a compound type.