Fayimora's Posts
Nairaland Forum › Fayimora's Profile › Fayimora's Posts
1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 42 pages)
Yeah I have a blackberry, lol would pm u ma pin in 10secs, Yeah java usually takes all the glory/love |
Yaaaay! I passed the test ![]() |
Hahahahha it matches them all, Try again! ![]() |
why u crying? |
Errm i did most of them and others that i havent added too .So mine, pick anyone you like, Please pick the Fish Tank ![]() |
Ok have finished the task, who wants to try it out, I have a 15 line code(Perl) and a text file with about 11k lines and it does the job in approx 1sec ![]() |
[quote author=naija_swag link=topic=717403.msg8757317#msg8757317 date=1311200796]I think am buying the regular expression thing if it makes the program run faster.I have a problem i am tryng to solve where i have to search 200,000 words for some patterns but i will try and do it in java.my initial solution with loops takes eternity to run.[/quote]Cool funny enough, in as much as they are fast, they can be very slow also. Just depends on how you use them. Also, the way you construct them matters. One mistake people make is trying to match things that never happen, its like entering a loop that would end but after a loooong while |
Hehehe yeah i get where u r coming from. Before i got the hang of regex, I always used an alternative. I learnt perl because i wanted to learn regex and it paid off. My regex matches ur names . I know they get very complex and thats even the more reason why I like them, they make me think. lol. Of course am not going to be writing a regex to validate an email(tho i already wrote one) when i could just get 3 from the internet and modify them to my taste if necessary. But you know there are times where you just have to face reality.Also, I think regex is one place where you believe the fact that "practice actually makes perfect". Thanks for the advice |
But all i just need to do it add 4 characters and it wont be . If i go ur way then am dead cause its not gonna be that easy manipulating it. |
Hmm one year in java, I suppose you could do [url=https://github.com/fayimora/Projects]one of these[url] then. Start with the aquarium, it pretty much fun . Happy anniversary BTW |
Oh ok cool, What exactly are you trying to develop? |
lol kk, That aint no where in ma whole syllabus |
really? and what if you have a line of instruction formatted just the way the actual data is formatted ? lol |
Hmmm sounds interesting, would get ma hands on it later |
Errm unfortunately you cant do that here, The text file contains stuff up to 400 lines. Not all of them are addresses. Some lines are headers and some footers just like you have seen above. Its going to be a serious waste of time trying to split strings. Also, there is no straight forward format for the file. It can be separated with as many spaces as possible some have extra stuff on their addresses as you can see so its just a waste of time. Thats where regular expressions come in. Also, you have to consider the speed, efficiency. I was able to parse 3000 addresses in less than 4secs. How about that ![]() The final regular expression is /\A([^,]+),\s?([^,]+),\s*([^,]+),?\s+([A-Z][A-Z])\s+(\d{5})(-\d{4})?\Z/I parsed the text file with perl if at all you want to see the code then i can post it here ![]() [quote author=naija_swag link=topic=717403.msg8757003#msg8757003 date=1311197703]this is naija_swag for you,i do my things manually.[/quote]Don't forget that it is advised to use available classes(most especially Java) rather than coding yourself. If you have a method in some class on the API that calculates the square root of a number, use it and dont write yours. Same thing applies here, when you have regular expressions to do the job for you, why pick the more expensive way? ![]() |
Never mind, Already figured it out Yeah i cud get answers from stackoverflow but its better i allow people here to giv it a try. |
Am trying to pick data that looks like this: PET SHELTER ADDRESS LISTthe data is about 4000 lines long so i couldnt think of a better way than regular expressions, Am using perl to do the manipulation and so far this is my regular expression /\A([^,]),\s?([^,]+),\s([^,]+),?\s+([A-Z][A-Z])\s+(\d{5})(-\d{4})?\Z/Have manipulated it for 1hr now but the best i have gotten is no result, Any help would be appreciable, Something somewhere is not right ![]() The output should be like this: Name: Barack Obama Address: 1600 Pennsylvania Avenue City: Washington State: DC Zip Code: 20500 Thats across all lines, |
You contribute, A lot more work still has to be done as we are developing a desktop app and not a web app, so your gonna have to take off all those e-stuff |
I dnt get, I thought u were against scala? What do hey do, unfortunately i havent programmed in scala before |
scottN:Twitter is moving a lot of resources to scala:d |
hmmm ok yeah u cant |
Hmm ok, Dnt think i even know what usability engineering is, Coolio |
farouqzaib:Errm i dnt understand this part. Do you mean you cant declare a function and call it from somewhere else like a main method? If yes then you are wrong. Check some of the threads that contain java code like my coding challenge series ![]() |
Naaa dat comes in 8 but you might gain from the new invokedynamic feature |
Havent heard dat before |
@csharpjava ask him if the same applies to those who actually focused on software development while studying, lol |
Nice!, Thanks @omo_to_dun for the book/link |
hmm ok, what do you use for small and large scale web apps? php? |
ur kidding me right? |
Site is poorly designed |
1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 42 pages)


. I know they get very complex and thats even the more reason why I like them, they make me think. lol.
? lol