Search Results

Search found 7380 results on 296 pages for 'scripting languages'.

Page 54/296 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Messy Filesytem : Duplicate File Removal from the command line

    - by jrause
    In debian/ubuntu I want to a) create a list of all the files in one directory tree b) do the same for a second directory tree c) compare the two lists such that, only the file NAMES are compared (i.e. just comparing the "file.txt" part so that "/home/folder/file.txt" == "/home/secondfolder/folder/file.txt) d) output a list of all the duplicates can anyone please explain how to do this using scripting languages or regex or something?

    Read the article

  • Is there a way to programatically set the printer properties in windows ?

    - by panzerschreck
    Hello, As a paper saving drive throughout the organization, we plan to set 2 page printing as default setting on all the windows machines. I would like to contribute to this by writing a small script that can do that for all the machines, maybe send an email to all the users, and let them run the batch file. Is that possible, can you please guide me. I have no knowledge about windows scripting, I program in java for my living. Thanks for your time.

    Read the article

  • Why binding is not a native feature in most of the languages?

    - by Gulshan
    IMHO binding a variable to another variable or an expression is a very common scenario in mathematics. In fact, in the beginning, many students think the assignment operator(=) is some kind of binding. But in most of the languages, binding is not supported as a native feature. In some languages like C#, binding is supported in some cases with some conditions fulfilled. But IMHO implementing this as a native feature was as simple as changing the following code- int a,b,sum; sum := a + b; a = 10; b = 20; a++; to this- int a,b,sum; a = 10; sum = a + b; b = 20; sum = a + b; a++; sum = a + b; Meaning placing the binding instruction as assignments after every instruction changing values of any of the variable contained in the expression at right side. After this, trimming redundant instructions (or optimization in assembly after compilation) will do. So, why it is not supported natively in most of the languages. Specially in the C-family of languages? Update: From different opinions, I think I should define this proposed "binding" more precisely- This is one way binding. Only sum is bound to a+b, not the vice versa. The scope of the binding is local. Once the binding is established, it cannot be changed. Meaning, once sum is bound to a+b, sum will always be a+b. Hope the idea is clearer now. Update 2: I just wanted this P# feature. Hope it will be there in future.

    Read the article

  • Alternatives to Java for Android development?

    - by paul.meier
    Hey all, I've started developing Android apps a couple of months ago, and have a few under my belt. While I can tolerate Java enough to keep developing, I was wondering what success the community has had getting other languages to run. I've done some investigation as to how other JVM languages work, and it appears Dalvik messes them up pretty hard. Clojure seems unable to run, Scala seems to be one of the most successful. JRuby has also had some luck, but they caution against anything major. I've also checked out Scheme via Moby and Kawa, both of which seem to have some promise. What luck have any of you had? Languages I'm missing, misrepresenting? Any non-"Hello World" apps you've written in non-Java? Any snags in trying to get another language to run (e.g. "as long as you don't use continuations, you're fine in X Scheme"). Any particular snags in developing apps non-Java, once you get them to run? Thanks, hope you well ^_^

    Read the article

  • Is learning C++ a good idea?

    - by chang
    The more I hear and read about C++ (e.g. this: http://lwn.net/Articles/249460/), I get the impression, that I'd waste my time learning C++. I some wrote network routing algorithm in C++ for a simulator, and it was a pain (as expected, especially coming from a perl/python/Java background ...). I'm never happy about giving up on some technology, but I would be happy, if I could limit my knowledge of C-family languages to just C, C# and Objective-C (even OS Xs Cocoa, which is huge and takes a lot of time to learn looks like joy compared to C++ ...). Do I need to consider myself dumb or unwilling, just because I'm not partial to the pain involved learning this stuff? Technologies advance and there will be options other than C++, when deciding on implementation languages, or not? And for speed: If speed were that critical, I'd go for a plain C implementation instead, or write C extensions for much more productive languages like ruby or python ... The one-line version of the above: Will C++ stay such a relevant language that every committed programmer should be familiar with it? [ edit / thank you very much for your interesting and useful answers so far .. ] [ edit / .. i am accepting the top-rated answer; thanks again for all answers! ]

    Read the article

  • Guidelines for creating a programming-language enjoyable to write programs in?

    - by sub
    I'm currently working on the topic of programming-languages and interpreter-design. I have already created several programming languages but couldn't reach my goal so far: Create a programming-language which focuses on giving the programmer a good feeling when writing code in it. It should just be fun and/or interesting and in no case annoying to write something in it. I get this feeling when writing code in Python. I sometimes get the opposite with PHP and in rare cases when having to reinvent some wheel in C++. So I've tried to figure out some syntactical features to make programming in my new language fun, but I just can't find any. Which concrete features, maybe mainly in terms of syntax, do/could make programming in a language fun? Examples: I find it enjoyable to program in Ruby because of it's use of code blocks. It would be nice if you could include exactly one example in your answer Those features do not have to already exist in any language! I'm doing this because I have experienced extreme rises in (my own) productivity when programming in languages I love (because of particular features).

    Read the article

  • Are "backwards" terminators for if and case unique to shell scripting?

    - by tomjakubowski
    In bash at least, if and case blocks are closed like this: if some-expr then echo "hello world" fi case $some-var in [1-5]) do-a-thing ;; *) do-another-thing esac as opposed to the more typical close of end or endif/endcase. As far as I know, this rather funny convention is unique to shell scripting and I have never seen such an odd block terminator anywhere else. Sometimes things like this have an origin in another language (like Ruby's elsif coming from Perl), or a strange justification. Does this feature of shell scripting have a story behind it? Is it found in other languages?

    Read the article

  • windows shell scripting through java

    - by GAURAV JAISWAL
    i am designing a desktop application like nero for removable media storage that also includes features of copyfast. i want to add an option of my own choice in the windows explorer right click menu. how can i do that? am i proceeding in the right direction?

    Read the article

  • Bash scripting problem

    - by komidore64
    I'm writing a bash script to sync my iTunes music directory to a directory on a removable hard drive. The script works fine when there is absolutely nothing in the folder on the external hard drive. Once all files have been copied to the external drive, then the script begins to act strange. Even though i just sync'd everything over, it proceeds to recopy certain files again. After the initial sync, it chooses the same files to resync each consecutive time the script is executed without any changes being made to the source directory. #!/bin/bash # shell script to sync music with gigabeat and/or firewire drive musicdir="/Users/komidore64/Music/iTunes/iTunes Media/Music" gigadir="/Volumes/GIGABEAT/music" # fwdir="/Volumes/" remove() { find "$1" \ ! \( -name "*.wav" \ -o -name "*.ogg" \ -o -name "*.flac" \ -o -name "*.aac" \ -o -name "*.mp3" \ -o -name "*.m4a" \ -o -name "*.wma" \ -o -name "*.m4p" \ -o -name "*.ape" \ -o -type d \) \ -exec rm -i {} \; } if [ $# == 0 ]; then echo "no device argument present" echo "specify '-g' for gigabeat" echo "or '-f' for firewire drive" else remove "$musicdir" while [ $1 ]; do case $1 in -g | --gigabeat ) rsync --archive --verbose --delete "$musicdir/" "$gigadir" ;; -f | --firewire ) rsync --archive --verbose --delete "$musicdir/" "$fwdir" esac shift done echo "music synced" fi

    Read the article

  • How can I effectively test a scripting engine?

    - by ChaosPandion
    I have been working on an ECMAScript implementation and I am currently working on polishing up the project. As a part of this, I have been writing tests like the following: [TestMethod] public void ArrayReduceTest() { var engine = new Engine(); var request = new ExecScriptRequest(@" var a = [1, 2, 3, 4, 5]; a.reduce(function(p, c, i, o) { return p + c; }); "); var response = (ExecScriptResponse)engine.PostWithReply(request); Assert.AreEqual((double)response.Data, 15D); } The problem is that there are so many points of failure in this test and similar tests that it almost doesn't seem worth it. It almost seems like my effort would be better spent reducing coupling between modules. To write a true unit test I would have to assume something like this: [TestMethod] public void CommentTest() { const string toParse = "/*First Line\r\nSecond Line*/"; var analyzer = new LexicalAnalyzer(toParse); { Assert.IsInstanceOfType(analyzer.Next(), typeof(MultiLineComment)); Assert.AreEqual(analyzer.Current.Value, "First Line\r\nSecond Line"); } } Doing this would require me to write thousands of tests which once again does not seem worth it.

    Read the article

  • scripting a google docs form submission

    - by justSteve
    I'm trying to create a bookmarklet that parses a page and sends the results to a googledocs spreadsheet via a form that I've defined. The relevent bit of the script is: var form = document.createElement("form"); form.action = "http://spreadsheets.google.com/formResponse?formkey=Fd0SHgwQ3YwSFd5UHZpM1QxMlNOdlE6MA&ifq"; form.method = "POST"; form.id="ss-form"; form.innerHTML = ["<input id='entry_0' name = 'entry.0.single' value = '" + orderDate + "'/>", "<input name = 'entry.2.single' value = '" + email + "'/>", "<input name = 'entry.3.single' value = '" + customerID + "'/>", ].join(""); form.submit(); alert(form.innerHTML); // returns: Nothing is being saved to the form via the bookmarklet - any way to capture google's response in my bookmarklet's code? (fwiw, i've injected jQuery via jQueryify) EDIT: Firebug's Net panel isn't hearing any of the activity triggered by the bookmarklet - How about i approach this from goolgle's viewform method instead of formresponse. The form i'm trying to submit is located at: http://spreadsheets.google.com/viewform?hl=en&formkey=dFd0SHgwQ3YwSFd5UHZpM1QxMlNOdlE6MA How can I go about injecting the script values into that form and then submitting that - again...via script within the bookmarklet that would have been triggered while on the page being parsed?

    Read the article

  • Bash scripting know the result of a command.

    - by Fork
    Hi, I am writing a bash script to run an integration test of a tool I am writing. Basically I run the application with a set of inputs and compare the results with expected values using the diff command line tool. It's working, but I would like to enhance it by knowing the result of the diff command and print "SUCCESS" or "FAIL" depending on the result of the diff. How can I do it?

    Read the article

  • Windows Batch Scripting Issue - Quoting Variables containing spaces

    - by Rick
    So here's my issue: I want to use %cd% so a user can execute a script anywhere they want to place it, but if %cd% contains spaces, then it will fail (regardless of quotes). If I hardcode the path, it will function with quotes, but if it is a variable, it will fail. Fails: (if %cd% contains spaces) "%cd%\Testing.bat" Works: "C:\Program Files\Testing.bat" Any ideas?

    Read the article

  • How Do I Prevent a XSS Cross-Site Scripting Attack When Using jQueryUI Autocomplete

    - by theschmitzer
    I am checking for XSS vulnerabilities in a web application I am developing. This Rails app uses the h method to sanitize HTML it generates. It does, however, make use of the jQueryUI autocomplete widget (new in latest release), where I don't have control over the generated HTML, and I see tags are not getting escaped there. The data fed to autocomplete is retrieved through a JSON request immediately before display. I Possibilities: 1) Autocomplete has an option to sanitize I don't know about 2) There is an easy way to do this in jQuery I don't know about 3) There is an easy way to do this in a Rails controller I don't know about (where I can't use the h method) 4) Disallow < symbol in the model Sugestions?

    Read the article

  • MS SQL Index Scripting

    - by Fouad Masoud
    I'm using MS SQL 2008. Is it possible to create a script to loop over all tables in a database generating a set of index drop scripts and create scripts separately? What I have to do is drop all indexes on a set of databases to run a heavy data load process but then I want to re-enable all the indexes. I don't want to have to go through each table and script an index drop and then index create. Thanks!

    Read the article

  • Photoshop scripting form .Net 3.5

    - by Mendy
    I read recently this post that explain how to use photoshop COM component from .net code. The problem that I don't see a reference to Interop.Photoshop.dll in Add Reference dialog COM column. Do anyone that have photoshop cs4 installed can see it? I wonder maybe it showed only in .net 1 platform...

    Read the article

  • Cross Domain Scripting Issues & JSONP

    - by DaveDev
    Our Client requires that we supply Widgits for their site. They want to link to us to get Html & the jQuery required to manipulate the Html and do asynchronous requests. I understand that there are cross-domain security limitations that would prevent this from being a possibility, but that some of those limitations are aleviated by using JSONP as the data transfer format. I'm finding it difficult in finding an explanation of what's possible in the context of what I'm trying to achieve. Could somebody please fill me in?

    Read the article

  • Whats up with cross site Scripting (getJSON) and flickr example

    - by Bernhard
    In past i had read the documentation about getJSON and there is an example with a flickr photo api. (the example with the [pussy]cats :-)). No I ask myself why is it possible, to access flickr directly with this example. Ive tried this by store this code on my local machine - it works but if I use a local copy of jquery i just get an error in firebug like this $ is not defined myurl/test.html Line 11 Does anybody of you have a solution for this paradox thing? This is the documentation url HTTP:api.jquery.com/jQuery.getJSON/ The example isn´t also not working if I store the HTTP:code.jquery.com/jquery-latest.js in my local jquery file. I also dont understand why the request isnt´s visible in Firebug Console Thank you in advance Bernhard

    Read the article

  • Batch scripting for directories or better method

    - by baron
    Hi Everyone, Looking at creating a simple batch file for my app. My app needs some directories to be in place as it runs. The first method I thought was just make a batch script: @ECHO OFF IF NOT EXIST C:\App GOTO :CREATE ELSE GOTO :DONTCREATE :CREATE MKDIR C:\App\Code ECHO DIRECTORY CREATED :DONTCREATE ECHO IT WAS ALREADY THERE 1) This doesn't run as I would expect. Both :CREATE and :DONTCREATE seem to run regardless? How do I do an If properly then? Output: A subdirectory or file C:\App\Code already exists. DIRECTORY CREATED IT WAS ALREADY THERE So it enters both true and false statements? 2) The app is a C# WPF app. For what I am trying to do here (create a couple of directories if they don't already exist) - should I do it some other way? Perhaps in the application as it runs?

    Read the article

  • finding the missing values in a range using any scripting language - perl, python or shell script

    - by manu
    Hi everyone I got stuck in one problem of finding the missing values in a range and the range is also variable for the successive rows. Ex. =================== inpt ==================== 673 673 673 676 676 680 2667 2667 2668 2670 2671 2674 ===================== output should be like this =================== 674 675 677 678 679 2669 2672 2673 ======================== This is just one part and the row values can be more also If there is any clarification plz let me know. thanx in advance manu

    Read the article

  • Scripting for JAVA - a problem to solve

    - by Parhs
    Hello.. I had no luck to find a good way to achieve the following: suppose i let the user to write a condition using javascript INS5 || ASTO.valueBetween(10,210) ... etc.... I tried to find a way to get the variables name...from JAVA... Rhino library didnt help a lot... However i found that handling exceptions i could get all the identifiers! Everything is great but one little problem..... How teh heck i can replace these identifiers with the numeric id of each var ? eg INS to be _234 ASTO to be _331 ? I want to to this replace because the name may change... I could do it using a replace but i know that this isnt easy because... 1) replacing _23 with MPLAH may replace also _234...(this could be fixed with regexp somehow..) 2)what if _23 is in a comment section ? rare to happen but possible /* _23 fdsafd ktl */ it should be replaced... 3)what if is a name of a function ??? _32() {} rare but shouldnt be replaced 4) what if it is enclosed in "" or ''??? And i am sure that there should me a lot more cases..... any ideas ? thank yoyu for your time

    Read the article

  • Java Scripting Engine importing my classes does not work

    - by Ayman
    A code is worth 1000 words of explaining it :-) package jasim; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class JSTest { public static void main(String[] args) throws ScriptException { ScriptEngine jse = new ScriptEngineManager().getEngineByExtension("js"); jse.eval("println(new jasim.JSTest().toString)"); } @Override public String toString() { return "JSTest Object"; } } This code will fail with the below exception: Exception in thread "main" javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "jasim" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1 How do I import my own classes into the ScriptEngine?

    Read the article

  • Calling Python from Java through scripting engine (jython)?

    - by griffin
    I'm trying to call Jython from a Java 6 application using javax.script: import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class jythonEx { public static void main (String args[]) throws ScriptException { ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngine pyEngine = mgr.getEngineByName("python"); try { pyEngine.eval("print \"Python - Hello, world!\""); } catch (Exception ex) { ex.printStackTrace(); } } } This is causing a NullPointerException: java.lang.NullPointerException at jythonEx.main(jythonEx.java:12) Does anyone have any idea what I'm doing wrong here? Edit: Thanks for the responses! I added jython.jar to the classpath and it runs properly: java -cp "./;jython.jar" jythonEx

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >