Search Results

Search found 1780 results on 72 pages for '400'.

Page 18/72 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Using mencoder to convert videos for your mobile phone.

    - by Manu
    I Have a LG Viewty (actually a KP501), and I use mencoder (part of mplayer) to convert videos, using the following script : mencoder "input.avi" -ovc lavc -oac lavc -lavcopts acodec=mp3:abitrate=128 -vop scale=400:240 -ffourcc DX50 -o "output.avi" Do you have similar mencoder scripts, for other phones ?

    Read the article

  • Apache LimitExcept not behaving as expected

    - by Farseeker
    I have the following directive in my Apache httpd.conf: <LimitExcept OPTIONS PROPFIND REPORT> deny from all </LimitExcept> OPTIONS and PROPFIND work as expected, but REPORT returns 400: Bad Request. Removing the LimitExcept alltogether and everything works as expected. Any ideas on why this might be? (This is the implementation of my question here).

    Read the article

  • Reducing apache VIRT and RES memory usage

    - by lisa
    On a quad-core server with 8GB of ram I have apache processes that use up to 2.3GB RES memory and 2.6GB VIRT memory. Here is a copy of the top -c command http://imgur.com/x8Lq9.png Is there a way to reduct the memory usage for these apache processes? These are my httpd.conf settings Timeout 160 TraceEnable Off ServerSignature Off ServerTokens ProductOnly FileETag None StartServers 6 <IfModule prefork.c> MinSpareServers 4 MaxSpareServers 16 </IfModule> ServerLimit 400 MaxClients 320 MaxRequestsPerChild 10000 KeepAlive On KeepAliveTimeout 4 MaxKeepAliveRequests 80

    Read the article

  • Weird Excel bar disgram behaviour

    - by Simon
    Hi I have a very simple question. I wanna have a diagram with the following table Apple 30 40 50 Pears 200 300 400 Bananas 10 20 30 The weird thing, when I try to draw a bar diagram the order of the bars change. So Excel draws me first the Bananas, the the pears and finally the apple bar... Is there anyway to tell Excel 2003 that it keeps the order? Thank you very much

    Read the article

  • How can Rackspace beat DigitalOcean's Pricepoint? [on hold]

    - by Matt Jensen
    I have recently discovered Digital Ocean and I have found it to be a relatively nice experience for small staging servers, and the thought occurred to me, why am I paying $267~ for a server on Rackspace (40GB RAM, 160 GB Drive, 2 vCPUs, 400 Mb/s) when Digital Ocean offers a server for $40 (40 GB RAM, 60GB Drive [storage is not a concern of mine], 2 vCPUs, ?Mb/s)? Does Rackspace offer some kind of obvious advantages in Transfer speed/bandwidth? My applications are small startups that for the immediate future will only have about 200-300 concurrent users at once.

    Read the article

  • serving mp3s to mobile devices is flooding nginx with partial requests

    - by drumfire
    I am serving mp3s with a minimalistic nginx server. What I see in my log files is that there are a lot of requests, in particular from AppleCoreMedia and sometimes Android useragents, that flood the server with short requests. Sometimes they keep requesting to download the same partial content for a very long time; sometimes more than an hour. For example: "GET /somefile.mp3 HTTP/1.1" 206 33041 "AppleCoreMedia/1.0.0.9B206 (iPhone; U; CPU OS 5_1_1 like Mac OS X; en_us)" "GET /somefile.mp3 HTTP/1.1" 206 33041 "AppleCoreMedia/1.0.0.9B206 (iPhone; U; CPU OS 5_1_1 like Mac OS X; en_us)" "GET /somefile.mp3 HTTP/1.1" 206 33041 "AppleCoreMedia/1.0.0.9B206 (iPhone; U; CPU OS 5_1_1 like Mac OS X; en_us)" [...] I also get a lot, but not as much, of these: "-" 400 0 "-" "-" 400 0 "-" The IP addresses are always from clients that start downloading shortly after that request, usually they have roughly the same UserAgent as in the first example. emphasized text I have enabled server throttling and connection limits in nginx to limit the huge amount of log entries from equivalent IPs at least somewhat. There was a performance issue when I saw the same behaviour on the previous server that used Apache. I installed nginx on a better server then moved the site. When Apache could not handle more connections from the increasing number of clients effectively that server was ddossed. There was no bandwidth issue with already connected clients and I don't know if the already connected clients were using more than one connection at a time. Please tell me: Are clients that appear to get stuck on a download a Bad Thing™ I heard people say their mobile bandwidth use was much higher than they could account for. I'm thinking this type of client behaviour can account for that. And costs us more bandwidth too. Which up to date alternatives exist out there that can handle serving this type of data better than plain HTTP? Useful general insights for someone who just came into this field straight out of the late 90s. :-)

    Read the article

  • Documenting Client Infrastructure

    - by Richard B
    Working on a new project, and need some documentation advice. I need to be able to document ~ 400 client sites to track assets, setup, hardware layout, network layout, etc. We want to have photos, maps, etc. wherever possible. We need this for a call center environment. Has anyone found any off the shelf software that performs this functionality, or are we on our own to develop the tools that we require?

    Read the article

  • 'Can't convert nil into String' error upon Puppet run

    - by Adrian
    When attempting to use modules copied into the Puppet modules directory, my puppet client returns ' Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert nil in String' errors when connecting to the Puppet master server. [root@puppetmaster modules]# rpm -qa *puppet* puppet-2.7.18-1.el6.noarch puppet-server-2.7.18-1.el6.noarch [root@puppetmaster modules]# uname -sr Linux 2.6.32-279.el6.x86_64 Code all checks out and is valid. SELinux is turned on.

    Read the article

  • How to override puppet class arguments in child node?

    - by Jon Skarpeteig
    I'm attempting to accomplish something like the below: node 'basenode' { class { 'puppet' : disable => false, } } node 'child' inherits 'basenode' { class { 'puppet' : disable => true, } } This gives me: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Class[Puppet] is already defined How can I override this setting for this single node, and still have a parameterised class?

    Read the article

  • Backing up oracle to TAPE

    - by andreas
    Hi folks, our Oracle database has grown very large as of late ~= 400 - 500 GB and saving to filesystem is not scalable anymore to us. We are looking at using RMAN to backup to tape (directly, not to fs then tape). Anyone can shed a light on this please?

    Read the article

  • What brand of wireless router would be compatible with many broadband modems and easy to use?

    - by Junior Mayhé
    Good afternoon I'm having too many intermittent problems with my DLINK DIR 400 router: Wireless connection is lost with no reason. Perhaps the current router is incompatible with this Scientific Atlanta cable modem DPC 2100R2. Scientific Atlanta is a Cisco company, but I'm really worried about this combination DLink - Cisco. Could anyone recommend me a good wireless router for Windows Vista / Windows 7? Thank you

    Read the article

  • What brand of wireless router would be compatible with many broadband modems and easy to use?

    - by Junior Mayhé
    Good afternoon I'm having too many intermittent problems with my DLINK DIR 400 router: Wireless connection is lost with no reason. Perhaps the current router is incompatible with this Scientific Atlanta cable modem DPC 2100R2. Scientific Atlanta is a Cisco company, but I'm really worried about this combination DLink - Cisco. Could anyone recommend me a good wireless router for Windows Vista / Windows 7? Thank you

    Read the article

  • git private server error: "Permission denied (publickey)."

    - by goddfree
    I followed the instructions here in order to set up a private git server on my Amazon EC2 instance. However, I am having problems when trying to SSH into the git account. Specifically, I get the error "Permission denied (publickey)." Here are the permissions of my files/folders on the EC2 server: drwx------ 4 git git 4096 Aug 13 19:52 /home/git/ drwx------ 2 git git 4096 Aug 13 19:52 /home/git/.ssh -rw------- 1 git git 400 Aug 13 19:51 /home/git/.ssh/authorized_keys Here are the permissions of my files/folders on my own computer: drwx------ 5 CYT staff 170 Aug 13 14:51 .ssh -rw------- 1 CYT staff 1679 Aug 13 13:53 .ssh/id_rsa -rw-r--r-- 1 CYT staff 400 Aug 13 13:53 .ssh/id_rsa.pub -rw-r--r-- 1 CYT staff 1585 Aug 13 13:53 .ssh/known_hosts When checking my logs in /var/log/secure, I used to get the following error message every time I tried to SSH: Authentication refused: bad ownership or modes for file /home/git/.ssh/authorized_keys However, after making a few permission changes, I no longer get this error message. Despite this, I am still getting the "Permission denied (publickey)." message every time I try to SSH. The command I am using to SSH is ssh -T git@my-ip. Here is the full log I get when I run ssh -vT [email protected]: OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: Connecting to my-ip [my-ip] port 22. debug1: Connection established. debug1: identity file /Users/CYT/.ssh/id_rsa type -1 debug1: identity file /Users/CYT/.ssh/id_rsa-cert type -1 debug1: identity file /Users/CYT/.ssh/id_dsa type -1 debug1: identity file /Users/CYT/.ssh/id_dsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2 debug1: match: OpenSSH_6.2 pat OpenSSH* debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr [email protected] none debug1: kex: client->server aes128-ctr [email protected] none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA 08:ad:8a:bc:ab:4d:5f:73:24:b2:78:69:46:1a:a5:5a debug1: Host 'my-ip' is known and matches the RSA host key. debug1: Found key in /Users/CYT/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /Users/CYT/.ssh/id_rsa debug1: Trying private key: /Users/CYT/.ssh/id_dsa debug1: No more authentication methods to try. Permission denied (publickey). I have spent a few hours going through threads on various sites, including SO and SF, looking for a solution. It seems that the permissions for my files are all okay, but I just can't figure out the problem. Any help would be greatly appreciated. Edit: EEAA: Here are the outputs you requested: $ getent passwd git git:x:503:504::/home/git:/bin/bash $ grep ssh ~git/.ssh/authorized_keys | wc -l grep: /home/git/.ssh/authorized_keys: Permission denied 0

    Read the article

  • Is 768Mb RAM @ 333Mhz faster or slower than 512Mb RAM @ 400Mhz?

    - by Peter
    I have a simple question, but am not a hardware specialist. I have a small low-budget server with 512 Mb SD RAM, 400 Mhz. I have an extra 256 lying around, but it's 333 Mhz. I know I can add it to the system, and that it would automatically adjust the 400Mhz to 333Mhz. But my question is, which is faster/better for performance: 512 at 400Mhz, or 768 at 333Mhz?

    Read the article

  • What windows licence can I purchase to run a web service in intranet? [closed]

    - by user63580
    Possible Duplicate: Can you help me with my software licensing question? One of my customers wants me to provide my web-app to be installed in his local area network, behind the firewall - it will not be accessible from the Internet. They require the server to be run on windows (linux is not acceptable). What windows licence shoud I purchase to run my web-based app for 400 users not violating Microsoft licencing terms?

    Read the article

  • Automatic picture size adjustment

    - by CChriss
    Does anyone know of a free utility that allows you to paste into it a graphics file (any type would work for me, jpg, bmp, png, etc) and it will size the file to within a preset size boundary? For instance, if I preset it to resize files to be a maximum of 400 wide by 300 tall, and I paste in a file 500x500, it would shrink the file to fit within the 300 tall limit. Thanks.

    Read the article

  • Creating a fallback error page for nginx when root directory does not exist

    - by Ruirize
    I have set up an any-domain config on my nginx server - to reduce the amount of work needed when I open a new site/domain. This config allows me to simply create a folder in /usr/share/nginx/sites/ with the name of the domain/subdomain and then it just works.™ server { # Catch all domains starting with only "www." and boot them to non "www." domain. listen 80; server_name ~^www\.(.*)$; return 301 $scheme://$1$request_uri; } server { # Catch all domains that do not start with "www." listen 80; server_name ~^(?!www\.).+; client_max_body_size 20M; # Send all requests to the appropriate host root /usr/share/nginx/sites/$host; index index.html index.htm index.php; location / { try_files $uri $uri/ =404; } recursive_error_pages on; error_page 400 /errorpages/error.php?e=400&u=$uri&h=$host&s=$scheme; error_page 401 /errorpages/error.php?e=401&u=$uri&h=$host&s=$scheme; error_page 403 /errorpages/error.php?e=403&u=$uri&h=$host&s=$scheme; error_page 404 /errorpages/error.php?e=404&u=$uri&h=$host&s=$scheme; error_page 418 /errorpages/error.php?e=418&u=$uri&h=$host&s=$scheme; error_page 500 /errorpages/error.php?e=500&u=$uri&h=$host&s=$scheme; error_page 501 /errorpages/error.php?e=501&u=$uri&h=$host&s=$scheme; error_page 503 /errorpages/error.php?e=503&u=$uri&h=$host&s=$scheme; error_page 504 /errorpages/error.php?e=504&u=$uri&h=$host&s=$scheme; location ~ \.(php|html) { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_intercept_errors on; } } However there is one issue that I'd like to resolve, and that is when a domain that doesn't have a folder in the sites directory, nginx throws an internal 500 error page because it cannot redirect to /errorpages/error.php as it doesn't exist. How can I create a fallback error page that will catch these failed requests?

    Read the article

  • PHP fb error posting story to user wall

    - by user237925
    I got an error from last 6 hrs. and stuck on it.While running my code i got this error again and again "Request failed with code: 400, message: {"error":{"message":"(#100) Object Invalid Value: Object at URL 'http://stayingnear.com/index.php?r=apartment\u00252Fview&id=1' of type 'stayingnearapp:apartment' is invalid because the given value '7.2853779052137E+14' for property 'fb:app_id' could not be parsed as type 'fbid'.","type":"OAuthException","code":100}}" is it the access token problem or what,and how can i handle this problem ?

    Read the article

  • How to use Nexus groups with Hudson to deploy artifacts post-build?

    - by John
    Hi there. I'm currently setting up Hudson to push artifacts to my Nexus repository upon succesful builds. Unfortunately I am having some trouble with getting Hudson to deploy using Nexus groups. I have two groups, upbeat.nexus (private) and public.nexus (public). I've set up the associated repositories in Nexus already. Here's my settings.xml: <settings> <mirrors> <mirror> <id>upbeat.nexus</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8099/nexus/content/groups/upbeat</url> </mirror> <mirror> <id>public.nexus</id> <mirrorOf>*</mirrorOf> <url>http://localhost:8099/nexus/content/groups/public</url> </mirror> </mirrors> <profiles> <profile> <id>upbeat.nexus</id> <repositories> <repository> <id>upbeat.central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> </profile> <profile> <id>public.nexus</id> <repositories> <repository> <id>public.central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> </profile> </profiles> <servers> <server> <id>upbeat.nexus</id> <username>build</username> <password></password> </server> <server> <id>public.nexus</id> <username>build</username> <password></password> </server> </servers> <activeProfiles> <activeProfile>upbeat.nexus</activeProfile> <activeProfile>public.nexus</activeProfile> </activeProfiles> In Hudson, when setting the "Deploy artifacts to Maven repository", I need to specify the repository URL and the repository ID. I've set the repository ID to "public.nexus" but if I set the URL to http://forge.upbeat.no/nexus/content/repositories/public and the ID to public.nexus I get the following error: Deploying artifacts to http://forge.upbeat.no/nexus/content/repositories/public Deploying the main artifact pom.xml [INFO ] Retrieving previous build number from public.nexus [INFO ] repository metadata for: 'snapshot com.upbeat.appl:skuldweb:1.0-SNAPSHOT' could not be found on repository: public.nexus, so will be created ERROR: Error deploying artifact: Failed to transfer file: http://forge.upbeat.no/nexus/content/repositories/public/com/upbeat/appl/skuldweb/1.0-SNAPSHOT/skuldweb-1.0-SNAPSHOT.pom. Return code is: 400 org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error deploying artifact: Failed to transfer file: http://forge.upbeat.no/nexus/content/repositories/public/com/upbeat/appl/skuldweb/1.0-SNAPSHOT/skuldweb-1.0-SNAPSHOT.pom. Return code is: 400 at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:94) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79) at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:109) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:598) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528) at hudson.model.Run.run(Run.java:1264) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:306) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:124) Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://forge.upbeat.no/nexus/content/repositories/public/com/upbeat/appl/skuldweb/1.0-SNAPSHOT/skuldweb-1.0-SNAPSHOT.pom. Return code is: 400 at org.apache.maven.wagon.providers.http.LightweightHttpWagon.put(LightweightHttpWagon.java:172) at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:244) at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:160) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80) ... 12 more Finished: FAILURE Any tips on how to deploy to a group so I don't have to specify (in Hudson) whether or not I am building a snapshot or a release version, and instead have it look at the version-tag in the pom to automatically place the artifact in the correct repository?

    Read the article

  • Can't focus fancybox iframe input

    - by bswinnerton
    So I'm using fancybox to load up a login iframe, and I would like it onComplete to bring focus to the username field. If someone could take a look at this code and let me know what's wrong, that'd be great. Gracias. /* Function to resize the height of the fancybox window */ (function($){ $.fn.resize = function(width, height) { if (!width || (width == "inherit")) inner_width = parent.$("#fancybox-inner").width(); if (!height || (height == "inherit")) inner_height = parent.$("#fancybox-inner").height(); inner_width = width; outer_width = (inner_width + 14); inner_height = height; outer_height = (inner_height + 14); parent.$("#fancybox-inner").css({'width':inner_width, 'height':inner_height}); parent.$("#fancybox-outer").css({'width':outer_width, 'height':outer_height}); } })(jQuery); $(document).ready(function(){ var pasturl = parent.location.href; $("a.iframe#register").fancybox({ 'transitionIn' : 'fade', 'transitionOut' : 'fade', 'speedIn' : 600, 'speedOut' : 350, 'width' : 450, 'height' : 385, 'scrolling' : 'no', 'autoScale' : false, 'autoDimensions' : false, 'overlayShow' : true, 'overlayOpacity' : 0.7, 'padding' : 7, 'hideOnContentClick': false, 'titleShow' : false, 'onStart' : function() { $.fn.resize(450,385); }, 'onComplete' : function() { $("#realname").focus(); }, 'onClosed' : function() { $(".warningmsg").hide(); $(".errormsg").hide(); $(".successfulmsg").hide(); } }); $("a.iframe#login").fancybox({ 'transitionIn' : 'fade', 'transitionOut' : 'fade', 'speedIn' : 600, 'speedOut' : 350, 'width' : 400, 'height' : 250, 'scrolling' : 'no', 'autoScale' : false, 'overlayShow' : true, 'overlayOpacity' : 0.7, 'padding' : 7, 'hideOnContentClick': false, 'titleShow' : false, 'onStart' : function() { $.fn.resize(400,250); }, 'onComplete' : function() { $("#login_username").focus(); }, 'onClosed' : function() { $(".warningmsg").hide(); $(".errormsg").hide(); $(".successfulmsg").hide(); } }); $("#register").click(function() { $("#login_form").hide(); $(".registertext").hide(); $.fn.resize(450,385); $("label").addClass("#register_form label"); }); $("#login").click(function() { $.fn.resize(400,250); $("label").addClass("#login_form label"); }); $("#register_form").bind("submit", function() { $(".warningmsg").hide(); $(".errormsg").hide(); $(".successfulmsg").hide(); if ($("#realname").val().length < 1 || $("#password").val().length < 1 || $("#username").val().length < 1) { $("#no_fields").addClass("warningmsg").show().resize(inherit,405); return false; } if ($("#password").val() != $("#password2").val()) { $("#no_pass_match").addClass("errormsg").show().resize(); return false; } $.fancybox.showActivity(); $.post( "../../admin/users/create_submit.php", { realname:$('#realname').val(), email:$('#email').val(), username:$('#username').val(), password:MD5($('#password').val()), rand:Math.random() } ,function(data){ if(data == "OK"){ $(".registerbox").hide(); $.fancybox.hideActivity(); $.fn.resize(inherit,300); $("#successful_login").addClass("successfulmsg").show(); } else if(data == "user_taken"){ $.fancybox.hideActivity(); $("#user_taken").addClass("errormsg").show().resize(inherit,405); $("#username").val(""); } else { $.fancybox.hideActivity(); document.write("Well, that was weird. Give me a shout at [email protected]."); } return false; }); return false; }); $("#login_form").bind("submit", function() { $(".warningmsg").hide(); $(".errormsg").hide(); $(".successfulmsg").hide(); if ($("#login_username").val().length < 1 || $("#login_password").val().length < 1) { $("#no_fields").addClass("warningmsg").show().resize(inherit,280); return false; } $.fancybox.showActivity(); $.post( "../../admin/users/login_submit.php", { username:$('#login_username').val(), password:MD5($('#login_password').val()), rand:Math.random() } ,function(data){ if(data == "authenticated"){ $(".loginbox").hide(); $(".registertext").hide(); $.fancybox.hideActivity(); $("#successful_login").addClass("successfulmsg").show(); parent.document.location.href=pasturl; } else if(data == "no_user"){ $.fancybox.hideActivity(); $("#no_user").addClass("errormsg").show().resize(); $("#login_username").val(""); $("#login_password").val(""); } else if(data == "wrong_password"){ $.fancybox.hideActivity(); $("#wrong_password").addClass("warningmsg").show().resize(); $("#login_password").val(""); } else { $.fancybox.hideActivity(); document.write("Well, that was weird."); } return false; }); return false; }); }); And here is the HTML: <p><a class="iframe" id="login" href="/login/">Login</a></p>

    Read the article

  • Unix: how to have delimiter as "\t&\t" in paste-tool?

    - by HH
    Results are in clean files. I want to get them to latex-table format with paste. So how can I have a delimiter "\t&\t"? or is there some Latex tool? Pasting Columnwise to have \t&\t delimiter $ paste -d'\t\&\t' d d_powered_-2 rad 5.0 400.0&384.5 7.5 204.1&184.5 10.0 100.0&115.5 15.0 44.4&58.2 20.0 25.0&45.0 25.0 16.0&38.8 30.0 11.1&33.3 35.0 8.2&34.4 37.0 7.3&34.1 40.0 6.2&34.1 $ paste d d_powered_-2 rad 5.0 400.0 384.5 7.5 204.1 184.5 10.0 100.0 115.5 15.0 44.4 58.2 20.0 25.0 45.0 25.0 16.0 38.8 30.0 11.1 33.3 35.0 8.2 34.4 37.0 7.3 34.1 40.0 6.2 34.1

    Read the article

  • replacing strings with regex in javascript

    - by koko
    Hi, regex is bugging me right now. I simply want to replace the range=100 in a string like var string = '...commonstringblabla&range=100&stringandsoon...'; with ...commonstringblabla&range=400&stringandsoon... I successfully matched the "range=100"-part with alert( string.match(/range=100/) ); But when I try to replace it string.replace(/range=100/, 'range=400'); nothing happens, the string still has the range=100 in it... I don't get it, please help.

    Read the article

  • Java textfile I/O problem

    - by KáGé
    Hello, I have to make a torpedo game for school with a toplist for it. I want to store it in a folder structure near the JAR: /Torpedo/local/toplist/top_i.dat, where the i is the place of that score. The files will be created at the first start of the program with this call: File f; f = new File(Toplist.toplistPath+"/top_1.dat"); if(!f.exists()){ Toplist.makeToplist(); } Here is the toplist class: package main; import java.awt.Color; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.prefs.Preferences; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTextArea; public class Toplist { static String toplistPath = "./Torpedo/local/toplist"; //I know it won't work this easily, it's only to get you the idea public static JFrame toplistWindow = new JFrame("Torpedó - [TOPLISTA]"); public static JTextArea toplist = new JTextArea(""); static StringBuffer toplistData = new StringBuffer(3000); public Toplist() { toplistWindow.setSize(500, 400); toplistWindow.setLocationRelativeTo(null); toplistWindow.setResizable(false); getToplist(); toplist.setSize(400, 400); toplist.setLocation(0, 100); toplist.setColumns(5); toplist.setText(toplistData.toString()); toplist.setEditable(false); toplist.setBackground(Color.WHITE); toplistWindow.setLayout(null); toplistWindow.setVisible(true); } public Toplist(Player winner) { //this is to be done yet, this will set the toplist at first and then display it toplistWindow.setLayout(null); toplistWindow.setVisible(true); } /** * Creates a new toplist */ public static void makeToplist(){ new File(toplistPath).mkdir(); for(int i = 1; i <= 10; i++){ File f = new File(toplistPath+"/top_"+i+".dat"); try { f.createNewFile(); } catch (IOException e) { JOptionPane.showMessageDialog(new JFrame(), "Fájl hiba: toplista létrehozása", "Error", JOptionPane.ERROR_MESSAGE); } } } /** * If the score is a top score it inserts it into the list * * @param score - the score to be checked */ public static void setToplist(int score, Player winner){ BufferedReader input = null; PrintWriter output = null; int topscore; for(int i = 1; i <= 10; i++){ try { input = new BufferedReader(new FileReader(toplistPath+"/top_"+i+",dat")); String s; topscore = Integer.parseInt(input.readLine()); if(score > topscore){ for(int j = 9; j >= i; j--){ input = new BufferedReader(new FileReader(toplistPath+"/top_"+j+".dat")); output = new PrintWriter(new FileWriter(toplistPath+"/top_"+(j+1)+".dat")); while ((s = input.readLine()) != null) { output.println(s); } } output = new PrintWriter(new FileWriter(toplistPath+"/top_"+i+".dat")); output.println(score); output.println(winner.name); if(winner.isLocal){ output.println(Torpedo.session.remote.name); }else{ output.println(Torpedo.session.remote.name); } output.println(Torpedo.session.mapName); output.println(DateUtils.now()); break; } } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(new JFrame(), "Fájl hiba: toplista frissítése", "Error", JOptionPane.ERROR_MESSAGE); } catch (IOException e) { JOptionPane.showMessageDialog(new JFrame(), "Fájl hiba: toplista frissítése", "Error", JOptionPane.ERROR_MESSAGE); } finally { if (input != null) { try { input.close(); } catch (IOException e) { JOptionPane.showMessageDialog(new JFrame(), "Fájl hiba: toplista frissítése", "Error", JOptionPane.ERROR_MESSAGE); } } if (output != null) { output.close(); } } } } /** * This loads the toplist into the buffer */ public static void getToplist(){ BufferedReader input = null; toplistData = null; String s; for(int i = 1; i <= 10; i++){ try { input = new BufferedReader(new FileReader(toplistPath+"/top_"+i+".dat")); while((s = input.readLine()) != null){ toplistData.append(s); toplistData.append('\t'); } toplistData.append('\n'); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(new JFrame(), "Fájl hiba: toplista betöltése", "Error", JOptionPane.ERROR_MESSAGE); } catch (IOException e) { JOptionPane.showMessageDialog(new JFrame(), "Fájl hiba: toplista betöltése", "Error", JOptionPane.ERROR_MESSAGE); } } } /** * * @author http://www.rgagnon.com/javadetails/java-0106.html * */ public static class DateUtils { public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; public static String now() { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); return sdf.format(cal.getTime()); } } } The problem is, that it can't access any of the files. I've tried adding them to the classpath and at least six different variations of file/path handling I found online but nothing worked. Could anyone tell me what do I do wrong? Thank you.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >