Posts

Text file into Excel VBA empty line new column -

i have sheets of data in txt files single column. need import excel , break each field break new columns @ empty line. not sure if best in import or after import. foobar detail1 detail2 val1 val2 val3 val4 randominfo widget detail1 detail2 val1 val2 val3 val4 randominfo you'll want read file in line line , move on when read empty line. edit: forgot answer question...just on import. other way makes scan list again , not efficient. dim r integer dim c integer ''initialize r = 2 c = 1 ''i'm assuming have row headers or row starts @ two. ''change 1 if want data in first row. open [your file path here] input #1 until eof(1) line input #1, readline if readline = "" 'index on 1 column 'start row indexer on c = c + 1 r = 2 else 'output "readline" sheet activesheet.cells(r, c).value = readline 'index down 1 row r = r + 1 ...

java - Returns a new HashMap that maps the words in list to their number of occurrences -

counts() return type: hashmap parameter list: arraylist parameter list action: returns new hashmap maps words in list number of occurrences public static hashmap<string,integer> counts( arraylist<string> words ) { hashmap<string, integer> map = new hashmap<string, integer>(); ( string w : words ) { if( !map.containskey( w ) ) { map.put( w, 1 ); } else{ map.put( w, map.get( w ) + 1 ); } } return map; } it doesn't display anything. if want display "results" of method, need iterate through keys, display output of values console: public static hashmap<string,integer> counts( arraylist<string> words ) { hashmap<string, integer> map = new hashmap<string, integer>(); ( string w : words ) { if( !map.containskey( w ) ) { map.put( w, 1 ); } else...

Where are all the XMPP user name and password saved -

when there domain created , username , password domain registered chat on xmpp. these username , password saved. are these stored on jabber server's database, or create database on our server , store them. like sunil@sunil.com stored in jabber server database or on sunil.com database. any link through more light on full cheers sunil that depends on jabber server used. jabber servers able store usernames , passwords in internal database, server implementations let configure external database, such mysql or postgres, or let use ldap user database.

postgresql - Heroku Django application slower after moving postgres database to Amazon free RDS -

i have pilot django project installed on heroku using free tier , free postgres database. due size limitation on heroku, moved database amazon rds free tier offers lot more space , no row limit. after move notice slow performance in django app! there way reconfigure setup make application/database go faster? if it's "free tier" of rds, using small database (in terms of cpu , memory) shouldn't come surprise slow. specifically, free tier t2.micro, has 1 virtual cpu , 1gb of memory. also, storage type (magnetic, ssd, provisioned iops) may make substantial difference. can observe disk stats in cloudwatch rds instance see if that's problem.

java - illegal reference to static field from initializer -

i new enums in java , confused why code compiles fine enum scale5 { good(), better(), best(); static scale5 s=good; } but code fails: enum scale5 { good(), better(), best(); scale5 s=good; } and error : illegal reference static field initializer. dont understand reason.i relatively inexperienced in enums please dump down me.thanks lot! the question asked here cannot refer static enum field within initializer? exact opposite of have asked.in case declaring s static compiles code fine. think of enum this: public final class scale5 { public static final scale5 = new scale5(); public static final scale5 better = new scale5(); public static final scale5 best = new scale5(); static scale5 s = good;//works because initialized first; scale5 ss = good;//doesn't work because in order initialize good, //ss must assigned object not yet initialized; }

In c# How do I control which Excel opens? -

i have excel 2010 , excel 2013 (via office 365) on machine (windows 7 home premium) is there way control excel opens when var excelapp = new excel.application(); is called? thanks time, kw one of possible approaches rely on dynamic com automation: type exceltype = type.gettypefromprogid( "excel.application.[v]" ); dynamic excel = activator.createinstance( exceltype ); where excel.application.[v] is excel.application.14 or excel.application.15 depending on version want run. since excel dynamic, use in same way, despite actual version: excel.visible = true; ...

Wait for process to end and continue code in CMD/BATCH -

i trying wait process end, can't use "start /w" because process opens program. so in all, need kind of scanner if process in waitsession , continue code killsession @echo off color 02 cd /d c:\windows\system32 timeout -t 1 ***waitsession*** (wait process end) mightyquest.exe ***killsession*** taskkill /f /im publiclauncher.exe taskkill /f /im awesomiumprocess.exe thanks this should it: @echo off color 02 cd /d c:\windows\system32 timeout -t 1 set tempfile="%temp%\%random%.txt" :waitsession rem fetch current process list. store in temp file easy searching. tasklist > %tempfile% rem reset process "flag" variable. set "process=" rem check process target name searching task list target process name. rem if output returned, put process "flag" variable. /f "usebackq tokens=1 delims=-" %%a in (`findstr /i "mightyquest.exe" %tempfile%`) set process=%%a rem if nothing returned, means proces...