How to return from a function back to the main application loop

2023-04-04 Thread Naterlarsen
Understood. Will give it another try. Thanks

How to return from a function back to the main application loop

2023-04-03 Thread Naterlarsen
I tried to compile the code on both client and server but got on error on each one. nim-1.6.10libpureconcurrencythreadpool.nim(22, 10) Error: Threadpool requires --threads:on option. I thought this might be a missing module but not finding any module problem. I will continue to check this.

How to return from a function back to the main application loop

2023-04-03 Thread Naterlarsen
I will load it tonight and take a closer look. Thanks.

How to return from a function back to the main application loop

2023-04-03 Thread Naterlarsen
Looks great! My only concern is firewall issues. The big advantage of reverse is it has no firewall problems. When helping a user it might be difficult to walk them through the process of setting this to go through their firewall. Have you been able to get this to work with the reverse format?

How to return from a function back to the main application loop

2023-04-03 Thread Naterlarsen
Looks good. Just need to understand how to implement spawn into the original code. Will this help to return control from download to main? Thanks for the input

How to return from a function back to the main application loop

2023-04-03 Thread Naterlarsen
When asked about the tool category, I’d put it into a type of support tool. Of course this type of tool never starts robust, and that’s fine. Robustness comes with time, not at the beginning. Thank you for your efforts.

How to return from a function back to the main application loop

2023-04-02 Thread Naterlarsen
Good morning (I'm in mountain time -Utah). As a follow-up on the purpose of this tool - You are correct, "remote support" is what I had in mind. Nothing nefarious. The reason for reverse client /server is that you don't need to worry about the firewall. The admin would just need to setup port f

How to return from a function back to the main application loop

2023-04-01 Thread Naterlarsen
I will take a look. If you have time Tomorrow please take a look. Thank you for your help on this. I really appreciate it.

How to return from a function back to the main application loop

2023-04-01 Thread Naterlarsen
Just a quick follow up with some testing I've done. If I insert the "stdout.write("Enter a command") along with "let input: string = strdin.readLine() and the input criteria, I can get a prompt again. However, it seems to work fine for other commands but the download command still has the same

How to return from a function back to the main application loop

2023-04-01 Thread Naterlarsen
Hey, that seemed to get it a little further than before. I am now getting the echo from the "Returning back to the main loop." if input.startsWith("download "): var get_name = input[9..^1] let (dirPath, fileName) = splitPat

How to return from a function back to the main application loop

2023-04-01 Thread Naterlarsen
Anything would help. If you have some time next week to play with this, that would be highly appreciated. There is not timeline, just a hunger for knowledge and how this all works. It's the knowledge not the time. Thanks. All appreicated.

How to return from a function back to the main application loop

2023-04-01 Thread Naterlarsen
Made the requested changes but not seeing a return back to the main loop. Also put an echo after calling the serve() function, - echo "Returning to the main loop.". Not seeing that echo either. The loop comes to an end but still not able to get back to the main program loop. Updated Client-

How to return from a function back to the main application loop

2023-04-01 Thread Naterlarsen
Thanks so much. I will try exactly that and see if it resolves the problem. The code works well except not getting back to the main loop to continue making requests. (:

How to return from a function back to the main application loop

2023-03-31 Thread Naterlarsen
Thanks. I was thinking about removing the function and putting it in the loops to have better control of it. I think I will however on the server have a callable function so it can be used by multiple blocks of code.

How to return from a function back to the main application loop

2023-03-31 Thread Naterlarsen
I am able to download a file via sockets between the client / server successfully, however, after making the function call (proc), for the download of the file, I am pulled out of the loop of the Main program and am not able to return back into the loop of the main program. I need some guidance

Using Socket for File Transfer

2023-03-27 Thread Naterlarsen
Thank you for helping. I really appreciate it.

Using Socket for File Transfer

2023-03-27 Thread Naterlarsen
Essentially I’m just trying to get some simple examples of a file transfer in nim. Reading the file and send. Then receiving the file and write to disk.

Using Socket for File Transfer

2023-03-26 Thread Naterlarsen
Good day all. I am more on the experienced side of Python and have written some successful file transfer applications (in python). However, I am struggling to find sufficient information or examples on how to do the same in nim. I have taken my code that I had done in Python and have attempted t

Screenshot works fine in own code but not over sockets.

2023-03-23 Thread Naterlarsen
I see. Great!! It's working. I was sure Yesterday my code was going to work because it looks right. I really appreciate the insight and knowledge you have. I changed all the "[0..]" slices to "startsWith". Works perfectly now. I will keep listening to you. Thanks again!

Screenshot works fine in own code but not over sockets.

2023-03-23 Thread Naterlarsen
Here is a copy of the current client / server. The stand alone version works great. Appears to only have a problem when implemented into the server side when trying to use "elif" or "startswith" to initiate its execution. I put the screenshot code block in the server twice seeing that startswith

Screenshot works fine in own code but not over sockets.

2023-03-22 Thread Naterlarsen
I have tested this by itself and it works great. When I implement it in client / server, i can get it to respond. Code - elif input.startsWith("scr"): var powershell: string = "powershell.exe" var command = "Add-Type -Asse

Only one line will load. Need all lines in directory to load.

2023-03-21 Thread Naterlarsen
Thanks I appreciate it. I plan on adding file transfer in the code. Moving files is essential.

Only one line will load. Need all lines in directory to load.

2023-03-21 Thread Naterlarsen
I've kept the reverse client / server format rather than the typical format. I've been able to improve it somewhat thanks to examples by members of the forum. Highly appreciated. Client Update - import net import strutils var server: Socket = newSocket() se

Only one line will load. Need all lines in directory to load.

2023-03-21 Thread Naterlarsen
Wow. Okay, I should have noticed the try outside the loop. Now works great. Thanks for your help. How did you learn sockets well? Any recommended books or websites? I do well with python but just started with nim. Wish to learn well.

Only one line will load. Need all lines in directory to load.

2023-03-21 Thread Naterlarsen
This code works very well the first time but it disconnects only after one time. Tried to fix it but not finding the reason for the disconnect. But works great the first time.

Only one line will load. Need all lines in directory to load.

2023-03-21 Thread Naterlarsen
The reverse of client and server was intentional. It was just an easier way for me to connect to my other machine. Thanks for all the help. I really appreciate it.

Only one line will load. Need all lines in directory to load.

2023-03-20 Thread Naterlarsen
Wow! Checking this out. Thanks for the update. I really appreciate it.

Only one line will load. Need all lines in directory to load.

2023-03-20 Thread Naterlarsen
That resolved the problem. Now I can get all the lines of data for each request! Here is the changes I made to both the client and the server. SERVER if input[0..3] == "path": var resp = newSeq[string]() let my_path = input[5..^1]

Only one line will load. Need all lines in directory to load.

2023-03-20 Thread Naterlarsen
My main concern was size. Raw sockets are small so that is my motivation. Not very familiar with Jester. How does it compare compiled size wise when doing the same in raw sockets? Thanks for the suggestions and information.

Only one line will load. Need all lines in directory to load.

2023-03-20 Thread Naterlarsen
Thanks, I agree that writing it down helps to better implement the steps in code. 1. When doing the for loop insert a variable to get number of folder items. 2\. Two variables num_of_dir@dir_list Create a separator character. 3. When on client side use num, dirs = split(“@“) 4\. With a

Only one line will load. Need all lines in directory to load.

2023-03-19 Thread Naterlarsen
I think a for loop when requesting from server can be sent back to the client for the number of need loops and then run a for loop on the with the incoming data for that number of times. Example code: import os echo "Please enter a directory path > " let input_dir_path

Only one line will load. Need all lines in directory to load.

2023-03-19 Thread Naterlarsen
Thanks, I will give it a try. Hopefully I can come up with something effective. Appreciate your help.

Only one line will load. Need all lines in directory to load.

2023-03-19 Thread Naterlarsen
I have fix the problem of just getting one line but its cause a different problem. I used a while loop to get all the lines, however, now I am knocked out of the original loop and loose the ability to continue making other requests. UPDATED CODE that gets multiple lines but looses ability to ma

Only one line will load. Need all lines in directory to load.

2023-03-18 Thread Naterlarsen
Trying to get a list of file / folders to load from client to server, however, if the requests are longer than one line, it only shows the first line. Tried a for loop but not working correctly. Only the path request is having a problem. All others requests work because they are one line respons

I asked chat-gpt to write a fft function in Nim

2023-03-17 Thread Naterlarsen
Chat gpt is not the best at nim (not yet anyway). But quite good at Python. It has a lot more data about python, hence the reason for better performing code.

Sending Directory Listing over Sockets Help.

2023-03-17 Thread Naterlarsen
Hey, got it working. Thanks for making me think betterlol. Here is what I was able to come up. Not the prettiest but its working. if input[0..3] == "path": var my_path = input[5..^1] for entry in walkDir(my_path): le

Sending Directory Listing over Sockets Help.

2023-03-16 Thread Naterlarsen
Thanks, I appreciate it. No worries about being honest.

Sending Directory Listing over Sockets Help.

2023-03-16 Thread Naterlarsen
I am trying to send a directory listing over sockets but getting an error. Please help. Example remote string being sent: The keyword, "directory" is cut out and only the directory path is fed into the userInput variable. The intent is to have the directory listing of both directories and files

How to Save Directory Listing into Variable.

2023-03-16 Thread Naterlarsen
Thanks for all the great help. Highly appreciated.

How to Save Directory Listing into Variable.

2023-03-16 Thread Naterlarsen
Need to the sub-directories names and file names in that directory to a variable. Here is the example in python. import os user_input = input("Enter a directory > ") file_path = os.listdir(user_input) print(file_path) output: Enter a dire

Slicing a string of characters from a starting point until all is selected.

2023-03-16 Thread Naterlarsen
Wow! Thanks for the help.

Slicing a string of characters from a starting point until all is selected.

2023-03-15 Thread Naterlarsen
Wow, I see. That helps a ton! Thanks for the help.

Trying To Slice the Characters Where Needed.

2023-03-15 Thread Naterlarsen
Thanks for the help. Appreciated.

Slicing a string of characters from a starting point until all is selected.

2023-03-15 Thread Naterlarsen
I am trying to slice a section of a string to obtain a specific section of that string. Here is an example in Python: import os my_string = "filesizec:\\users\\nate\\desktop\\thepark.jpg" new_string = my_string[8:] print(new_string) file_size = os.path

Trying To Slice the Characters Where Needed.

2023-03-15 Thread Naterlarsen
When sending or receiving strings in nim, I'm not sure how to slice the part of the string I want to use. Example in python: import os enter_some_characters = input(str("Enter a string of 10 characters > ")) first_group_of_characters = enter_some_characters[:5]

Wish to use nim to take a screenshot of my desktop background

2023-03-14 Thread Naterlarsen
I've been looking for a module to help me take a screenshot of my desktop(entire screen). I haven't been able to find anything but I am sure that it exists. Any information or line or snippet would be very helpful. I just want to take a screenshot of my computer and then save it as an image (png

Windows Screen Capture Help

2023-03-12 Thread Naterlarsen
Thank you for the information and the help. I appreciate it.

Cursor Location for user input.

2023-03-12 Thread Naterlarsen
I noticed when using user input, the cursor always shows below the request for the user to input information. Not sure I'm placing this so it should request on the same link as the user input - Example: import os while true: echo "Enter a file path > "

Windows Screen Capture Help

2023-03-11 Thread Naterlarsen
I am trying to create a simple application that captures the desktop screen, however, not able to find much information about how to do this. I have been looking for some time and have had no luck. Please help. Please see the code below. import winim let window = FindWindow("Window Title", nil

Fstring and Split to Variable Error

2023-03-10 Thread Naterlarsen
Thanks, that solved the problem! import strutils var names = "nate@john@sally" let name_list = names.split('@') let name1 = name_list[0] let name2 = name_list[1] let name3 = name_list[2] echo name1 echo name2 echo name3

Fstring and Split to Variable Error

2023-03-10 Thread Naterlarsen
There must be a way to save to values and separate them with a character such as @ then after sending it via sockets to the client to split it and extract those values. variable1@variable2 newvar, newvar2 = variable.split("@")

Fstring and Split to Variable Error

2023-03-10 Thread Naterlarsen
Here is my working python code that Im trying to replicate in nim. Getting an error. Working python code - #Collect information from user input. old_file_name = input("Enter the path and name of the file name to change >") new_file_name = input("Enter the new file name >") #Create an fstring

Getting a Compile Error - "Error: cannot open file: sockets"

2023-03-08 Thread Naterlarsen
wow, thanks. I will give it a try. Highly appreciated.

Getting a Compile Error - "Error: cannot open file: sockets"

2023-03-08 Thread Naterlarsen
Thanks. Will try this. Very much appreciated.

Getting a Compile Error - "Error: cannot open file: sockets"

2023-03-08 Thread Naterlarsen
Running on windows 10. Installed nim and has been working for some projects. However, I tried to do a simple server using sockets and it's getting an error. See below for full error. C:UsersusernameDownloadsnimnim-1.6.10bin>nim c --run "c:usersusernamedocumentsnimcodeserver.nim Hint: used confi

Compile error “no socket”

2023-03-07 Thread Naterlarsen
Created a simple code with sockets but when compiling I get an error that socket not found. Tried to use nimble install but the links for the socket module are dead(404). This is on a windows system. Later I’ll setup Linux which is better for nim but for the present, I need to use windows os. Pl