scripting

Adding Scripting functionality to .NET applications

I have a little game written in C#. It uses a database as back-end. It's a Trading Card Game, and I wanted to implement the function of the cards as Script. What I mean is that I essentially have an Interface ICard which the Card implements (public class Card056 : ICard) and which contains function that are called by the game. Now, to...

What PHP framework would you choose for a new application and why?

Over the course of your web development experience, what PHP framework(s) have you worked with? What strengths and weaknesses have you observed in those frameworks? Considering these, what framework would you recommend if beginning a new application? ...

MS-SQL: Drop all tables whose names begin with a certain string

I'd like a script to drop all tables whose name begins with a given string. I'm sure this can be done with some dynamic sql and the INFORMATION_SCHEMA tables. If anyone has a script, or can knock one up quickly, please post it. If no-one posts an answer before I figure it out myself, I'll post my solution. ...

Common Types of Subversion Hooks

What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!...

Date arithmetic in Unix shell scripts

I need to do date arithmetic in Unix shell scripts that I use to control the execution of third party programs. I'm using a function to increment a day and another to decrement: IncrementaDia(){echo $1 | awk 'BEGIN { diasDelMes[1] = 31 diasDelMes[2] = 28 diasDelMes[3] = 31 diasDelMes[4] = 30 diasDel...

showing a message box from a bash script in linux

I'm writing a few little bash scripts under Ubuntu linux. I want to be able to run them from the GUI without needing a terminal window to enter any input or view any output. So far the only input required is a password for sudo - and gksudo handles that fine. But I haven't found an easy way to show a message box yet. Is there some kind ...

How to resolve symbolic links in a shell script

Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time. If the target is a directory, it might be possible to chdir() into the directory and then call getcwd(), but I r...

How do you use PowerShell?

Windows PowerShell came out last year and got great reviews from many .net bloggers (Hanselman comes to mind). It seemed to be touted as a great new utility that somehow made everything that you would ever do on the command line easier, and integrated with .Net. However, the more I read about it, the more it seems to be a tool that is gr...

Can I copy files to a Network Place from a script or the command line?

Is it possible, in Windows XP, to copy files to a Network Place from the command line, a batch file or, even better, a PowerShell script? What sent me down this road of research was trying to publish files to a WSS 3.0 document library from a user's machine. I can't map a drive to the library in question because the WSS site is only ava...

Automate adding entries to a wiki

This is a follow up to my previous question about renaming a bunch of files Once I have my renamed files I need to add them to my project wiki page. This is a fairly repetitive manual task, so I guess I could script it but I don't know where to start. The process is: Got to appropriate page on the wiki for each team member (Developer...

quoting System.DirectoryServices.ResultPropertyCollection

I'm missing something here: $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry $objSearcher.Filter = ("(objectclass=computer)") $computers = $objSearcher.findall() So the question is why do the two following outputs differ? $computers...

Which scripting language to support in an existing codebase?

I'm looking at adding scripting functionality to an existing codebase and am weighing up the pros/cons of various packages. Lua is probably the most obvious choice, but I was wondering if people have any other suggestions based on their experience. Scripts will be triggered upon certain events and may stay resident for a period of time....

How do I generate scripts that will rebuild my MS SQL Server 2005 database WITH data?

I have a SQL Server 2005 database that I would like to be able to recreate at a moment's notice. I want to be able to point to my database and generate a complete set of scripts that will not only create all the tables/views/sprocs/functions that are in the database, but will also populate all the tables with data. Are there any tools t...

Is it OK to drop sql statistics?

We've been trying to alter a lot of columns from nullable to not nullable, which involves dropping all the associated objects, making the change, and recreating the associated objects. We've been using SQL Compare to generate the scripts, but I noticed that SQL Compare doesn't script statistic objects. Does this mean its ok to drop them...

Batch file to "Script" a Database

Is it possible to somehow use a .bat file to script the schema and/or content of a SQL Server database? I can do this via the wizard, but would like to streamline the creation of this file for source control purposes. I would like to avoid the use of 3rd party tools - just limiting myself to the tools that come with SQL Server. ...

In SQL Server, how do I generate a CREATE TABLE statement for a given table?

I've spent a good amount of time coming up with solution to this problem, so in the spirit of this post, I'm posting it here, since I think it might be useful to others. If anyone has a better script, or anything to add, please post it. Edit: Yes guys, I know how to do it in Management Studio - but I needed to be able to do it from wi...

Delete all but the most recent X files in bash

Is there a simple way, in a pretty standard UNIX environment with bash, to run a command to delete all but the most recent X files from a directory? To give a bit more of a concrete example, imagine some cron job writing out a file (say, a log file or a tar-ed up backup) to a directory every hour. I'd like a way to have another cron job...

which language you use for "throw away" programs?

Which language do you use for "throw away" programs? By "throw away" I don't mean perl one liners, but code that is useful for a current project but may not be added to it. ...

Best way to extract data from a FileMaker Pro database in a script?

My job would be easier, or at least less tedious if I could come up with an automated way (preferably in a Python script) to extract useful information from a FileMaker Pro database. I am working on Linux machine and the FileMaker database is on the same LAN running on an OS X machine. I can log into the webby interface from my machine. ...

Windows Mobile - What scripting platforms are available?

We have a number of users with Windows Mobile 6 and need to apply minor changes. eg. update a registry setting. One option is push and execute an executable file using our device management software. I'd like this to be a little more friendly for the admins who are familiar with scripting in VBScript/JScript etc. What are the options fo...