Search Results

Search found 491 results on 20 pages for 'geo ego'.

Page 7/20 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Jython and python modules

    - by Geo
    I've just started using the PythonInterpreter from within my Java classes, and it works great! However, if I try to include python modules (re, HTMLParser, etc.), I'm receiving the following exception (for re): Exception in thread "main" Traceback (innermost last): File "", line 1, in ? ImportError: no module named re How could I make the classes from the jython jar "see" the modules python has available?

    Read the article

  • Scala isn't allowing me to execute a batch file whose path contains spaces.Same Java code does.What

    - by Geo
    Here's the code I have: var commandsBuffer = List[String]() commandsBuffer ::= "cmd.exe" commandsBuffer ::= "/c" commandsBuffer ::= '"'+vcVarsAll.getAbsolutePath+'"' commandsBuffer ::= "&&" otherCommands.foreach(c => commandsBuffer ::= c) val asArray = commandsBuffer.reverse.toArray val processOutput = processutils.Proc.executeCommand(asArray,true) return processOutput otherCommands is an Array[String], containing the following elements: vcbuild /rebuild path to a .sln file vcVarsAll contains the path to Visual Studio's vcvarsall.bat. It's path is C:\tools\microsoft visual studio 2005\vc\vcvarsall.bat. The error I receive is: 'c:\Tools\Microsoft' is not recognized as an internal or external command, operable program or batch file.. The processutils.Proc.executeCommand has the following implementation: def executeCommand(params:Array[String],display:Boolean):(String,String) = { val process = java.lang.Runtime.getRuntime.exec(params) val outStream = process.getInputStream val errStream = process.getErrorStream ... } The same code, executed from Java/Groovy works. What am I doing wrong?

    Read the article

  • Help me find an appropriate ruby/python parser generator

    - by Geo
    The first parser generator I've worked with was Parse::RecDescent, and the guides/tutorials available for it were great, but the most useful feature it has was it's debugging tools, specifically the tracing capabilities ( activated by setting $RD_TRACE to 1 ). I am looking for a parser generator that can help you debug it's rules. The thing is, it has to be written in python or in ruby, and have a verbose mode/trace mode or very helpful debugging techniques. Does anyone know such a parser generator ? EDIT: when I said debugging, I wasn't referring to debugging python or ruby. I was referring to debugging the parser generator, see what it's doing at every step, see every char it's reading, rules it's trying to match. Hope you get the point. BOUNTY EDIT: to win the bounty, please show a parser generator framework, and illustrate some of it's debugging features. I repeat, I'm not interested in pdb, but in parser's debugging framework. Also, please don't mention treetop. I'm not interested in it.

    Read the article

  • Catching typos in scripting languages

    - by Geo
    If your scripting language of choice doesn't have something like Perl's strict mode, how are you catching typos? Are you unit testing everything? Every constructor, every method? Is this the only way to go about it?

    Read the article

  • How to accurately parse smtp message status code (DSN)?

    - by Geo
    RFC1893 claims that status codes will come in the format below you can read more here. But our bounce management system is having a hard time parsing error status code from bounce messages. We are able to get the raw message, but depending on the email server the code will come in different places. Is there any rule on how to parse this type of messages to obtain better results. We are not looking for the 100% solution but at least 80%. This document defines a new set of status codes to report mail system conditions. These status codes are intended to be used for media and language independent status reporting. They are not intended for system specific diagnostics. The syntax of the new status codes is defined as: status-code = class "." subject "." detail class = "2"/"4"/"5" subject = 1*3digit detail = 1*3digit White-space characters and comments are NOT allowed within a status- code. Each numeric sub-code within the status-code MUST be expressed without leading zero digits. The quote above from the RFC tells one thing but then the text below from a leading tool on bounce management says something different, where I can get a good source of standard status codes: Return Code Description 0 UNDETERMINED - (ie. Recipient Reply) 10 HARD BOUNCE - (ie. User Unknown) 20 SOFT BOUNCE - General 21 SOFT BOUNCE - Dns Failure 22 SOFT BOUNCE - Mailbox Full 23 SOFT BOUNCE - Message Too Large 30 BOUNCE - NO EMAIL ADDRESS. VERY RARE! 40 GENERAL BOUNCE 50 MAIL BLOCK - General 51 MAIL BLOCK - Known Spammer 52 MAIL BLOCK - Spam Detected 53 MAIL BLOCK - Attachment Detected 54 MAIL BLOCK - Relay Denied 60 AUTO REPLY - (ie. Out Of Office) 70 TRANSIENT BOUNCE 80 SUBSCRIBE Request 90 UNSUBSCRIBE/REMOVE Request 100 CHALLENGE-RESPONSE

    Read the article

  • Is it possible to get the exit code from a subshell?

    - by Geo
    Let's imagine I have a bash script, where I call this: bash -c "some_command" do something with code of some_command here Is it possible to obtain the code of some_command? I'm not executing some_command directly in the shell running the script because I don't want to alter it's environment.

    Read the article

  • Where to find good examples or Templates for Configuration Management Plans?

    - by Geo
    Documentation is not the favorite area of a developer but an important area to fulfill if you want to have standards in the organization. We are trying to put together a new Configuratio Mgmt Plan to setup Change Controls, Backups strategies and other fun things, like the process from development, staging to production. I will like to have your opinions on good examples or probably a good start for CMP process.

    Read the article

  • 2 batch string questions.

    - by Geo
    1) Is there any built-in which can tell me if a variable's contents contain only uppercase letters? 2) is there any way to see if a variable contains a string? For example, I'd like to see if the variable %PATH% contains Ruby.

    Read the article

  • setText deprecated

    - by Geo
    Hi there, i saw your comment about getting rid of the setText deprecated error, and using cell.textLabel.text it works perfectly for OS 4.0 but it doesn't work on 3.1.3, the app crashes at the loading screen, have you got any ideas?

    Read the article

  • What JavaScript object copy function works with greasemonkey?

    - by Geo
    I know there is another question related to copying objects in JavaScript here, but the code they provide does not work with greasemonkey. From what I was able to trace, the code for the accepted answer dies/ stops at the line : var temp = new obj.constructor(); Is there any way to see what went wrong ? It's not really necessary I use the same function for the object copying, but I would like something that works. Do you know some function?

    Read the article

  • Scala capture group using regex

    - by Geo
    Let's say I have this code: val string = "one493two483three" val pattern = """two(\d+)three""".r pattern.findAllIn(string).foreach(println) I expected findAllIn to only return 483, but instead, it returned two483three. I know I could use unapply to extract only that part, but I'd have to have a pattern for the entire string, something like: val pattern = """one.*two(\d+)three""".r val pattern(aMatch) = string println(aMatch) // prints 483 Is there another way of achieving this, without using the classes from java.util directly, and without using unapply?

    Read the article

  • What Amazon S3 .NET Library is most useful and efficient?

    - by Geo
    There are two main open source .net Amazon S3 libraries. Three Sharp LitS3 I am currently using LitS3 in our MVC demo project, but there is some criticism about it. Has anyone here used both libraries so they can give an objective point of view. Below some sample calls using LitS3: On demo controller: private S3Service s3 = new S3Service() { AccessKeyID = "Thekey", SecretAccessKey = "testing" }; public ActionResult Index() { ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View("Index",s3.GetAllBuckets()); } On demo view: <% foreach (var item in Model) { %> <p> <%= Html.Encode(item.Name) %> </p> <% } %> EDIT 1: Since I have to keep moving and there is no clear indication of what library is more effective and kept more up to date, I have implemented a repository pattern with an interface that will allow me to change library if I need to in the future. Below is a section of the S3Repository that I have created and will let me change libraries in case I need to: using LitS3; namespace S3Helper.Models { public class S3Repository : IS3Repository { private S3Service _repository; #region IS3Repository Members public IQueryable<Bucket> FindAllBuckets() { return _repository.GetAllBuckets().AsQueryable(); } public IQueryable<ListEntry> FindAllObjects(string BucketName) { return _repository.ListAllObjects(BucketName).AsQueryable(); } #endregion If you have any information about this question please let me know in a comment, and I will get back and edit the question. EDIT 2: Since this question is not getting attention, I integrated both libraries in my web app to see the differences in design, I know this is probably a waist of time, but I really want a good long run solution. Below you will see two samples of the same action with the two libraries, maybe this will motivate some of you to let me know your thoughts. WITH THREE SHARP LIBRARY: public IQueryable<T> FindAllBuckets<T>() { List<string> list = new List<string>(); using (BucketListRequest request = new BucketListRequest(null)) using (BucketListResponse response = service.BucketList(request)) { XmlDocument bucketXml = response.StreamResponseToXmlDocument(); XmlNodeList buckets = bucketXml.SelectNodes("//*[local-name()='Name']"); foreach (XmlNode bucket in buckets) { list.Add(bucket.InnerXml); } } return list.Cast<T>().AsQueryable(); } WITH LITS3 LIBRARY: public IQueryable<T> FindAllBuckets<T>() { return _repository.GetAllBuckets() .Cast<T>() .AsQueryable(); }

    Read the article

  • Email function using templates. Includes via ob_start and global vars

    - by Geo
    I have a simple Email() class. It's used to send out emails from my website. <? Email::send($to, $subj, $msg, $options); ?> I also have a bunch of email templates written in plain HTML pierced with a few PHP variables. E.g. /inc/email/templates/account_created.php: <p>Dear <?=$name?>,</p> <p>Thank you for creating an account at <?=$SITE_NAME?>. To login use the link below:</p> <p><a href="https://<?=$SITE_URL?>/account" target="_blank"><?=$SITE_NAME?>/account</a></p> In order to have the PHP vars rendered I had to include the template into my function. But since include does not return the contents but rather just sends it directly to the output, I had to wrap it with the buffer functions: <? abstract class Email { public static function send($to, $subj, $msg, $options = array()) { /* ... */ ob_start(); include '/inc/email/templates/account_created.php'; $msg = ob_get_clean(); /* ... */ } } After that I realized that the PHP vars are not rendered as they are being inside of the function scope, so I had to globalize the variables inside of the template: <? global $SITE_NAME, $SITE_URL, $name; ?> <p>Dear <?=$name?>,</p> ... So the question is whether there is a more elegant solution to this? Mainly I am concerned about my workarounds using ob_start() and global. For some reason that seems to me odd. Or this is pretty much the common practice?

    Read the article

  • How can I make this Perl regex work?

    - by Geo
    I have this line ( it's a single line, SO makes it seem like 2 ): /Od /D "WIN32" /D "_DEBUG" /FD /EHa /MDd /Fo"Debug" /Fd"Debug\vc80.pdb" /W3 /c /Zi /clr /TP .\main.cpp" And I want to extract the .\main.cpp. I thought the following would do the trick: if($string =~ /.*\s+(.*)$/i) { print "matched ",$1,"\n"; } because this same regex works in Ruby, and extracts the string I required. How can I get it working?

    Read the article

  • Questions about serving static files from a servlet

    - by Geo
    I'm very new to servlets. I'd like to serve some static files, some css and some javascript. Here's what I got so far: in web.xml: <servlet> <description></description> <display-name>StaticServlet</display-name> <servlet-name>StaticServlet</servlet-name> <servlet-class>StaticServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>StaticServlet</servlet-name> <url-pattern>/static/*</url-pattern> </servlet-mapping> I'm assuming in the StaticServlet I'd have to work with request.getPathInfo to see what was requested, get a mime type, read the file & write it to the client. If this is not the way to go, or is not a viable way of doing things, please suggest a better way. I'm not really sure where to place the static directory, because if I try to print new File(".") it gives me the directory of my Eclipse installation. Is there a way to find out the project's directory?

    Read the article

  • How do I make my Log::Log4perl logger work?

    - by Geo
    Here's the code I have: use strict; use warnings; use Log::Log4perl qw(:easy); Log::Log4perl->init({ level => $DEBUG }); my $logger = Log::Log4perl->get_logger("my.logger"); my $appender = Log::Log4perl::Appender->new("Log::Log4perl::Appender::File",filename => "my.file"); $appender->layout(Log::Log4perl::Layout::SimpleLayout->new); $logger->add_appender($appender); $logger->info("this is an info"); all I want to do is log a message to a file, and have the level show up. I understood that is what the SimpleLayout is for . I'd like to do this without a configuration file. Running the code above shows the following message: Log::Log4perl configuration looks suspicious: No loggers defined

    Read the article

  • How can I decode UTF-16 data in Perl?

    - by Geo
    If I open a file ( and specify an encoding directly ) : open(my $file,"<:encoding(UTF-16)","some.file") || die "error $!\n"; while(<$file>) { print "$_\n"; } close($file); I can read the file contents nicely. However, if I do: use Encode; open(my $file,"some.file") || die "error $!\n"; while(<$file>) { print decode("UTF-16",$_); } close($file); I get the following error: UTF-16:Unrecognised BOM d at F:/Perl/lib/Encode.pm line 174 How can I make it work with decode?

    Read the article

  • Django models & Python class attributes

    - by Geo
    The tutorial on the django website shows this code for the models: from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) votes = models.IntegerField() Now, each of those attribute, is a class attribute, right? So, the same attribute should be shared by all instances of the class. A bit later, they present this code: class Poll(models.Model): # ... def __unicode__(self): return self.question class Choice(models.Model): # ... def __unicode__(self): return self.choice How did they turn from class attributes into instance attributes? Did I get class attributes wrong?

    Read the article

  • Can I use Lotus Notes to send mail ?

    - by Geo
    I have to code an app that at some point in time will have to send some reports using Lotus Notes. My questions are : Can I send mail through the Lotus Notes client, or something related to Lotus Notes ( a command line tool maybe? )? If so, where could I find information related to this? I would prefer not having to do it in C/C++, but if no other options' present, that would do. How can I find out the server's address? The GUI is not intuitive, and I can't find the server address. The server's located on another computer on the network.

    Read the article

  • How can I decode UTF-16 data in Perl when I don't know the byte order?

    - by Geo
    If I open a file ( and specify an encoding directly ) : open(my $file,"<:encoding(UTF-16)","some.file") || die "error $!\n"; while(<$file>) { print "$_\n"; } close($file); I can read the file contents nicely. However, if I do: use Encode; open(my $file,"some.file") || die "error $!\n"; while(<$file>) { print decode("UTF-16",$_); } close($file); I get the following error: UTF-16:Unrecognised BOM d at F:/Perl/lib/Encode.pm line 174 How can I make it work with decode?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >