Search Results

Search found 5682 results on 228 pages for 'lord of scripts'.

Page 69/228 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • How can I find all attributes with single quotes in a Sublime Text 2 document and replace with double quotes?

    - by Brandon Durham
    I'm feeling particularly nit-picky today. I'm working in some HTML docs that have single quotes around all attribute values through the docs, like this: <div class='classone classtwo'> I'd love to be able to do a find-and-replace in each doc and replace with double quotes, like this: <div class="classone classtwo"> Many elements in the document will have multiple attributes: <div class='classone classtwo' data-scripts='lazyload'> And some will have the correct double quotes: <div class='classone classtwo' data-scripts="lazyload"> What's the best way to replace all single quotes wrapping values with double?

    Read the article

  • Best way to run remote VBScript in ASP.net? WMI or PsExec?

    - by envinyater
    I am doing some research to find out the best and most efficient method for this. I will need to execute remote scripts on a number of Window Servers/Computers (while we are building them). I have a web application that is going to automate this task, I currently have my prototype working to use PsExec to execute remote scripts. This requires PsExec to be installed on the system. A colleague suggested I should use WMI for this. I did some research in WMI and I couldn't find what I'm looking for. I want to either upload the script to the server and execute it and read the results, or already have the script on the server and execute it and read the results. I would prefer the first option though! Which is more ideal, PsExec or WMI? For reference, this is my prototype PsExec code. This script is only executing a small script to get the Windows OS and Service Pack Info. Protected Sub windowsScript(ByVal COMPUTERNAME As String) ' Create an array to store VBScript results Dim winVariables(2) As String nameLabel.Text = Name.Text ' Use PsExec to execute remote scripts Dim Proc As New System.Diagnostics.Process ' Run PsExec locally Proc.StartInfo = New ProcessStartInfo("C:\Windows\psexec.exe") ' Pass in following arguments to PsExec Proc.StartInfo.Arguments = COMPUTERNAME & " -s cmd /C c:\systemInfo.vbs" Proc.StartInfo.RedirectStandardInput = True Proc.StartInfo.RedirectStandardOutput = True Proc.StartInfo.UseShellExecute = False Proc.Start() ' Pause for script to run System.Threading.Thread.Sleep(1500) Proc.Close() System.Threading.Thread.Sleep(2500) 'Allows the system a chance to finish with the process. Dim filePath As String = COMPUTERNAME & "\TTO\somefile.txt" 'Download file created by script on Remote system to local system My.Computer.Network.DownloadFile(filePath, "C:\somefile.txt") System.Threading.Thread.Sleep(1000) ' Pause so file gets downloaded ''Import data from text file into variables textRead("C:\somefile.txt", winVariables) WindowsOSLbl.Text = winVariables(0).ToString() SvcPckLbl.Text = winVariables(1).ToString() System.Threading.Thread.Sleep(1000) ' ''Delete the file on server - we don't need it anymore Dim Proc2 As New System.Diagnostics.Process Proc2.StartInfo = New ProcessStartInfo("C:\Windows\psexec.exe") Proc2.StartInfo.Arguments = COMPUTERNAME & " -s cmd /C del c:\somefile.txt" Proc2.StartInfo.RedirectStandardInput = True Proc2.StartInfo.RedirectStandardOutput = True Proc2.StartInfo.UseShellExecute = False Proc2.Start() System.Threading.Thread.Sleep(500) Proc2.Close() ' Delete file locally File.Delete("C:\somefile.txt") End Sub

    Read the article

  • Custom script in .screenrc

    - by benoror
    Hi. I made a script that spawns a remote shell or runs a local shell whether it's on the current machine or not: #!/bin/bash # By: benoror <[email protected]> # # spawns a remote shell or runs a local shell whether it's on the current machine or not # $1 = hostname if [ "$(hostname)" == "$1" ]; then bash else ssh "$1.local" fi For example, if I'm on server1: ./spawnshell.sh server1 -> runs bash ./spawnshell.sh server2 -> ssh to server2.local I want that script to run automatically in separate tabs in GNU Screen, but I can't make it run, my .screenrc: ... screen -t "@server1" 1 exec /home/benoror/scripts/spawnshell.sh server1 screen -t "@server2" 2 exec /home/benoror/scripts/spawnshell.sh server2 ... But it doesn't works, I've tried without 'exec', with -X option and a lot more. Any ideas ?

    Read the article

  • Calling an svn update from a php script via a browser is not working

    - by hbt
    Hey guys, I have two scripts. running an update and calling shell_exec('svn update') and shell_exec('svn st') running a mysqldump shell_exec('mysqldump params') The svn script is not running the update command, the svn st is printing results but not the svn update I tried to declare parameters when calling svn update eg 'svn update ' . dir . ' --username myuser --password mypasswd --non-interactive'; -- still nothing Played with most of the params If this is something related to binaries/permissions/groups, I don't see it. The mysqldump command works fine and is producing a file, so why isn't the svn updating the filesystem? Please do not advise using core SVN classes in PHP. This is not an option, I don't have complete control over the server and the module is not available. Thanks for your help, -hbt PS: important thing to mention here. The scripts works when called via the command line. It only fails when called via a web browser.

    Read the article

  • Why first arg to execve() must be path to executable

    - by EBM
    I understand that execve() and family require the first argument of its argument array to be the same as the executable that is also pointed to by its first argument. That is, in this: execve(prog, args, env); args[0] will usually be the same as prog. But I can't seem to find information as to why this is. I also understand that executables (er, at least shell scripts) always have their calling path as the first argument when running, but I would think that the shell would do the work to put it there, and execve() would just call the executable using the path given in its first argument ("prog" from above), then passing the argument array ("args" from above) as one would on the command line.... i.e., I don't call scripts on the command line with a duplicate executable path in the args list.... /bin/ls /bin/ls /home/john Can someone explain?

    Read the article

  • How to Properly Reference a JavaScript File in an ASP.NET Project?

    - by DaveDev
    Hi Guys I have some pages that reference javascript files. The application exists locally in a Virtual Directory, i.e. http://localhost/MyVirtualDirectory/MyPage.aspx so locally I reference the files as follows: <script src="/MyVirtualDirectory/Scripts/MyScript.js" type="text/javascript"></script> The production setup is different though. The application exists as its own web site in production, so I don't need to include the reference to the virtual directory. The problem with this is that I need to modify every file that contains a javascript reference so it looks like the following: <script src="../Scripts/MyScript.js" type="text/javascript"></script> I've tried referencing the files this way in my local setup but it doesn't work. Am I going about this completely wrong? Can somebody tell me what I need to do? Thanks

    Read the article

  • jquery to php (wait for php script until result/finish)

    - by user354051
    Hi, I am executing a php call from javascript(jQuery), php sript is sending result back. The problem is that these php scripts are taking some time (milliseconds), and java script is not waiting for them to finish, thus variables are not getting initialized with correct values. The code is simple: $.get("php/validation.php",{'email':email},function(data){ // valid_email now contains true/false alert(data); if(data=="true"){ var valid_email = true;} }); The "alert" is printing true but value of valid_mail is recognized as "false" in the code below. Is there any other better way to call php scripts and wait for until they are not finished? Prashant

    Read the article

  • How do you keep track of what you have released in production?

    - by systempuntoout
    Tipically a deploy in production does not involve just a mere source code update (build) but requires a lot of other important tasks like for example: Db scripts (tables, query..) Configuration files (differents from test\production) Batch to schedule Executables to move to the correct path Etc. etc. In our company we just send an email to a "Release email address" describing the tasks in order, which changeset need to be published (TFS), which SP need to be updated, db scripts and so on. I believe there's not a magic tool that does these tasks automagically in order, rollback included; but probably there's something better than email that helps to keep track of releases in production. Do you have any tools to suggest or practices to share?

    Read the article

  • Does anyone has the experience of using the new p4 replicate command in their Perforce back-up /rest

    - by Thomas Corriol
    Hi all, we recently performed an upgrade of our whole perforce system to 2009.02 During this exercise, we noticed that the back-up /restore process that was installed here by the Perforce consultant a year ago was not completely working. Basically, the verify command has never worked (scary !). As we are obliged to revisit our Back-Up/Restore scripts, I was toying with the idea of using the new p4 replicate command. The idea is to use it alongside an rsync of the data files, so that in case of crash we will lose at worst an hour of work (if we execute them every hour). Does anyone has the experience or an example of back-up/restore scripts using the p4 replicate command of the 2009.02 version ? Thanks, Thomas

    Read the article

  • Embedding Python and adding C functions to the interpreter

    - by monoceres
    I'm currently writing an applications that embedds the python interpreter. The idea is to have the program call user specified scripts on certain events in the program. I managed this part but now I want the scripts to be able to call functions in my program. Here's my code so far: #include "python.h" static PyObject* myTest(PyObject* self,PyObject *args) { return Py_BuildValue("s","123456789"); } static PyMethodDef myMethods[] = {{"myTest",myTest},{NULL,NULL}}; int main() { Py_Initialize(); Py_InitModule("PROGRAM",myMethods); PyRun_SimpleString("print PROGRAM.myTest()"); Py_Finalize(); } Thanks!

    Read the article

  • MD5 hash differences between Python and other file hashers

    - by Sam
    I have been doing a bit of programming in Python (still a n00b at it) and came across something odd. I made a small program to find the MD5 hash of a filename passed to it on the command line. I used a function I found here on SO. When I ran it against a file, I got a hash "58a...113". But when I ran Microsoft's FCIV or the md5sum.py in \Python26\Tools\Scripts\, I get a different hash, "591...ae6". The actual hashing part of the md5sum.py in Scripts is m = md5.new() while 1: data = fp.read(bufsize) if not data: break m.update(data) out.write('%s %s\n' % (m.hexdigest(), filename)) This looks functionally identical to the code in the function given in the other answer... What am I missing? (This is my first time posting to stackoverflow, please let me know if I am doing it wrong.)

    Read the article

  • Client validation of INPUT of type FILE without postback using jQuery

    - by Fixer
    I want to check on the client side that a file has been selected before the form can be submitted. <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm("Upload", "Files", FormMethod.Post, new { enctype = "multipart/form-data" })) { <input id="File" name="File" type="file" size="80" /> <input type="submit" name="name" value="Upload" /> } Currently this form is doing postbacks for validation. What is going wrong?

    Read the article

  • Spring's JdbcDaoSupport (using MySQL Connector/J) fails after executing sql that adds FK

    - by John
    I am using Spring's JdbcDaoSupport class with a DriverManagerDataSource using the MySQL Connector/J 5.0 driver (driverClassName=com.mysql.jdbc.driver). allowMultiQueries is set to true in the url. My application is an in-house tool we recently developed that executes sql scripts in a directory one-by-one (allows us to re-create our schema and reference table data for a given date, etc, but I digress). The sql scripts sometime contain multiple statements (hence allowMultiQueries), so one script can create a table, add indexes for that table, etc. The problem happens when including a statement to add a foreign key constraint in one of these files. If I have a file that looks like... --(column/constraint names are examples) CREATE TABLE myTable ( fk1 BIGINT(19) NOT NULL, fk2 BIGINT(19) NOT NULL, PRIMARY KEY (fk1, fk2) ); ALTER TABLE myTable ADD CONSTRAINT myTable_fk1 FOREIGN KEY (fk1) REFERENCES myOtherTable (id) ; ALTER TABLE myTable ADD CONSTRAINT myTable_fk2 FOREIGN KEY (fk2) REFERENCES myOtherOtherTable (id) ; then JdbcTemplate.execute throws an UncategorizedSqlException with the following error message and stack trace: Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [ THE SQL YOU SEE ABOVE LISTED HERE ]; SQL state [HY000]; error code [1005]; Can't create table 'myDatabase.myTable' (errno: 150); nested exception is java.sql.SQLException: Can't create table 'myDatabase.myTable' (errno: 150) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) and the table and foreign keys are not inserted. Also, especially weird: if I take the foreign key statements out of the script I showed above and then place them in their own script that executes after (so I now have 1 script with just the create table statement, and 1 script with the add foreign key statements that executes after that) then what happens is: tool executes create table script, works fine, table is created tool executes add fk script, throws the same exception as seen above (except errno=121 this time), but the FKs actually get added (!!!) In other words, when the create table/FK statements are in the same script then the exception is thrown and nothing is created, but when they are different scripts a nearly identical exception is thrown but both things get created. Any help on this would be greatly appreciated. Please let me know if you'd like me to clarify anything more.

    Read the article

  • Razor View Engine and jQuery

    - by rjovic
    Hi, does anybody know how to force Razor View engine to print exact line which is under foreach loop. Code follows : @section head{ <script type="text/javascript" src="@Url.Content("~/Content/Scripts/jquery-1.4.1.js")"></script> <script type="text/javascript" src="@Url.Content("~/Content/Scripts/jquery.progressbar.min.js")"></script> <script type="text/javascript"> $(document).ready(function() { @foreach(var player in Model) { jQuery("#pb@PlayerID").progressBar(); } }); </script> } I tried using $() and jQuery() but in both case razor don't know what to do. Is there any way to force him to print exact this : jQuery("#pb@PlayerID").progressBar(); . I want to have something like this : $(document).ready(function() { $("#pb1").progressBar(); $("#pb2").progressBar(); $("#pb3").progressBar(); }); Thank you in advance!

    Read the article

  • associating a filetype with a batch script, and getting parameters passed to file of that type.

    - by Carson Myers
    Sorry for the cryptic title. I have associated python scripts with a batch file that looks like this: python %* I did this because on my machine, python is installed at C:\python26 and I prefer not to reinstall it (for some reason, it won't let me add a file association to the python interpreter. I can copy the executable to Program Files and it works -- but nothing out of Program Files seems to work). Anyways, I can do this, so far: C:\py django-admin C:\py python "C:\python26\Lib\site-packages\django\bin\django-admin.py" Type 'django-admin.py help' for usage. C:\py django-admin startproject myProj C:\py python "C:\python26\Lib\site-packages\django\bin\django-admin.py" Type 'django-admin.py help' for usage. but the additional parameters don't get passed along to the batch script. This is getting very annoying, all I want to do is run python scripts :) How can I grab the rest of the parameters in this situation?

    Read the article

  • FastCGI C++ program and missing SCRIPT_NAME

    - by Simone Margaritelli
    Hi guys, i'm studying the fastcgi developement kit because i'm writing a new scripting language and i'd like to write a fastcgi version of the interpreter to run scripts as webpages. I'm using this example from the sdk, located at /srv/http/bin/echocpp So, in my httpd.conf file, i have the following lines : FastCgiServer /srv/http/bin/echocpp -idle-timeout 120 -processes 4 ScriptAlias / /srv/http/bin/echocpp/ ... ... AddHandler fastcgi-script hy Where 'hy' is the extensions of my scripts. Then, when i try browse, for instance http://localhost/~evilsocket/prime.hy I see all the environment variables as expected from the echo-cpp.cpp programm, except for the SCRIPT_NAME that is empty. Is there something i'm missing out of this? How am i supposed to obtain the full path of the script to run it inside my fastcgi version of the interpreter? Thanks

    Read the article

  • Rails architecture questions

    - by justinbach
    I'm building a Rails site that, among other things, allows users to build their own recipe repository. Recipes are entered either manually or via a link to another site (think epicurious, cooks.com, etc). I'm writing scripts that will scrape a recipe from these sites given a link from a user, and so far (legal issues notwithstanding) that part isn't giving me any trouble. However, I'm not sure where to put the code that I'm writing for these scraper scripts. My first thought was to put it in the recipes model, but it seems a bit too involved to go there; would a library or a helper be more appropriate? Also, as I mentioned, I'm building several different scrapers for different food websites. It seems to me that the elegant way to do this would be to define an interface (or abstract base class) that determines a set of methods for constructing a recipe object given a link, but I'm not sure what the best approach would be here, either. How might I build out these OO relationships, and where should the code go?

    Read the article

  • jQuery Dialog theme not being applied

    - by Tim
    I'm using jquery-1.4.2.min.js and jquery-ui-1.8.1.custom.min.js. According to Firebug, both minimized scripts have been loaded. They both appear in the dropdown list on Firebug's Scripts tab. The dialog is launching, but there's no background and so the text below it shows through, and there's no "window" stuff at all, no titlebar, no X button. Just the floating/draggable text with a -close- link at the top left corner. I was under the impression from reading these pages http://jqueryui.com/demos/dialog/ http://jqueryui.com/themeroller/ that the UI theme-driven appearance would be automatically applied to the dialog when it was invoked using this barebones call: $('#dialog').dialog() I would be grateful for suggestions on how to troubleshoot this. Thanks

    Read the article

  • How to "select file" with Python script? . Google App Engine . Python .

    - by draconisthe0ry
    I'm trying to create an online application for a python function i have created. in my script, i input the path of my file for the computer (input_path = '/users/user/desktop/input.txt') but i'm not sure how to go about this using Google App Engine . I have the choice between 3 templates: flask, django, and bottle . I really do believe this question is relevant for people transitioning from scripts to web-based applications. Do I need to incorporate GUI stuff from Tkinter or something? There has to be a way to simply select a file to use for the input path in an interactive way using python scripts

    Read the article

  • what is the best practices around links and url in asp.net-mvc

    - by ooo
    looking at different sites, i see conflicting conventions. if you want to have links to images, other pages, js files, i have seen: URL.Content("~/scripts/myscript.js"); <a href="/scripts/msscripts.js"> <img src="../../content/stylesheet.css"> <img src="../content/stylesheet.css"> these all seem to work in asp.net mvc but it seems like there are all doing slightly different things. I am moving to a new webserver where they are changing from iis redirecting to isapi rewriting and i was told to make sure my links were done in a correct way or the site not work. Can someone clarify what the "correct" way is ?

    Read the article

  • Using external javascript files with asp.net MVC

    - by twal
    I have some javascript inwhich I am using such helpers as var url = <%=ResolveUrl("~/controller/action") %> When the javascript is embeded in the .aspx page using the <script> tag everything works fine When I move it out to an external file those scripts that have the helper methods do not work. Other scripts do just the ones with the var url = <%=ResolveUrl("~/controller/action") %> do not. Are these not possible to use in external javascript files?? I would like to get all of my javascript out of the aspx files if I can. thanks!

    Read the article

  • Secure, simple php faq creating/editing script to base further development off of?

    - by Tchalvak
    I'm looking to build a simple site centered around a simple faq system in php. The faq concept is simple, but I want to have an administrative-access backend for editing and creating the entries, and securing a login seems more complex and time-consuming, so I'm looking for suggestions for code to start me off. Does anyone know of any open source php scripts or snippets that would work as base code for administrative login to some php scripts that could be used as a simple faq system? Or base code for both, the faq php code + web administrative access code?

    Read the article

  • Performance problems when loading local JSON via <script> elements in IE8

    - by Jens Bannmann
    I have a web page with some JS scripts that needs to work locally, e.g. from hard disk or a CD-ROM. The scripts load JSON data from files by inserting <script> tags. This worked fine in IE6, but now in IE8 it takes an enormous amount of time: it went from "instantly" to 3-10 seconds. The main data file is 45KB large. How can I solve this? I would switch from <script> tags to another method of loading JSON (ideally involving the new native JSON parser), but it seems locally loaded content cannot access the XMLHttpRequest object. Any ideas?

    Read the article

  • How can I append and execute a script inside an iframe in a cross browser way (specifically IE!)?

    - by agmin
    Background: I need to load ad scripts after the DOM has loaded. Because many of the scripts use document.write() and other potentially bad functions to run after the DOM has loaded, I want to load the scripts inside an iframe. So when the ad needs to be shown, an event is triggered which does the following: var iframe = document.createElement('iframe'); iframe.setAttribute('id', 'iframeId'); iframe.setAttribute('src', 'about:blank'); var adContainer = document.getElementById('AdContainer'); adContainer.appendChild(iframe); var val = '<html><head></head><body>'; val += '<scr' + 'ipt type="text/javascript" src="' + url + '"></scr' + 'ipt>'; val += '</body></html>'; If I don't assign the html and body tags to val, the script automatically gets appended to the head of the iframe and fails to execute in FF. In IE, the script doesn't execute with or without the head/body/html tags. var doc = iframe.contentWindow || iframe.contentDocument; if (doc.document){ doc = doc.document } doc.open(); doc.write(val); doc.close(); I found this last bit of code here: http://stackoverflow.com/questions/1591135/why-does-appending-a-script-to-a-dynamically-created-iframe-seem-to-run-the-s. I do NOT want to load jquery in the iframe though, I just want to append a script and have it execute. My current solution seems to work great in FF and Webkit. However, IE doesn't execute the script. The script is written to the page, but doesn't start running. Is there a better way to append the script to the iframe so it will run cross browser? Or is it possible to tell IE to run the script? I know that I could load an external document with the ad script via the iframe, but I don't want to make the extra call to my server if I can do this dynamically. Also, I've tried using appendChild() on the iframe's body to insert the script, but since the script element is created outside the iframe's DOM this doesn't seem to work.

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >