Tag Archives: 2023
Godot – save dialog in C# in Godot game engine.
This source code show you how to deal with save dialog and not only with this in Godot game engine. I used C# source code to show the dialog issue and I make a source code in gd to solve same issue. Is the same algoritm but with gd programming language. You can find this… Read More »
Toolwiz Care tested on Windows 10.
Toolwiz Care is a free suite of tools and applications for your computer that aim to optimize your system’s performance and manage clutter. Clean and remove unnecessary files and data and free up disk space to improve speed and allow your computer to run as efficiently and effectively as possible. Additionally, it includes a number… Read More »
Godot – files in C# in Godot game engine.
Today I tested a new source code with the Godot game engine. The source code recognizes the drag and drop operation for text and image files.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | using Godot; using System; using System.Collections.Generic; using System.IO; public partial class DragAndDropImport : Control { private Sprite2D _imageSprite2D; private Label _textLabel; // Called when the node enters the scene tree for the first time. public override void _Ready() { _textLabel = GetNode<Label>("VBoxContainer/Panel/Text"); _imageSprite2D = GetNode<Sprite2D>("VBoxContainer/Panel/Image"); ConnectFilesDroppedSignal(); } private bool FileIsText(string fileName) { if(Path.GetExtension(fileName).ToLower().Equals(".txt")) { return true; } return false; } private bool FileIsImage(string fileName) { List<string> imageExtensions = new List<string> {".png",".jpg",".jpeg",".bmp",".svg",".svgz",".tga",".webp"}; foreach(var image in imageExtensions) { if (Path.GetExtension(fileName).ToLower().Equals(image)) { return true; } } return false; } private void LoadSprite2DTextureFromDisk(string imagePath, Sprite2D sprite) { Image img = new Image(); if(img.Load(imagePath) == Error.Ok) { var texture = ImageTexture.CreateFromImage(img); sprite.Texture = texture; sprite.Centered = false; } else { _textLabel.Text = "Could not load the image from " + imagePath; }; } private void ConnectFilesDroppedSignal() { var rootNode = GetTree().Root; rootNode.FilesDropped += OnFilesDropped; } public void OnFilesDropped (string[] files) { _textLabel.Text = string.Empty; if(FileIsText(files[0])) { string text = File.ReadAllText(files[0]); _textLabel.Text = text; } else if (FileIsImage(files[0])) { LoadSprite2DTextureFromDisk(files[0], _imageSprite2D); } else { _textLabel.Text = "\"" + Path.GetFileName(files[0]) +"\"" + "Is not a .txt or supported image file."; } // print message on Godot console //GD.Print("The files was dropped, first file is " + files[0]); } // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { } } |
News : Windows 10 KB5026435 released.
You can find it on the official webpage database. Here’s a list of all bug fixes and improvements: Microsoft fixed an issue where the touch keyboard failed to open. Microsoft fixed an issue that broke Storage Spaces Direct (S2D) cluster. Microsoft fixed an issue where policies did not apply correctly to mobile device management (MDM),… Read More »
Google Apps Script – reading and store feeds from feedly website – part 055.
You need to have an account with feeds on feedly.com and create a on this website. Open your google drive , create a new spreadsheet and open the Google Apps Script editor. This will allow to use this source code and the result of the running will be add into your spreadsheet:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | function getFeedlyFeeds() { // your User ID-ul var userId = ""; // your Access Token-ul var accessToken = ""; var apiUrl = "https://cloud.feedly.com/v3/"; // URL for API Feedly //GET all feeds var response = UrlFetchApp.fetch(apiUrl + "streams/contents?streamId=user/" + userId + "/category/global.all", { headers: { Authorization: "Bearer " + accessToken }, muteHttpExceptions: true }); // check HTTP answer var statusCode = response.getResponseCode(); if (statusCode === 200) { var responseData = JSON.parse(response.getContentText()); // store data into items var items = responseData.items; // sorting items.sort(function(a, b) { var dateA = new Date(a.published); var dateB = new Date(b.published); return dateA - dateB; }); // iterations for feeds for (var i = 0; i < items.length; i++) { var item = items[i]; var title = item.title; var url = item.canonicalUrl || item.originId; var published = new Date(item.published); // create sheet name var sheetName = published.toISOString().split("T")[0]; // get sheet var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName); // if sheet is not exist then create it if (!sheet) { sheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet(sheetName); sheet.getRange("A1").setValue("Feed Title"); sheet.getRange("B1").setValue("Feed URL"); sheet.getRange("C1").setValue("Published Date"); } // add feeds var lastRow = sheet.getLastRow(); sheet.getRange(lastRow + 1, 1).setValue(title); sheet.getRange(lastRow + 1, 2).setValue(url); sheet.getRange(lastRow + 1, 3).setValue(published); } } else { Logger.log("Error HTTP: " + statusCode); } } |
C – Testing ncurses on linux – 007.
Today I will show a simple source code with two functions. This source code will try to read from a file named level.txt a string like this: 101010100000011111101110101010101 and show empty spaces and square ASCII based on this string. You can compile this source code from a file named screen.c like this:
1 2 | [mythcat@fedora GUI]$ gcc -o screen screen.c -lncurses [mythcat@fedora GUI]$ ./screen |
Let’s see… Read More »
C – Testing ncurses on linux – 006.
Today, I will show a source code with ncurses that show you extended characters. Run the executable into your tty not on the terminal, because you don’t see all of these characters. Let’s see the source code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #include <ncurses.h> int main(void) { int counter, counter2=0; initscr(); curs_set(0); attron(A_UNDERLINE); mvprintw(0,24,"NCURSES ALTCHARSET CHARACTERS\n"); attroff(A_UNDERLINE); for (counter=43; counter < 256; counter++) { printw("%3d = ", counter); addch(counter | A_ALTCHARSET); if (counter2 < 7) { addch(' '); addch(ACS_VLINE); printw(" "); } counter2++; if (counter2 > 7) { addch('\n'); counter2=0; } switch (counter) { case 46: counter=47; break; case 48: counter=95; break; case 97: counter=101; break; case 126: counter=127; break; case 128: counter=160; break; case 172: counter=173; } } getch(); endwin(); return 0; } |
I