My question is about why rbind function of R does not work for Gujarati text input - user-input

library(tibble)
library(tidyr)
pos_tweets = rbind(c(‘મને આ કાર ગમે છે’, ‘positive’),
Error: unexpected input in "pos_tweets = rbind(c(‘"
c(‘આ દૃશ્ય સુંદર છે’, ‘positive’),
Error: unexpected input in " c(‘"
c(‘આ સવારે મને મજા આવે છે’, ‘positive’),
Error: unexpected input in " c(‘"
c(‘સંગીત રોમાંચક છે’, ‘positive’),
Error: unexpected input in " c(‘"
c(‘રમેશ મારો પાકો દોસ્ત છે’, ‘positive’),
Error: unexpected input in " c(‘"
c(કમળા ખૂબ રૂપાળી છે’, ‘positive’),
Error: unexpected input in " c(\"
c(અમારું બિલાડું રમતિયાળ છે’, ‘positive’),
Error: unexpected input in " c(\"
c(લાડુ તો ભાવે જ ને’, ‘positive’),
Error: unexpected input in " c(\"
c(વાડી લીલી છે’, ‘positive’),
Error: unexpected input in " c(\"
c(ચોપડી રસપ્રદ છે’, ‘positive’)
Error: unexpected input in " c(\"
)
Error: unexpected ')' in ")"

Either single quote marks ' or double quote marks " must be used around the text.
Above are "strange" left quote and right quote, and fails the syntax check for allowed characters, and the text is not being recognized as a valid character string. It is the result of SMART QUOTES, given by WORD resulting in characters x93 and x94, instead of x22. See article I found 11/18/2018 at
https://support.office.com/en-us/article/change-curly-quotes-to-straight-quotes-and-vice-versa-017963a0-bc5f-486b-9c9d-0ec511a8fb8f
Change all left-quote to single or double, and then change all right-quote to the same.
Has nothing to do with text being Gujarati text.
c(‘મને આ કાર ગમે છે’, ‘positive’) fails
Copy the above and paste into Notepad, and then change font size to 18 to see the difference.
both of these work
> pos_tweets = rbind(c("મને આ કાર ગમે છે", "positive"))
> pos_tweets = rbind(c('મને આ કાર ગમે છે', 'positive'))

Related

I am using traci4matlab, and I am running "traci_test2.m" but this error occured

Dot indexing is not supported for variables of this type.
Error in traci.sendExact (line 19)
activeConnection.dos.writeInt(len);
Error in traci.getVersion (line 23)
result = traci.sendExact();
Error in traci.start (line 65)
[traciVersion,sumoVersion] = traci.getVersion();
Error in traci_test2 (line 57)
traci.start(['sumo-gui -c ' '"' scenarioPath '"' ' --start']);
19
activeConnection.dos.writeInt(len);

Illegal Character Escape in Text.Smolder.Renderer.String.purs

In an attempt to compile my program, I received the following error regarding the file String.purs from the Text.Smolder.Renderer module:
Error found:
at bower_components\purescript-smolder\src\Text\Smolder\Renderer\String.purs:76:
56 - 76:57 (line 76, column 56 - line 76, column 57)
Unable to parse module:
Illegal character escape code
I looked at the source file and found the following at line 76:
toStream s = foldr (\c t -> c :< (Just t)) (mkCofree '\0' Nothing) cs
How can this be corrected? (And how on earth could a compiler error be in a public library!!!)

error " Undefined function 'data_ref' for input arguments of type 'double'. "

my code matlab for denoising EEG artifact show me always this error : "error " Undefined function 'data_ref' for input arguments of type 'double'. "
%% Load Reference Data
load data_ref;
data_ref = data_ref(1:data_length)*10/2^15;
data_ref = power_supply_noise_remove(data_ref, Fs);
data_ref = data_ref - mean(data_ref);
data_ref = [data_ref data_ref];**
the error is line 26:
Undefined function 'data_ref' for input arguments of type 'double'.
Error in art_emd_ica (line 26) data_ref = data_ref(1:data_length)*10/2^15;

psql errors on restore database

Please read a litle story first. So I have a front end application that run on a SUSE Linux Enterprise 9 PC and PostgreSQL 7.4.2 database server.
Now I installed on a Windows 8.1 PC postgresql-9.5.1 from get.enterprisedb.com.
When I want to restore the backup from SUSE (that was made from a menu item of the front end application) with the command:
psql -U admin -d MyDataBase -f BackupDatabase
I receive a lot of errors like:
^
psql:d:/Ael_DB.tar:27100: ERROR: syntax error at or near "Scara"
LINE 1: Scara: A;
^
psql:d:/Ael_DB.tar:27101: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 20;
^
psql:d:/Ael_DB.tar:27102: ERROR: syntax error at or near "Ü8"
LINE 1: Ü?Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27103: ERROR: syntax error at or near "Bulevardul"
LINE 1: Bulevardul: AUREL VLAICU;
^
psql:d:/Ael_DB.tar:27104: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 6;
^
psql:d:/Ael_DB.tar:27105: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: C6;
^
psql:d:/Ael_DB.tar:27106: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 48;
^
psql:d:/Ael_DB.tar:27107: ERROR: syntax error at or near "WLocalitate"
LINE 1: WLocalitate: Constanta;
^
psql:d:/Ael_DB.tar:27108: ERROR: syntax error at or near "Strada"
LINE 1: Strada: CAIUTI;
^
psql:d:/Ael_DB.tar:27109: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 27;
^
psql:d:/Ael_DB.tar:27110: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27111: ERROR: syntax error at or near "Strada"
LINE 1: Strada: CRINULUI;
^
psql:d:/Ael_DB.tar:27112: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 19;
^
psql:d:/Ael_DB.tar:27113: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27114: ERROR: syntax error at or near "Strada"
LINE 1: Strada: DRAGOSLAVELE;
^
psql:d:/Ael_DB.tar:27115: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 1B;
^
psql:d:/Ael_DB.tar:27116: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: 1A;
^
psql:d:/Ael_DB.tar:27117: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 9;
^
psql:d:/Ael_DB.tar:27118: ERROR: syntax error at or near ""Localitate"
LINE 1: "Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27119: ERROR: syntax error at or near "Strada"
LINE 1: Strada: OBORULUI;
^
psql:d:/Ael_DB.tar:27120: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 54;
^
psql:d:/Ael_DB.tar:27121: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: L2;
^
psql:d:/Ael_DB.tar:27122: ERROR: syntax error at or near "Scara"
LINE 1: Scara: B;
^
psql:d:/Ael_DB.tar:27123: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 34;
^
psql:d:/Ael_DB.tar:27124: ERROR: syntax error at or near "┼Localitate"
LINE 1: ┼Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27125: ERROR: syntax error at or near "Strada"
LINE 1: Strada: PRELUNGIREA LILIACULUI;
^
psql:d:/Ael_DB.tar:27126: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 6;
^
psql:d:/Ael_DB.tar:27127: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: G8;
^
psql:d:/Ael_DB.tar:27128: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 50;
^
psql:d:/Ael_DB.tar:27129: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27130: ERROR: syntax error at or near "Strada"
LINE 1: Strada: STEFAN CEL MARE;
^
psql:d:/Ael_DB.tar:27131: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 57;
^
psql:d:/Ael_DB.tar:27132: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: M17;
^
psql:d:/Ael_DB.tar:27133: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 24;
^
psql:d:/Ael_DB.tar:27134: ERROR: syntax error at or near "eme"
LINE 1: eme.Localitate: Mereni;
^
psql:d:/Ael_DB.tar:27147: ERROR: syntax error at or near "ńwĆ"
LINE 1: ńwĆ
^
psql:d:/Ael_DB.tar:27147: ERROR: syntax error at or near "˘ţŤ"
LINE 1: ˘ţŤ;
^
psql:d:/Ael_DB.tar:27147: ERROR: syntax error at or near "˘ţŤ"
LINE 1: ˘ţŤ;
^
psql:d:/Ael_DB.tar:27147: ERROR: syntax error at or near "o"
LINE 1: o↕?;
^
psql:d:/Ael_DB.tar:27147: ERROR: syntax error at or near "uLp"
LINE 1: uLp;
^
psql:d:/Ael_DB.tar:27147: ERROR: syntax error at or near "uLp"
LINE 1: uLp;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "∟"
LINE 1: ∟♀×#=∟♀>Ý`
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "Öę?"
LINE 1: Öę?;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "Öę?"
LINE 1: Öę?;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "o"
LINE 1: o↕?;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "o"
LINE 1: o↕?;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "o"
LINE 1: o↕?;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "o"
LINE 1: o↕?;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "∟"
LINE 1: ∟ů⌂?śů⌂?śů⌂?ś♀]?<ף<Öę?<|Í<ŹÂuD"
LINE 1: |>D;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "|>D"
LINE 1: |>D;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near "|>D"
LINE 1: |>D;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near ">"
LINE 1: >Ă.;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near ">"
LINE 1: >Ă.;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near ">"
LINE 1: >Ă.;
^
psql:d:/Ael_DB.tar:27153: ERROR: syntax error at or near ">"
LINE 1: >Ă.;
^
☼▲◄♀☻". available for "▼→♥gupa↕; agem↕↕g▬N↨X ☼#☺☻; ┌g☺4g☺(☻►=♦?☻
Try \h with no arguments to see available help.
psql:d:/Ael_DB.tar:27171: ERROR: syntax error at or near "∟"
LINE 1: .resources.resource.9.typede5zĆ♀4VĎm_1181127081303.zipbp"]...
^
psql:d:/Ael_DB.tar:27171: ERROR: syntax error at or near ")"
LINE 1: )R6↔ ^H§"0Ű☺k‼"d§}↔=$ç♂▬order b'y ´ nt♀▲Á☺ůlocal"ć☻#'m♂"Me...
^
psql:d:/Ael_DB.tar:27174: ERROR: syntax error at or near "l"
LINE 1: l◄!L'♠Z su‼ŕraI_c◄1⌂ nl/ç &tšl‼Sl§=↔=n☼§☺E☼U♥m☺Ř nm☻Km☼...
^
psql:d:/Ael_DB.tar:27175: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27176: ERROR: syntax error at or near "Bulevardul"
LINE 1: Bulevardul: 1 DECEMBRIE 1918;
^
psql:d:/Ael_DB.tar:27177: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 6;
^
psql:d:/Ael_DB.tar:27178: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: L56;
^
psql:d:/Ael_DB.tar:27179: ERROR: syntax error at or near "Scara"
LINE 1: Scara: B;
^
psql:d:/Ael_DB.tar:27180: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 25;
^
psql:d:/Ael_DB.tar:27181: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27182: ERROR: syntax error at or near "Bulevardul"
LINE 1: Bulevardul: 1 MAI;
^
psql:d:/Ael_DB.tar:27183: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 3;
^
psql:d:/Ael_DB.tar:27184: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: H10;
^
psql:d:/Ael_DB.tar:27185: ERROR: syntax error at or near "Scara"
LINE 1: Scara: A;
^
psql:d:/Ael_DB.tar:27186: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 20;
^
psql:d:/Ael_DB.tar:27187: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27188: ERROR: syntax error at or near "Bulevardul"
LINE 1: Bulevardul: AUREL VLAICU;
^
psql:d:/Ael_DB.tar:27189: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 6;
^
psql:d:/Ael_DB.tar:27190: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: C6;
^
psql:d:/Ael_DB.tar:27191: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 48;
^
psql:d:/Ael_DB.tar:27192: ERROR: syntax error at or near "WLocalitate"
LINE 1: WLocalitate: Constanta;
^
psql:d:/Ael_DB.tar:27193: ERROR: syntax error at or near "Strada"
LINE 1: Strada: CAIUTI;
^
psql:d:/Ael_DB.tar:27194: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 27;
^
psql:d:/Ael_DB.tar:27195: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27196: ERROR: syntax error at or near "Strada"
LINE 1: Strada: CRINULUI;
^
psql:d:/Ael_DB.tar:27197: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 19;
^
psql:d:/Ael_DB.tar:27198: ERROR: syntax error at or near "Localitate"
LINE 1: Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27199: ERROR: syntax error at or near "Strada"
LINE 1: Strada: DRAGOSLAVELE;
^
psql:d:/Ael_DB.tar:27200: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 1B;
^
psql:d:/Ael_DB.tar:27201: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: 1A;
^
psql:d:/Ael_DB.tar:27202: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 9;
^
psql:d:/Ael_DB.tar:27203: ERROR: syntax error at or near ""Localitate"
LINE 1: "Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27204: ERROR: syntax error at or near "Strada"
LINE 1: Strada: OBORULUI;
^
psql:d:/Ael_DB.tar:27205: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 54;
^
psql:d:/Ael_DB.tar:27206: ERROR: syntax error at or near "Blocul"
LINE 1: Blocul: L2;
^
psql:d:/Ael_DB.tar:27207: ERROR: syntax error at or near "Scara"
LINE 1: Scara: B;
^
psql:d:/Ael_DB.tar:27208: ERROR: syntax error at or near "Apartamentul"
LINE 1: Apartamentul: 34;
^
psql:d:/Ael_DB.tar:27209: ERROR: syntax error at or near "┼Localitate"
LINE 1: ┼Localitate: Constanta;
^
psql:d:/Ael_DB.tar:27210: ERROR: syntax error at or near "Strada"
LINE 1: Strada: PRELUNGIREA LILIACULUI;
^
psql:d:/Ael_DB.tar:27211: ERROR: syntax error at or near "NumÄ?r"
LINE 1: NumÄ?r arterÄ?: 6;
^
I did not let the command to finish since the database has 6 GB and would last too long.
The question is where I am wrong or missing something ?

Unable to execute pig scripts using Azure powershell

This is my Pig script
$QueryString = "A = load 'wasb://$containername#$StorageAccount.blob.core.windows.net/table1' using PigStorage(',') as (col1 chararray,col2 chararray,col3 chararray,col4 chararray,col5 chararray,col6 chararray,col7 int,col8 int);" +
"user_list = foreach A GENERATE $0;" +
"unique_user = DISTINCT user_list;" +
"unique_users_group = GROUP unique_user ALL;" +
"uu_count = FOREACH unique_users_group GENERATE COUNT(unique_user);" +
"DUMP uu_count;"
i get this error when i execute above pig script
'2015-04-14 23:17:55,177 [main] ERROR org.apache.pig.PigServer - exception during parsing: Error during parsing. <line 1, column 166> mismatched input 'chararray' expecting RIGHT_PAREN
Failed to parse: <line 1, column 166> mismatched input 'chararray' expecting RIGHT_PAREN
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:241)
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:179)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1678)
at org.apache.pig.PigServer$Graph.access$000(PigServer.java:1411)
at org.apache.pig.PigServer.parseAndBuild(PigServer.java:344)
at org.apache.pig.PigServer.executeBatch(PigServer.java:369)
at org.apache.pig.PigServer.executeBatch(PigServer.java:355)
at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:140)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:769)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:509)
at org.apache.pig.Main.main(Main.java:156)
2015-04-14 23:17:55,177 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 1, column 166> mismatched input 'chararray' expecting RIGHT_PAREN
I edited the LOAD statement like this and the rest of the script is same
$QueryString = "A = load 'wasb://$containername#$StorageAccount.blob.core.windows.net/table1';" +
the error i get now is
2015-04-14 23:23:00,117 [main] ERROR org.apache.pig.PigServer - exception during parsing: Error during parsing. <line 1, column 162> Syntax error, unexpected symbol at or near ';'
Failed to parse: <line 1, column 162> Syntax error, unexpected symbol at or near ';'
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:241)
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:179)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1678)
at org.apache.pig.PigServer$Graph.access$000(PigServer.java:1411)
at org.apache.pig.PigServer.parseAndBuild(PigServer.java:344)
at org.apache.pig.PigServer.executeBatch(PigServer.java:369)
at org.apache.pig.PigServer.executeBatch(PigServer.java:355)
at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:140)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:769)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:509)
at org.apache.pig.Main.main(Main.java:156)
2015-04-14 23:23:00,132 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 1, column 162> Syntax error, unexpected symbol at or near ';'
Details at logfile: C:\apps\dist\hadoop-2.4.0.2.1.9.0-2196\logs\pig_1429053777602.log
I don't understand what the error is. Can you someone help me with executing this query on windows powershell(i am using windows powershell ISE, so i can edit the queries)
The issue is at this statement user_list = foreach A GENERATE $0;. PowerShell is interpreting $0 as a parameter, and since it is not defined PowerShell is substituting an empty string. You can define a parameter in the script like $0 = '$0'; or just escape the $ like:
user_list = foreach A GENERATE `$0;
PowerShell uses the ` (backtick, next to the '1' key) as an escape character for double-quoted strings.
so the script can look like:
$0 = '$0';
$QueryString = "A = load 'wasb://$containerName#$storageAccountName.blob.core.windows.net/table1' using PigStorage(',') as (col1,col2,col3,col4,col5,col6,col7,col8) ;"+
"user_list = foreach A GENERATE $0;" +
"unique_user = DISTINCT user_list;" +
"unique_users_group = GROUP unique_user ALL;" +
"uu_count = FOREACH unique_users_group GENERATE COUNT(unique_user);" +
"DUMP uu_count;"
or
$QueryString = "A = load 'wasb://$containerName#$storageAccountName.blob.core.windows.net/table1' using PigStorage(',') as (col1,col2,col3,col4,col5,col6,col7,col8) ;"+
"user_list = foreach A GENERATE `$0;" +
"unique_user = DISTINCT user_list;" +
"unique_users_group = GROUP unique_user ALL;" +
"uu_count = FOREACH unique_users_group GENERATE COUNT(unique_user);" +
"DUMP uu_count;"