Search Results

Search found 1099 results on 44 pages for 'arg geo'.

Page 15/44 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • 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

  • 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

  • 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

  • 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

  • Detecting struckout text in a cell using JExcelApi

    - by Geo
    I need to detect whether the text within a cell is struck out or not. I'm using this: Cell cc = sheet.getCell("B1"); CellFormat format = cc.getCellFormat(); System.out.println(format.getFont().isStruckout()); but I remember I read somewhere that CellFormat is deprecated and CellFeatures should be used instead. How could one find out whether a text is struck out using CellFeatures?

    Read the article

  • How to use Java on Google App Engine without exceeding minute quotas?

    - by Geo
    A very simple java code inside a doGet() servlet is getting more than a second of cpu time on GAE. I have read some quota related documentation and apparently I am not doing anything wrong. //Request the user Agent info String userAgent = req.getHeader("User-Agent"); I wanted to know what was using the CPU the most, I use a google help recommendation. //The two lines below will get the CPU before requesting User-Agent Information QuotaService qs = QuotaServiceFactory.getQuotaService(); long start = qs.getCpuTimeInMegaCycles(); //Request the user Agent info String userAgent = req.getHeader("User-Agent"); //The three lines below will get the CPU after requesting User-Agent Information // and informed it to the application log. long end = qs.getCpuTimeInMegaCycles(); double cpuSeconds = qs.convertMegacyclesToCpuSeconds(end - start); log.warning("CPU Seconds on geting User Agent: " + cpuSeconds); The only thing that the code above tells me is that inspecting the header will use more than a second (1000ms) of cpu time, which for Google is a warning on the log panel. That seems to be a very simple request and still is using more than a second of cpu. What I am missing?

    Read the article

  • Decoding utf16 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

  • SQL Server 2005 - Find minimum unused value within a range

    - by Geo Ego
    I have a situation similar to the following question: Insert Data Into SQL Table Where my scenario differs is that I have a non-auto-incrementing primary key field that can have a range between 1000 and 1999. We only have about a hundred values in it thus far, but the maximum value has already been taken (1999), and there are gaps in the numbering sequence. Thus, I need to find a value that is between 1000-1999 and not taken. For instance, if my current values are, for example, 1000, 1001, 1003, and 1999, I would want the query to return 1002.

    Read the article

  • When should I implement globalization and localization in C#?

    - by Geo Ego
    I am cleaning up some code in a C# app that I wrote and really trying to focus on best practices and coding style. As such, I am running my assembly through FXCop and trying to research each message it gives me to decide what should and shouldn't be changed. What I am currently focusing on are locale settings. For instance, the two errors that I have currently are that I should be specifying the IFormatProvider parameter for Convert.ToString(int), and setting the Dataset and Datatable locale. This is something that I've never done, and never put much thought into. I've always just left that overload out. The current app that I am working on is an internal app for a small company that will very likely never need to run in another country. As such, it is my opinion that I do not need to set these at all. On the other hand, doing so would not be such a big deal, but it seems like it is unneccessary and could hinder readability to a degree. I understand that Microsoft's contention is to use it if it's there, period. Well, I'm technically supposed to call Dispose() on every object that implements IDisposable, but I don't bother doing that with Datasets and Datatables, so I wonder what the practice is "in the wild."

    Read the article

  • What's the benefit of calling new on an object instance?

    - by Geo
    I'm reading [Programming Perl][1], and I found this code snippet: sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { color => "bay", legs => 4, owner => undef, @_, # Override previous attributes }; return bless $self, $class; } With constructors like this one, what's the benefit of calling new on an object instance? I assume that it's what it's for, right? My guess is that if anyone would want to write such a constructor, he would have to add some more code that copies the attributes of the first object to the one about to be created.

    Read the article

  • How we run a .NET 32-bit application in a 64-bit Windows server?

    - by Geo
    We are installing a third party application in one of our 64-bit Windows servers. This application apparently was build with the compiler option set to choose the platform at run time. When we run the application it gives us an error: System.BadImageFormatException: is not a valid Win32 application. I have seen in MSDN forums that in order to fix this error I have to build the application set to 32-bit, and that way it will run fine on a 64-bit server. I check on other StackOverflow links Other Posts. How to get around this situation? For everyone that wants to know more information: The application is running fine in a 32-bit test server. IIS version 6 using SQL Server Express 2005 On the Web Service Extension there are both Framework64\v2.0.50727\aspnet_isapi.dll and Framework\v2.0.50727\aspnet_isapi.dll

    Read the article

  • Why does System.Threading.Timer callback successfully update UI?

    - by Geo P
    I have several System.Threading.Timers on my form application with callbacks that update the UI...successfully - i.e. without throwing errors. I had built these earlier, before I knew that UI should not be updated on any thread other than the UI thread. Now I am confused as to why it does not throw cross-thread exceptions when I am updating UI on these separate threading.timer threads? I will be changing these callbacks so that the UI updates are invoked on UI thread, but I am curious as to why this works. Edit: My application is a WinForms Application.

    Read the article

  • Looking for a Silverlight 3 or 4 Menu control providing decent keyboard support.

    - by Geo
    I've an N-Tier application using Silverlight for the client. The customer as one particular request - I thought was more than reasonable: all actions – including menu navigation – has to be available through keyboard. When I tried Silverlight 4 I was surprised not to find any menu control so I downloaded several open source and commercial menu controls. I was very disappointed, after having searched for a couple of hours I didn’t manage to find any control that provide a decent keyboard support. Most controls provide no support or some basic support but not one control enabled to gain focus on the first item through the keyboard. You are able to use the keyboard (arrow keys) but you need first to select the control with the mouse! Not one control provided support for Keyboard shortcuts. Does anyone know of any Silverlight control providing descent support?

    Read the article

  • Can I programmatically find out if a drive is in use?

    - by Geo
    Is there any way of programmatically finding out if a mapped drive is currently in use? If I try to unmount the drive with net use, and the drive is being used, it will tell me that the drive is in use and prompt me to take further action. I'd like to be able to unmap drive automatically if it's no longer being used. The system is a Windows XP.

    Read the article

  • How can I use the eclipse indenter from my code?

    - by Geo
    I noticed the eclipse indenter has support for the latest version of java, and it would be nice if I could use that class to indent generated java source code. Is there a way of integrating it ? EDIT: I need to be able to include the code formatter in my code. No external calls. EDIT2: I've managed to get it working. You can read the story here. Thanks VonC !

    Read the article

  • How can I find out a servlet's URL?

    - by Geo
    Let's say I have this in my web.xml: <servlet> <description></description> <display-name>MainServ</display-name> <servlet-name>MainServ</servlet-name> <servlet-class>MainServ</servlet-class> </servlet> <servlet-mapping> <servlet-name>MainServ</servlet-name> <url-pattern>/MainServ</url-pattern> </servlet-mapping> Imagine I'm in that servlet's doGet method. Is there anyway of getting at the /MainServ value?

    Read the article

  • How can I securely check if a username is already taken?

    - by Geo
    I have a form where someone can create a new user. I'd like to add some AJAX to check if a username is taken, as soon as the input field loses focus. I'm not really sure how to go about this, as this could pave the way to bruteforce attack, since you could check for any username and see whether or not it exists. Any suggestions?

    Read the article

  • Where can I find documentation for Scala's delayed function calls?

    - by Geo
    I saw a delayed example in David Pollak's "Beginning Scala". I tried to adapt that, by trial and error. Here's what I have: def sayhello() = { println("hello") } def delaying(t: => Unit):Unit = { println("before call") t println("after call") } delaying(sayhello()) How would you delay a function/method that takes parameters? Why can't I use parantheses when I call t? Where can I find more documentation on delaying functions?

    Read the article

  • How can I get an error or a warning from a PreparedStatement?

    - by Geo
    I had an update like this: update table set col1=?,col2=?,col3=? where col4=?; and I filled it up like this: statement.setString(1,"some_value"); statement.setString(2,"some_value"); statement.setString(3,"some_value"); and I forgot to add a fourth value.I did a executeUpdate and of course nothing happened to the database. I spent about 1 hour debugging it, to see where it goes wrong. I then modified my code to print the SQLWarning object returned by the getWarnings method. It always returned null. I even modified the code to the buggy state it was, before I set the fourth parameter, and still no warning. Does anyone know how one can get an error/warning? If it matters, my Connection is set to autoCommit.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >