Programming, computers, etc. [Serious]

All things asdf (and anything else)

Re: Programming, computers, etc. [Serious]

Postby assdef » Sun May 22, 2016 12: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
assdef
JKL;'s Nightmare
JKL;'s Nightmare
 
Posts: 6361
Joined: Sat Jan 02, 2010 5:30 pm

Re: Programming, computers, etc. [Serious]

Postby Uly » Sun May 22, 2016 2:15 pm

Computer computer computer, computer. Computer computer, software hardware network computer language Computer. Compute computing computer.
User avatar
Uly
ASDF Prophet
ASDF Prophet
 
Posts: 3736
Joined: Tue Dec 08, 2015 3:40 pm
Location: At your service

Re: Programming, computers, etc. [Serious]

Postby Anonymously Famous » Fri May 27, 2016 12: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.
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: 10048
Joined: Thu Mar 03, 2011 2:52 pm

Re: Programming, computers, etc. [Serious]

Postby Arkannine » Mon May 30, 2016 8:34 pm

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
Arkannine
ASDF Warlord
ASDF Warlord
 
Posts: 15517
Joined: Tue Oct 28, 2008 5:21 pm
Location: I'm on a boat

Re: Programming, computers, etc. [Serious]

Postby Shai'tan » Tue May 31, 2016 7: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:

Image
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 25459
Joined: Fri Sep 14, 2007 8:14 am
Location: Seven

Re: Programming, computers, etc. [Serious]

Postby Arkannine » Tue May 31, 2016 8:23 am

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
Arkannine
ASDF Warlord
ASDF Warlord
 
Posts: 15517
Joined: Tue Oct 28, 2008 5:21 pm
Location: I'm on a boat

Re: Programming, computers, etc. [Serious]

Postby atomtengeralattjaro » Tue May 31, 2016 5: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.
History has taught us that we don't learn from the past.

Image
User avatar
atomtengeralattjaro
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 33499
Joined: Wed May 23, 2007 11:43 am
Location: green

Re: Programming, computers, etc. [Serious]

Postby assdef » Tue May 31, 2016 9:11 pm

Look I have one too!

Image
Image
User avatar
assdef
JKL;'s Nightmare
JKL;'s Nightmare
 
Posts: 6361
Joined: Sat Jan 02, 2010 5:30 pm

Re: Programming, computers, etc. [Serious]

Postby Anonymously Famous » Wed Jun 15, 2016 12: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.
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: 10048
Joined: Thu Mar 03, 2011 2:52 pm

Re: Programming, computers, etc. [Serious]

Postby Shai'tan » Thu Jun 30, 2016 8:46 am

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:

Image
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 25459
Joined: Fri Sep 14, 2007 8:14 am
Location: Seven

Re: Programming, computers, etc. [Serious]

Postby atomtengeralattjaro » Fri Jul 01, 2016 8:56 am

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.
History has taught us that we don't learn from the past.

Image
User avatar
atomtengeralattjaro
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 33499
Joined: Wed May 23, 2007 11:43 am
Location: green

Re: Programming, computers, etc. [Serious]

Postby Shai'tan » Fri Jul 01, 2016 12: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:

Image
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 25459
Joined: Fri Sep 14, 2007 8:14 am
Location: Seven

Re: Programming, computers, etc. [Serious]

Postby atomtengeralattjaro » Fri Jul 01, 2016 4:21 pm

Have you tried Wireshark?
How about turning it off and back on again?
History has taught us that we don't learn from the past.

Image
User avatar
atomtengeralattjaro
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 33499
Joined: Wed May 23, 2007 11:43 am
Location: green

Re: Programming, computers, etc. [Serious]

Postby Shai'tan » Fri Jul 01, 2016 5: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:

Image
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 25459
Joined: Fri Sep 14, 2007 8:14 am
Location: Seven

Re: Programming, computers, etc. [Serious]

Postby Anonymously Famous » Fri Jul 01, 2016 6: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.
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: 10048
Joined: Thu Mar 03, 2011 2:52 pm

Re: Programming, computers, etc. [Serious]

Postby Shai'tan » Sun Jul 03, 2016 5: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:

Image
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 25459
Joined: Fri Sep 14, 2007 8:14 am
Location: Seven

Re: Programming, computers, etc. [Serious]

Postby assdef » Mon Jul 04, 2016 1: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
assdef
JKL;'s Nightmare
JKL;'s Nightmare
 
Posts: 6361
Joined: Sat Jan 02, 2010 5:30 pm

Re: Programming, computers, etc. [Serious]

Postby Uly » Tue Jul 05, 2016 2:04 pm

Code: Select all
PRINT "I quit"
User avatar
Uly
ASDF Prophet
ASDF Prophet
 
Posts: 3736
Joined: Tue Dec 08, 2015 3:40 pm
Location: At your service

Re: Programming, computers, etc. [Serious]

Postby Anonymously Famous » Tue Jul 05, 2016 5: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.
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: 10048
Joined: Thu Mar 03, 2011 2:52 pm

Re: Programming, computers, etc. [Serious]

Postby Shai'tan » Wed Jul 06, 2016 6: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:

Image
User avatar
Shai'tan
ASDF's Best Friend
ASDF's Best Friend
 
Posts: 25459
Joined: Fri Sep 14, 2007 8:14 am
Location: Seven

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 10 guests

cron