Programming, computers, etc. [Serious]

All things asdf (and anything else)
User avatar
assdef
JKL;'s Nightmare
JKL;'s Nightmare
Posts: 7273
Joined: Sat Jan 02, 2010 9:30 pm

Re: Programming, computers, etc. [Serious]

Post by assdef » Sun May 22, 2016 4:47 pm

Computer computer computer computer. Computer computer, computer computer computer. Computer: computer computer computer computer computer?! Computer, computer! Computer computer computer computer, computer computer computer computer. Computer computer, computer computer computer computer computer computer software.
Image

User avatar
Uly
ASDF Prophet
ASDF Prophet
Posts: 4060
Joined: Tue Dec 08, 2015 7:40 pm
Location: where the hawks play!
Pronouns: Jedi Master

Re: Programming, computers, etc. [Serious]

Post by Uly » Sun May 22, 2016 6:15 pm

Computer computer computer, computer. Computer computer, software hardware network computer language Computer. Compute computing computer.
REAL RX

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 May 27, 2016 4:47 pm

Arkannine wrote:
Anonymously Famous, on being a localization engineer, wrote:Yes, and yes.
That's cool. I tried recently pulling off some freelance translation jobs but it's really hard to get your first one when you have no certifications or experience, even though you're pretty good with the language :(
Yeah. It can be hard without the certifications, etc.

If you're confident in your translation abilities, and you still want to do it, I could recommend some translation agencies. Send me a PM if you're interested.
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
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 » Tue May 31, 2016 12:34 am

Anonymously Famous wrote: If you're confident in your translation abilities, and you still want to do it, I could recommend some translation agencies. Send me a PM if you're interested.
I did, thanks :)

To push the topic back to programming, computers, etc:

Have you guys ever done any home project with electronics, a Raspberry Pi, Arduino or something like that? How was it?
Two small projects of mine come to mind:

I - For a university event organized by students from my course, I was requested to modify a megaphone. The deal was that it required 6 of those big round disposable batteries, which is fairly expensive. So I was tasked with finding a way to adapt it to use a single rechargeable battery. Through testing the megaphone's battery contacts I figured out that it was a series circuit and its start and end positions. Since it was a series circuit and used 6 1.5V batteries, I knew that its total tension was 6 * 1.5 = 9V. The rechargeable battery I have home is 12V, but I also have a handy voltage regulator so it was no issue. I hooked up the battery to the regulator and the regulator to the battery contacts in the megaphone, switched everything on and it worked perfectly! Next step was just taping the battery to the outside of the megaphone, since it didn't fit very well inside. Not very high-tech or sturdy but it did save us a bit of cash!

II - I bought this cool LED strip. You can modify each LED in it individually, so there's some pretty cool effects to be made. Anyway, I made a quick Arduino program with a couple of modes for it (spinning and switching colors and the like), fed it with a 9V disposable battery and went to a party using it as a belt! It was pretty wild while it lasted, since at the time I only had the relatively bulky Arduino Uno and the pressure from my pocket broke the tip off one of the jumper cables. Still, I may or may not do it again better!
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 » Tue May 31, 2016 11:49 am

That's cool. I have a Raspberry Pi, but I'm terrible at coming up with small projects like these. :shaiface:
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 » Tue May 31, 2016 12:23 pm

Shai'tan wrote:That's cool. I have a Raspberry Pi, but I'm terrible at coming up with small projects like these. :shaiface:
Well, I'd suggest getting a cheap webcam or the Pi's camera and make a people counter or something like that. OpenCV is great and relatively easy to learn.
assdef wrote:I've seen a number of Cocks in my days.

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 May 31, 2016 9:51 pm

Programmable panels, you say? Well check out the crazy inventions of Simone Giertz https://youtu.be/Lh2-iJj3dI0
granted, most of her things don't actually need an arduino, but they're fun.
Ivokyuftaf6666 wrote:
Sun Oct 20, 2019 5:22 pm
Awesome Site, Delivering Fun
Image

User avatar
assdef
JKL;'s Nightmare
JKL;'s Nightmare
Posts: 7273
Joined: Sat Jan 02, 2010 9:30 pm

Re: Programming, computers, etc. [Serious]

Post by assdef » Wed Jun 01, 2016 1:11 am

Look I have one too!

Image
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 Jun 15, 2016 4:13 pm

Shai'tan wrote:That's cool. I have a Raspberry Pi, but I'm terrible at coming up with small projects like these. :shaiface:
Same.
Arkannine wrote:
Anonymously Famous wrote: If you're confident in your translation abilities, and you still want to do it, I could recommend some translation agencies. Send me a PM if you're interested.
I did, thanks :)
Sorry I kind of disappeared. I'll take a look at the PM and get back to you probably later today.
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 Jun 30, 2016 12:46 pm

So I'm trying to build a program in Windows, using Visual Studio and C#, for work. I'm a complete newbie though, and I was wondering if any of you had any experience (or know if it's possible) with doing the following:

1? Go to a page
2. Execute a javascript function on that page. (Looks like javascript:lookupUser(parameters...)
3. Fetch the results on the next page.

EDIT:

Well, firstly I need to log in somehow... It's not using a regular login page though.
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 » Fri Jul 01, 2016 12:56 pm

Do you have to use the javascript part? What does it do? (Is there any async requests that it does? Or does it just work with data it already has?)
Does it need to be dynamic (as in: does your program need to work even if the javascript is changed?)

Getting a webpage is easy:

Code: Select all

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("url here");
try
{
	using (HttpWebResponse response = (HttpWebResponse)req.GetResponse())
	{
		if (response.StatusCode != HttpStatusCode.OK)
		{
			//throw error, refer to response.StatusDescription
		}
		using (StreamReader reader = new StreamReader(response.GetResponseStream()))
		{
			string response =  reader.ReadToEnd();
			//use response
		}
	}
}
catch (WebException ex)
{
	//throw error, refer to ex
}
(Just an example, it should be made a bit more complex with asynchronous operation as to not hog the main thread while waiting for the server, etc.)

What kind of login page, what do you mean not regular? Is it delegated login (like login with facebook, google, etc)?
For the basics I would refer you to the ASDFdisapprover (have I not sent you the code?), it uses login cookie.
I'd be happy to help, if you share the details. PM me if you don't want it made public.
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 » Fri Jul 01, 2016 4:53 pm

atomtengeralattjaro wrote:Do you have to use the javascript part? What does it do? (Is there any async requests that it does? Or does it just work with data it already has?)
Javascript collects the info in the text fields (user id, name, that kind of thing) then makes a request to search for those variables. What kind of request I don't know, it's kinda hard to scrape info with only Dev tools in Chrome. Almost all extensions are blocked, or gets removed if you unblock it (registry edit the whitelist/blacklist as I learned today).

Does it need to be dynamic (as in: does your program need to work even if the javascript is changed?)
Not really, I don't expect the javascript to change tbh.
Getting a webpage is easy:

Code: Select all

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("url here");
try
{
	using (HttpWebResponse response = (HttpWebResponse)req.GetResponse())
	{
		if (response.StatusCode != HttpStatusCode.OK)
		{
			//throw error, refer to response.StatusDescription
		}
		using (StreamReader reader = new StreamReader(response.GetResponseStream()))
		{
			string response =  reader.ReadToEnd();
			//use response
		}
	}
}
catch (WebException ex)
{
	//throw error, refer to ex
}
(Just an example, it should be made a bit more complex with asynchronous operation as to not hog the main thread while waiting for the server, etc.)
Yeah, got this down. Which was when I discovered the login issue (kept getting 401'd).
What kind of login page, what do you mean not regular? Is it delegated login (like login with facebook, google, etc)?
It uses single sign on when logging in from IE, in Chrome you get prompted for user id and password. I think this means that IE fetches a certificate or something of the kind and uses that in its call.
For the basics I would refer you to the ASDFdisapprover (have I not sent you the code?), it uses login cookie.
You did, but I don't have access to pastbin at work. I sent it to myself though, so I have it and it's really helpful :D
I'd be happy to help, if you share the details. PM me if you don't want it made public.
Thanks! I'll be sure to be on the safe side with the info I give out publicly.
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 » Fri Jul 01, 2016 8:21 pm

Have you tried Wireshark?
How about turning it off and back on again?
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 » Fri Jul 01, 2016 9:05 pm

No, maybe I can try that. I did manage to have Live HTTP Headers addon installed, but it got removed again.
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 » Fri Jul 01, 2016 10:47 pm

Does it have to be in C#, or in the .net framework at all?

If not, you could look into creating an HTA (HTML Application). You write them using Javascript and/or VBScript. They open in an application window that's actually a modified instance of Internet Explorer.

That might mimic the behavior of IE doing the single sign on.

I don't know if this helps at all, but it's what I could think of.
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 » Sun Jul 03, 2016 9:37 pm

Not really, but I thought it would be easier to do and share if I get it working. Means that my colleagues don't have to install anything to make it work.

Never heard of it, I'll check it out, thanks :)
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
assdef
JKL;'s Nightmare
JKL;'s Nightmare
Posts: 7273
Joined: Sat Jan 02, 2010 9:30 pm

Re: Programming, computers, etc. [Serious]

Post by assdef » Mon Jul 04, 2016 5:13 pm

Damn programming. In the accounting course I'm taking the prof suddenly starts talking about XML (XBRL). If she starts talking about pukeymin, I swear to god I am dropping this course.
Image

User avatar
Uly
ASDF Prophet
ASDF Prophet
Posts: 4060
Joined: Tue Dec 08, 2015 7:40 pm
Location: where the hawks play!
Pronouns: Jedi Master

Re: Programming, computers, etc. [Serious]

Post by Uly » Tue Jul 05, 2016 6:04 pm

Code: Select all

PRINT "I quit"
REAL RX

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 05, 2016 9:37 pm

assdef wrote:Damn programming. In the accounting course I'm taking the prof suddenly starts talking about XML (XBRL). If she starts talking about pukeymin, I swear to god I am dropping this course.
It seems that there are a lot of things that are XML-based. I'd never heard of XBRL before.
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 » Wed Jul 06, 2016 10:26 am

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#.
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.

Post Reply