Daily Archives

Articles indexed Friday March 26 2010

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

  • shell script passing subset of arguments

    - by arav
    From the wrapper shell scripts i am calling the Java program. I want the Unix shell script to pass all the arguments to java program except the EMAIL argument. HOW Can i remove the EMAIL argument and pass the rest of the arguments to the java program. EMAIL argument can come at any position. valArgs() { until [ $# -eq 0 ]; do case $1 in -EMAIL) MAILFLAG=Y shift break ;; esac done } main() { valArgs "$@" $JAVA_HOME/bin/java -d64 -jar WEB-INF/lib/test.jar "$@"

    Read the article

  • Regular expressions and matching question marks in URLs

    - by James P.
    I'm having trouble finding a regular expression that matches the following String. Korben;http://feeds.feedburner.com/KorbensBlog-UpgradeYourMind?format=xml;1 One problem is escaping the question mark. Java's pattern matcher doesn't seem to accept \? as a valid escape sequence but it also fails to work with the tester at myregexp.com. Here's what I have so far: ([a-zA-Z0-9])+;http://([a-zA-Z0-9./-]+);[0-9]+ Any suggestions?

    Read the article

  • Why does my Sax Parser produce no results after using InputStream Read?

    - by Andy Barlow
    Hello, I have this piece of code which I'm hoping will be able to tell me how much data I have downloaded (and soon put it in a progress bar), and then parse the results through my Sax Parser. If I comment out basically everything above the //xr.parse(new InputSource(request.getInputStream())); line and swap the xr.parse's over, it works fine. But at the moment, my Sax parser tells me I have nothing. Is it something to do with is.read (buffer) section? Also, just as a note, request is a HttpURLConnection with various signatures. /*Input stream to read from our connection*/ InputStream is = request.getInputStream(); /*we make a 2 Kb buffer to accelerate the download, instead of reading the file a byte at once*/ byte [ ] buffer = new byte [ 2048 ] ; /*How many bytes do we have already downloaded*/ int totBytes,bytes,sumBytes = 0; totBytes = request.getContentLength () ; while ( true ) { /*How many bytes we got*/ bytes = is.read (buffer); /*If no more byte, we're done with the download*/ if ( bytes <= 0 ) break; sumBytes+= bytes; Log.v("XML", sumBytes + " of " + totBytes + " " + ( ( float ) sumBytes/ ( float ) totBytes ) *100 + "% done" ); } /* Parse the xml-data from our URL. */ // OLD, and works if comment all the above //xr.parse(new InputSource(request.getInputStream())); xr.parse(new InputSource(is)) /* Parsing has finished. */; Can anyone help me at all?? Kind regards, Andy

    Read the article

  • Why Kiln is based on Mercurial, and not other (D)VCS

    - by Jakub Narebski
    What were the reason for chosing Mercurial as a basis of FogCreek Kiln, a source control management system with tightly integrated code review, and FogBugz integration? Why Mercurial, and not other (distributed) version control system, like Bazaar, Git or Monotone, or creating own version control system like Fossil (distributed software configuration management, including bug tracking and wiki) did? What were features that make FogCreek choose Mercurial as Kiln engine?

    Read the article

  • How to make this .htaccess rule case insensitive?

    - by alex
    This is a rule in my .htaccess # those CSV files are under the DOCROOT ... so let's hide 'em <FilesMatch "\.CSV$"> Order Allow,Deny Deny from all </FilesMatch> I've noticed however that if there is a file with a lowercase or mixed case extension of CSV, it will be ignored by the rule and displayed. How do I make this case insensitive? I hope it doesn't come down to "\.(?:CSV|csv)$" (which I'm not sure would even work, and doesn't cover all bases) Note: The files are under the docroot, and are uploaded automatically there by a 3rd party service, so I'd prefer to implement a rule my end instead of bothering them. Had I set this site up though, I'd go for above the docroot. Thanks

    Read the article

  • next line in jython

    - by kdev
    Hi everyone , count_record=file.readline() count_prev=count_record[:-1] , i used this to read the previous line and it worked but now when i am using count_next=count_record[:+1] i am not able to read the next line , is there is way to do so read the next time . Thanks for your help

    Read the article

  • pylons on production server fedora 8

    - by stormdrain
    I'm interested in learning some python, and thought Pylons would be a good starting point (after spending 2 days trying to get django working -- to no avail). I have an Amazon EC2 instance with Fedora 8 on it. It is a bare-bones install. I am halfway through my second day of trying to get it to work. I have mod_wsgi installed. I have Apache (though that's a later task to tackle). I have easy_install, paster is working fine; basically all of the pre-requisites mentioned throughout the Pylons docs. I can't for the life of me get the thing to work. And I can't seem to find a coherent walkthough anywhere that lists all the steps necessary. There is tons of info out there, but it is all scattered. Wsgi this, python that. Google, google, google... "47 million results found for 'socket.error:(lol, 'Yous a goofs')". So, this is my latest attempt: apachectl -k stop cd /home/ paster create -t pylons test [blah blah.. ok] cd test nano development.ini [hmm, last time I changed the host from 127.0.0.1 to my domain name or url, it threw an error like socket.error: (99, 'Cannot assign requested address')... I'll just leave it] [open port 5000 on firewall] paster serve development.ini [firefox-url:5000] Firefox can't establish a connection to the server Doing these steps locally works as expected. This is just a test to see if I can get it to work at all, which I can't. If I get it to work, then is the task of getting it to work with apache. My madness is that I'd like to play around a little developing and deploying before diving into a full-fledged project. So far: self, I am dissapoint.

    Read the article

  • The best approach for multilingual user interface

    - by Mehdi Golchin
    I am working on a multilingual web application. I'm wondering how do i design the best user interface that the user can localize data for various languages? for instance, in making a page which its title is different in every lang, do i put a textbox for every one? it's not a suitable way to do(in case of 10 lang, the user has 10 textbox!!! too silly) what is your idea about this? Edit: i have no problem with globalization in my system. in fact, i'm looking for a good way for my interface design which user can enter his data to my forms in various langs. thanks in advance

    Read the article

  • Git on DreamHost still balking on big files even after I compiled with NO_MMAP=1

    - by fuzzy lollipop
    I compiled Git 1.7.0.3 on DreamHost with the NO_MMAP=1 option, I also supplied that option when I did the "make NO_MMAP=1 install". I have my paths set up correctly, which git reports my ~/bin dir which is correct, git --version returns the correct version. But when I try to do a "git push origin master" with "big" files ~150MB it always fails. Does anyone have an suggestions on how to get DreamHost to accept this "big" files from a git push?

    Read the article

  • How to install plesk using YUM on centOS 5 ?

    - by Tom
    Hi, i have a vps running centOS 5.4 LAMP and i want to install Plesk panel, so i've installed ART packages using SSH like they said here : http://www.atomicorp.com/channels/plesk/ , i tried to execute : yum install plesk but i got : Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirrors.netdna.com * atomic: www5.atomicorp.com * base: yum.singlehop.com * extras: mirror.steadfast.net * updates: www.gtlib.gatech.edu atomic | 1.9 kB 00:00 atomic/primary_db | 425 kB 00:00 Setting up Install Process No package plesk available. Nothing to do Means that no package called "plesk" found. the question is what's the command to install Plesk in my vps or is there another "easy" way to do it, because i'm not really pro in sys administration :) Thanks

    Read the article

  • What is the MM/DD/YYYY regular expression and how do I use it in php?

    - by zeckdude
    I found the regular expression for MM/DD/YYYY at http://www.regular-expressions.info/regexbuddy/datemmddyyyy.html but I don't think I am using it correctly. Here's my code: $date_regex = '(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d'; $test_date = '03/22/2010'; if(preg_match($date_regex, $test_date)) { echo 'this date is formatted correctly'; } else { echo 'this date is not formatted correctly'; } When I run this, it still echoes 'this date is not formatted correctly', when it should be saying the opposite. How do I set this regular expression up in php?

    Read the article

  • How do i jump to a breakpoint within gdb?

    - by Chris Smullian
    Hey folks! I'm new to gdb and I tried out the following: I set a breakpoint, which worked fine actually, but is there any possibility to jump immediately to that breakpoint without using "next" or "step". Using "next" or "step" takes really long to get to the final breakpoint. I wasn't able to find a faster way. Any help is preciated! regards chris smullian

    Read the article

  • How to let the user choose between typing price inclusive VAT or exclusive VAT in TextField?

    - by Sanoj
    I am implementing an back-office application where the user type in prices for products. Sometimes it is preferred to type the price inclusive value-added-tax, VAT and sometimes exclusive VAT. How do I best let the user choose between the inclusive or exclusive VAT in a usability perspective? I could have two TextFields above eachother one inclusive VAT and one exclusive, and reflect the input. But I don't think that reflecting the input in another TextField at realtime is good when it comes to usability, it distracts the user. I could also have two Radiobuttons above the TextField or below, or maybe besides the TextField that let the user make the choice. Or should I have a single button for turning between inclusive/exclusive VAT? like On/Off-buttons. But what text should I have on the button and how should the button be designed? I think this is good because it takes less space and it is easy to have it close to the TextField, but it's very hard to design a good button in a usability perspective. Please give me some recommendations. Maybe someone of you works with usability or have seen a similar problem.

    Read the article

  • Importing a function/class from a Python module of the same name

    - by Brendan
    I have a Python package mymodule with a sub-package utils (i.e. a subdirectory which contains modules each with a function). The functions have the same name as the file/module in which they live. I would like to be able to access the functions as follows, from mymodule.utils import a_function Strangely however, sometimes I can import functions using the above notation, however other times I cannot. I have not been able to work out why though (recently, for example, I renamed a function and the file it was in and reflected this rename in the utils.__init__.py file but it no longer imported as a functions (rather as a module) in one of my scripts. The utils.__init__.py reads something like, __all__ = ['a_function', 'b_function' ...] from a_function import a_function from b_function import b_function ... mymodule.__init__.py has no reference to utils Ideas?

    Read the article

  • rubygem Twitter4R Issues

    - by Leonardo Dario Perna
    Hi everyone, I'm trying to get started with twitter4r but I'm having some issues: Why I can't load the gem in IRB? $ sudo gem install twitter4r Successfully installed twitter4r-0.3.2 1 gem installed Installing ri documentation for twitter4r-0.3.2... Installing RDoc documentation for twitter4r-0.3.2... $ irb require 'rubygems' = false require 'twitter4r' LoadError: no such file to load -- twitter4r from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from (irb):2 I've downloaded the http://files.rubyforge.vm.bytemark.co.uk/twitter4r/twitter4rails.post-0_2_4.zip app and it works only with twitter4r-0.2.4 and NOT with last version twitter4r-0.3.2: $ script/server ./script/../config/boot.rb:26:Warning: Gem::SourceIndex#search support for String patterns is deprecated, use #find_name = Booting Mongrel (use 'script/server webrick' to force WEBrick) = Rails application starting on http://0.0.0.0:3000 = Call with -d to detach = Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... Exiting /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- twitter/rails (MissingSourceFile) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:495:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:342:in `new_constants_in' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:495:in `require' from /Users/leonardodarioperna/Projects/Kaaaki/marrakaaaki/ twitter4rails.post-0_2_4/config/environment.rb:64 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:495:in `require' ... 23 levels... from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3 Last thing, in the /config/environment.rb I need to specify: RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION if I use my last rails version: RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION I get this error: $ script/server -p3002 = Booting Mongrel = Rails 2.3.4 application starting on http://0.0.0.0:3000 /Library/Ruby/Site/1.8/rubygems.rb:280:in `activate': can't activate activerecord (= 1.15.6, runtime) for [], already activated activerecord-2.3.4 for ["rails-2.3.4"] (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:35:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:156:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:521:in `new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:156:in `require' from /Library/Ruby/Gems/1.8/gems/twitter4r-0.2.4/lib/twitter/rails.rb: 6 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/ active_support/dependencies.rb:156:in `require' ... 8 levels... from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/commands/server.rb: 84 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3 And that's all :-) Thank you!

    Read the article

  • I have having following warning in gcc compilation in 32 bit architecture but not having any such wa

    - by thetna
    symbol.c: In function 'symbol_FPrint': symbol.c:1209: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL' symbol.c: In function 'symbol_FPrintOtter': symbol.c:1236: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL' symbol.c:1239: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL' symbol.c:1243: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL' symbol.c:1266: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL' In symbol.c 1198 #ifdef CHECK 1199 else { 1200 misc_StartErrorReport(); 1201 misc_ErrorReport("\n In symbol_FPrint: Cannot print symbol.\n"); 1202 misc_FinishErrorReport(); 1203 } 1204 #endif 1205 } 1206 else if (symbol_SignatureExists()) 1207 fputs(symbol_Name(Symbol), File); 1208 else 1209 fprintf(File, "%ld", Symbol); 1210 } And SYMBOL is defined as: typedef size_t SYMBOL When i replaced '%ld' with '%zu' , i got the following warning: symbol.c: In function 'symbol_FPrint': symbol.c:1209: warning: ISO C90 does not support the 'z' printf length modifier Note: From here it has been edited on 26th of march 2010 and and following problem has beeen added because of its similarity to the above mentioned problem. I have following statement: printf("\n\t %4d:%4d:%4d:%4d:%4d:%s:%d", Index, S->info, S->weight, Precedence[Index],S->props,S->name, S->length); The warning I get while compiling in 64 bit architecture is : format ‘%4d’ expects type ‘int’, but argument 5 has type ‘size_t’ here are the definitions of parameter: NAT props; typedef unsigned int NAT; How can i get rid of this so that i can compile without warning in 32 and 64 bit architecture? What can be its solution?

    Read the article

  • Retry web service call if authentication failure requires re-login

    - by Pete
    I'm consuming a web service from C#, and the web service requires a login call and then uses cookie sessions. The web service will time out sessions after a certain timeframe, after which the client will have to re-login. I'd like to find a way to automatically catch the soap fault the service sends back in this scenario, and handle it by re-logging in and then retrying the previously attempted call. I would prefer to do this somehow automatically for all the web service methods in question, rather than having to manually wrap the calls with the retry logic. Suggestions?

    Read the article

  • Can I apply a texture to UIToolbar?

    - by Ben
    I tried doing this: [toolbar setTint:[UIColor colorWithPatternImage:[UIImage imageNamed:@"thingFromMyBundle.png"]]]; but it just ended up black. At first I assumed you weren't allowed to "tint" with a texture, but I've seen apps recently that can do this. Am I missing something? Thanks.

    Read the article

  • Django templates crashes with no sense

    - by user233323
    Hello I'm trying to use google visualization API along with django templates system. I got an error that don't know how to fix. The error is the following: invalid_block_tag raise self.error(token, "Invalid block tag: '%s'" % command) django.template.TemplateSyntaxError: Invalid block tag: 'endfor' The code is: function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('date', 'time'); data.addColumn('number', 'x'); data.addColumn('number', 'y'); data.addColumn('number', 'z'); data.addRows([ {% for d in datos &} [new Date({{d.instante|date:"Y, m, d, H, i, s"}}), {{d.x}}, {{d.y}}, {{d.z}}] {% if not forloop.last %},{% endif %} ]); {% endfor %} var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div')); chart.draw(data, {displayAnnotations: true}); } Thanks you all!

    Read the article

  • Does RSI affect legs?

    - by Peter Coulton
    Wikipedia says that RSI is also called 'work related upper limb disorder', but I'm getting serious knee pain when I'm sat working for long periods (18+ hours). Has anyone else experienced this, and have you found a solution?

    Read the article

  • How can I keep a hash sorted?

    - by srk
    use strict; use warnings; my @aoh =( { 3 => 15, 4 => 8, 5 => 9, }, { 3 => 11, 4 => 25, 5 => 6, }, { 3 => 5, 4 => 18, 5 => 5, }, { 0 => 16, 1 => 11, 2 => 7, }, { 0 => 21, 1 => 13, 2 => 31, }, { 0 => 11, 1 => 14, 2 => 31, }, ); #declaring a new array to store the sorted hashes my @new; print "\n-------------expected output------------\n"; foreach my $href (@aoh) { #i want a new array of hashes where the hashes are sorted my %newhash; my @sorted_keys = sort {$href->{$b} <=> $href->{$a} || $b <=> $a} keys %$href; foreach my $key (@sorted_keys) { print "$key => $href->{$key}\n"; $newhash{$key} = $href->{$key}; } print "\n"; push(@new,\%newhash); } print "-----------output i am getting---------------\n"; foreach my $ref(@new) { my @skeys = skeys %$ref; foreach my $key (@skeys) { print "$key => $ref->{$key}\n" } print "\n"; } The output of the program : -------------expected output------------ 3 => 15 5 => 9 4 => 8 4 => 25 3 => 11 5 => 6 4 => 18 5 => 5 3 => 5 0 => 16 1 => 11 2 => 7 2 => 31 0 => 21 1 => 13 2 => 31 1 => 14 0 => 11 -----------output i am getting--------------- 4 => 8 3 => 15 5 => 9 4 => 25 3 => 11 5 => 6 4 => 18 3 => 5 5 => 5 1 => 11 0 => 16 2 => 7 1 => 13 0 => 21 2 => 31 1 => 14 0 => 11 2 => 31 Please tell me what am i doing wrong in storing the hashes into a new array.. how do i achieve what i want.. ? Thanks in advance...

    Read the article

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