1.11M Members

Latest Posts in Software Development

Re: in Java
 
0
 

I forgot to post the work I did. Apologies for that.

a)Create a HashMap<String,Integer> which would store each word and its occurrences across all files.
b) Fill this map with the occurrences per word in first file.
c) Initiate threads (1 per file) which will read all the contents of the file first to another map and then loop over the HashMap to identify which word is not present. Whichever is not present, we remove from the HashMap thereby ensuring that only the ones that exist in all files are retained.

The problem I am facing is to get the final map after all the threads are executed. Assume I have to print the output to the cmd prompt. Then I have to get the final map and print them. As of now I have put the print stmt in the run method itself. So its printing the content everytime a thread executes. But I want final map and print only once. So how to get the final map after all the threads are executed?

I know to achieve this my traditional method like load each file,count occurrence of each word, check for the word and do necessary operations. But this isn't efficient right? So thought of multithreading.

Please let me know if any better approach can be used to achieve the solution for the problem.

Re: in Mobile Development
 
0
 

i have already a website and i want to make an app out of it. I know javascript, css, php very good. is there another way to make an cross plattform app?

in Mobile Development
 
0
 

Ι am trying to make an app. I visited phonegap.com. I install node.js and run C:> npm install -g phonegap on the command promp. Does anybody knows what to do next?

Re: in C++
 
0
 

Ah, OK, that's important information we will need in order to give an answer; however, this forum is specific to the C++ language, not FORTRAN, which would be discussed in the 'Legacy Languages' forum. Hopefully, one of the moderators will move this over to that message board sometime soon.

Re: in Mobile Development
 
0
 

Short answer : Yes.

If you look at the recent trend around mobile app development a lot of revenue is generated around ad's. Even the most recent game apps like Flappy Bird was said to generate around $50,000 a day from in-app advertisements.

You can even look at the Market Research to know about the specifics about the ad's being targeted and the turnover.

So, yes if you develop an app and run whatever ad-service, I think you would be able to get similar or more gains, if not less, from the visits.

Re: in Python
 
0
 
while not (done):

will loop until done==True
To get done==True in the code you posted, you have have to enter "s" on your only input line, i.e.

    choose=input("\nChoose a class please : f=Fighter, m=Magic User ")

You can also use a return statement to exit the funtion containing the while loop

Re: in Java
 
0
 

You are using Scanner class to accept an input (nextLine()), so you could simply test what the input would be. So what you may do is to convert the input String to bytes. If I remember correctly, the esc key gives you a byte array length of 1 with value of 27 inside. So you could check if the input value (after converted to byte array using getBytes() has size of 1 and the value inside is 27. Though, the user still has to press Enter key so the program will accept the value (for nextLine()). However, Ctrl+<any key> does not seem to be working for Java in the console...

Re: in C++
 
0
 

'PLATO' itself a compiler.Espeacialy for 'FORTRAN' programing.'FORTRAN' is mathematical problem-oriented language.it was all fine,recently my 'PLATO' compiler started compiling my program showing 'no error' and after then,when i run the program it do nothing only showing black DOS box with 'prees 'return' to continue' written on it.here is a link of plato http://www.silverfrost.com/32/ftn95/ftn95_personal_edition.aspx here's one program of mine Program primei
Implicit none
integer i,n,item
item=2
8 Write(,)'please enter an integer greater than 1'
Read*, n
If(n<=1)then
Write(,)'input error'
go to 8
end if
do i=2,n-1
if(mod(n,i)==0)then
item=item+1
exit
else
end if
end do
if(item>2)then
Write(,)'composite number'
else
Write(,)'prime number'
end if
end program

    by the way, i am  new in programing.                    
Re: in VB.NET
 
0
 

i have two tables in access and i want to update datagridview which is made from joining of these two tables, how update this datagridview in vb.net

Re: in VB.NET
 
0
 

i have two tables in access and i want to update datagridview which is made from joining of these two tables, how update this datagridview in vb.net

in VB.NET
 
0
 

i have two tables in access and i want to update datagridview which is made from joining of these two tables, how update this datagridview in vb.net

Re: in Python
 
0
 

it does for the files but i jsut got told they arent files but subfolders that have the numbers in the names which makes this so much more confussing for me.

Re: in Python
 
0
 

Another way, returning a list of integers

>>> import re
>>> def getints(string):
...     return [int(x) for x in re.findall(r'\d+', string)]
... 
>>> getints("foo23bar01-14qux2")
[23, 1, 14, 2]
Re: in C++
 
1
 

Gobne

Celary yuo aer a gineus who not olny cna qukcily slove teh hmorweok of ohters threbey hdaning tehm a sulotoin on a palte, but yuo cna aslo raed tihs gabrbled meassge in nomral tmie. Jsut in csae yuo hdan't geussed I dwon repeepd yuo as yuo dno't apaeppr to hvae laernt why tihs is worng.

Re: in Python
 
0
 

Maybe this will help ...

s = "test01-15.dat"

q = s.split('.')
print(q)
print(q[0])

numeric = "".join(n for n in s.split('.')[0] if n in '0123456789-')
print(numeric)
print(numeric.split('-'))

''' result ...
['test01-15', 'dat']
test01-15
01-15
['01', '15']
'''
in Python
 
0
 

I am trying to do a search for sub-folders in a directory that conaint numbers. The format could be a date range for example: 1-1, 01-1, 1-01, 01-01. The first number will only go up to 12 and the second one will go as high as 31 and im trying to figure out how to read the date of files that are in there then once it finds the correctly formated file name it kicks off the code to go into that file and do what else my code is set to do . If there is a simple way to do this please let me knwo cause this has me running in circles and if my code is needed i will post it.

Software Development Tag Cloud