scripting

Programming thunderbird Email Client?

Anyone has C#/Ruby/Python/Java or Perl scripts to get all the emails in a folder in Thunderbird client and download all the attachments? I have more than 200 resumes as attachment kept in Resumes folder of thunderbird and I need to download the attachment and categories them. Any API reference to program thunderbird would be great.. I ...

Automatically touch all files that use a certain #define (#ifdef foo / #endif)

Say you have a C project with tons of files, and tons of configurations managed by usign the -D option in GCC to define some flags. In my particular case, I have loads of files with that kind of stuff: void foo( sometype *x) { do_stuff_with_x(x); #ifdef MY_FLAG do_additional_stuff(x); #endif #ifdef OTHER_FLAG do_some_other_s...

Running scripts after object creation in Ruby on Rails

Hi all, I'd like to run a script that does some evaluation of user-entered data after it is successfully created. I have a model representing the data, but how do I specify that the model class should execute function X after an instance is successfully created? Part 2: would it be more appropriate to put the code I want to execute in ...

Cocoa application with an optional command line mode

I'm about to start a new Cocoa project from scratch and one of the requirements I have already been given is being able to choose either a Cocoa GUI or a command line mode from the same executable. Scriptability may be a possible addition in the future but that is not a concern right now. What is the best strategy for going about this ...

Label Clearcase branch via batch script

I need to create a Clearcase label script to run on a UNIX server. Labels will not always be on the latest build and the script needs to be run via a manual process. It will label every file a branch of code at a version (currently selected by a timestamp-timestamp is from a Hudson build engine which will create these scripts and ftp ...

doubt in shell scripting

fact() { if [ $1 -eq 1 ] then return 1 else y=`expr $1 - 1` fact $y b=$(($1 * $?)) return $b fi } echo "enter" read n fact $n echo "$?" this is a program to find the factorial of a number. output is correct up to 5 . the output of 6 is giving as 208 but the actual value is 720. w...

How to implement "record macro" like that in Microsoft Excel?

How to implement "record macro" like that in Microsoft Excel? PS: any language/platform. I just want an idea of how to do that. as far as i know, i can embed a script interpreter(maybe javascript) and make c++ object visible to scripts, just DOM in web browser. My question is that how to record user actions and then generated javascript ...

Script to logout user and perform background task

I'm trying to find a way when a user logs in the system to automatically log off and perform a background script. Specifically I will need to remove the local user account but keep the home folder in place. This will only need to be done once but I'm not sure of the best approach. The purpose of logging in once is to capture the accoun...

How do I open an Explorer window in a given directory from cmd.exe?

I see how to launch many other programs from a batch file, but I can't find a command like open on Mac OS X. Does such a tool exist on Windows? Powershell, or a Windows API call from an executable would also work. ...

Kill and restart multiple processes that fit a certain pattern

I am trying write a shell script that will kill all processes that are running that match a certain pattern, then restart them. I can display the processes with: ps -ef|grep ws_sched_600.sh|grep -v grep|sort -k 10 Which gives a list of the relevent processes: user 2220258 1 0 16:53:12 - 0:01 /bin/ksh /../../../../../ws_...

How to strip down a jquery to fit your needs?

Hello, I have this script running, and I'm wondering if I need all of http://code.jquery.com/jquery-latest.min.js It's 70 kb, and I would love to be able to strip it down. $('a.inframe').click(function() { var e=$(this); if (!e.data('state')) { //if state is undefined e.data('state','open'); //set the state to 'open' // E...

About the RenderScript

Recently,i search for articles about renderscript,but it seems that there's none. can any one give me some articles talking about renderscript? ...

what contents should be filled in PDT eclipse?

at "debug configurations" -> 'php script' -> 'new_config', on the right "PHP script arguments",what arguments should i fill in? for example: < ?php $tmp = $_GET['arg']; // is here the argument will be replaced ? echo $tmp; ?> i have no idea how to debug a URL with parameters. ...

downloading file using curl

I have a quite simple task: i need to download file from a web page. In browser, it is done by pressing submit button. Just simple button, press it and you see the pop-up window asking where to save file and so on. Data is sent to server via post method. I tried POST'ing with curl like: curl -d "foo=bar&....." [URL] but this request re...

jQuery ajax function return

I have this function that embeds flash : function embedswfile(target, swf, base, width, height) {//dosomething} And I want to call the function like this embedSwf("flashgame",decode("<?=base64_encode($path['location'])?>"),decode("<?=base64_encode($path['base_directory'])?>"),"800","600" ) The idea is that whenever someone looks f...

I need to convert OLEAutomationDate (UTC) to a readable date/time format using VBscript?!?

Can anyone help me with this? Ive hit every resource that I could find and the best answer I found or was given is I should convert my script to a Powershell script, only problem is that option is not available to me. Does anyone have an algorithm that I can use or be pointed to a function that can convert this date/time format??? Thank...

If I used views for my SSAS DSV, can the relationships in SSAS Data Source View be scripted?

I based an SSAS 2005 cube on a data source view comprised of views in the relational layer, nto tables with relationships. I did not use schema binding on the views. Now I need to rebuild two projects from these, but dread having to connect the views' facts and dims all over again in the dsv. Is there script that will reestablish or reme...

What is the most valuable scripting language, VBScript or JScript?

What is the most valuable scripting language, VBScript or JScript? ...

Retrieve plain text script from compiled bash script

Some time ago, i wrote some bash scripts for my school. I thought it would be very clever to 'protect' them, so i compiled them with shc into a binary file. Some weeks later, i lost the uncompiled scripts and now i have only my binarys left. Is there a way to retrieve the scripts back from the shc generated binarys? I looked into the so...

remove duplicates per line

I have several csv's that look like this: I have several large text files (csv's) that on some lines have redundant entries. That is, due to the way they were merged a certain field will often have the same value twice or three times. It's not always in the same order though. BWTL, NEWSLETTER, NEWSLETTER BWTL, NEWSLETTER, R2R, NEWSLETT...