scripting

Decimal comaprison in Java script

I am trying to compare two decimal values in Java script. I have two objects as one assogned value "3" and the other as "3.00". When i say if (obj1 == obj2) it does not pass the condition as it is does the string comparision. I would instead want it to do a decimal comparision where 3 = 3.00. Please let me know how to do this. ...

With Lua and Python embeddable, is there a place for Basic?

I started off programming in Basic on the ZX81, then BASICA, GW-BASIC, and QBasic. I moved on to C (Ah, Turbo C 3.1, I hardly knew ye...) When I got started in microcontrollers I regressed with the BASIC Stamp from Parallax. However, BASIC is/was awesome because it was so easy to understand and so hard to make a mistake. I moved on t...

Basic sample of a scriptable plugin for FireFox in C++ with VS2005/8

My experience to write a plugin for FireFox is below zero. Is someone out there who could point me to sample code on how to get this accomplished in C++ with VS2005/8? What I need to do with JavaScript in the hosting html page is something like this: var obj = document.getElementById("MyFFPlugin"); var value = obj.CalculateValue; //...

Detecting failure of a Bash "export" value

In Bash I'm executing a command and putting the result in a variable like this: export var=`svn ls` But if SVN fails for some reason--say it returns a non-zero error code--export still returns status code 0. How do I detect if the executed command fails? ...

How can I launch an instance of an application using Python?

I am creating a Python script where it does a bunch of tasks and one of those tasks is to launch and open an instance of Excel. What is the ideal way of accomplishing that in my script? ...

Bash script, match on dates like?

I'm writing a script to remove some build artifacts older than 1 week. The files have names in the form artifact-1.1-200810391018.exe. How do I go about removing only the files that are greater than 1 week old, excluding the time in hours and minutes at the end of the date-time-stamp? Currently it is removing all of the files in the ...

Lua as a general-purpose scripting language?

When I see Lua, the only thing I ever read is "great for embedding", "fast", "lightweight" and more often than anything else: "World of Warcraft" or in short "WoW". Why is it limited to embedding the whole thing into another application? Why not write general-purpose scripts like you do with Python or Perl? Lua seems to be doing great ...

How do I auto load a database jar in Groovy without using the -cp switch?

I want to simplify my execution of a Groovy script that makes calls to an Oracle database. How do I add the ojdbc jar to the default classpath so that I can run groovy RunScript.groovy instead of groovy -cp ojdbc5.jar RunScript.groovy ...

Scripting common tasks in Vim

While using Vim (at home and at work), I often find myself doing similar things repeatedly. For example, I may turn a bunch of CSV text into a series of SQL inserts. I've been using Vim for years, but only recently have I tried to seriously think about how I could improve my productivity while using it. My question is.. Is there a good ...

Changing the color of a selected link that is embedded in a table.

Hi, I'm trying to use class names to change the color of a link after it has been selected, so that It will remain the new color, but only until another link is selected, and then it will change back. I'm using this code that was posted by Martin Kool in this question: <html> <head> <script> document.onclick = function(evt) { ...

Which scripting language do you use the most and why?

Which scripting language do you use the most and why? Given the opportunity, which other scripting language would you use and why? Python Groovy Ruby Perl PHP Jython JRuby TCL JACL IronRuby Lua Javascript etc ...

Python vs Groovy vs Ruby? (based on criteria listed in question)

Considering the criteria listed below, which of Python, Groovy or Ruby would you use? Criteria (Importance out of 10, 10 being most important) Richness of API/libraries available (eg. maths, plotting, networking) (9) Ability to embed in desktop (java/c++) applications (8) Ease of deployment (8) Ability to interface with DLLs/Shared Lib...

Why do double-quote change the result

I have a simple linux script: #!/bin/sh for i in `ls $1` do echo $i done In my temp folder are 4 file: a.a, a.aa, a.ab and a.ac When i call ./script temp/*.?? i get: temp/a.aa When i call ./script "temp/*.??" i get: temp/a.aa temp/a.ab temp/a.ac Why do the double quote change the result? ...

What is the (single) best online source for learning OpenOffice.org scripting API

I am using OpenOffice.org for most of my not so very frequent Office Suite needs and most of the time it is more than adequate replacement for it's commercial alternative. Where it falls short though is the scripting API. I am yet to find the documentation that would make sense of the API in a way that would let me concentrate on my tas...

Detect whether adobe reader is installed using VB code

hi i want to detect whether adobe reader is installed using VB6. Also if detected that its not installed what would be the best solution. ...

Is it possible to publish a FLA from the command line?

In our project we have a large number (hundreds) of FLA files created by the artists in CS3, from which we compile SWFs to use in our Flex/AS3 application. As part of a streamlined build/deploy system, it would be really handy to be able to automate publishing all these FLAs, and ideally deploying the SWFs too. I found some ways to do t...

We have a graphical designer, now they want a text based designer. Suggestions?

I'm sorry I could not think of a better title. The problem is the following: For our customer we have created (as part of a larger application) a graphical designer which they can use to build "scenario's". These scenario's consist of "Composites" which in turn consist of "Commands". These command objects all derive from CommandBase a...

Why the Global Interpreter Lock?

What is exactly the function of Python's Global Interpreter Lock? Do other languages that are compiled to bytecode employ a similar mechanism? ...

What would be the ideal script language for parsing text files?

My code reads in a file, usually HTML but it could be any plain text. Now I was thinking to have each piece as a separate module loaded externally at run time so I don't have to maintain it. I would like to use a scripting language to parse the text/strings and call my appropriate c or c++ functions. What scripting language would be good...

Execute a JavaScript function in a C# application.

Without using a WebBrowser control, how could I execute a JavaScript function, that is decoupled from any browser DOM dependencies, in a C# application? I am investigating implementing validation rules only once, for both server and client validation. See this question for reference if you like. Are there any JS interpretor libraries ...