Good alternative to Windows batch scripts? [closed] - scripting

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are some good alternatives to Windows batch scripts? We have a number of them and they are very "clunky" to work with. As our group is familiar with Java is Groovy a good option?
A lot of our scripts are used to prep dev databases so they involve a lot of cd mydir, hg fetch, sqlplus ..., etc..

If you are interested in developing scripts for Windows than a technology developed specifically for Windows, like the PowerShell, is a sensible choice.
While groovy will probably allow you achieve your goal I don't think there is a particular advantage that it could offer.
Saying that, you have to consider familiarity factor and learning curve. You say developers have experience with Java and Groovy in which case running ant tasks via the groovy DSL can prove easier than learning PowerShell.
Regardless, consider developing your scripts using the TDD approach. Groovy offers plenty of frameworks (try Spock for example) while there are also ways to achieve that for PowerShell.

Powershell, VBScript, Perl, Python. There are no shortages of good scripting languages that have a Windows implementation.

It kind of depends on what you are looking to do with your scripts. BASH on windows via cygwin might be a good thing to try.

You might also wanna look at good old Ant, it has targets for copying, executing shell commands, etc. Gradle might be even better, as it supports inline Groovy code, including easy loops and conditions, which Ant lacks.

PowerShell 2.0 onward is a good choice. It will come along with Windows Server 2008 R2 or windows 7 onward. you don't need to install anything on top of these O/S version.

Related

Scripting engine for OS X application [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am going to develop an application for OS X and I need some scripting engine for it.
The purpose of the scripts is to receive a text on their input (HTML file in most cases), parse it in some way and return the data to my app. These scripts should be easily editable by the users, therefore they should have some common used syntax like C or pascal.
Can you suggest some lightweight solution for this?
Thanks!
PS. I am new to OS X development, trying to switch from Windows...
Two suggestions:
Javascript, try the V8 engine. http://code.google.com/p/v8/ Very popular, likely familiar syntax to many.
Lua. http://www.lua.org Extremely lightweight and simple to connect. If your script editors write scripts for World of Warcraft, for example, they will know Lua.
In general AppleScript/Automator actions are easy for the end user to work with since the technology includes a GUI for building scripts without much programming knowledge. For experienced developers used to other languages, they can be a bit too friendly/loose and have a somewhat different syntax (more like plain English). The good thing is that they can also call other languages as needed, so a developer familiar with Perl or whatever could incorporate that into an AppleScript or Automator action.
Since you're talking about parsing text, Perl itself would be a good solution - again there's some difference in syntax, but the scripts can be rather compact and the basics of parsing aren't too difficult to learn. I haven't personally incorporated Perl into an OS X app, I've just used it on the command line, so I don't know if there are any pitfalls to that approach.
One additional advantage to AppleScript is that you can make your application itself scriptable so that users could automate the functions of your application into a larger workflow.
I would suggest downloading the free TextWrangler application by Bare Bones Software, or a similar developer's text editor, to see how they incorporate scripting into the application. This may give you additional insight into your approach.
LUA seems to be a good choice.

What exactly is VBScript, and what books/online resources could I use to learn it? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some programming knowledge, I can write console applications in Python, Java, and I can do both console and GUI programs with VB.net. Since I know VB.net, I though I should learn VBScript. I read online that it is a language used on Internet Explorer, but the tech department at my school writes applications in a text editor and saves them as a .vbs and runs them on the computer(no browser needed). I have used this method to make a simple Message Box(MsgBox"message here",4,"title here"). Is this a single language able to be used in both environments, or are these two separate things?
I read online that it is a language used on Internet Explorer...
Yes, VBScript can be used as an alternative to JavaScript. But, in practice, nobody uses VBScript for web application development because it works only in Internet Explorer.
...but the tech department at my school writes applications in a text editor and saves them as a .vbs and runs them on the computer(no browser needed).
Yes, and many problems can be solved with VBScript. VBScript is a complete programming language and it can access the COM subsystem in Windows. What I like about VBScript is that it is available on all Windows systems. So, it is wonderful solution when you have restrictions that prohibit you from installing other language interpreters/runtimes such as the Java JRE, Python, Perl, Ruby, etc.
For an example of what you can do with VBScript, see this example which demonstrates reading a key from the Windows Registry.
And check out my post here for a pointer to downloading Microsoft's authoritative VBScript reference as a Windows help file.
All that said, Microsoft has pretty much stopped enhancing VBScript and is putting its energy into PowerShell. PowerShell is very much aimed at System Adminstrators and it is an exceptionally capable language when used for that purpose. However, the last time I looked, PowerShell was weak with respect to creating your own classes. (Or at least it was awkward.) As an application developer, though, when I am solving a problem with VBScript, I typically make use of classes via the Class keyword extensively. A lot of folks don't know this, but you can do object-oriented programming in VBScript, and I do so often.
Check out this example that shows how you can develop your own classes via the Class keyword in VBScript.

pragmatic cross platform (and very fast to make it - actually - work) "throwaway" code: which language/tools? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
my development style brings me to write a lot of throw-away "assisting" code,
whether for automatic generation of code parts, semi-automated testing, and generally to build dummies, prototypes or temporary "sparring partners" for the main development; I know I'm not the only one...
since I frequently work both under windows and Unicies, I'd like to non-exclusively focus on a single "swiss army knife" tool that can work in both the environments with limited differences, that would allow me to do usual stuff like text parsing, db access, sockets, nontrivial filesystem and process manipulation
until now under unix I've used a bit of perl and massive amounts of shell scripts, but the latter are a bit limited and perl... despite being very capable and having modules for an incredible array of duties, sincerely I find it too "hostile" for me for something that goes beyond 100 lines of code.
what would you suggest?
scripting is not a requirement, it would be ok to use more static-styled languages IF it makes development faster (getting programs to actually do their work and possibly in a human readable state) and if it doesn't become nightmarish to handle errors/exception and to adapt to dynamic environments (e.g. I don't like to hardwire data /db table structure in my code, especially by hand).
I've been intrigued by python, ruby, but maybe groovy (with its ability to access the huge class library and his compact syntax) or something else is better suited
thanks a lot in advance!
(meanwhile, on a completely different note, scala looks really tempting just for the cleanliness of it, but that's - probably - a completely different story, unless you tell me the opposite...?)
Python is arguably one of the best choices. Its biggest benefit is that it has a huge built-in library for doing all sorts of stuff. It is also mature, very cross-platform, actively developed, and has many support options (mailing lists, newsgroups, etc).
In addition, it has a built-in GUI toolkit (tkinter) for those times when you need to write a quick GUI to get input from a user or display output from a running process. And if you don't like tkinter, there are other cross-platform GUI toolkits available.
I suggest Python.
For me it has a sweet spot of good libraries, documentation, community, cross-platform functionality, and ease of writing/reading.
It fills a similar niche to Perl's, but if you find Perl to be 'hostile' for longer scripts, you will probably like Python, especially when compared to Ruby, which feels more Perl-y, IMHO.
As an aside, all of these are quite easy to just try out - why not do that?
Then you can decide for yourself instead of trusting the questionable wisdom of an online forum (:
I think that Python and Ruby are your best bets, depending on exactly how you think and code.
I personally find Python EXTREMELY readable and its syntax is highly intuitive. I've heard Python described as "pseudo-code plus colons."
On the other hand, once you get around its slightly bizarre syntax, Ruby makes for high-speed development. It's built around DRY principles and convention-before-configuration, which is great for rapid prototyping.
There are other languages--especially Haskell and the Lisp dialects--that can make for super-rapid prototyping, but they don't have as large a supportive community, so there's a shortage in library and discussion supply.

Why is Mono implementing WCF? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Why is the Mono project implementing WCF interfaces and classes "as is"?
I do not understand what is the point to repeat Microsoft's design. My experience says that WCF is a huge framework with an implementation based on SOAP services. There are tremendous problems with their approach. It simply does not fit well for simple HTTP request processing cycle. Why not try to invent a better framework instead?
Update:
OK, I get it. :) I like the .NET platform, C# and I like that this platform is available on another OS, but ...
Don't you guys see that many things in the original (Microsoft) frameworks can be done better?
Look at System.ServiceModel.Channels.Message. This is one of big things of customization landscape.
Why do I see XML everywhere? How can I easily do anything with classes like this? It is feasible, but I cannot say this is good design for a general purpose communication framework. I thought that the purpose of the Mono project is not just bringing the .NET ecosystem to unix* but make it better.
I think the whole point is to make WCF platform available in other operating systems than Microsoft Windows. So, if you have an application developed with MS VisualStudio (Microsoft's compilers), you can deploy it on Linux or Mac OS X if you wish.
You can also use MonoDevelop and Mono Compilers if you decide to code WCF in alternative platforms.
Because not everything is suitable for a simple http request processing cycle. Because SOAP offers features REST does not. Because it hooks into a wide set of encryption, authentication and authorization options. Because what you see as as tremendous problems solve problems for others.
Mono exists to allow .net on other OS's. Mono is not about picking and choosing what to implement based on merit.

Free/cheap PowerDesigner alternative? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
We are using PowerDesigner at work for database modelling. But there is a hell of a price tag on that piece of software. And frankly, all I use is physical diagrams for MS SQL, which is about 1% of what PD knows.
Are there any good alternatives? I know about Visio and MS SQL Diagrams, but looking for other options.
Power*Architect is the way to go. It's free, open source, and does a really great job helping you build your ERDs. Plus, it works on Windows, Linux, and OSX.
Open System Architect: www.codebydesign.com - it does job for me perfect
Check out Sparx Enterprise Architect also.
I just use SQL Server using the diagrams folder. The designer is pretty simple to use, and can be used to generate tables fairly quickly. Considering it's free with the software, I don't see the issue.
SourceForge.net Druid project
Has a templating engine to produce DDL or what ever you like.
Has the ability to have multiple diagrams in one model.
Only does physical data model.
It is free and has source available.
It is a java based tool so it will run on Unix or Windows.
How about MagicDraw? It is a very powerfull tool, but I think it as expensive as PowerDesigner, not sure.
You might want to look at https://www.xcase.com/demo.php. It's not free, but it's quite a bit cheaper than PowerDesigner, as far as I can tell. I've used earlier versions, but lately I've had easy access to Visio, so have continued with that instead of investing in xCase.
The version of Visio that comes with VS Enterprise Architect has a forward-engineer feature that will generate SQL. There is also a type library for the modelling engine, but (on older versions at least) it won't extract certain items such as comments. However, the generated SQL has the comments in a fairly simple structure that does facilitate parsing the generated SQL.
You can get older versions of VS enterprise architect on E-bay for not very much money (I think mine cost about £250).
One caveat for reverse-engineers is that all pre-VS2005 visio DB modelling engines will not play nicely with the SQL Server 2005 native client. You need to either script out the database and re-load it on a SQL2000 server (dealing with SQL2005 specific features such as schemas is left as an exercise for the reader) or get a more recent version.
Well there's another alternative. Use it for more than just making tables! Exploit it, get your money's worth. You've already paid for it, you could drop the maintenance and just use it as-is. Anyways, something to ponder.