PyAIML failing with use of "secure" predicate - aiml

I've just started playing with PyAIML. My notes are at http://webseitz.fluxent.com/wiki/AIML.
I'm trying to use a starting AIML file that loads a whole directory of AIML files. But getting the You are not permitted to load AIML sets response. Even after adding k.setBotPredicate("secure", "yes") in the code.
What am I missing?

Related

How can I compile my ColdFusion code for sourceless distribution, and have it be unreadable?

I've been tasked with creating a deployable version of a ColdFusion web app to be installed on a clients server. I'm trying to find a way to give them a compiled version of our code, and my first inclination was to use the CFCompile utility that I found here. However, after running CFCompile, most of the code in the CFM files is still readable. The only thing that appears to be obfuscated at all is the actual ColdFusion code - all of the SQL Queries are still perfectly readable. (Example in the screenshot below)
The HTML and JavaScript are also still readable in the compiled code, but that doesn't matter as those can be seen in a web browser anyways.
Is there another way to distribute my source code in a format that is completely unreadable to the user? I'm guessing that for whatever method I choose, there will be some way of decompiling the code. That's not an issue, I just need to find a way to make it more difficult than opening the file and seeing the queries.
Hostek has a pretty good write up on the subject over on their site - How to Encrypt or Compile ColdFusion Files.
Basically, from that article:
Using cfcompile.bat
The cfcompile.bat utility will compile all .cfm and .cfc files within a given directory into Java bytecode. This has the effect of making your source code unreadable, and it also prevents ColdFusion from having to compile your ColdFusion files on first use which provides a small performance enhancement.
More details about using cfcompile.bat can be found in ColdFusion's Documentation
Using cfencode.exe
The cfencode.exe utility will apply basic encryption to a specific file or directory. If used to encrypt a directory, it will apply encryption to ALL files in the directory which can break any JS, CSS, images, or other non-ColdFusion files.
They do also include this note at the bottom:
Note: Encrypting your site files with cfencode does not guarantee absolute security of your source code, but it does add a layer of obfuscation to help prevent unauthorized individuals from viewing the source.
The article goes on to give basic instructions on how to use each.
Adobe has this note on their site regarding cfencode:
Note: You can also use the cfencode utility, located in the cf_root/bin directory, to obscure ColdFusion pages that you distribute. Although this technique cannot prevent persistent hackers from determining the contents of your pages, it does prevent inspection of the pages. The cfencode utility is not available on OS X.
I would also add that it will be trivial for anyone familiar with ColdFusion to decode anything encoded with this utility because they also provide the decoder.

Loading local STL files

I tried referencing a local STL file for the skull example and changed:
skull.file = 'http://x.babymri.org/?skull.vtk';
to:
skull.file = 'file:///C:/graham/cad_files/rubber_duck.stl';
but I don't see my model.
The STL file is a binary file, and I see from the API document that these are supported.
I'm using Windows and am sure that the file:///C:/... format is correct.
I'm using jsfiddle and saved the file as an external resource:
jsfiddle.net/gmseed/TTBr2/6/
Can you try to drop the file in slicedrop.com?
If it works, it means there is something wrong in your code, if it doesn't work, it is related to XTK
The jsfiddle link is not working because the file your are trying to pass is not available to the public. (it is sitting on your computer, and the link only works from your computer)
You could use drop box or google drive to host your file instead.
Thanks

Cloning Open Cart admin language issue

I'm trying to clone one fully functioning opencart website to another. The front-end of the website is in Dutch and the back-end I have left English default.
Here are the steps I have taken:
Copy database to new environment
Copy files and edit both the config files(config.php and admin/config.php) to match the server paths.
when i go to test the site, all seems to be working fine, until i go to the admin section where i find this blasted error which seems to be very common:
Notice: Error: Could not load language dutch! in /opt/www/prezent/graviolashop.de/HTML/system/library/language.php on line 39
I'm not sure if this is a path issue or something wrong with the db?
I have googled this issue but none are specific to my perticular case. Has anyone had this issue and resolved it?
Thanks.
If it's unable to load the language and you've copied them over as you say, then this is going to be a config issue. Ensure your path is exactly as it should be. A good way to do this is to create a file such as error.php in your root website folder. Then put some erroneous code in it like
<?php
dfs sdf sd;
Then call the file at www.yoursite.com/error.php, and it will show you the path in the error which you can copy exactly. One other unlikely but possible problem could be permissions, but the former is far more likely

About the intrepreter for AIML

I tried to build a chatbot in AIML. I downloaded the codes from http://nlp-addiction.com/chatbot/mathbot/ but couldn't get the idea about how to run the program. Please help me.
An AIML file isn't program code, it's a data file (much like any other xml file).
You need to use an interpreter like Program-AB to load and use the file to answer queries.
If you just want to test the contents and formatting of the aiml file, you could use Pandorabots and load the file into a blank bot fairly easily.
Yes, AIML file isn't program code. It's just like a data format. You can learn about it more from here : http://www.alicebot.org/aiml.html
AIML is a data encoding format that tells the bot when to do what to do. Many interpreters can be used to interpret the aiml tags.
One of them is PyAIML which is python based interpreter fairly simple to use.

SAXParseException that only occurs locally. Works on WebServers

I am writing a junit test that is testing and older piece of code. This code works on our iplanet webservers and our local Tomcat servers and runs with no problems. However when run by the JUNIT test I get this exception.
Background: It pulls an XSL file from a JAR then transforms it with an xml document that is read in from a resource file.
I have tried changing transformer factories, changing encoding, and checked all files for null characters using a hex editor. Any ideas?
[Fatal Error] :2251:46: An invalid XML character (Unicode: 0x0) was found in the value of attribute "test" and element is "xsl:when".
SystemId Unknown; Line #2251; Column #46; org.xml.sax.SAXParseException; lineNumber: 2251; columnNumber: 46; An invalid XML character (Unicode: 0x0) was found in the value of attribute "test" and element is "xsl:when".
**UPDATE
I have found that if I use the project's class folder where the XSL is held and move it about the jar's dependency it works, but if it uses the xsl out of the jar it breaks
SUGGESTIONS:
1) Make sure your library versions all match.
2) I suspect that " An invalid XML character (Unicode: 0x0) was found" might be caused by any of several completely different things. You should investigate each of them.
3) First, most obvious - check your input for a null character :)
4) Second, check your encoding - perhaps your sender is writing UTF-16, but your reader is expecting UTF-8. Here's a good link:
*
Error about invalid XML characters on Java
This is an encoding issue. Either you read it the inputstream as UTF8
and it isn't or the other way around.
You should specify the encoding explicitly when you read the content.
E.g. via
new InputStreamReader(getInputStream(), "UTF-8")
Another problem could be the tomcat. Try to add URIEncoding="UTF-8" in
your tomcat’s connector settings in the server.xml file
5) The root cause might also be a failed read or a missing object of some kind. A missing definition, perhaps.
Q: What is "SystemId"? What might cause it to "go missing"?
6) One possibility is that "resolveEntity()" is failing:
InputSource resolveEntity(String publicId, String systemId)
Here are a couple of links regarding that problem:
Java SAX Parser raises UnknownHostException
how to disable dtd at runtime in java's xpath?
7) Both of these links suggest "resolveEntity() might be failing because you can't connect to a specified host. Check the network host names listed in your XML, and make sure you can "ping" them.
If it's got as far as line 2251 that suggests strongly that there's something wrong with the file contents around that location. If there's nothing wrong with the file at that location, my next suggestion would be that something's wrong with the parser. I know it sounds crazy, but the XML parser built in to the JDK is seriously buggy, and I would check whether the problem goes away if you install the Apache version of Xerces in its place. In many cases this is simply a question of putting the relevant JAR files in the lib/endorsed directory of the JDK installation.
This was caused because the XSL files I was trying to transform were still in a JAR. I had to have Maven extract the files into the target directory first.