₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,276 members, 8,449,534 topics. Date: Tuesday, 21 July 2026 at 11:20 PM

Toggle theme

Fayimora's Posts

Nairaland ForumFayimora's ProfileFayimora's Posts

1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 42 pages)

ProgrammingRe: Java 7 Lauches On 7/7 (7th July) by Fayimora(m): 12:06am On Jul 21, 2011
Yeah I have a blackberry, lol would pm u ma pin in 10secs, Yeah java usually takes all the glory/love
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 12:06am On Jul 21, 2011
Yaaaay! I passed the test cheesy
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 11:56pm On Jul 20, 2011
Hahahahha it matches them all, Try again! tongue
ProgrammingRe: Java 7 Lauches On 7/7 (7th July) by Fayimora(m): 11:44pm On Jul 20, 2011
why u crying?
ProgrammingRe: Algorithm Workout! by Fayimora(m): 11:40pm On Jul 20, 2011
Errm i did most of them and others that i havent added too cheesy .So mine, pick anyone you like, Please pick the Fish Tank cheesy
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 11:39pm On Jul 20, 2011
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 cheesy
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 11:33pm On Jul 20, 2011
[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
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 11:31pm On Jul 20, 2011
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 grin. 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
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 10:58pm On Jul 20, 2011
But all i just need to do it add 4 characters and it wont be cheesy. If i go ur way then am dead cause its not gonna be that easy manipulating it.
ProgrammingRe: Algorithm Workout! by Fayimora(m): 10:56pm On Jul 20, 2011
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 cheesy. Happy anniversary BTW
ProgrammingRe: Java 7 Lauches On 7/7 (7th July) by Fayimora(m): 10:54pm On Jul 20, 2011
Oh ok cool, What exactly are you trying to develop?
ProgrammingRe: Computer Science by Fayimora(m): 10:53pm On Jul 20, 2011
lol kk, That aint no where in ma whole syllabus
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 10:52pm On Jul 20, 2011
really? and what if you have a line of instruction formatted just the way the actual data is formattedhuh? lol
ProgrammingRe: You May Want To Try This . . . by Fayimora(m): 10:51pm On Jul 20, 2011
Hmmm sounds interesting, would get ma hands on it later
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 10:42pm On Jul 20, 2011
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 thatcheesy

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 cheesy

[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? cheesy
ProgrammingRe: Help With This Regular Expression: by Fayimora(op): 8:24pm On Jul 20, 2011
Never mind, Already figured it out cheesy

Yeah i cud get answers from stackoverflow but its better i allow people here to giv it a try.
ProgrammingHelp With This Regular Expression: by Fayimora(op): 8:00pm On Jul 20, 2011
Am trying to pick data that looks like this:
PET SHELTER ADDRESS LIST
Master created 2011-07-20
----------------------------------------
Eustace Golightly, 1725 Mansfield Court, Success, AK    72470
Reginald Winterbottom, 190 Porter Road, Peabody, MA 01960
Penelope Smallbone,8462 Byron Way, Woonsocket, RI  02895
Cuthbert Eggleston, 9084 Constable Drive, Tuba City AZ 86045-9542
Barack Obama, 1600 Pennsylvania Avenue, Washington, DC 20500
----------------------------------------
Report Ends
the 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 sad

The output should be like this:

Name: Barack Obama
Address: 1600 Pennsylvania Avenue
City: Washington
State: DC
Zip Code: 20500


Thats across all lines,
ProgrammingRe: Community Project(strictly Java) by Fayimora(op): 7:19pm On Jul 20, 2011
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
ProgrammingRe: Java 7 Lauches On 7/7 (7th July) by Fayimora(m): 7:18pm On Jul 20, 2011
I dnt get, I thought u were against scala? What do hey do, unfortunately i havent programmed in scala before
ProgrammingRe: Java 7 Lauches On 7/7 (7th July) by Fayimora(m): 3:45pm On Jul 20, 2011
scottN:
Still pretty very much low level from a business pt of view. I think I'll wait for 8 and stick to Java. Though I'm still trying 2 give SCALA a chance cos it's has a lot of prospects but it's still not mature for the enterprise world.(IMHO)
Twitter is moving a lot of resources to scala:d
ProgrammingRe: Algorithm Workout! by Fayimora(m): 12:51pm On Jul 20, 2011
hmmm ok yeah u cant
ProgrammingRe: Computer Science by Fayimora(m): 11:58am On Jul 20, 2011
Hmm ok, Dnt think i even know what usability engineering is, Coolio
ProgrammingRe: Algorithm Workout! by Fayimora(m): 11:55am On Jul 20, 2011
farouqzaib:
@Mobinga, I understand the fact that the individual functions/methods of a class are made up of procedural code but u just don't declare a function in Java and use it, or maybe I'm missing something.
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 cheesy
ProgrammingRe: Java 7 Lauches On 7/7 (7th July) by Fayimora(m): 11:51am On Jul 20, 2011
Naaa dat comes in 8 but you might gain from the new invokedynamic feature
WebmastersRe: I Own Nairapals.com .i Need Advice On What Sort Of Website I Should Lauch On It. by Fayimora(m): 11:51am On Jul 20, 2011
Havent heard dat before
ProgrammingRe: Computer Science by Fayimora(m): 8:32am On Jul 20, 2011
@csharpjava ask him if the same applies to those who actually focused on software development while studying, lol
ProgrammingRe: Computer Science by Fayimora(m): 8:31am On Jul 20, 2011
Nice!, Thanks @omo_to_dun for the book/link
ProgrammingRe: Which Php Framework Do You Use? by Fayimora(m): 8:31am On Jul 20, 2011
hmm ok, what do you use for small and large scale web apps? php?
WebmastersRe: Need Assistance ? by Fayimora(m): 8:26am On Jul 20, 2011
ur kidding me right?
WebmastersRe: Need Assistance ? by Fayimora(m): 6:32am On Jul 20, 2011
Site is poorly designed

1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 42 pages)