Jump to content

Home

Computer Science/Programming Thread


Recommended Posts

I thought I'd create an Ahto version of the Computer Science/Programming Thread from the Swamp. Discuss programming languages, IDEs, APIs, ask for help with a section of code, non-programming areas of computer science like filesystems, hardware (hardware-software interaction only please).

 

I only ask that this thread doesn't turn into "zOMG <insert tech-related product here> is teh pwnz0r and <insert other tech-related product here> sux0rz" :xp:

Link to comment
Share on other sites

Has anyone ever used their COM port as digital I/O? This was something I was tinkering with a couple years back but never put it into use. The way it appears to me, you have the possibility of 4 inputs (Pin 1: CD, Pin 6: DSR, Pin 8: CTS, and Pin 9: RING) and 2 outputs (Pin 4: DTR, Pin 7: RTS). Pin 2 and 3 may also be able to provide additional In and Out. My tests inolved driving an optically-isolated relay with the outputs and triggering the inputs with a 9 Volt battery. The test application is written in VB6 using APIs if anyone cares.

 

Here's one of the old reference materials I remember finding on the web: http://www.arcelect.com/rs232.htm

CommViaAPI.zip

Link to comment
Share on other sites

Has anyone ever used their COM port as digital I/O? This was something I was tinkering with a couple years back but never put it into use. The way it appears to me, you have the possibility of 4 inputs (Pin 1: CD, Pin 6: DSR, Pin 8: CTS, and Pin 9: RING) and 2 outputs (Pin 4: DTR, Pin 7: RTS). Pin 2 and 3 may also be able to provide additional In and Out. My tests inolved driving an optically-isolated relay with the outputs and triggering the inputs with a 9 Volt battery. The test application is written in VB6 using APIs if anyone cares.

 

Here's one of the old reference materials I remember finding on the web: http://www.arcelect.com/rs232.htm

I'd be interested in seeing that test application if you don't mind posting a link :)

 

At any rate, I found a way to sucessfully convert XviD-encoded AVI files into DivX files without a loss of quality or any video corruption (before I had trouble converting them without the picture darkening, flickering, or having a bright green line appear at the top of the video). I used VirtualDub 1.3c (10740), XviD codec v2.1, and the DivX codec v6.2 codec. Apparently, the green line(s) were caused by not using the right resize filter. I tried using the Bicubic and Bilinear filters (which caused the green line). It turns out that when I used the Lanczos4 filter it disappeared everytime I converted the files!

 

Anyways, here's the configuration I had to use to get the damn thing to work:

 

  • 780 kbps bitrate, 1-pass
  • "Insane Quality" codec performance
  • NO ENHANCED MULTITHREADING, IT CORRUPTS THE RESULTANT AVI FILE
  • ASC Bidirectional coding
  • Max Keyframe Interval of 300 frames
  • 50% keyframe interval
  • Custom size of 720x480 (you could probably use whatever size you want though)
  • Resize filter: Lanczos4
  • Crop 2 from the top
  • Psychovisual texture enhancement to get rid of picture corruption (it looks s*** without this)
  • H.263 Optimized quantization
  • I don't care what anyone else says, full stream processing *has* to be used to maintain picture quality

 

The only drawback is that the video isn't resized, I've yet to figure out why, but I just ran them through Premiere Pro 1.5 to render them so they conform to the NTSC standard.

Link to comment
Share on other sites

Reminds me of computing class last year. In that we did ASCII, quick and visual basic, binary, c++ etc etc. I thought it'd be a good step onto the ladder of the computer gaming industry and possibly a job therin. I failed the course miserably. So much for that idea.

Link to comment
Share on other sites

wow, this makes me wish i had never gotten out programming... :)

I took basic computer science and Basic Programming when i was in school way back in the day... I got to were i was a really good programmer... er... on the Commadore 64... but never went any further then that... I thought about taking classes in .Net Basic and C+/C++ but those were just fleeting thoughts... Like Astrotoy7, now I'm more of a hardware type of guy, building and repairing mine and others computers.

Link to comment
Share on other sites

I'd be interested in seeing that test application if you don't mind posting a link

 

At any rate, I found a way to sucessfully convert XviD-encoded AVI files into DivX files without a loss of quality or any video corruption (before I had trouble converting them without the picture darkening, flickering, or having a bright green line appear at the top of the video). I used VirtualDub 1.3c (10740), XviD codec v2.1, and the DivX codec v6.2 codec. Apparently, the green line(s) were caused by not using the right resize filter. I tried using the Bicubic and Bilinear filters (which caused the green line). It turns out that when I used the Lanczos4 filter it disappeared everytime I converted the files!

 

Anyways, here's the configuration I had to use to get the damn thing to work:

 

* 780 kbps bitrate, 1-pass

* "Insane Quality" codec performance

* NO ENHANCED MULTITHREADING, IT CORRUPTS THE RESULTANT AVI FILE

* ASC Bidirectional coding

* Max Keyframe Interval of 300 frames

* 50% keyframe interval

* Custom size of 720x480 (you could probably use whatever size you want though)

* Resize filter: Lanczos4

* Crop 2 from the top

* Psychovisual texture enhancement to get rid of picture corruption (it looks s*** without this)

* H.263 Optimized quantization

* I don't care what anyone else says, full stream processing *has* to be used to maintain picture quality

 

 

The only drawback is that the video isn't resized, I've yet to figure out why, but I just ran them through Premiere Pro 1.5 to render them so they conform to the NTSC standard.

 

Ooh! Interesting... how long did it take you to figure out all that? I've been researching C++ and so forth recently (And have decided after six months of faffing about that I hate Visual Basic, completely and utterly) - So compared to a lot of you guys I am probably something of a programming novice :(. Good idea on the thread!

Link to comment
Share on other sites

Ooh! Interesting... how long did it take you to figure out all that? I've been researching C++ and so forth recently (And have decided after six months of faffing about that I hate Visual Basic, completely and utterly) - So compared to a lot of you guys I am probably something of a programming novice :(. Good idea on the thread!

I lost track of time after a few hours. It was basically process of elimination. I'm just glad I burned the test clip I had without a lead-out at the end of the DVD-R (that way my DVD player would read the last clip on the disc), I still managed to ruin a few of them however. I burned some fansubbed anime I had to disk, but the audio on the last clip from about 16 minutes in to the end didn't get copied :(

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...