Author Topic: C0D3_THR34D;  (Read 739 times)

Triple Zero

  • DO NOT ABUSE EXCEPT FOR URGENT FURNITURE MOVING EMERGENCIES
  • One-Armed Jizz Moppers
  • Deserved It
  • **
  • Posts: 80835
  • Horrible and Sexy Queen of Cheese
    • View Profile
    • Random BIP
C0D3_THR34D;
« on: June 29, 2012, 02:31:56 pm »
THIS THREAD IS ABOUT CODE




and I'll start off with this:

  • I've recently discovered a passion for programming, mainly scripting in HTA, VBS, batch and python.

Oh good! You're going to explain me about HTA and VBS soon!

The kids at the Young Researchers Centre just discovered the wonders of batch files. Especially that you can put things like "start JimmyIsAwesome.txt" and it pops up a notepad screen that says ... you guessed it.

I don't know why I couldn't get them interested in Python. Well, I'm fairly sure it is because I didn't have a drop dead simple example that would give immediate results. They're not averse to figuring out complex stuff, but apparently you gotta show them there is SOME treasure at the end of the road first. AKA I  build it first :)

Anyway so I thought maybe VBS is a nice idea because one of them also figured out you can make stuff pop up by writing the right commands in a textfile and renaming it to ".vbs"

Which is pretty awesome because it means it's a real programming language that is available by default on every windows system.

But then I found out that any type of UI in VBScript is limited to popup message boxes and popup input prompt message boxes. Is that right? And that for anything more complex you need to use a HTA ?

Fortunately HTA seems to have the advantage that you can also use JScript, which is kinda like Javascript. And I know that better.

Another problem is that it seems that to do anything *useful* you need to make ActiveX COM objects or whatever and that seems super complicated.

THOUGHTS????
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

Bu☆ns

  • █ ▀█ ▀ █ ▀█▄ ▀█
  • Deserved It
  • ****
  • Posts: 37886
  • Way Out West
    • View Profile
Re: C0D3_THR34D;
« Reply #1 on: June 30, 2012, 12:52:07 am »
HTA is just HTML for applications.

The problem with HTML is it lacks the security to make system changes.  That's where HTA comes in and can do things like this.

I gotta say that I've gotten a TON of info from microsoft's "The Scripting Guys"

They also made this HTA Help-o-matic applications that does a great job combining the html and the vbs to give you an example of how to use it. Download it here.

Some good examples of HTAs can be found at http://www.robvanderwoude.com/htaexamples.php

HTAs can make a nice interface for running batch scripts also.

Make a html header...
Then you create a subroutine in the script part of the hta and then call it later using a button in the body of the html.

AwesomeBatch.hta
Code: [Select]
<head>
     <title>awesome button that makes awesome batch file run!</title>
         <hta:application 
          ID = "HTA" 
          ApplicationName = "Awesome batch file"
          Border = "Thin"
          InnerBorder="No"
          Navigable="No"
          SCROLL="no"
          SingleInstance = "Yes"
          Version = "1.0"
          WindowState = "Normal" />
<script LANGUAGE="VBSCRIPT" %>

Sub awesomebatch
Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run ("awesomebatchscript.cmd")
End Sub

</script>
</head>
<body>

<input type="button" value="Awesome Batch File" name="run_button"  onClick="awesomebatch">

</body>

Now, if you check out the Help-o-matic.hta you'll see you can make all kinds of html type stuff like radio buttons, text fields, buttons, inactive text....
 

I'll add more later...

Triple Zero

  • DO NOT ABUSE EXCEPT FOR URGENT FURNITURE MOVING EMERGENCIES
  • One-Armed Jizz Moppers
  • Deserved It
  • **
  • Posts: 80835
  • Horrible and Sexy Queen of Cheese
    • View Profile
    • Random BIP
Re: C0D3_THR34D;
« Reply #2 on: June 30, 2012, 05:19:46 pm »
Awesome thanks for the links! I tried looking for some good tutorials, but it seemed the level of blind-leading-blind was even worse than when looking for PHP tutorials ...
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

Bu☆ns

  • █ ▀█ ▀ █ ▀█▄ ▀█
  • Deserved It
  • ****
  • Posts: 37886
  • Way Out West
    • View Profile
Re: C0D3_THR34D;
« Reply #3 on: June 30, 2012, 05:57:26 pm »
Yeah that pretty much surprised me too...I figured since it was and easy way to create a gui that more people would be doing it.  I found that when I needed to do more research that I ended up just looking up vbs/html stuff -- since it's pretty much the same thing.

One caveat: some of the wscript methods, like the wscript.echo or wscript.quit won't work in an HTA since they're designed to use the windows script host environment.  There are ways around them though like using msgbox instead of echo, for instance.

Triple Zero

  • DO NOT ABUSE EXCEPT FOR URGENT FURNITURE MOVING EMERGENCIES
  • One-Armed Jizz Moppers
  • Deserved It
  • **
  • Posts: 80835
  • Horrible and Sexy Queen of Cheese
    • View Profile
    • Random BIP
Re: C0D3_THR34D;
« Reply #4 on: June 30, 2012, 09:28:17 pm »
Currently I'm at the point of "let's see what I can do with this".

I just want to see what it can do, for sorts of stuff, and how complex it is, since it's an actual programming/scripting language shipped with every Windows install.

Just like QBASIC was in the old days. And I was kind of sad that there was no longer a programming environment for people to discover in their own computer without having to install anything extra.

Of course those QBASIC days were different anyway, back then it was way more of a big deal what sort of things came along with your default OS, while today nobody bats an eye if they need to download and install some external thing (say, Python).

Still, it's a cool trick because it works with just Notepad and any Windows computer.
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

LMNO, PhD (life continues)

  • Internet Fuckweasel of Haunted Pork Dimensions.
  • Deserved It
  • ****
  • Posts: 82859
  • Internet Fuckweasel of Haunted Pork Dimensions.
    • View Profile
    • Earfatigue Productions: When it has to sound like you give a shit.
Re: C0D3_THR34D;
« Reply #5 on: July 20, 2012, 11:51:41 am »
Dear coding freaks,


Is this funny?


LMNO
Pope/Wrought Iron Instigator
First Church of Last Exit Before Toll
The Spider Project.

Buy the Chao te Ching, or be doomed forever.

http://www.stonybrook.edu/sb/marburger/index.shtml

"Get offa me, you freaks!  This is not North Korea.  No.  This is America, and I expect to be PAID for that sort of nonsense.  In advance.  No credit...Cash on the barrelhead or GTFO.  I swear to God, there's nothing more annoying than commie perverts who don't understand the intrinsic value of the free market system."

guryaf

  • Known
  • *
  • Posts: 183
    • View Profile
Re: C0D3_THR34D;
« Reply #6 on: July 20, 2012, 05:09:38 pm »
Dear coding freaks,


Is this funny?




I don't know if anyone would find that funny, but the artwork is pretty bad. The lack of faces is kind of disturbing.

LMNO, PhD (life continues)

  • Internet Fuckweasel of Haunted Pork Dimensions.
  • Deserved It
  • ****
  • Posts: 82859
  • Internet Fuckweasel of Haunted Pork Dimensions.
    • View Profile
    • Earfatigue Productions: When it has to sound like you give a shit.
Re: C0D3_THR34D;
« Reply #7 on: July 20, 2012, 05:47:09 pm »
... yeah, you should go to xckd.com and look through the archives first.


I'm not trying to be mean, but there is some context needed, here.
LMNO
Pope/Wrought Iron Instigator
First Church of Last Exit Before Toll
The Spider Project.

Buy the Chao te Ching, or be doomed forever.

http://www.stonybrook.edu/sb/marburger/index.shtml

"Get offa me, you freaks!  This is not North Korea.  No.  This is America, and I expect to be PAID for that sort of nonsense.  In advance.  No credit...Cash on the barrelhead or GTFO.  I swear to God, there's nothing more annoying than commie perverts who don't understand the intrinsic value of the free market system."

Telarus

  • Fictional Ego
  • Deserved It
  • ****
  • Posts: 12147
  • Ratcheting Metallic Sex Doll of The End Times
    • View Profile
Re: C0D3_THR34D;
« Reply #8 on: July 20, 2012, 07:15:13 pm »
Holyshit, there's a site for this.

http://www.explainxkcd.com/2012/07/20/server-problem/
Quote
Image text: Protip: Annoy Ray Kurzweil by always referring to it as the 'Cybersingularity'.

In this comic, Cueball has messed up his Linux server (apparently again as he does this a lot).  Megan comes over and runs the 'ls' command which lists the files in the location/directory and gets a "Device is not responding error".

The best I can make of the directory is that it is nonsense.  Adobe is the maker of such programs as Acrobat, Flash and Photoshop.  Android VM would be a virtual machine for the mobile Operating System created by Google called Android.

But, the crux of the comic is that Cueball should really just give up and wait for the singularity.  The singularity is (thanks Wikipedia!) "the hypothetical future emergence of greater-than-human superintelligence through technological means. Since the capabilities of such intelligence would be difficult for an unaided human mind to comprehend, the occurrence of a technological singularity is seen as an intellectual event horizon, beyond which events cannot be predicted or understood.

Proponents of the singularity typically state that an "intelligence explosion",where superintelligences design successive generations of increasingly powerful minds, might occur very quickly and might not stop until the agent's cognitive abilities greatly surpass that of any human."

In the image text, Ray Kurzweil is an author and futurist who has talked and written much about the singularity.

See the comments for gems like:
Quote
isn’t it it also implying how ludicrous it is that “ls” is accessing an Android virtual machine, installed with an Adobe documentation directory, on a shared volume?


 :lulz:
Telarus, KSC,
.__.  Keeper of the Contradictory Cephalopod, Zenarchist Swordsman,
(0o)  Tender to the Edible Zen Garden, Ratcheting Metallic Sex Doll of The End Times,
/||\   Episkopos of the Amorphous Dreams Cabal

Join the Doll Underground! Experience the Phantasmagorical Safari!

Bebek Sincap Ratatosk

  • Probably
  • Deserved It
  • ****
  • Posts: 8967
    • View Profile
Re: C0D3_THR34D;
« Reply #9 on: July 20, 2012, 07:19:31 pm »
I have questions about Java and WSDL... its the only thing I hate about my new job.

1. Have any of you spags done WSDL/SOAP with Java?

2. How the hell do you maintain sessions?

3. Why does it keep bitching about this library, even when I point it directly at the damned thing?
- I don't see race. I just see cars going around in a circle.

"Back in my day, crazy meant something. Now everyone is crazy" - Charlie Manson

LuciferX

  • Metanoia
  • Deserved It
  • ****
  • Posts: 18407
  • fripping moncrey!
    • View Profile
Re: C0D3_THR34D;
« Reply #10 on: July 21, 2012, 06:30:57 pm »
Holyshit, there's a site for this.

http://www.explainxkcd.com/2012/07/20/server-problem/
Quote
Image text: Protip: Annoy Ray Kurzweil by always referring to it as the 'Cybersingularity'.

In this comic, Cueball has messed up his Linux server (apparently again as he does this a lot).  Megan comes over and runs the 'ls' command which lists the files in the location/directory and gets a "Device is not responding error".

The best I can make of the directory is that it is nonsense.  Adobe is the maker of such programs as Acrobat, Flash and Photoshop.  Android VM would be a virtual machine for the mobile Operating System created by Google called Android.

But, the crux of the comic is that Cueball should really just give up and wait for the singularity.  The singularity is (thanks Wikipedia!) "the hypothetical future emergence of greater-than-human superintelligence through technological means. Since the capabilities of such intelligence would be difficult for an unaided human mind to comprehend, the occurrence of a technological singularity is seen as an intellectual event horizon, beyond which events cannot be predicted or understood.

Proponents of the singularity typically state that an "intelligence explosion",where superintelligences design successive generations of increasingly powerful minds, might occur very quickly and might not stop until the agent's cognitive abilities greatly surpass that of any human."

In the image text, Ray Kurzweil is an author and futurist who has talked and written much about the singularity.

See the comments for gems like:
Quote
isn’t it it also implying how ludicrous it is that “ls” is accessing an Android virtual machine, installed with an Adobe documentation directory, on a shared volume?


 :lulz:

and resource/data files won't run as executables just because they are in directory that should contain binaries  :lulz:
Hic Salta?
________
...  being in ignorance, they may be less evil for fear of that which is withdrawn______

Triple Zero

  • DO NOT ABUSE EXCEPT FOR URGENT FURNITURE MOVING EMERGENCIES
  • One-Armed Jizz Moppers
  • Deserved It
  • **
  • Posts: 80835
  • Horrible and Sexy Queen of Cheese
    • View Profile
    • Random BIP
Re: C0D3_THR34D;
« Reply #11 on: July 28, 2012, 01:26:51 pm »
Well they would if the .jar file had the sense of beginning with #!/bin/java -jar !! :lulz:

Dear coding freaks,


Is this funny?

I didn't quite understand it either. My best guess was like the comment Telarus quoted "implying how ludicrous it is that “ls” is accessing an Android virtual machine, installed with an Adobe documentation directory, on a shared volume?" -- except with much less detail than that, but that error message implied *something* ludicrous was going on.

For extra explanations there's also an XKCD forum linked on xkcd.com which has a separate thread for every comment. I usually go there if I'm in need for an explanation (which I was actually planning to do with this comic, but then forgot about it).
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.