News:

News:  0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657, motherfuckers.

Main Menu

C0D3_THR34D;

Started by Triple Zero, June 29, 2012, 03:31:56 PM

Previous topic - Next topic

Triple Zero

THIS THREAD IS ABOUT CODE





and I'll start off with this:

Quote from: Bu☆ns on June 29, 2012, 06:32:09 AM

  • 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

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

<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

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

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

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

Dear coding freaks,


Is this funny?



guryaf

Quote from: LMNO, PhD (life continues) on July 20, 2012, 12:51:41 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

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

Telarus

Holyshit, there's a site for this.

http://www.explainxkcd.com/2012/07/20/server-problem/
QuoteImage 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:
Quoteisn'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

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

minuspace

Quote from: Telarus on July 20, 2012, 08:15:13 PM
Holyshit, there's a site for this.

http://www.explainxkcd.com/2012/07/20/server-problem/
QuoteImage 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:
Quoteisn'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:

Triple Zero

Well they would if the .jar file had the sense of beginning with #!/bin/java -jar !! :lulz:

Quote from: LMNO, PhD (life continues) on July 20, 2012, 12:51:41 PMDear 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.