Search Results

Search found 18761 results on 751 pages for 'lot'.

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

  • Parsing large txt files in ruby taking a lot of time?

    - by hershey92
    below is the code to download a txt file from internet approx 9000 lines and populate the database, I have tried a lot but it takes a lot of time more than 7 minutes. I am using win 7 64 bit and ruby 1.9.3. Is there a way to do it faster ?? require 'open-uri' require 'dbi' dbh = DBI.connect("DBI:Mysql:mfmodel:localhost","root","") #file = open('http://www.amfiindia.com/spages/NAV0.txt') file = File.open('test.txt','r') lines = file.lines 2.times { lines.next } curSubType = '' curType = '' curCompName = '' lines.each do |line| line.strip! if line[-1] == ')' curType,curSubType = line.split('(') curSubType.chop! elsif line[-4..-1] == 'Fund' curCompName = line.split(" Mutual Fund")[0] elsif line == '' next else sCode,isin_div,isin_re,sName,nav,rePrice,salePrice,date = line.split(';') sCode = Integer(sCode) sth = dbh.prepare "call mfmodel.populate(?,?,?,?,?,?,?)" sth.execute curCompName,curSubType,curType,sCode,isin_div,isin_re,sName end end dbh.do "commit" dbh.disconnect file.close 106799;-;-;HDFC ARBITRAGE FUND RETAIL PLAN DIVIDEND OPTION;10.352;10.3;10.352;29-Jun-2012 This is the format of data to be inserted in the table. Now there are 8000 such lines and how can I do an insert by combining all that and call the procedure just once. Also, does mysql support arrays and iteration to do such a thing inside the routine. Please give your suggestions.Thanks.

    Read the article

  • How to make Windows 7 machine allocate a lot of hard disk cache?

    - by Jian Lin
    I am recording some game play capture (recording playing of PS3 or Wii) using a PC with Windows 7 and Hauppauge 1212 HD Recorder, and I have 4GB of RAM... is there a way to increase the size of Windows 7's hard disk cache size so that writing to the hard drive can be super fast? Since there is at least 1.5GB of RAM not being used, something like allocating 1GB just as hard disk cache, is it possible?

    Read the article

  • MsMpEng.exe (Windows Defender?) uses a lot of CPU at startup and runs two instances on a single core

    - by dlamblin
    I'm using Windows XP Professional SP2 on a single core AMD64 processor, and I've got two instances of MsMpEng.exe starting up when I start up and log in. They use 64MB and 32MB of ram and 140MB and 80MB of virtual memory, and fluctuate around 80% CPU usage for about 5 minutes at start up. They are (I read) associated with Windows Defender, but I'm concerned about: There's two of them, everything I read generally has only one reported. They might be scanning each other, and I want that to stop. They might be getting scanned by avgrsx.exe (AVG Free 8) (uses about 16Mb v ram) They might also be scanning moe.exe (assosciated with ms live mesh, which I'm considering getting rid of) Lastly I have Microsoft Security Essentials. I don't know the process name associated there. The main concern of mine (apart from the double instances) is that these are all trying to prioritize scanning each other at once except maybe moe.exe. This might seem legitimate but is likely a useless drain on resources. Have I made a mistake in having all of these installed, or is there a way to inform them not to do whatever they're doing that's taking about 5+ minutes at start up? [I also have Google Desktop, but I'm keeping that.] Comment if none of this makes sense to you.

    Read the article

  • CentOS 5.5 x86_64 VPS - A lot of inbound traffic when idle?

    - by Matt Clarke
    I have a CentOS VPS from UKWSD and I'm getting inbound traffic that I cannot understand. The VPS was setup yesterday and I installed vnstat this morning around 10am, since then the server was basically idle and doing nothing from 12pm but it's showing activity inbound which is way over what it should be and i'd say the outbound is pretty much over to top too. Here is vnstat (snapshot taken at 10:30pm GMT) http://i.imgur.com/XnORb.jpg Here is the iptables http://pastebin.com/uGxX2Ucw The reason I'm concerned is.. 1) I have no idea why this is happening, and I like to know what's going on :D 2) I've calculated (briefly) that this pointless traffic would use around 15-20GB of bandwidth per month, and when your on a 150GB limit - it's quite an issue. I'm struggling to understand this and I thought I'd get some advice before asking my ISP (and risk looking completely stupid) Regards Matt

    Read the article

  • My Mac OS X 10.5 netstat reveals a lot of open UDP connections.

    - by bboyreason
    here are my netstat results (besides server-less connections): Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 192.168.1.98.49224 r1.ycpi.vip.sp2..http ESTABLISHED tcp4 0 0 192.168.1.98.49223 r1.ycpi.vip.sp2..http ESTABLISHED tcp4 0 0 192.168.1.98.49203 lax04s01-in-f189.https ESTABLISHED tcp4 0 0 192.168.1.98.49201 lax04s01-in-f19..https ESTABLISHED tcp4 0 0 192.168.1.98.49198 lax04s01-in-f19..http ESTABLISHED tcp4 0 0 192.168.1.98.49196 lax04s01-in-f19..https ESTABLISHED tcp4 0 0 192.168.1.98.49194 lax04s01-in-f19..https ESTABLISHED tcp4 0 0 192.168.1.98.49192 lax04s01-in-f19..https ESTABLISHED tcp4 0 0 192.168.1.98.49183 r1.ycpi.vip.sp2..http ESTABLISHED tcp4 0 37 192.168.1.98.49179 l1.login.vip.sp1.https CLOSING tcp4 0 0 192.168.1.98.49175 lax04s01-in-f104.https ESTABLISHED tcp4 0 37 192.168.1.98.49167 l1.login.vip.sp1.https LAST_ACK tcp4 0 0 192.168.1.98.49164 lax04s01-in-f19..https ESTABLISHED tcp4 0 0 192.168.1.98.49174 69.31.112.122.http TIME_WAIT tcp4 0 0 192.168.1.98.49173 69.31.113.83.http TIME_WAIT udp4 0 0 *.ipp **.* udp4 0 0 192.168.1.98.ntp **.* udp4 0 0 *.49628 **.* udp4 0 0 *.51997 **.* udp4 0 0 *.64675 **.* udp4 0 0 *.61947 **.* udp4 0 0 *.65152 **.* udp4 0 0 *.55643 **.* udp4 0 0 *.51704 **.* udp4 0 0 *.59757 **.* udp4 0 0 *.53643 **.* udp4 0 0 *.65346 **.* udp4 0 0 *.61960 **.* udp4 0 0 **.* **.* udp6 0 0 localhost.ntp **.* udp4 0 0 practivate.adobe.ntp **.* udp6 0 0 localhost.ntp **.* udp6 0 0 *.ntp **.* udp4 0 0 *.ntp **.* udp6 0 0 *.mdns **.* udp4 0 0 *.mdns **.** udp4 0 0 *.** **.** udp4 0 0 *.** **.** omitted a few asterisks, basically all the empty spots are asterisks what is up with all the UDP connections listening on any port? is that what this means? the internet activity that should be going in is that i connected via wpa to wifi at a small restaurant visited a few pages, checking mail from a few different accounts, no new mail or downloads where done. ?

    Read the article

  • Why do servers go down after a lot of traffic?

    - by mohabitar
    I'm working on an iOS app that makes extensive use of databases, where users will be able to sync their data to a server. However, I'm terrified of the event that if too many users start using the app, the servers will no longer be able to handle it. I'm not a server guy at all and am not too familiar with how that works, but my question is, why do servers get overloaded and how can that be prevented? Does it have to do with who my server host is? Or is it about the efficiency of my code? If my host is a reliable server, such as Amazon AWS, am I still at risk for server problems? Bottom line is, does it have to do with the way I implement my code, or does it have to do with who my host is?

    Read the article

  • What's a fast way to copy a lot of files from an internal hard-drive to external (USB) storage?

    - by jonathanconway
    I have a large amount of data - about 500 GB - on the internal hard drive of a desktop PC. This includes music, videos, PDFs... you name it. I want to copy everything to an external USB hard drive (1.5 tb capacity). The desktop PC runs Ubuntu. To being with, I simply plugged in and mounted the hard drive and dragged the top-level folder onto the drive. It's started copying, but it seems to be proceeding very slowly. About 10 minutes later and it's only done about 500 MB. I'm sure this is slower than what I could achieve with less total data. So I'm wondering if there's a quicker way of doing this. Would it be better to copy it in portions of 500MB or so, rather than all at once?

    Read the article

  • How to add extensions to a lot of files using content of each file?

    - by v8media
    I've got over 10,000 files that don't have extensions from older versions of the Mac OS. They're extremely nested, and they also have all sorts of strange formatting and characters. They don't have file types or creator codes attached to them any longer. A great deal of these files have text in the file that will let me determine extensions (for example Word.Document.8 is in every file created by that version of Word, and Excel.Sheet.8 in every file created with that version of Excel). I found a script that looks like it would work for one of these file types at a time, but it erases parts of filenames after nefarious characters, which is not good. find . -type f -not -name "." -print0 |\ xargs -0 file |\ grep 'Word.Document.8' |\ sed 's/:.*//' |\ xargs -I % echo mv % %.doc So, two questions from that: One is, should I clean the characters in the filenames first, or programmatically deal with those in the script in order to leave them the same? As long as I lose no information from the filenames, I don't see a problem cleaning out slashes and other problem characters. Also, if I clean the filenames, there are likely to be duplicates, so any cleaning script would have to add something like "-1" before the extension to make sure nothing gets lost. 2nd question is how do I change the script so that it will look for more than one file type at the same time and give each the proper extension? I'm not tied to this script, but it is understandable, which is a pro. Mac OS X 10.6 is installed on this file server, but I've got access to any recent versions of OS X. Thanks, Ian

    Read the article

  • The good SQL database to process a lot of data?

    - by Dorian
    I have to process like 10-100 millions records. I have to give the data to the client when it's finish. The data is givent as SQL requests to execute in the database. He have a powerful server with MySQL, I think it will be fast enough. The issue is my computer is not as powerful as his server, so I would like to use an other SQL server who is compatible (I export his database and import it in my computer) with MySQL but more powerful. What should I use? Or am I doomed to use MySQL?

    Read the article

  • Do busy smtp servers use long running tcp connections to exchange lot of mails?

    - by iamrohitbanga
    I had this idea from http://stackoverflow.com/questions/2813326/maximum-number-of-bytes-that-can-be-sent-on-a-tcp-connection is it possible that smtp servers like gmail and yahoo enter into some form of agreement to maintain a tcp connection between them so that lots of mails could be sent on the same tcp connection. it would be efficient as there would be heavy mail traffic between these mail servers.

    Read the article

  • Why Windows needs reboot a lot more than Linux?

    - by kolistivra
    Hi, I use both Ubuntu and Windows XP. One thing that catches my attention for a long time is the high need for reboots in Windows. Most of the time when I install a program, Windows requests to reboot system. This happens considerably more frequently than Linux. Why is it so? Thanks!

    Read the article

  • OOMK kills mysql and apache when there is still a lot[?] of mem

    - by Flyer
    let me first say that I'm pretty new ti *nix systems and even more to server management. Anyway, I've got a little problem. I got VPS with 1gb mem, system is debian 6. I have few sites running on it, though some load can only be caused by one of them. Recently, OOMK started to kill mysql, causing wp and phpbb giving error that it can't connect to mysql server. Error itself is not good, especially if it happens at night and site becomes unavailable until I wake up and restart mysql. I have probably bad line in my cron which can be cause of it all (again, I'm new to it) */20 * * * * sync; echo 3 > /proc/sys/vm/drop_caches Well, if you need any information, let me know, since I don't really know which information can be useful here. Also, I'd like to know if it's not too bad to have above cron task.

    Read the article

  • Why does moving large folders take a lot of time?

    - by acidzombie24
    What can i do to fix this? Drop permission properties? I have a large folder with 100k files. I moved it into my archive folder and its taking forever to move. Why is that? I know on XP it takes <1sec but not on windows 7. I am sure its a permission thing, is there a way i can disable it and make it faster? -edit- I am moving the folder into another in the same drive/partition. In XP. AFAIK it just moves the folder file from one place to another. In windows 7, it seems like its touching something in every file when i move it.

    Read the article

  • How to print a html-table with a lot of columns.

    - by bruno
    Hello all, I'm trying to print a table with a lot of columns, so that the width of the table doesn't fit a single page. I'm using jqprint to print that table. But it prints only the left part of the table, and the right part it won't print. Is there a way to print the table on multiple pages? Kind regards, Bruno

    Read the article

  • Which flash server i should use for flash chat with a lot of instant users?

    - by Almas Adilbek
    I'm currently developing flash chat for social networking websites like facebook. Actually i want to develope flash chat in this game. Chat would have a lot of instant active users. So that, i need to know which flash servers i should use, is there any free ones that are pretty good for such high performance needs? I've found ElectroServer4 Professional. Is it enough for my task? Thank you

    Read the article

  • Should I be using the command pattern? Seems like a lot of work...

    - by Fedor
    My Room class has a lot of methods I used before I decided to use the command pattern. Previously, I was invoking a lot of commands and now it seems I have to make a method in my roomParser class for every method. If I wanted to invoke say, setHotelCode I would have to create a method in roomParser that iterates through and invokes the method. Is this the way I should be using the command pattern? <?php interface Parseable { public function parse( $arr, $dept ); } class Room implements Parseable { protected $_adults; protected $_kids; protected $_startDate; protected $_endDate; protected $_hotelCode; protected $_sessionNs; protected $_minRate; protected $_maxRate; protected $_groupCode; protected $_rateCode; protected $_promoCode; protected $_confCode; protected $_currency = 'USD'; protected $_soapAction; protected $_soapHeaders; protected $_soapServer; protected $_responseXml; protected $_requestXml; public function __construct( $startdate,$enddate,$rooms=1,$adults=2,$kids=0 ) { $this->setNamespace(SESSION_NAME); $this->verifyDates( $startdate, $enddate ); $this->_rooms= $rooms; $this->_adults= $adults; $this->_kids= $kids; $this->setSoapAction(); $this->setRates(); } public function parse( $arr, $dept ) { $this->_price = $arr * $dept * rand(); return $this; } public function setNamespace( $namespace ) { $this->_sessionNs = $namespace; } private function verifyDates( $startdate, $enddate ) {} public function setSoapAction( $str= 'CheckAvailability' ) { $this->_soapAction = $str; } public function setRates( $rates='' ) { } public function setHotelCode($code ) { $this->_hotelCode = $code; } private function getSoapHeader() { return '<?xml version="1.0" encoding="utf-8"?> <soap:Header> </soap:Header>'; } private function getSoapFooter() { return '</soap:Envelope>'; } private function getSource() { return '<POS> <Source><RequestorId ID="" ID_Context="" /></Source> </POS>'; } function requestXml() { $this->_requestXml = $this->getSoapHeader(); $this->_requestXml .='<soap:Body></soap:Body>'; return $this->_requestXml; } private function setSoapHeaders ($contentLength) { $this->_soapHeaders = array('POST /url HTTP/1.1', 'Host: '.SOAP_HOST, 'Content-Type: text/xml; charset=utf-8', 'Content-Length: '.$contentLength); } } class RoomParser extends SplObjectStorage { public function attach( Parseable $obj ) { parent::attach( $obj ); } public function parseRooms( $arr, $dept ) { for ( $this->rewind(); $this->valid(); $this->next() ) { $ret = $this->current()->parse( $arr, $dept ); echo $ret->getPrice(), PHP_EOL; } } } $arrive = '12/28/2010'; $depart = '01/02/2011'; $rooms = new RoomParser( $arrive, $depart); $rooms->attach( new Room( '12/28/2010', '01/02/2011') ); $rooms->attach( new Room( '12/29/2010', '01/04/2011') ); echo $rooms->count(), ' Rooms', PHP_EOL; Edit: I'm thinking it may be easier if I made the RoomParser less generic by storing properties that all the objects will share. Though I'll probably have to make methods if I want to override for a certain object.

    Read the article

  • my realtime network receiving time differs a lot, anyone can help?

    - by sguox002
    I wrote a program using tcpip sockets to send commands to a device and receive the data from the device. The data size would be around 200kB to 600KB. The computer is directly connected to the device using a 100MB network. I found that the sending packets always arrive at the computer at 100MB/s speed (I have debugging information on the unit and I also verified this using some network monitoring software), but the receiving time differs a lot from 40ms to 250ms, even if the size is the same (I have a receiving buffer about 700K and the receiving window of 8092 bytes and changing the window size does not change anything). The phenomena differs also on different computers, but on the same computer the problem is very stable. For example, receiving 300k bytes on computer a would be 40ms, but it may cost 200ms on another computer. I have disabled firewall, antivirus, all other network protocol except the TCP/IP. Any experts on this can give me some hints?

    Read the article

  • Advanced example-driven C book with a lot of code.

    - by Inso Reiges
    Hello, I am looking for a book on advanced C programming that: Teaches how to effectively express one's solution in C when one already knows the language in depth. Shows some common design idioms expressed in C, like encapsulation, modularity and that kind of thing. Is example-driven with a lot of good-quality code. I already know the language itself so books like otherwise wonderful "Expert C Programming" by Peter van der Linden is not really what i am looking for. What i need is a book on how to express my design in C, what are the common idioms, best practices, etc. I would also like to note that i am primarily interested in C, not C++, C#, Objective-C or any other languages inspired by C-like syntax. Thank you.

    Read the article

  • What's Your favorite f# use? where does f# makes life (a lot) easier (compared to c#)?

    - by luckyluke
    I've skimmed the stack and did not get the overflow as there is probably no such question. I'm just learning f# and I am A seasoned c# and .net dev. I am into financial apps and currently F# helps me a lot with maths calcs like zero finding or minimum finding (although I still want some good maths library there). I see that processing multiple items (files or smth) tends to be easier, but my GUI (web, win) are still c# based. I am in the team of 5 devs and we know that the new tool is out, we are learning it after hours (to pimp ourselves up) but maybe we shouldn't bash the door somebody already opened. So in business apps, whats Your first killer part of soft You would code in F# (if You could and would know IT would be easier, faster, more testable, easier to maintain etc.? Business rules? ImageProcessing? Data processing? hope it's not to subjective. luke

    Read the article

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