Is Music turing complete? - turing-machines

Considering this:
Music is, a combination of frequencies (in hertz) produced that may be pleasing/displeasing to the listener ( let's assume that all forms of consonance and dissonance in music produced are music since the concept of consonance and dissonance is subject to the era and genre of music that one is acquainted with)
having said this: let's define the alphabet of music consisting of these characters ( a set of frequencies that repeat after reaching do, which is 2 times the frequency of the starting do ):
do di ra re ri me mi fa fi se sol si le la li te ti do
where in the rules being that if accending the alphabet it would be :
do di re ri me fa fi sol si la li ti do
and descending would be :
do ti te la le sol se fa mi me re ra do
Just by taking in this much , would this be turing complete ?

Related

How to split a feature in pandas

This is the first 5 examples of the training set i'm working on. I'm supposed to predict the rating given by that user to other comedy in the test set.
So this is how the test set looks, but without the ratings:
So i have a few questions:
1.What would be the best way to seperate the joke identifier into Comedian and Location. For example, Klint De Drunk is a comedian, Enugu 1 is a location
What would be the best approach to get the best prediction accuracy deep learning wise.
Thank you
Viewers_ID Joke_identifier Response_ID Rating
0 A1 Klint De Drunk Enugu 1 A1_Klint De Drunk Enugu 1 0.11
1 A1 Klint De Drunk Enugu 2 A1_Klint De Drunk Enugu 2 -4.64
2 A1 Klint De Drunk PH 1 A1_Klint De Drunk PH 1 -3.39
3 A1 Klint De Drunk PH 2 A1_Klint De Drunk PH 2 0.44
4 A1 Klint De Drunk Lagos 1 A1_Klint De Drunk Lagos 1 -4.83
5 A1 Klint De Drunk Lagos 2 A1_Klint De Drunk Lagos 2 -4.52
for point 1:
use:
df['Joke_identifier_new'] = df['Joke_identifier'].str.rsplit(n=2).str[0]
df['location'] = df['Joke_identifier'].str.rsplit(n=2).str[1:].str.join(' ')
print(df)
However, you should create a new column for the split, do not assign it back as the second code wouldnot yeild desired results. You can then drop the original columns if required.

Searching movie by title, sql vs http access

My doubt is, when I make a movie search by title in a another different language than English, why the search is more precise if use HTTP access than SQL ?
For example i want to retrieve info about the Movie "El gran Robo" (spanish title) original title "Flypaper".
case 1) using SQL access
ia = IMDb(accessSystem='sql', uri = "mysql://devel:password#localhost/imdb")
movies = ia.search_movie("el gran robo")
for m in movies:
print m['titles']
OUTPUT:
7 uomini e un cervello
El gran rabo
List item
Mathias Sandorf
La gran revista
Green River
Green River
The Grim Reaper
The Grim Reaper
La commare secca
Anthropophagus
La verte moisson
Granny R.I.P.
Gehirnreflexe
Rosso sangue
Green River Killer
Grammar Revolution
German Whorefare 4
Cuori in campo
Grim Reaper
Grim Reaping
case 2) using HTTP access
ia = IMDb()
movies = ia.search_movie("el gran robo")
for m in movies:
print m['titles']
OUTPUT:
Flypaper
The Big Steal
Robbery
El gran robo del tren
El gran robo de Lorenza
The Bank Job
The First Great Train Robbery
Grand Theft Auto
The Great Train Robbery
Hot Money
7 uomini e un cervello
The Great Missouri Raid
Le Great Dane Robbery
El gran río
Después del gran robo
Gran-Robo tonda
As you can see, the search with HTTP returned the right Movie, Flypaper.
Is it possible get the same results using SQL ?
Short version: some data are missing in the plain text data files.
Extended explanation in the imdbpy-help mailing list: http://sourceforge.net/p/imdbpy/mailman/message/33067664/

tesseract ocr works terrible on ios (7)

I don't know if something is wrong with me or tesseract library but it works terrible.
Tesseract* tesseract = [[Tesseract alloc] initWithDataPath:#"tessdata" language:#"eng"];
[tesseract setVariableValue:#"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZéèô" forKey:#"tessedit_char_whitelist"]; //limit search
[tesseract setImage:[UIImage imageNamed:#"sampledoc.jpg"]]; //image to check
[tesseract recognize];
NSLog(#"%#", [tesseract recognizedText]);
[tesseract clear];
This is the sample image I want to extract text from:
And this is what I get after running:
THE SILVER CHAIR
by r 5 Lawn
CHAPTER ow
BEHIND THE cm
lr W1C a dull aulumn day and llll Pole vmscrylng ulmo mo gym
She ms clymg because Illey had been bullymg her Hus Is not gmng In baa school oolyl se I
shall say 15 lane is poslble Ibvlll lllrs schwll which lsnol 1 plusinl subjzrl II was Tcr
eduummlr o sdsooV rm bolh boysuld glrlsl Mm used no he cnllcd o wmxodl schonll some
said on wax ml nculy so mixed as an mlndsohhe people whn an n These penple had um mu
m boyund glrlsshauld loeullma mdn who my mo And unlonunalcb mm ml or
mom aflhc hlggzsl bays mo girls liked best was bullying Ihe mm All suns orlllmgsl hound
mmgso went on Much u an nvdmlry saloon wnuld mm bum flwnd om ma snowed m lulfn
R1my hm al Ilus school xhcy vlucrfl Or mu Iflhcy mo mo people who am am wxc not
expellad m pomsloa The mm no they Mile lntntesilng psycholoycnl msxs mdsaul for
them and mm mlhem for hnun Mo Ifyml knew lhe nghl sorlofdnngxmsay In mo um
mo maul result wos um vou became mlhev 1 fmounlelhan olllnrwlsc
no mswmy ml Pole W crymg on ml dull autumn my on me dlmp Vmlc pith Much runs
bellman um um arm gym ma Ihe lhvubbezy mm ole mam nearly nmulea her ay whan
boy came round Ihz oomuonhogym Mxmlmg mm ms lnmlds m ms pocktu I12 mm In
lmo nu
CuIV yuu look when yolfre gomw ma JIH Fob
Mu nglur sud me km won mam man a and am he mom hen rm ll WV Polef he
not was upv
ml only mndc lung the am you mm mo yodic llymg oo my somclhmg um um Ihn lfyou
spnk you1l smrl ctymg owl
lfs mum I suww l as mualr sand me hwy Mlmlbx ouggmg ms hlnds nmm mm ms vovkals
ml waded Them wlsw moo forhurm sly llH1hVlIgoCVOllWiIE ooolo have Said u They both
knew
wow laok has said the beyl Wherek no gond us all r
He mezm WEIL am he am mlk mum mo mlnmne begmnmg n lecmne ml suddenly liew mm a
lmxpcr hvmdl Isqnllc Illkcly llllng Io hlppen Ifyou law been mmrupled in n cryl
I
What I am supposed to do?
He meant the pixel resolution (PPI), not the image dimension.
I rescaled the image (from 96 DPI) to 300 DPI and got almost all text recognized correctly. The image definitely needed pre-processing before OCR step.
Tesseract *tesseract = [[Tesseract alloc] initWithDataPath:#"tessdata" language:#"eng"];
[tesseract setImage:chosenImage];
[tesseract recognize];
NSLog(#"%#",[tesseract recognizedText]);

What are the common natural language expression for timespans and dates?

I am creating a natural language date parser for scheduling recurring events that span a few times a day to several times a month or year.
Please help me think of the common ways to express these events (bonus for additional languages than English)
Here's what I have so far:
twice everyday
once every week
Mondays and Thursdays
No later than 1/25
as needed every day
twice the last sun of every month
the 5th friday of every month at 8
Edit
This video was pretty helpful in thinking about natural language date patterns.
http://youtu.be/m-hdy9a4ac4
code: https://github.com/dcparker/temporals
I am still hoping to get a few other examples
Edit 2
Apparently the key words are:
Temporal Words and Phrases
Adverbs of Time
French
http://french.about.com/od/vocabulary/a/time.htm
une fois - once
une fois par semaine - once a week
quotidien - daily
tous les jours - every day
tous les deux jours - every other day
hebdomadaire - weekly
toutes les semaines - every week
mensuel - monthly
annuel - yearly
Edit 3
When in doubt, find a standard...
http://search.cpan.org/dist/DateTime-Format-Natural/lib/DateTime/Format/Natural/Lang/EN.pm

Column breaks in mulicolumn text in Windows 8 XAML

Here described how I can create multicolumn text with horizontal scroll in Windows 8 Metro style app. Is there way to add "column breaks" to get any title on the top of column, not in the middle (having in mind, that we don't know how many columns in each section):
You could create an ItemsControl and make the RichTextColumns as a DataTemplate. Each columns are in a list that is bound to ItemsControl.
Here is XAML sample:
<ItemsControl x:Name="itemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<!-- Content is allowed to flow across as many columns as needed -->
<common:RichTextColumns x:Name="richTextColumns" Margin="25,20,25,20">
<RichTextBlock x:Name="richTextBlock" Width="200" Style="{StaticResource ItemRichTextStyle}" IsTextSelectionEnabled="False">
<Paragraph>
<Run FontSize="26.667" FontWeight="Light" Text="{Binding Title}"/>
<LineBreak/>
<LineBreak/>
</Paragraph>
<Paragraph>
<Run FontWeight="SemiLight" Text="{Binding Content}"/>
</Paragraph>
</RichTextBlock>
<!-- Additional columns are created from this template -->
<common:RichTextColumns.ColumnTemplate>
<DataTemplate>
<RichTextBlockOverflow Width="200" Margin="80,0,0,0">
<RichTextBlockOverflow.RenderTransform>
<TranslateTransform X="-1" Y="4"/>
</RichTextBlockOverflow.RenderTransform>
</RichTextBlockOverflow>
</DataTemplate>
</common:RichTextColumns.ColumnTemplate>
</common:RichTextColumns>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Here is C# code-behind sample:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var samples = new List<SampleColumnData>
{
new SampleColumnData{
Title = "Column1",
Content = "Just the good ol' boys, never meanin' no harm. Beats all you've ever saw, been in trouble with the law since the day they was born. Straight'nin' the curve, flat'nin' the hills. Someday the mountain might get 'em, but the law never will. Makin' their way, the only way they know how, that's just a little bit more than the law will allow. Just good ol' boys, wouldn't change if they could, fightin' the system like a true modern day Robin Hood. Knight Rider, a shadowy flight into the dangerous world of a man who does not exist. Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless in a world of criminals who operate above the law. I never spend much time in school but I taught ladies plenty. It's true I hire my body out for pay, hey hey. I've gotten burned over Cheryl Tiegs, blown up for Raquel Welch. But when I end up in the hay it's only hay, hey hey. I might jump an open drawbridge, or Tarzan from a vine. 'Cause I'm the unknown stuntman that makes Eastwood look so fine. Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. Birds taught me to sing, when they took me to their king, first I had to fly, in the sky so high so high, so high so high so high, so - if you want to sing this way, think of what you'd like to say, add a tune and you will see, just how easy it can be. Treacle pudding, fish and chips, fizzy drinks and liquorice, flowers, rivers, sand and sea, snowflakes and the stars are free. La la la la la, la la la la la la la, la la la la la la la, la la la la la la la la la la la la la, so - Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. "
},
new SampleColumnData{
Title = "Column2",
Content = "Just the good ol' boys, never meanin' no harm. Beats all you've ever saw, been in trouble with the law since the day they was born. Straight'nin' the curve, flat'nin' the hills. Someday the mountain might get 'em, but the law never will. Makin' their way, the only way they know how, that's just a little bit more than the law will allow. Just good ol' boys, wouldn't change if they could, fightin' the system like a true modern day Robin Hood. Knight Rider, a shadowy flight into the dangerous world of a man who does not exist. Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless in a world of criminals who operate above the law. I never spend much time in school but I taught ladies plenty. It's true I hire my body out for pay, hey hey. I've gotten burned over Cheryl Tiegs, blown up for Raquel Welch. But when I end up in the hay it's only hay, hey hey. I might jump an open drawbridge, or Tarzan from a vine. 'Cause I'm the unknown stuntman that makes Eastwood look so fine. Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. Birds taught me to sing, when they took me to their king, first I had to fly, in the sky so high so high, so high so high so high, so - if you want to sing this way, think of what you'd like to say, add a tune and you will see, just how easy it can be. Treacle pudding, fish and chips, fizzy drinks and liquorice, flowers, rivers, sand and sea, snowflakes and the stars are free. La la la la la, la la la la la la la, la la la la la la la, la la la la la la la la la la la la la, so - Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. "
},
new SampleColumnData{
Title = "Column3",
Content = "Just the good ol' boys, never meanin' no harm. Beats all you've ever saw, been in trouble with the law since the day they was born. Straight'nin' the curve, flat'nin' the hills. Someday the mountain might get 'em, but the law never will. Makin' their way, the only way they know how, that's just a little bit more than the law will allow. Just good ol' boys, wouldn't change if they could, fightin' the system like a true modern day Robin Hood. Knight Rider, a shadowy flight into the dangerous world of a man who does not exist. Michael Knight, a young loner on a crusade to champion the cause of the innocent, the helpless in a world of criminals who operate above the law. I never spend much time in school but I taught ladies plenty. It's true I hire my body out for pay, hey hey. I've gotten burned over Cheryl Tiegs, blown up for Raquel Welch. But when I end up in the hay it's only hay, hey hey. I might jump an open drawbridge, or Tarzan from a vine. 'Cause I'm the unknown stuntman that makes Eastwood look so fine. Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. Birds taught me to sing, when they took me to their king, first I had to fly, in the sky so high so high, so high so high so high, so - if you want to sing this way, think of what you'd like to say, add a tune and you will see, just how easy it can be. Treacle pudding, fish and chips, fizzy drinks and liquorice, flowers, rivers, sand and sea, snowflakes and the stars are free. La la la la la, la la la la la la la, la la la la la la la, la la la la la la la la la la la la la, so - Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. "
},
};
itemsControl.ItemsSource = samples;
}
And here is a screenshot:
Hope this helps!

Resources