₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,259 members, 8,449,456 topics. Date: Tuesday, 21 July 2026 at 07:31 PM

Toggle theme

Jacob05's Posts

Nairaland ForumJacob05's ProfileJacob05's Posts

1 2 3 4 5 6 7 8 ... 19 20 21 22 23 24 25 26 27 (of 37 pages)

PoliticsRe: Will You Vote For Jonathan In The Forthcoming Election? by jacob05(m): 10:02am On Apr 08, 2013
No, No and No. I dey craze ? Why should i vote for an incompetent and confused "figure"? Nope not again;
ComputersRe: Ubuntu Linux by jacob05(m): 2:36am On Apr 03, 2013
My Ubuntu 13.04

ComputersRe: Ubuntu Linux by jacob05(m): 6:46am On Mar 31, 2013
Wow, ubuntu 13.04 is the best... very fast.... Unity now faster.. great !!!!
ComputersRe: Ubuntu Linux by jacob05(m): 9:24pm On Mar 30, 2013
4llerbuntu: greatest beta ever . 13.04

i dunno what possessed me into upgrading my main work box to 13.04 beta, but it has been a great decision.

has to be the best ubuntu install i ever had

how to?
Upgrading now !!!
ProgrammingRe: Please Advice On The Best Platform For A Webapp by jacob05(m): 3:22am On Mar 25, 2013
Fayimora: Why not use what you already know? I HATE PHP but if that's what you know, then go for it bird.

Good luck
Why huh undecided
Jobs/VacanciesRe: Top Ten Worst Jobs To Have In Lagos by jacob05(m): 3:16pm On Mar 19, 2013
LOL @ No 2
ProgrammingRe: Developing A Facebook-like Ticker For Nairaland by jacob05(m): 6:15pm On Mar 17, 2013
subscribing..
WebmastersRe: 509 Bandwidth Limit Exceeded - Nscdc.gov.ng by jacob05(m): 5:28pm On Mar 15, 2013
Are you kidding me, That's a .gov site. Ø ga ø... My Oga at The Top should have an explanation.
PoliticsRe: APC Rejects INEC's Call For Name Change by jacob05(m): 3:29am On Mar 14, 2013
reserved
PoliticsRe: Owners Of Oil Wells In Nigeria Unveiled By Segun Adeniyi by jacob05(m): 3:28am On Mar 14, 2013
wow...
Tech JobsRe: Sitepoint Books For Sale by jacob05(op):
void
Tech JobsSitepoint Books For Sale by jacob05(op): 12:43pm On Mar 11, 2013
PHP & MYSQL: NOVICE TO NINJA, 5TH EDITION - N4500

JQUERY: NOVICE TO NINJA, 2ND EDITION - N4500

PHP MASTER: WRITE CUTTING-EDGE CODE - N6000


THE PRINCIPLES OF BEAUTIFUL WEB DESIGN, 2ND EDITION - N5000

FoodRe: What Food Aroma Can't You Resist? by jacob05(m): 7:54am On Mar 01, 2013
Fried Eggs, beans and Freshly baked Bread
ProgrammingRe: Payza Sendmoney Api In Java by jacob05(m): 9:38pm On Feb 06, 2013
o
Javanian: Thanks for your review, you have made some valid points that i will look into when am less busy....

The C# implementation is available here https://dev.payza.com/sdks-and-sample-codes/net/api/SendMoneyClient.cs
you're welcome. ooh i see, your version is just a mirror of the CS version, That's where the bad code smells from. Would be anxiously waiting for the next version
ProgrammingRe: Payza Sendmoney Api In Java by jacob05(m): 12:26pm On Feb 06, 2013
Cool, Nice on Bro wink {i mean MRS/MISS. LOL}.

My Thoughts.

1. java.net.URLEncoder.encode((String)strCurrency); Bla Bla looks so Ugly.. can't there be just a function to encapsulate these ?
2. The sbDataToSend.append("&CURRENCY="wink and sbDataToSend.append("&RECEIVEREMAIL="wink and the rest . Can't they be passed by the user in an array {JSON Style} ? this i think would help if in future new parameters are added and would save the Programmer FROM Jumping into the CODE.

Can you paste the C# implementation pls.
PoliticsRe: Boko Haram Demands N26bn From FG, Borno Government by jacob05(m): 9:33am On Feb 02, 2013
fools
ProgrammingRe: Sorting List Of Numbers And Strings: Simple Puzzle by jacob05(m): 8:48am On Jan 04, 2013
pastebin.com/rWhEvaYw
ProgrammingRe: Sorting List Of Numbers And Strings: Simple Puzzle by jacob05(m): 8:33am On Jan 04, 2013
lordZOUGA: this code breaks if the input contains zero
Nice catch boss! Fixed

#include <string>
#include <vector>
#include <functional>
#include <iostream>
#include <algorithm>
#include <sstream>
using namespace std;
void split(const string& s, char c,
vector<string>& v) {
string::size_type i = 0;
string::size_type j = s.find(c);
while (j != string::npos) {
v.push_back(s.substr(i, j-i));
i = ++j;
j = s.find(c, j);
if (j == string::npos)
v.push_back(s.substr(i,
s.length( )));
}
}
bool isIntergerFamily(string value){
int myint =0;
stringstream(value) >> myint;
return ((myint != 0) || (value == "0" ) ) ? true : false;

}
template <class T>
void printOut(vector<T> temp ){
for (int i = 0; i < temp.size( ); +
+i) {
cout << temp[i] << " ";
}
}
template <class T>
void maskOrder(string type,
vector<T> inputVector,
vector<string>& maskVector ){
stringstream ss;
for (int i = 0,counter = 0; i <
maskVector.size( ) && counter <
inputVector.size() ; ++i) {
if(type == "int" &&
isIntergerFamily(maskVector[i])){
ss.str("" ;
ss << inputVector
[counter];
maskVector[i] = ss.str();
counter++;
}
if(type == "string" && !
isIntergerFamily(maskVector[i])){
maskVector[i] =
inputVector[counter];
counter++;
}
}
}
int main( ) {
vector<string> splittedString;
vector<string> tempVector;
vector<string> stringVector;
vector<int> intergersVector;
int myint;
string inputString;
cout << "Enter String :";
getline(cin,inputString);
split(inputString, ' ',
splittedString);
tempVector = splittedString;
sort(tempVector.begin()
,tempVector.end());
for (int i = 0; i < tempVector.size
( ); ++i) {
if (isIntergerFamily(tempVector
[i])){
stringstream(tempVector[i])
>> myint;
intergersVector.push_back
(myint);
}else{
stringVector.push_back
(tempVector[i]);
}
}
maskOrder("string",stringVector,
splittedString);
maskOrder("int",intergersVector,
splittedString);
printOut(splittedString);
}
ProgrammingRe: Sorting List Of Numbers And Strings: Simple Puzzle by jacob05(m): 7:57am On Jan 04, 2013
pak: ekt_bear, I feel like punching you for depriving me of my sleep really. Saw this as I was about to hit the sack and couldn't blink until I cracked it.

My fav pastime is Python but since I dont us python in my day job, I've been terribly rusty.
Infact the stuff took me well over an hour considering I was even just installing the python executable on my new sis.

However, having lost out in the competition to be the fastest, I strove for the next glorious crown - to be the most elegant grin grin grin

Guess I achieved it. 19 lines of code

Prince actually did the stuff in 18 lines (with the white spaces stripped of) but the script didn't run when I tried it out. I guess he has to check out one or two stuffs in the code.

. . .and the Java solutions ? puleeeeeeeeaaaaaaaaaase. is that the code to calculate the GDP of Nigeria ?
Really, I appreciate you guys (the programmers) but its the lang that I detest.

To The C++ guy, I believe C++ can do better than that, That was actually my first love. but kudos though.



Check out my solution

http://pastebin.com/W3swZVfd
Well, thanks bro. My C++ version could have been 'elegant' as you claim your solution is if C++ had provided robust string processing classes like python does (li.split() wink) and also a portable mechanism to check for type (s.isdigit() python provided). Guessed those took the glory smiley. I'm still waiting for a better solution though
ProgrammingRe: Sorting List Of Numbers And Strings: Simple Puzzle by jacob05(m): 12:30am On Jan 04, 2013
lordZOUGA: @jacob05, nice one boss. Seems as if you learnt coding with "C++ cookbook"... You can do better though
yes boss wink
ProgrammingRe: Sorting List Of Numbers And Strings: Simple Puzzle by jacob05(m): 6:46pm On Jan 03, 2013
ProgrammingRe: Sorting List Of Numbers And Strings: Simple Puzzle by jacob05(m): 6:43pm On Jan 03, 2013
@lordZOUGA i hail ooooo
I'm Quite new to C/C++ but here is my lengthy version...


#include <string>
#include <vector>
#include <functional>
#include <iostream>
#include <algorithm>
#include <sstream>

using namespace std;

void split(const string& s, char c,
vector<string>& v) {
string::size_type i = 0;
string::size_type j = s.find(c);

while (j != string::npos) {
v.push_back(s.substr(i, j-i));
i = ++j;
j = s.find(c, j);

if (j == string::npos)
v.push_back(s.substr(i, s.length( )));
}
}

bool isIntergerFamily(string value){
int myint =0;
stringstream(value) >> myint;
if (myint != 0){
return true;
}else{
return false;
}
}


template <class T>
void printOut(vector<T> temp ){
for (int i = 0; i < temp.size( ); ++i) {
cout << temp[i] << " ";
}
}

template <class T>
void maskOrder(string type, vector<T> inputVector, vector<string>& maskVector ){
stringstream ss;
for (int i = 0,counter = 0; i < maskVector.size( ) && counter < inputVector.size() ; ++i) {
if(type == "int" && isIntergerFamily(maskVector[i])){
ss.str(""wink;
ss << inputVector[counter];
maskVector[i] = ss.str();
counter++;
}
if(type == "string" && !isIntergerFamily(maskVector[i])){
maskVector[i] = inputVector[counter];
counter++;
}
}
}

int main( ) {
vector<string> splittedString;
vector<string> tempVector;
vector<string> stringVector;
vector<int> intergersVector;
int myint;

string inputString;
cout << "Enter String :";
getline(cin,inputString);
split(inputString, ' ', splittedString);

tempVector = splittedString;
sort(tempVector.begin(),tempVector.end());

for (int i = 0; i < tempVector.size( ); ++i) {
if (isIntergerFamily(tempVector[i])){
stringstream(tempVector[i]) >> myint;
intergersVector.push_back(myint);
}else{
stringVector.push_back(tempVector[i]);
}
}
maskOrder("string",stringVector,splittedString);
maskOrder("int",intergersVector,splittedString);
printOut(splittedString);
}
EducationRe: Unilorin 2012/2013 Admissions by jacob05(m): 7:30pm On Dec 15, 2012
prodahood: poor usage of English. .....you better than that bro...bravo
prodahood: poor usage of English. .....you better than that bro...bravo
See Person wey dey correct Person.. lol... Olodo Dey Correct Olodo
ProgrammingRe: Are There No C++ Proogrammers In The House? by jacob05(m): 11:46am On Dec 15, 2012
smiley
ProgrammingRe: [C++ Open Source] Relax! ( File Management Tool) by jacob05(m): 12:30pm On Nov 25, 2012
Wow, Cool project.. remember doing sometime like this but not as deep while learning python back then (https://www.nairaland.com/197567/programming-challenge-pythonjavavb.net-etc#3297355).... Thumbs Up #Following wink

1 2 3 4 5 6 7 8 ... 19 20 21 22 23 24 25 26 27 (of 37 pages)