How i get the similarity of phrases in C# .NET - sql-server

I have a sql database with data about headers of news. Example:
id title
867 MPE consegue inverter julgamento
868 Defensoria P blica realiza licita
869 Prefeitos eleitos de todas as partes do Estado
870 Inc ndio deixa 80 pessoas desabrigadas
871 Carlos Amastha visita parlamentares
872 Defensoria P blica requer anula o
873 Marcelo Miranda diz que n o possui obriga o
874 Ex-assessor diz que Coimbra lhe deu dois cheques
I need to get each title and see if there are other news to talk about the same subject.
How i do it? My plataform is .Net and use sql server 2012.

You will probably want to put a Full-Text Index on this column and/or table. It's a complex subject, but you can start reading up on it here: http://msdn.microsoft.com/en-us/library/ms142571.aspx

Related

how to update database with extension db1 [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 months ago.
Improve this question
I am working on updating an outdated database with extension db1, which was created in 2002. But the problem is I can access the structure of this database to create a new one to work with a program that I use it.
DATA BASE Simulatix v1.00 (c)FAROS 1995
¥L<ٍe ض IDENT ب¸ ICAO ±± LATITUDE آ½ًüآ½ً| LONGITUDE آ½ًüآ½ً| ELEV €ےh ¹ MAG VAR €ےh² SPEED LIMIT €ےک´ SPEED LIMIT ALT €ے`¶ TRANS ALT €ے8؛CYFB CY "oEحٹ€إn „‏ PFCYVQ CY 3دtE"ہيإٌ # PFDTMB DT ¼E"R!D
¸EBBR EB Wل>E~‰†C¸ ىےْ '”EDDB ED wkDEïخJD› ْ 'ˆEDDF ED ùں;Eچژ Dlےےْ 'ˆEDDH ED IE3سD5 ْ 'ˆEDDK ED H؟>EGHضC.‎ےْ 'ˆEDDL ED ڑM#Ew·تC“ ِےْ 'ˆEDDM ED ¢S5E’ت0Dخ
ْ 'ˆEDDN ED ³‍9Eي+&D ْ 'ˆEDDP ED ïض#E¼‹7Dر ْ 'ˆEDDS ED H–6EWT
Dَ ْ 'ˆEDDT ED LEEذPGDy ْ 'ˆEDDV ED خ¹DE؛#D· ْ 'ˆEDDW ED پيFEحD üےْ 'ˆEDHI ED قءHE‰ˆD ˆEDLW ED •1AE^نC¨ûےْ 'ˆEDOP ED قYHE ہ0D¦
ْ 'ˆEETN EE حج^Ef>؛D„ ? ˆEFHK EF ‰0bEڑ9»D§ ; ˆEFIV EF 3¥€E«ڑحDل` ˆEFJY EF ح jE¼‹ہDثD ˆEFOU EF |sE«*¾D/ G ˆEFPO EF ïzfE¼{£D, 1 ˆEFRO EF 3›yE3»ءD…N ˆEFTP EF «NfE‰è°D†8 ˆEFTU EF "îbEfِ¦D، 1 ˆEFVA EF wklE3;£D 1 ˆEGBB EG ´³DEjأرآEعے  EGCC EG کHE;أضےْ 'ˆEGGD EG ]¯#E5%#أnطے ¸EGGP EG D HE¼û*أQ شےْ 'ˆEGGW EG ¼‡BEحج°ءâےْ 'pEGHH EG حl>Eڑفآ$ فے  EGJJ EG ،‡8E»أقے ¸EGKK EG "خ?E«ھ6ءؤ كےْ 'pEGLL EG f
AEwwفءP âےْ 'pEGMH EG ‰ˆ#E‰ˆ،B² èے ¸EGNM EG CےIE±Dاآھضے ˆEGNX EG قFEق]ںآ2غےْ ' EGPD EG „VEDأ× خے pEGPF EG …QEق‎„أ اےْ 'pEGPH EG ذQEڑYJأ‡ ثےْ 'pEGPK EG w'PEڑ™‰أA أےْ 'pEGSS EG ڑ‘BEڑ™aA\هےْ 'pEHAM EH ¼'DEحىژCُےٌےْ '¸EHRD EH «ضBEق…Cٌےïےْ '¸EIDW EI {THE-¼أٍ ہے ˆEINN EI و،EELكؤ. °ے ˆEKAH EK SE‏HDR ¸EKBI EK ¶QEشF D÷ ےے ¸EKCH EK 3‘PEïض=D ْ XˆEKKA EK ڈSE’قD« ےے ¸EKRN EK ¼|NE´d]D4 ˆEKSP EK ˆOE~ُ
Dچ ¸EKTS EK VE”D üے ¸EKYT EK VEت¼D
¸ELLX EL R:EH!؛Cزِےْ '”ENAL EN ٍ›jEش–·CE ىے XENAN EN fىپEڑ)rD+ ْ 'XENAT EN …4ƒE`I¯D F ˆENBO EN oB|EڈzWD* XENBR EN بbEçٹœC¥ ىےْ 'XENCN EN ¼CZEحŒٍC9 ِے  ENDU EN حzپEU
‹Dü 2 XENEV EN «j€Eح,zDT ( XENFG EN مخdECRD‰
as you can see I can't open it correctly. Is there any way to open this file .db1 and update it for this year 2022??
I have this program to access DB and check the data as you can see the rows, and column.

Query a nested dictionnary in MongoDB document

I'm trying to learn how to filter out nested dictionaries in the MongoDB database. All documents have the same structure as this example which I will try to get:
I try to obtain the document thanks to the Name which is 'My Burberry - Eau de Parfum':
{ "q0.Results": {"Name":"My Burberry - Eau de Parfum"} }
But it doesn't give me anything back:
What you are doing:
{ "q0.Results": {"Name":"My Burberry - Eau de Parfum"} }
says find me documents where q0.Results is exactly like this document/subdocument: {"Name":"My Burberry - Eau de Parfum"}
In the arrays, you just need dot notation and the following should give you the result:
{ "q0.Results.Name": "My Burberry - Eau de Parfum" }

How to split a string considering more than one blank spaces in Ruby

I'm trying to get an array with the following output:
["", "7", "02156567848", "CORTIER EP. ENGERANT ROSE JOSE MARIE", "059 NOMBRE DE LA PERSONA ES DIFERENTE"]
But using next code the result is different, because split is considering any non word character to separate the strings.
a = " 7 02156567848 CORTIER EP. ENGERANT ROSE JOSE MARIE. 059 NOMBRE DE LA PERSONA ES DIFERENTE"
b = a.split(/\W\W+/)
p b
Output:
["", "7", "02156567848", "CORTIER EP", "ENGERANT ROSE JOSE MARIE", "059 NOMBRE DE LA PERSONA ES DIFERENTE"]
Any idea how to solve this?
Thanks and regards!
Split on \s{2,} -- two or more white-space characters.
a = " 7 02156567848 CORTIER EP. ENGERANT ROSE JOSE MARIE. 059 NOMBRE DE LA PERSONA ES DIFERENTE"
a.split(/\s{2,}/)
# => ["", "7", "02156567848", "CORTIER EP. ENGERANT ROSE JOSE MARIE.", "059 NOMBRE DE LA PERSONA ES DIFERENTE"]
repl

Order by relevance, lucene search

Search Term:
cristina de oliveira
This is the query:
(name_text:(cristina\ de\ oliveira^200.0 OR cristina\ de\ oliveira*^100.0 OR cristina\ de\ oliveira~^50.0))
This is the result:
MARIA CRISTINA DE OLIVEIRA,
LIA CRISTINA DE OLIVEIRA,
MARISA CRISTINA DE OLIVEIRA,
CRISTINA de OLIVEIRA
Problem:
Since search term is "cristina de olveira", the first result should be "CRISTINA de OLIVEIRA" and not "MARIA CRISTINA DE OLIVEIRA", how can I get exactly search term as the first result

how to run an old .BAS file

i have an old .BAS file that im trying to launch. I just need the program to work - i don't need to edit or do anything with the code. Does anybody know how to run it so i can see the program - its an old solitaire game i use for an example to show how the code is written. Can i run it through visual studio 2010 - if yes how? Or with program should i use to launch it?
Public Class Form1
SCREEN 9,0 'medium resolution'
FORGRUND%=4
BAGGRUND%=63
PILE%=9
DUG%=2
RUNDE%=1
ANTFLYT%=0
ANTKONGER%=0
KONGE13%=0
COLOR FORGRUND%,BAGGRUND%:CLS:KEY OFF
OPTION BASE 1 'laveste v‘rdi i tabeller s‘ttes til 1'
'*********************************************************'
' en lille startmelodi til at komme ignag med'
'*********************************************************'
'PLAY "mb o3 l8 ffffafffafdfe4.l8 eeeegeeedefed4" kattekilling
PLAY "mb o3 t255 l8 df+ga2df+ga2df+gl4af+df+e2l8f+f+ed4.df+4aaag2f+gl4af+ded2"
'*********************************************************'
'lav en konverteringstabel'
'*********************************************************'
GOSUB 2060
'*********************************************************'
'lav kasser s† de er flotte'
'*********************************************************'
GOSUB 2260
'*********************************************************'
'2 tabeller: randomizer, kort'
'randomizer initieres med vilk†rlige tal'
'*********************************************************'
GOSUB 2640
'*********************************************************'
'vi skal putte kortet p† rette plads p† bordet/sk‘rmen'
'*********************************************************'
GOSUB 2840
'*********************************************************'
'l‘s bord og flyt til sk‘rm'
'*********************************************************'
GOSUB 2950
'*********************************************************'
'pr›v at l‘se F fra sk‘rm'
'*********************************************************'
X=6
Y=3
FRASKARMX%=0 'initier fra-koordinat til brug ved mark›rbev‘gelser'
FRASKARMY%=0 'initier fra-koordinat til brug ved mark›rbev‘gelser'
COLOR PILE%,BAGGRUND%
LOCATE X,Y:PRINT CHR$(24)
COLOR FORGRUND%,BAGGRUND%
LOCATE 23,2:PRINT"V‘lg kort der skal flyttes ved at
taste "
FUNDET=1
WHILE FUNDET 's†l‘nge F ikke er indtastet'
FT$=INKEY$:IF FT$="" THEN LOCATE 1,72:PRINT TIME$:GOTO 510
IF LEN(FT$)=1 GOTO 630
IF LEN(FT$)=2 GOTO 560 'evt. mark›r bev‘gelse'
GOTO 680 'til endwhile'
'find mark›r-bev‘gelse'
FT$=RIGHT$(FT$,1)
IF ASC(FT$)=77 THEN GOSUB 1660 'pil til h›jre'
IF ASC(FT$)=75 THEN GOSUB 1750 'pil til venstre'
IF ASC(FT$)=72 THEN GOSUB 1850 'pil op'
IF ASC(FT$)=80 THEN GOSUB 1940 'pil ned'
GOTO 680
'find bogstav'
IF (FT$<>"f") AND (FT$<>"F") AND (FT$<>"a") AND (FT$<>"A") AND (FT$<>"N") AND
(FT$<>"n") AND (FT$<>"b") AND (FT$<>"B") GOTO 680
FUNDET=0
WEND
etc
VB2005 Express has an upgrade wizard. It opens automatically when you try to open a VB6 project.
This must be VB for DOS, (versions 1.0, not sure if 2.0 was ever made), its not qb since it has forms support (QB didnt have that) and its not Windows version since it has this SCREEN and COLOR statements (for console text resolution and colors) :
SCREEN 9,0 '**medium resolution' switch 0=nocolor 1=color
mode 9 with 0 no color
SCREEN 9: 640 x 350 graphics
80 x 25 or 80 x 43 text format, 8 x 14 or 8 x 8 character box
16 colors assigned to 4 attributes (64K adapter memory), or 64 colors assigned to 16 attributes (more than 64K adapter memory)
If 64K EGA adapter memory, 1 video memory page (0); otherwise, 2 pages (0-1)
COLOR FORGRUND%,BAGGRUND%:CLS:KEY OFF
looking that there are GOTO and GOSUBS with line number labels and the KEY OFF command, example code was ported from GWBasic that had line numbers in it and had 25th line displaying functions keys commands (turned off by key off).

Resources