דיברתי עם מישהו בתחום והוא אמר לי את הדבר הבא
"רק מה עם התחמה? יש לך החתמת יישומים נגד אנטיוירוסים? כי לי אין, אני מחלק בד"כ תוכנות שנחשבות וירוסים אצל הרבה אנטיוירוסים, מאחר ולא הצלחתי לעבוד עם חברת החתמה נורמלית."
אשמח לקבל כל מידע בנושא
תודה
דיברתי עם מישהו בתחום והוא אמר לי את הדבר הבא
"רק מה עם התחמה? יש לך החתמת יישומים נגד אנטיוירוסים? כי לי אין, אני מחלק בד"כ תוכנות שנחשבות וירוסים אצל הרבה אנטיוירוסים, מאחר ולא הצלחתי לעבוד עם חברת החתמה נורמלית."
אשמח לקבל כל מידע בנושא
תודה
@dovid
תודה.
אם הבנתי נכון אז backgroundworker עוזר רק כאשר מריצים סקריפט מתוך winform
מה עושים כאשר המקרה הוא הפוך כשמריצים winform מתוך סקריפט
כאשר מריצים סקריפט מתוך form מכיון שהסקריפט משתמש עם אותו thread של ה-form אז הוא בעצם תוקע את התוכנה.
הפתרון הוא כמובן להריץ אותו על thread אחר.
מה שהסתבכתי הוא מה לעשות כאשר אני צריך שהform לא ייתקע אבל בו זמנית הסקריפט יהיה לו אינטראקציה עם הform כמו למשל progressbar שנמצא בתוך ה form
מדריך בסיסי ל dapper לפשוטי העם (כמוני)
https://www.geeksforgeeks.org/c-dapper/
@ek0583232948
האם כוונתך לפקודה 'מצב שינה' בתפריט של הכיבוי?
אם כן אז תנסה את הכלי הזה
https://www.sordum.org/9502/hibernate-enable-or-disable-v1-3/
@Aharon-0
api בעיקר אבל בc#
איזה תשתית כלומר?
שאלה: מישהו יודע איפה אפשר להשיג מידע יעיל על אוטומציה ב C#?
(השאלה עבור אישתי שהתחילה עבודה חדשה ופתאום הודיעו לה שבסוף הם צריכים אטומציה בc# ולא בגאווה או סלניום ואין לה מושג מאיפה להתחיל - C# בסיסי היא יודעת כי היא למדה בסמינר).
תודה מראש.
@אפרים22 כתב בתוכנה לחיפוש בתוך מסמכים כדוגמת החיפוש של אוצר החכמה עם תרגום מלא לעברית וממשק מימין לשמאל:
הומלץ למעלה להוריד את הוי. וכך עשיתי.
במקרה שלך כמובן עדיף להשאיר את הוי
@פלורידה כתב בתוכנה לחיפוש בתוך מסמכים כדוגמת החיפוש של אוצר החכמה עם תרגום מלא לעברית וממשק מימין לשמאל:
אני משתמש בזה לוורד ולא נתקל בשום תקלה.
לא חייב להיות בעיה תלוי בכמות מסמכים ובחוזק של המחשב - זו לא בעיה בעצם רק פונקציה שמאוד מכבידה.
@אפרים22
האם אתה מנסה לאנדקס מסמכי וורד.
בזמנו כשדיברנט עם המפתח הוא אמר שאם מאנדקסים מסמכי וורד זה מאוד מכביד על האינדוקס כי אין לו את הכלים לעשות זאת בצורה ישירה (לשמור על העיצוב) ללא המרה קודם לpdf.
הייתי ממליץ לך להישאר עם השימוש לה נועד התוכנה דהיינו מסמכי טקסט פשוטים ומסמכי Pdf.
@dovid כתב בביצוע פרקטי לאינדוקס מאגר טקסט עברי:
אני צריך ערובה שהשקעתי בתשובה לא תירד לטמיון.
גם מאוד מפריע לי הפיזור שלך בשאלות, זה נראה שאתה בלחץ אטומי. תברר דבר דבר, תעיין תבין ותחכים.
לגבי הערובה אני נמצא במקום של התלמיד כך שהשאלה היא האם התלמיד יכול להגיד לרב שמה שהוא אומר זה יעיל לו או לא? לבינתיים לא איכזבת אז אני מאמין בך. אם נגיע לתוצאות שאפשר להשתמש בהם ברור שאשתמש בזה.
האמת היא שאני עדיין מנסה לעכל את זה שיש פה מישהו שמוכן ככה לעזור בחפשיות (אם לא אשגע אותו מדאי הרבה). VBA הייתי צריך ללמוד לבד והדרך הייתה מפותלת ומעניינת. (היה לי שם חברותא אבל לא "רב").
לחץ אטומי ממש לא - פשוט ככה הראש שלי עובד אני מבין דברים הפוך, לא מההתחלה לסוף אלא מהסוף להתחלה הריכוז שלי ג"כ עובד בצורה מעניינת כלומר שהריכוז שלי מאוד ממוקד - סוג של חפרפרת שפשוט נדבק על משהו עד שהוא מגיע לאשורו (גם הנקיונות שלי לשבת נראים ככה - וזה משגע את אישתי...) (מכיון שראית את התפתחות חלק מהפוסטים שלי אני חושב שאתה יכול לקבל תמונה קצת על מה אני מדבר).
כל זה לא אומר שאני לא יכול לעבוד בצורה מסודרת אם צריך. אשתדל להישאר כאן בפוסט זה ולא לפזר שאלות לכל עבר.
דבר ראשון החיפוש הוא לא הגיוני, הטבלה הרי מכילה מילים בודדות, לא ביטוי (של יותר ממילה).
את זה אני יודע - הבדיקה היתה על חיפוש של מילה אחת כדי לבדוק מהירות שליפה.
לגבי הסימות וכו' הסיבה היא בגלל שאני אוהב לבדוק מקרי קצה לפני שאני נכנס לעובי הקורה. אולי אתה צודק ואי אפשר לשפוט יעילות לפי מקרי קצה. למרות שבפרוייקט שלי השימוש בסיומות וכו' אמור להיות די מצוי.
למעשה עשיתי עכשיו בדיקה ללא הסיומות ולא היה שום הבדל מצד המהירות
command.Parameters.Add(new SQLiteParameter("@searchTerm", searchTerm));
@dovid
אשמח אם תפשיט לי את המילים "פרמטרי האחזור". מה בדיוק החסרון בFTS המהירות? או אולי כוונתך לאיך התוצאות יוצגו?
למעשה ישבתי על SQLITE קצת לא יודע למה כל כך הסתבכתי לפני זה עם התכנות הבסיסי אכן זה די פשוט. (הוספתי פה גם רכיבים כדי להקל על מי שרוצה לראות את התוצאה הסופית).
התוצאות שקיבלתי - אינדוקס די מהיר - אבל חיפוש קצת איטי אולי שיטת החיפוש שלי לא טובה? (השתמשתי ב-סריקה מלאה כדי לאפשר חיפוש לא מדויק)
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
private System.Windows.Forms.Button buttonProcessFile;
private System.Windows.Forms.Button buttonViewTable;
private System.Windows.Forms.TextBox textBoxResult;
private System.Windows.Forms.ProgressBar progressBar;
private System.Windows.Forms.ProgressBar progressBar2;
private System.Windows.Forms.Button buttonSearch;
private DataGridView dataGridViewSearchResults;
private System.Windows.Forms.TextBox textBoxSearch;
public Form1()
{
InitializeComponent();
InitializeDynamicControls();
}
private void InitializeDynamicControls()
{
// Create a Button for processing
buttonProcessFile = new System.Windows.Forms.Button();
buttonProcessFile.Text = "Process Text File";
buttonProcessFile.Location = new System.Drawing.Point(12, 12);
buttonProcessFile.Click += buttonProcessFile_Click;
this.Controls.Add(buttonProcessFile);
// Create a Button for processing
buttonViewTable = new System.Windows.Forms.Button();
buttonViewTable.Text = "View";
buttonViewTable.Location = new System.Drawing.Point(100, 12);
buttonViewTable.Click += buttonViewTable_Click;
this.Controls.Add(buttonViewTable);
//create progressbar
//progressBar = new System.Windows.Forms.ProgressBar();
//progressBar.Dock = DockStyle.Bottom;
//this.Controls.Add(progressBar);
//create progressbar
progressBar2 = new System.Windows.Forms.ProgressBar();
progressBar2.Dock = DockStyle.Bottom;
this.Controls.Add(progressBar2);
// Create a TextBox for displaying results
textBoxResult = new System.Windows.Forms.TextBox();
textBoxResult.Multiline = true;
textBoxResult.ScrollBars = ScrollBars.Vertical;
textBoxResult.Size = new System.Drawing.Size(400, 200);
textBoxResult.Location = new System.Drawing.Point(12, 50);
this.Controls.Add(textBoxResult);
// Create a TextBox for entering search terms
textBoxSearch = new System.Windows.Forms.TextBox();
textBoxSearch.Location = new System.Drawing.Point(200, 12);
this.Controls.Add(textBoxSearch);
// Create a Button for initiating the search
buttonSearch = new System.Windows.Forms.Button();
buttonSearch.Text = "Search";
buttonSearch.Location = new System.Drawing.Point(300, 12);
buttonSearch.Click += buttonSearch_Click;
this.Controls.Add(buttonSearch);
// Create a DataGridView for displaying search results
dataGridViewSearchResults = new DataGridView();
dataGridViewSearchResults.Dock = DockStyle.Bottom;
this.Controls.Add(dataGridViewSearchResults);
}
private void buttonSearch_Click(object sender, EventArgs e)
{
string searchTerm = textBoxSearch.Text.Trim();
if (string.IsNullOrWhiteSpace(searchTerm))
{
MessageBox.Show("Please enter a search term.");
return;
}
string databaseFilePath = GetDatabaseFilePath();
using (SQLiteConnection connection = new SQLiteConnection($"Data Source={databaseFilePath};Version=3;"))
{
connection.Open();
using (SQLiteCommand command = new SQLiteCommand("SELECT * FROM WordData WHERE Word LIKE @searchTerm;", connection))
{
command.Parameters.Add(new SQLiteParameter("@searchTerm", "%" + searchTerm + "%"));
using (SQLiteDataAdapter adapter = new SQLiteDataAdapter(command))
{
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
// Display the search results in the DataGridView
dataGridViewSearchResults.DataSource = dataTable;
}
}
}
}
static string GetDatabaseFilePath()
{
// Get the path to the executable directory
string programFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
return Path.Combine(programFolder, "your-database-file.sqlite");
}
private void buttonProcessFile_Click(object sender, EventArgs e)
{
// Create or open the SQLite database
string databaseFilePath = GetDatabaseFilePath();
using (SQLiteConnection connection = new SQLiteConnection($"Data Source={databaseFilePath};Version=3;"))
{
connection.Open();
// Create a table to store word data
CreateTable(connection);
// Let the user choose a folder to scan for text files
string folderPath = GetFolderPath();
if (folderPath != null)
{
ProcessFolder(connection, folderPath);
textBoxResult.AppendText("Data saved to SQLite table." + Environment.NewLine);
}
else
{
textBoxResult.AppendText("No folder selected. Exiting..." + Environment.NewLine);
}
}
}
private string GetFolderPath()
{
using (FolderBrowserDialog folderDialog = new FolderBrowserDialog())
{
folderDialog.Description = "Select a folder to scan for text files.";
DialogResult result = folderDialog.ShowDialog();
if (result == DialogResult.OK)
{
return folderDialog.SelectedPath;
}
else
{
return null; // User canceled the folder selection
}
}
}
private void ProcessFolder(SQLiteConnection connection, string folderPath)
{
string[] textFiles = Directory.GetFiles(folderPath, "*.txt", SearchOption.AllDirectories);
progressBar2.Maximum = textFiles.Length;
progressBar2.Value = 0;
int fileCount = 0;
foreach (string textFilePath in textFiles)
{
ProcessTextFile(connection, textFilePath);
fileCount++;
progressBar2.Value++;
}
textBoxResult.AppendText($"Processed {fileCount} text files and saved data to SQLite table." + Environment.NewLine);
}
private void ProcessTextFile(SQLiteConnection connection, string textFilePath)
{
// Read the text file using Windows-1255 encoding
string[] lines = File.ReadAllLines(textFilePath, Encoding.GetEncoding(1255));
//progressBar.Value = 0;
//progressBar.Maximum = lines.Length;
int lineNumber = 1;
List<WordData> wordDataList = new List<WordData>();
// Regular expression to match Hebrew characters
Regex hebrewRegex = new Regex(@"\p{IsHebrew}+(?<=\p{IsHebrew})\""(?=\p{IsHebrew})\p{IsHebrew}+|\p{IsHebrew}{2,}");
foreach (string line in lines)
{
// Use the regular expression to match and extract Hebrew words
MatchCollection matches = hebrewRegex.Matches(line);
foreach (Match match in matches)
{
string word = NormalizeHebrewText(match.Value);
// Add word data to the list
wordDataList.Add(new WordData
{
Word = word,
LineNumber = lineNumber,
FileName = textFilePath
});
}
lineNumber++;
//if (progressBar.Value < progressBar.Maximum)
//{ progressBar.Value++; }
}
//// Sort the words using Hebrew culture
//wordDataList.Sort((a, b) => string.Compare(a.Word, b.Word, new CultureInfo("he-IL"), CompareOptions.None));
// Insert all word data into the SQLite table at once
InsertWordDataBatch(connection, wordDataList);
textBoxResult.AppendText($"{textFilePath} Processed {lines.Length} lines and saved data to SQLite table." + Environment.NewLine);
}
private string NormalizeHebrewText(string text)
{
// Normalize Hebrew text (e.g., remove diacritics)
// You may need to implement this normalization based on your specific requirements.
// Example: Normalize to remove diacritics (NFD normalization)
text = new string(text.Normalize(NormalizationForm.FormD).Where(c => char.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark).ToArray()); // Normalize Hebrew text.
return text; // Return the normalized text.
}
static void CreateTable(SQLiteConnection connection)
{
using (SQLiteCommand command = new SQLiteCommand(
"CREATE TABLE IF NOT EXISTS WordData (Word TEXT, LineNumber INT, FileName TEXT);", connection))
{
command.ExecuteNonQuery();
}
}
static void InsertWordDataBatch(SQLiteConnection connection, List<WordData> wordDataList)
{
using (SQLiteCommand command = new SQLiteCommand(connection))
{
// Start a transaction for batch insert
using (var transaction = connection.BeginTransaction())
{
command.CommandText = "INSERT INTO WordData (Word, LineNumber, FileName) VALUES (@word, @lineNumber, @fileName);";
command.Parameters.Add(new SQLiteParameter("@word", DbType.String));
command.Parameters.Add(new SQLiteParameter("@lineNumber", DbType.Int32));
command.Parameters.Add(new SQLiteParameter("@fileName", DbType.String));
foreach (var wordData in wordDataList)
{
command.Parameters["@word"].Value = wordData.Word;
command.Parameters["@lineNumber"].Value = wordData.LineNumber;
command.Parameters["@fileName"].Value = wordData.FileName;
// Add the command to the transaction
command.ExecuteNonQuery();
}
// Commit the transaction to perform the batch insert
transaction.Commit();
}
}
}
private void buttonViewTable_Click(object sender, EventArgs e)
{
string databaseFilePath = GetDatabaseFilePath();
using (SQLiteConnection connection = new SQLiteConnection($"Data Source={databaseFilePath};Version=3;"))
{
connection.Open();
using (SQLiteCommand command = new SQLiteCommand("SELECT * FROM WordData;", connection))
{
using (SQLiteDataAdapter adapter = new SQLiteDataAdapter(command))
{
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
// Create a new form to display the table
Form tableForm = new Form();
tableForm.Text = "WordData Table Contents";
// Create a DataGridView control and set its properties
DataGridView dataGridView = new DataGridView();
dataGridView.Dock = DockStyle.Fill;
dataGridView.DataSource = dataTable;
// Add the DataGridView to the form
tableForm.Controls.Add(dataGridView);
// Show the form as a dialog
tableForm.ShowDialog();
}
}
}
}
public class WordData
{
public string Word { get; set; }
public int LineNumber { get; set; }
public string FileName { get; set; }
}
}
}
ועוד שאלה:
@dovid כתב בביצוע פרקטי לאינדוקס מאגר טקסט עברי:
לגבי הפרוייקט שלכם תוכלו לבנות רשימת מילים, ולהכניס לטבלה את הפרטים הבאים:
המילה, מס' ספר, מס' שורה/פסקה, מיקום
בטבלה אחרת להכניס את הנתונים עצמם לשליפה מהירה של פסקאות של ספרים, ככה:
מס' פסקה (מספר רץ), פסקה, מס' ספר
לא הצלחתי למצוא את המכנה המשותף בין שני הטבלאות שמאפשר לי להצליב בין המידע שאקבל מטבלה א' לצורך טבלה ב'.
אולי עם דוגמא קצרה אוכל לרדת לסוף דעתך.