איזה path כתבת?

אביי
-
עזרה עם שגיאה בהעלאת קובץ בחלקים לימות המשיח בc# -
פיתוח אפליקציה לטסלה-כיצד?@מתושלח-הבבלי1 לפי מה שאני הבנתי, זה לא חנות, אלא טסלה "מפתחת" (ליתר דיוק מסתבר מטמיעה) אפליקציות פופלאריות מסוימות במערכת שלה, אבל אין חנות בכלל,
מכאן זה גם נראה ככה
https://www.tesla.com/ownersmanual/model3/he_il/GUID-79A49D40-A028-435B-A7F6-8E48846AB9E9.html -
עזרה עם שגיאה בהעלאת קובץ בחלקים לימות המשיח בc#@dovid כתב בעזרה עם שגיאה בהעלאת קובץ בחלקים לימות המשיח בc#:
אם תסכים לשתף אותי בטוקן שלך במייל אשמח
תודה!
שלחתי במייל -
עזרה עם שגיאה בהעלאת קובץ בחלקים לימות המשיח בc#@dovid שכחתי לציין במפורש, רק הלארג', הבעיה היא איפשהו בהעלאת החלקים,
גם כי העלאת קובץ גדול (עד 50) בUploadSmallFileAsync עובדת מצויין, וגם כי אני מקבל את השגיאה רק אחרי העלאת כל חלק, אבל בתגובה לבקשת סיום ההעלאה חוזרת תגובה של הצלחה מימות המשיח, (רק שהקובץ שנוצר ריק, כי אין חלקים..)
-
עזרה עם שגיאה בהעלאת קובץ בחלקים לימות המשיח בc#תגובה: העלאת קובץ בapi לימות המשיח | קוד שבפייתון עובד וב nodejs לא כל כך
כתבתי את המחלקה הזו,
הקובץ המועלה - ריק,כשהוספתי דיבאג להעלאת החלקים, אני מקבל אחרי כל חלק את השגיאה:
Failed to upload chunk 1: {"error":"Server error. Uploads directory isn't writable","uploadName":null}
זה המחלקה,
(השוותי ידנית וגם ניסיתי עם קלוד, למחלקות בפייתון וnode שפורסמו שם, ללא הצלחה)using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Threading.Tasks; using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Windows.Forms; public class YemotUploader { // הגדרה אחת בלבד של גודל הצ'אנק private static readonly int ChunkSizeBytes = 8000000; // 8MB private byte[] ReadFileBytes(string filePath) { return File.ReadAllBytes(filePath); } private List<byte[]> ReadInChunks(string filePath) { var fileBytes = ReadFileBytes(filePath); var chunks = new List<byte[]>(); for (int offset = 0; offset < fileBytes.Length; offset += ChunkSizeBytes) { int currentChunkSize = Math.Min(ChunkSizeBytes, fileBytes.Length - offset); var chunk = new byte[currentChunkSize]; Array.Copy(fileBytes, offset, chunk, 0, currentChunkSize); chunks.Add(chunk); } return chunks; } public async Task<string> UploadFileAsync(string filePath, string tokenYemot, string path, string convertAudio, string autoNumbering) { var fileInfo = new FileInfo(filePath); var contentName = Path.GetFileName(filePath); var contentSize = fileInfo.Length; if (contentSize <= ChunkSizeBytes) { // העלאת קובץ קטן return await UploadSmallFileAsync(filePath, tokenYemot, path, convertAudio, autoNumbering); } else { // העלאת קובץ גדול return await UploadLargeFileAsync(filePath, tokenYemot, path, convertAudio, autoNumbering); } } private async Task<string> UploadSmallFileAsync(string filePath, string tokenYemot, string path, string convertAudio, string autoNumbering) { using (var httpClient = new HttpClient()) using (var formData = new MultipartFormDataContent()) { formData.Add(new StringContent(tokenYemot), "token"); formData.Add(new StringContent(path), "path"); formData.Add(new StringContent(convertAudio), "convertAudio"); formData.Add(new StringContent(autoNumbering), "autoNumbering"); var fileBytes = File.ReadAllBytes(filePath); var fileContent = new ByteArrayContent(fileBytes); fileContent.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("form-data") { Name = "\"file\"", FileName = $"\"{Path.GetFileName(filePath)}\"" }; fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); formData.Add(fileContent, "file"); var response = await httpClient.PostAsync("https://www.call2all.co.il/ym/api/UploadFile", formData); return await response.Content.ReadAsStringAsync(); } } private async Task<string> UploadLargeFileAsync(string filePath, string tokenYemot, string path, string convertAudio, string autoNumbering) { var contentName = Path.GetFileName(filePath); var contentSize = new FileInfo(filePath).Length; var qquuid = Guid.NewGuid().ToString(); var chunks = ReadInChunks(filePath); var failedChunks = new List<int>(); // העלאת כל הצ'אנקים for (int i = 0; i < chunks.Count; i++) { try { using (var httpClient = new HttpClient()) using (var content = new MultipartFormDataContent()) { var chunk = chunks[i]; var offset = i * ChunkSizeBytes; content.Add(new StringContent(tokenYemot), "token"); content.Add(new StringContent(path), "path"); content.Add(new StringContent(qquuid), "qquuid"); content.Add(new StringContent(convertAudio), "convertAudio"); content.Add(new StringContent(autoNumbering), "autoNumbering"); content.Add(new StringContent("yemot-admin"), "uploader"); content.Add(new StringContent(contentName), "qqfilename"); content.Add(new StringContent(contentSize.ToString()), "qqtotalfilesize"); content.Add(new StringContent(chunks.Count.ToString()), "qqtotalparts"); content.Add(new StringContent(chunk.Length.ToString()), "qqchunksize"); content.Add(new StringContent(offset.ToString()), "qqpartbyteoffset"); content.Add(new StringContent(i.ToString()), "qqpartindex"); var fileContent = new ByteArrayContent(chunk); fileContent.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("form-data") { Name = "\"qqfile\"", FileName = $"\"{contentName}\"" }; fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); content.Add(fileContent, "qqfile"); var response = await httpClient.PostAsync("https://www.call2all.co.il/ym/api/UploadFile", content); var responseText = await response.Content.ReadAsStringAsync(); // בדיקה האם התגובה תקינה if (!response.IsSuccessStatusCode || responseText.Contains("error")) { failedChunks.Add(i); MessageBox.Show($"Failed to upload chunk {i}: {responseText}"); Console.WriteLine($"Failed to upload chunk {i}: {responseText}"); } else { Console.WriteLine($"Successfully uploaded chunk {i}"); } } } catch (Exception ex) { failedChunks.Add(i); Console.WriteLine($"Error uploading chunk {i}: {ex.Message}"); } } // בדיקה האם כל הצ'אנקים הועלו בהצלחה if (failedChunks.Count > 0) { throw new Exception($"Failed to upload chunks: {string.Join(", ", failedChunks)}"); } // שליחת בקשת סיום using (var httpClient = new HttpClient()) { var finalFormData = new FormUrlEncodedContent(new Dictionary<string, string> { { "token", tokenYemot }, { "path", path }, { "uploader", "yemot-admin" }, { "convertAudio", convertAudio }, { "autoNumbering", autoNumbering }, { "qquuid", qquuid }, { "qqfilename", contentName }, { "qqtotalfilesize", contentSize.ToString() }, { "qqtotalparts", chunks.Count.ToString() } }); try { var doneResponse = await httpClient.PostAsync( "https://www.call2all.co.il/ym/api/UploadFile?done", finalFormData ); var responseText = await doneResponse.Content.ReadAsStringAsync(); Console.WriteLine($"Done response: {responseText}"); // ניסיון לפרסור של הjson הכפול if (!string.IsNullOrEmpty(responseText)) { // מציאת ה-JSON הראשון בתגובה int firstBrace = responseText.IndexOf('{'); int lastBrace = responseText.LastIndexOf('}'); if (firstBrace >= 0 && lastBrace > firstBrace) { string jsonPart = responseText.Substring(firstBrace, lastBrace - firstBrace + 1); try { // בדיקה האם ה-JSON תקין var jObject = JObject.Parse(jsonPart); return jsonPart; } catch (JsonReaderException) { Console.WriteLine($"Invalid JSON response: {jsonPart}"); } } } return responseText; } catch (Exception ex) { Console.WriteLine($"Error in done request: {ex.Message}"); throw; } } } }
-
זיהוי אקרודים בפייתון@אביחיל כתב בזיהוי אקרודים בפייתון:
ובדרך אגב מה הסיפור הזה בפייתון שכל עידכון גירסה שלהם משבש את חלק ניכר מהספריות למה אין להם תאימות מינימלית
זה מזכיר שפות מלפני 20 שנה
חשבתי שבעידן הזה אין כאלה בעיותבוא לnode ותדבר
-
זיהוי אקרודים בפייתון@אביחיל שמעתי על pychord, אני חושב אבל שצריך לתת לה פרטים מסויימים על השמע, שניתן לקבל באמצעות הספרייה aubio,
(אני לא מכיר אישית, מישהו כתב על השילוב ביניהם לפני כמה חודשים איפשהו)
-
מתי להגדיר אינדקס במסד נתונים@yossiz כתב במתי להגדיר אינדקס במסד נתונים:
דהיינו להוסיף where לפקודה של יצירת האינדקס
טוב לדעת, לא ידעתי שאפשרי,
(אני בד"כ לא מאנדקס אותם בכלל, כי זה כמעט תמיד נוטה לצד הtrue) -
מתי להגדיר אינדקס במסד נתונים@מוטי-מן אני לא יודע אם יש בזה כללים ברורים,
אבל אני עושה אינדקס בד"כ על שדות שאני משתמש בהם הרבה בLEFT JOIN, ORDER, GROUP וכמובן WHERE, אני לא עושה את זה תמיד, אלא רק שדות שמשמשים בכמה שאילתות שמתבצעות בתדירות,
להבנתי אם תגדיר יותר מידי אינדקסים זה אומנם עשוי לשפר את מהירות שליפת הנתונים, אבל יאט את קצב הקליטה של נתונים חדשים (האינדקס מתעדכן בכל פעם שאתה מוסיף נתונים),
לגבי אינדקסים על שדות בוליאנים, אני לא יודע,
-
באיזה עדכון לווינדוס 10 הוכנס pyqt6?PyQt6 היא לא חלק אינטגרלי מwindows,
זה ספרייה של python ליצירת ממשקי משתמש גרפיים,https://stackoverflow.com/questions/74512247/pyqt6-dll-load-failed-while-importing-qtgui-the-specified-procedure-could-not
https://forum.qt.io/topic/137365/pyqt6-dll-load-failed-while-importing-qtgui-the-specified-procedure-could-not-be-found/2זה נראה שאם תתקין פייתון (עדכני) ואת החבילה
pip install PyQt6
זה יפתור את הבעיה,אני לא יודע כיצד לפתור את זה ספציפית מול האנקי, אבל הנה התייחסות לזה בפורומים שלהם
https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322
https://forums.ankiweb.net/t/solution-for-anyone-else-who-might-have-this-error/43718 -
רשימת שכונות לפי עריםרשימת שכונות בישראל לפי ערים.
-
לוקליזציה בhebcal/core בnodeאיך עובד הלוקליזציה בhebcal/core?
אני רוצה לקבל את זה כ "he-x-NoNikud"
export const convertToHebrewDate = (dateString) => { const date = new Date(dateString); const hDate = new HDate(date); return `${hDate.getDate()} ב${hDate.getMonth()} ${hDate.getFullYear()}`; };
התיעוד כאן אבל אני לא מצליח להבין אותו,
-
API נדרים פלוס, נחסם?@Shmuel754 זה לא שגיאה,
ההבדל הוא בAction.
-
API נדרים פלוס, נחסם?@צבי-ש כתב בAPI נדרים פלוס, נחסם?:
@Nedarim יש חדש?
מעדכן שעלה תיעוד מסודר, כאן:
https://matara.pro/nedarimplus/ApiDocumentation.html -
מכשיר קטן - סמארטפון. לצורך אפליקציה אחת. ניראות כשרה@צעיר אני זוכר שחיפשתי בעבר, וראיתי בעלי באבא כמה מכשירים ברעיון של הביפרים של איחוד הצלה, תנסה לחפש
(זה בד"כ שייך לקטגוריות של "תעשייתי"ו"מוקשח") -
רשימת שכונות לפי ערים@צעיר אם זה עדיין רלוונטי, עיין כאן
ואפשר להשתמש בAPI של רשות המיסים,
https://www.nadlan.gov.il/Nadlan.REST/Main/GetNeighborhoodsListByCityAndStartsWith?cityName=ירושלים&startWithKey=-1 -
כמה משלמים על עבודת תכנות כזאת@אף-אחד-3 אשמח אם תוכל ליצור עימי קשר באישי בהקדם,
תודה -
BLOB IMG -
BLOB IMG@שרה-רחל זה נורא פשוט, וכתבתם שזה מגיע מinput file אז הנה דוגמה שכתב GPT
<!DOCTYPE html> <html lang="he"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>המרת תמונה ל-Base64</title> </head> <body> <h1>המרת תמונה ל-Base64</h1> <input type="file" id="imageInput" accept="image/*"> <br><br> <textarea id="base64Output" rows="10" cols="50" placeholder="כאן יופיע קוד Base64"></textarea> <script> document.getElementById('imageInput').addEventListener('change', function(event) { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function() { const base64String = reader.result.split(',')[1]; document.getElementById('base64Output').textContent = base64String; document.getElementById('base64Output').textContent = reader.result; }; reader.readAsDataURL(file); } }); </script> </body> </html>
שימו לב לכפילות
document.getElementById('base64Output').textContent = base64String; document.getElementById('base64Output').textContent = reader.result;
פשוט הGPT החליט שלא צריך את הכותרת
data:image/png;base64
, ואני חושב שבמקרה הזה כן צריך -
BLOB IMGקובץ XSL FO שהוא עם תגיות דומה לHTML
יותר נכון לומר: בתבנית XML
אני חושב שצריך לטעון את זה באמצעות fo:external-graphic, וכblob זה אומר לטעון את התמונה כbase64.
<fo:table-cell> <fo:block> <fo:external-graphic src="url('data:image/jpeg;base64,/9j/6zLrSlCpAAADLhanVtYgAAAB5q3+FHf8fXrS49qMfhQAn40oo/DpSqDnoc0Af/2Q==')"></fo:external-graphic> </fo:block> </fo:table-cell>
https://stackoverflow.com/questions/26155275/how-to-load-image-by-xsl-fo