scripting

TimThumb vs Saving Thumbnails

Just a quick question: I'm working on revamping a script that serves vehicle inventory to users. The site receives thousands of hits per month with many pageviews per visitor. My question is this: I am going to have 7 images for each vehicle in the new system. 1 Main Product Photo 6 Interior Extra Photos The 6 extras will be viewed a...

How do I remove newlines from a text file?

Hey there everyone ... I have the following data, and I need to put it all into one line... I have this: 22791 ; 14336 ; 22821 ; 34653 ; 21491 ; 25522 ; 33238 ; I need this: 22791;14336;22821;34653;21491;25522;33238; If anyone could help me it would be a great !! Thanks in advance! --------- EDIT No of these commands...

Cannot execute a javascript script file from windows explorer or the DOS prompt

I'm a C++ developer and want to install the WTL appwizard to Visual Studio 2010. To do this, I must run a .js script file. I recently tried out Aptana IDE and it's clobbered the .js file association, and now I cannot execute this .js script file. How can I execute .js script files again? ...

How to take out some of the new lines of a document

Hey there!! Firstly, I'm really new on this and I'm having difficulties... I have this data: [05/Apr/2010:09:59:34 -0300] /~bcc/topo-zero.html 200 238 2 [05/Apr/2010:10:01:19 -0300] /~bsi/materiais/ed/u6.html 200 286960 3 [05/Apr/2010:10:04:56 -0300] /~firedo/AISG/AISGroupContributions.html 200 33193 2 ...

Why would you use two (or more) databases instead of one? [Scripting]

Many database libraries come setup for multiple database connections - but I've never actually known of an scripting application that needed to connect to two databases during it's run. (compiled, daemon-running languages are a different matter). I understand having database slaves so that you can spread the load out - but usually on s...

How to count lines on a document ?

Hey there ... I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.00 4.00 0.00 0.00 0.00 0.00 0.00 94.00 09:16:40 AM all 5.00 0.00 0.00 4.00 0.00 0.00 0.00 0.00 91.00 09:16:41 AM all 0.00 0.00 4.00 0.00 0.00 0.00 ...

Converting XElement to HTML string

I am performing XML Operations on an XHTML document utilizing Xml and Linq. When converting it back to a String for outputting to a browser, it renders script tags in their original provided form when creating the XElement as <script />. That prevents it being processed correctly by most browsers on the market. I would like to perform...

git: repo monitoring tool

Do you know any good repo monitoring solution? I'd like to get information when someone pushes to remote repo (preferably via taskbar tray icon: "someuser pushed…"). Other solutions I consider: recieve hook periodically git log via cron check for updates on running every git command (my system of choice is Ubuntu) ...

exit expect {} without timeout

I am struggling with the classic problem of typing password automatically in ssh, and like everybody else I am stumbling in the dark regarding expect. Finally I cobbled together a script that kinda work: #!/usr/bin/expect -f # command line args set user_at_host [lrange $argv 0 0] set password [lrange $argv 1 1] set timeout 1 # ssh c...

Powershell help, if process exists, stop it, else start a service??

Hi All, I'm pretty new to Powershell. I have 2 different scripts I'm running that I would like to combine into one script. Script 1 has 1 line Stop-Process -ProcessName alcore.* -force It's purpose is to end any process that begines with "alcore." Script 2 has 1 line as well Start-Service -displayname crk* It starts any service ...

Get source of a website which requires post login

Hello, I wan't to write a script to get the source of a website which requires a post login. I need a shell script to do this. I want to parse some information. Any idea which language is the best choice for handling the http request and maybe cookies? Thank you. ...

An infinite scrolling panel in AS3

Hi everyone, I'm trying to create a infinite scrolling panel containing diagonal stripes in ActionScript 3. As the panel is dragged to the right or left, the program populates it with more stripes, to create the appearance of an infinitely scrolling panel. The stripe graphic itself is an MC in my library with the class name of Stripe. ...

How to make vim substitute <script with <script type="..."></script>

I created the following rule: iabbrev <lt>script <script type="text/javascript"></script> But during launch vim says: Error detected while processing .vimrc: line 290: E474: Invalid argument Pointing on that line. And I cannot workaround this, seems like the problem is in the left part, just like "script" is a reserved word. Is ther...

capturing key press event in DIV

i need key press or key down event for DIV, when the DIV has the focus? any ideas ...

Scripting language for C++

Dear all: I'm getting a little rusty in scripting languages, provided they're popping like mushrooms lately :) Today I thought that it would be nice to have a scripting language that talks seamlessly to C++, that is, could use C++ classes, and, the most important for me, could be compiled into C++ or some DLL/.SO (plus its .h) so that ...

executing php script in console

Hey, i'm trying to execute a php in the console, but each time i run it: php myscript.php it only outputs the content of the file, it dowsn't run it. output: <? echo 'test'; ?> instead of: test What's wrong? I have php installed under c:/program files/php and the environment variable is set. Thanks, Dave ...

Facebook like status url detection

I am wondering if there is a script similar to the facebook status update thing, What I mean, is when for ex. I paste a youtube/other video site/image/link it automatically detects the contents of the page and associates an embed code with it (if its a video).. So I'm wondering if there is a ready script that has a large database of web...

Programmatically tampering with Mac OSX MenuBar settings.

I have a program that needs to turn on and off the system clock in the menu bar. This will do that: defaults write com.apple.MenuBarClock ClockEnabled -bool false (with false->true to turn it back on). Except it doesn't actually take effect until I manually open up Date & Time settings (just opening the settings causes the menu bar t...

Anonymous implementation of abstract classes in Rhino

I need to implement a listener in JavaScript by anonymous subclass of an existing abstract base class, defined like this: public class Speaker { public static abstract class MyListener { private String name; public MyListener(final String name) { this.name = name; } public abstract boolean listen(final String words); } }...

SOTI MobiControl Script Command Set - Copy functionality

Is this format of script valid when using SOTI’s Script command set? copy c:\SOTI\test.txt 1:\Program Files\MR Mobile Client\ c:\SOTI\test.txt being on the server where MobiControl is installed. And 1:\Program Files\MR Mobile Client\ is the device we are running the script on. Thanks ...