Programming, computers, etc. [Serious]

All things asdf (and anything else)
User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37528
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Wed Jul 06, 2016 12:47 pm

how do you run a python script?
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26276
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Wed Jul 06, 2016 2:25 pm

What do you mean? From C#? Should be possible, saw some examples when I googled it.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37528
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Wed Jul 06, 2016 4:07 pm

I meant in general, I know i could google this, but i'm lazy. So you need a python runtime thing to be installed, and then just run your thing? Or is there something special? Because I'm not sure why you need to start it from .NET then, if there isn't anything to it.
Anyway, System.Diagnostics.Process.Start(filename) will start things.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Arkannine
ASDF Warlord
ASDF Warlord
Posts: 15525
Joined: Tue Oct 28, 2008 9:21 pm
Location: I'm on a boat
Pronouns: Don't even try, I'm offended already

Re: Programming, computers, etc. [Serious]

Post by Arkannine » Wed Jul 06, 2016 5:36 pm

Oh, I've been learning Python and it's fantastic for rapid development and simple scripts. There is a library/function for anything low-level you can think of, so you don't have to worry at all about that and it's really easy to get going. Most of these libraries are built-in, and the ones that aren't are extremely simple to include; there's pip, which is similar to a package manager in which you just

Code: Select all

pip install numpy
and then you just have to

Code: Select all

import numpy
at the top of your code, no version complications, no file location complications, no having to fiddle with any settings to get it working, it just works out of the box. Simply amazing.
atomtengeralattjaro wrote:how do you run a python script?
You must have a Python interpreter installed (that is, the official one you download from the python website or your package manager).
Then, if you're on Linux/Mac or you're on Windows and the installation is in your Path variables just

Code: Select all

python script.py
You can also double-click it but it has that small issue also present in whatever language where the program will exit immediately on completion, so if it's a terminal application it'll close as soon as it's done which might not leave time to read stuff if you need to and there wasn't a blocking input request at the end of the program.

Also because it's interpreted it means anything you write is multi-platform out of the box! I think there's some modules that aren't, if they depend on calls to external languages, but I never had to use one of those. It's so easy I actually just keep my .py files in my Dropbox folder and edit and run them across OS's.
assdef wrote:I've seen a number of Cocks in my days.

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26276
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Thu Jul 07, 2016 7:32 am

atomtengeralattjaro wrote:I meant in general, I know i could google this, but i'm lazy. So you need a python runtime thing to be installed, and then just run your thing? Or is there something special? Because I'm not sure why you need to start it from .NET then, if there isn't anything to it.
Anyway, System.Diagnostics.Process.Start(filename) will start things.
Arkannine is correct on how it runs. I was thinking of having an all-in one program that could do a lot of stuff we need for work. Having the python script be something external kinda defeats the purpose. There's also the issue that the python script depends on a couple of extra packages I installed through pip. Which is a rather painful thing to do for most people as it needs Cntlm to use the proxy at work. I'd rather avoid doing that if it's something I'm to give to my colleagues.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Thu Jul 07, 2016 6:23 pm

Shai'tan wrote:Figured it out! Managed to do it in Python with Requests and NLTLM, so now I just need to reproduce it in C# or call the python script from C#.
I believe you can embed Python in programs, so you might want to look into that.

Glad you got it figured out!
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26276
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Thu Jul 07, 2016 9:38 pm

Might look into that as it was a lot easier to do than it seems to be in C#. Taking a little break from that though, now working on communicating with Active Directory, which is one of the reasons I want to build this in C# as well. (It looks to be a lot easier to do this in C#).
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Jul 11, 2016 5:53 pm

It might be fun to have a program that's a Frankensteined together C# and Python program.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26276
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Mon Jul 11, 2016 7:36 pm

Hehe, might be. Just worried about having to download extra stuff for python because that is not easy.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Tue Jul 12, 2016 6:08 pm

Well, however you get it to work, I hope it's not too much trouble in the long run.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26276
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Tue Jul 12, 2016 7:50 pm

True. If I can get it to work that's the main point anyway.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
Arkannine
ASDF Warlord
ASDF Warlord
Posts: 15525
Joined: Tue Oct 28, 2008 9:21 pm
Location: I'm on a boat
Pronouns: Don't even try, I'm offended already

Re: Programming, computers, etc. [Serious]

Post by Arkannine » Sat Jul 16, 2016 5:26 pm

Shai'tan wrote:Hehe, might be. Just worried about having to download extra stuff for python because that is not easy.
Have you heard about Cython? I never used it, but my impression is that it converts Python into C and then compiles into bytecode. Might be worth a look.
assdef wrote:I've seen a number of Cocks in my days.

User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
Posts: 26276
Joined: Fri Sep 14, 2007 12:14 pm
Location: Seven
Contact:

Re: Programming, computers, etc. [Serious]

Post by Shai'tan » Sun Jul 17, 2016 8:05 pm

Hmm, think I have heard of it, but never used it. I'll look into it, thanks!

Also, you don't need the " around the url.
Quote of the Ages:
atomtengeralattjaro wrote:The Forums of ASDF turn, and Pages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Page that gave it birth comes again. On one Page, called the Six Hundred and Ninety Fifth Page by some, a Page yet to come, a Page long past, a post was made by atomtengeralattjaro. The post was not the beginning. There are neither beginnings nor endings to the turning of the Forums of ASDF. But it was a beginning.

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Mon Aug 01, 2016 9:47 pm

The other day, I discovered that one of my coworkers knows about and uses one of my favorite scripting languages that no one has heard about. And he's done stuff that's a lot more complicated than anything I've ever done with it. Thousands of lines of code, with GUI, etc. It was fun to talk about it with him when just about everyone else goes "What is that?"
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37528
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Tue Sep 20, 2016 7:45 am

Encoding bullcrap:



I see this black diamond shape with a white question mark in it a lot in this old article. Is there anything to be done about this, or is it a lost cause? Seems to be in place of punctuation.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
ThingerDudes
ASDF Warlord
ASDF Warlord
Posts: 20958
Joined: Sun Apr 12, 2009 4:12 am
Location: near, far, wherever i are

Re: Programming, computers, etc. [Serious]

Post by ThingerDudes » Tue Sep 20, 2016 7:38 pm

Not sure what the best way to go about doing this is but if you can get the hex values of the characters and put that into something like this maybe that would help?
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Wed Sep 21, 2016 10:22 pm

It is indeed an encoding issue. The page is encoded in ANSI (Windows-1252), but is being displayed as though it were encoded in UTF-8. What you're seeing is the "replacement character," which is often shown when the current encoding can't properly render the data as characters. The page source doesn't declare an encoding (aka "charset") in the metadata, so it's up to the browser to guess. If you go to "View" -> "Text Encoding" -> "Western" (Firefox) or "More Tools" -> "Encoding" -> "Western (Windows-1252)" (Chrome), it should correct any issues.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
atomtengeralattjaro
Site Admin
Site Admin
Posts: 37528
Joined: Wed May 23, 2007 3:43 pm
Location: green
Pronouns: he / they / that submarine
Contact:

Re: Programming, computers, etc. [Serious]

Post by atomtengeralattjaro » Thu Sep 22, 2016 7:42 pm

Thanks AF! Super.
I didn't even think to look anywhere near there, as I usually have the menu bar hidden in firefox..
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Thu Sep 22, 2016 11:27 pm

No problem! I may use this website as a real world example of character encoding issues.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

User avatar
Anonymously Famous
JKL; Assassin
JKL; Assassin
Posts: 11413
Joined: Thu Mar 03, 2011 6:52 pm
Location: Area ???, under Bermuda Triangle

Re: Programming, computers, etc. [Serious]

Post by Anonymously Famous » Fri Oct 21, 2016 7:08 pm

Someone did a DDoS on a DNS, and now a bunch of stuff I need to access to do my job effectively are unavailable. So I'm here.

Here's an article about the attack.
BOTTOM TEXT
ThingerDudes wrote:The only reasonable amount of Nutella is infinity. Everything else is too little.
Proud poster of the 300kth post in General

Post Reply