₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,256 members, 8,449,445 topics. Date: Tuesday, 21 July 2026 at 07:04 PM

Toggle theme

Jacob05's Posts

Nairaland ForumJacob05's ProfileJacob05's Posts

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

PoliticsRe: Power: FG To Meet 10, 000mw Target By December – Minister by jacob05(m): 10:14am On Aug 24, 2013
lol
BusinessRe: Nigerian Products Vs Chinese Products by jacob05(m): 12:46pm On Aug 20, 2013
#TecnoTeam
PoliticsRe: Ogun Poised To Overtake Lagos In Development! by jacob05(m): 9:41am On Aug 16, 2013
This is all bull shit, Come to Mowe and see the True development in OGUN . If OGUN must be celebrated for True development, it must start with Mowe. MOWE is horrible!!!!!
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 1:53pm On Aug 04, 2013
Bolubaba: Did you try it?
nope. Reports says it's buggy . Aren't taking such risk
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 10:26am On Aug 04, 2013
Bolubaba: Did you install the CMW-r (custom recovery)
No
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 5:28am On Aug 04, 2013
kenk4life: pls how do I take. screen shots on my l3. please. reply
I'm Using Easy screenshot which can be download from google play
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 5:27am On Aug 04, 2013
mathefaro: please how did you go about it, is it the tutorial above?
yes, if you follow it carefully it is straight forward wink
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 3:56am On Aug 04, 2013
Thanks guys, finally Rooted my L3 phone

PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 3:13pm On Jul 29, 2013
Just got this phone, any help on what to do to make good use of it
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 3:10pm On Jul 29, 2013
Prestige324: have u bought the phone?
yes
PhonesRe: Tecno L3 Discussion Thread by jacob05(m): 9:32am On Jul 29, 2013
Hi tecnorians, pls i want to get this phone today but i've being seeing criticisms about it's display and poor flash camera at night. Any advise?
Forum GamesRe: ~<<The Last Person To Post In This Thread Wins>>~ by jacob05(m): 12:01am On Jul 14, 2013
[size=50pt]JACOB05 Wins[/size]
Forum GamesRe: ~<<The Last Person To Post In This Thread Wins>>~ by jacob05(m): 12:00am On Jul 14, 2013
lol
Forum GamesRe: ~<<The Last Person To Post In This Thread Wins>>~ by jacob05(m): 11:59pm On Jul 13, 2013
.
Forum GamesRe: ~<<The Last Person To Post In This Thread Wins>>~ by jacob05(m): 11:58pm On Jul 13, 2013
who wins? undecided
PoliticsRe: FG Targets $10bn From National Flag Carrier by jacob05(m): 9:14am On Jul 04, 2013
fitzmayowa: Have you taken your medicine todayhuh
hmm, it's that sad we're name sake embarassed, further comment reserved
PoliticsRe: FG Targets $10bn From National Flag Carrier by jacob05(m): 9:08am On Jul 04, 2013
hmmm, Nice Development, First Sha , lol grin
PoliticsRe: Luxury-Bus Owners Confirms That Roads Are Better Now by jacob05(m): 9:06am On Jul 04, 2013
The Driver is probably Drunk.... or the Road Made Him Drunk ... lol grin
HealthRe: 8 Sleeping Positions And Their Effects On Health by jacob05(m): 1:52pm On Jun 30, 2013
Oyinbo sef, which kind position make person dey self?, me don violate everythin o o, i never die sha.
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 3:57pm On Jun 27, 2013
authurowen: Jacob, you are a developer. Can you take a closer look at your implementation and mine and see the difference?

Also try parsing the other test case i provided in my solution to your own solution and see what it returns.
secondly, Using your algorithm (which is wrong) after you're done printing the array, Your Master Array It will become empty (at a quick glance)
I don't know the version of PHP you're using but my code(Unedited) works perfectly well and correct providing the values you used in your code;


<?
class Spiral{

private $masterArray= [];

public function addArray(array $array){
$this->masterArray[] = $array;
}

public function getSpiral(){
$workingList = [];
while (!empty($this->masterArray) ){

$workingList = array_merge($workingList,$this->popListTopArray());
$workingList = array_merge($workingList,$this->popLastArraysElement());
$workingList = array_merge($workingList,$this->popListLastArrayReversed());
$workingList = array_merge($workingList,$this->popFirstArraysElementReversed());
}

return $workingList;

}

private function popFirstArraysElementReversed()
{
if(empty($this->masterArray)) return array();
$workingArray = [];
foreach ($this->masterArray as &$array) {
$workingArray = array_merge($workingArray,(array)array_shift($array));
}
krsort($workingArray);
return $workingArray;

}

private function popListLastArrayReversed()
{
if(empty($this->masterArray)) return array();
$workingArray = [];
$workingArray=array_pop($this->masterArray);
krsort($workingArray);

return $workingArray;
}

private function popListTopArray()
{
if(empty($this->masterArray)) return array();
return array_shift($this->masterArray);
}

private function popLastArraysElement()
{
if(empty($this->masterArray)) return array();
$workingArray = [];
foreach ($this->masterArray as &$array) {
//$testArray = $array[0];
$workingArray = array_merge($workingArray,(array)array_pop($array));
}
return $workingArray;

}
}

//First Implementation
$a = [1,2, 3, 4, 5];
$b = [16 ,17 ,18 ,19 ,6];
$c = [15 ,24 ,25 ,20 ,7];
$d = [14 ,23 ,22 ,21 ,8];
$e = [13 ,12 ,11 ,10 ,9];

$spiral = new Spiral();
$spiral->addArray($a);
$spiral->addArray($b);
$spiral->addArray($c);
$spiral->addArray($d);
$spiral->addArray($e);

var_dump($spiral->getSpiral());

//Second
$a = [ 'R', 'W' ,'Q' ,'F'];
$b = [6 ,'P', 'E' , 'G'];
$c = ['D', 'J', 'L', 'V'];
$d = ['Z' ,31, 'K', 1];

$spiral = new Spiral();
$spiral->addArray($a);
$spiral->addArray($b);
$spiral->addArray($c);
$spiral->addArray($d);
var_dump($spiral->getSpiral());
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 7:10pm On Jun 26, 2013
@authurowen and how is your algo different from mine undecided. huh
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 2:51pm On Jun 25, 2013
But I'm greatly concerned about what is wrong with my implementation.(PHP) huh
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 2:44pm On Jun 25, 2013
kambo: Anoda passve poster in d programmg room.
He shud ,provde his own implementation, justifyg his design choices, for all to see and possibly learn from not just vanish into thin air after postg a Q.
Seconded undecided
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 5:47pm On Jun 24, 2013
:/ @danmc
jacob05: @authurowen what is my implementation not doing? Or should have done?
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 7:07am On Jun 24, 2013
@authurowen what is my implementation not doing? Or should have done?
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 7:34pm On Jun 23, 2013
danmc: he's saying make it dynamic so that it can handle any number of items in the matrix. what u have so far is static. anyway, it's good that u tried.
you can add as much arrays of any length with the addArray na. Or what againhuh
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 7:14pm On Jun 23, 2013
lordZOUGA: this is trivial. you just have print a 2 dimensional data structure in a different way.
your trivial solution will be much appreciated bro
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 7:12pm On Jun 23, 2013
authurowen: Thanks for attempting Jacob. (a PHP Solution is also feasible) but
You solution should be better improved, as we do not know the size of the array until we're read it. so reading the input only 4 times will not suffice.
huh You can add as much array to the list bro. An example to explain what you mean pls?
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 12:43pm On Jun 23, 2013
Just Realise that it's meant to be written in Java or C# . ##awkward Moment
ProgrammingRe: Code Challenge [1]: Pseudo-code, C#, JAVA (apply Object Oriented Principles) by jacob05(m): 12:08pm On Jun 23, 2013
The Above can still be greatly improved sha... undecided... Thanks

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