scripting-language

How do I set up jsr223 scripting with scala as scripting language

拥有回忆 提交于 2019-12-12 08:47:08
问题 So far I have tried the sling implementation for jsr223 scripting for scala, but was not able to get it set up correctly. when I do this: public static void main(String[] args) { try { new ScriptEngineManager().getEngineByName("scala"). eval("object HelloWorld {def main(args: Array[String]) { println(\"Hello, world!\") }}"); } catch (ScriptException e) { e.printStackTrace(); } } I got nothing but: javax.script.ScriptException: ERROR org.apache.sling.scripting.scala.Script line 13 : not found:

Error in regex formulation for web scraping in python

醉酒当歌 提交于 2019-12-11 18:49:49
问题 I am trying to scrape some information from a website. I require 8 fields of information, I have got it for 5 fields, but 3 fields are always coming empty. I think there is some mistake with my regular expression formulation. I am doing it in python and I don't have to use BS. Here are the HTML fileds I need to scrape. This is example of one of the webpage. enter code here <td><span class="facultyName">John Matthew Falletta, MD</span> <span class="primaryTitle">Professor of Pediatrics</span>

Python lambda function printing <function <lambda> at 0x7fcbbc740668> instead of value

走远了吗. 提交于 2019-12-10 04:28:45
问题 I am a beginner in python, and I was playing around with lambda functions. I was writing a program using lambda function to print characters that are +1 the ascii value of the input characters. My code is #!/usr/bin/python import sys try: word = sys.argv[1] except: print "No arguments passed" sys.exit(1) def convert_ascii(char): return "".join(chr(ord(char) + 1)) for i in word: print convert_ascii(i) print lambda x: chr(ord(i) + 1) I have a function convert_ascii that does the same thing as

Is Bash an interpreted language?

冷暖自知 提交于 2019-12-09 08:58:51
问题 From what I've read so far, bash seems to fit the defintion of an interpreted language: it is not compiled into a lower format every statement ends up calling a subroutine / set of subroutines already translated into machine code (i.e. echo foo calls a precompiled executable) the interpreter itself, bash , has already been compiled However, I could not find a reference to bash on Wikipedia's page for interpreted languages, or by extensive searches on Google. I've also found a page on

Implementing a simple XML based Scripting Language for an XNA Game

老子叫甜甜 提交于 2019-12-09 02:10:17
问题 I'm working with a team on a RPG engine in C# and XNA. We're planning on targeting Windows and Windows Phone 7, but are running into issues with AI interactions and controlling player actions during cutscenes. FOr the most part, everything is extracted using the MVC design pattern, but abstracting all logic and movement into a controller could cause issues down the line. So the idea is to have an interface (IScriptEngine) that takes an IScriptObject and updates data in the map model

Why are most scripting languages loosely typed?

不打扰是莪最后的温柔 提交于 2019-12-07 05:36:12
问题 why most of the scripting languages are loosely typed ? for example javascript , python , etc ? 回答1: First of all, there are some issues with your terminology. There is no such thing as a loosely typed language and the term scripting language is vague too, most commonly referring to so called dynamic programming languges . There is weak typing vs. strong typing about how rigorously is distinguished between different types (i.e. if 1 + "2" yields 3 or an error). And there is dynamic vs. static

Debugging a scripting language like ruby

北城以北 提交于 2019-12-07 01:52:13
问题 I am basically from the world of C language programming, now delving into the world of scripting languages like Ruby and Python. I am wondering how to do debugging. At present the steps I follow is, I complete a large script, Comment everything but the portion I want to check Execute the script Though it works, I am not able to debug like how I would do in, say, a VC++ environment or something like that. My question is, is there any better way of debugging? Note: I guess it may be a repeated

New scripting language

為{幸葍}努か 提交于 2019-12-06 10:50:27
I am trying to create a scripting language by myself (it doesn't have to be perfect - although that would be great if it was), mostly because i'm doing it for fun and to learn about how they're created etc. According to the answer over here: Creating a scripting language what I'm supposed to be looking into is this: http://msdn.microsoft.com/en-us/library/xawadt95%28VS.85%29.aspx . But, I have absolutely no idea what that MSDN page is on about. Can somebody please help? P.S. Are there any free/open source scripting languages that target the Windows Script Host, that also have full source code

Lua scripting line by line

我是研究僧i 提交于 2019-12-05 12:19:21
I added Lua scripting to my C# Application by using the DynamicLua libary and it works very well. I would like to implement that you get the current line which is being executed (Like in Visual Studio) and highlight it. Currently I am doing this: public static void RunLua(string LuaToExecute) { dynamic lua = new DynamicLua.DynamicLua(); string[] lua_s_split = LuaToExecute.Split('\n'); int counter = 0; foreach (string line in lua_s_split) { // highlight current line in editor HighlightLine(counter + 1); //execute current line lua(line); counter++; } } This is working great with my Lua code like

Why are most scripting languages loosely typed?

放肆的年华 提交于 2019-12-05 10:36:11
why most of the scripting languages are loosely typed ? for example javascript , python , etc ? First of all, there are some issues with your terminology. There is no such thing as a loosely typed language and the term scripting language is vague too, most commonly referring to so called dynamic programming languges . There is weak typing vs. strong typing about how rigorously is distinguished between different types (i.e. if 1 + "2" yields 3 or an error). And there is dynamic vs. static typing , which is about when type information is determined - while or before running. So now, what is a