₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,965 members, 8,447,994 topics. Date: Sunday, 19 July 2026 at 01:21 PM

Toggle theme

LogicDcoder's Posts

Nairaland ForumLogicDcoder's ProfileLogicDcoder's Posts

1 2 3 4 5 6 (of 6 pages)

EducationRe: Ukaegbu Stephanie Graduates With First Class From Godfrey Okoye University by logicDcoder(m): 3:18pm On Oct 06, 2020
Beauty with brain! Congrats
CrimeRe: Police Officers Break A Man's Head In His House In Delta (Disturbing Video) by logicDcoder(m): 3:57pm On Sep 28, 2020
angelEmade:
Nigerian Police being unprofessional since 1648
Someone on nairaland once said he feels happy whenever these miscreants in uniform fall dead. Yes we all insulted that fellow...why? Well, because we feel policemen have families too.
.
.
Hush!
Wait a moment and judge yourself.
Let your own words create a fluke of reminisce within you.
This man with a broken skull have no family?
The many Nigerians that are slaughtered daily have no family?
.
.
La familia! They do!! It goes without saying!!

Their family groans in pain every single moment...the torment is forever, the pain is eternal.
Gifty Akita once said...
"What shall it profit a man to dance like a python but swallowed whole by an earthworm? Everyman is free to do evil but let him know that the evil shall be upon his own head"
.
.
There is an old Palestinian poem that said:
"A child less than nine
With a people from the Nile
In the nights he stood against the tanks
With a stone he aimed at the armies.
Do you know who is stronger?
It is not the adversaries that taketh the soul
Nor the armies with guns and bayonet s
But the child with the pebble
Who, with hope,
Fought a tank with a pebble."
.
.
.
One day, guns will no longer be enough to stop the common man.
I can only wonder what their next weapon will be.
One day, the child of a slain man will rise to the killer of his father
The uniform of our police would no longer mean a thing... The guns of the army might fail them and yes...
.
.
SARS will finally dance to the music.
...the music of sarz on the beat.
.
.

If you are a uniformed personnel reading this,let your mind flash back to that bribery, that rape, that extortion, that innocent kill...
.
.
Imagine that they were your own children.
Feel the pain... Feel their pains.
...yes...like that,may you feel their pains continually.
.
.
#forever
hmmm
Nairaland GeneralRe: Computer Science Vs. Software Engineering – How Are They Different? by logicDcoder(m): 7:11pm On Sep 27, 2020
Bro for my own side ooo... computer science na d branch of engineering science dat studies (with the aid of computers) computable processes n structures(in CS you learn the art of solving problems with existing algorithms, developing algorithms using programming languages and others. U will make use of discrete math, data structures, existing algorithms etc. in solving problems) while software engineering is a branch of CS dat deals with the development of software and testing of the software.(In SE you will learn all d software design processes, a lil bit algorithm n DS and a lot of tools used by developers. ).
Just see CS as industrial chemistry and SE as chemical engineering!
Christianity EtcRe: Prophet Odumeje Celebrates His Wife, Uju Ohanaemere On Her Birthday (Photos) by logicDcoder(m):
Hmmm I laf in bahose!

CareerRe: What Would Your Occupation Be If You Followed Your Childhood Dream? by logicDcoder(m): 3:56pm On Sep 15, 2020
A versatile engineer!
ProgrammingRe: When Do I Use Calloc() And Malloc() In C Language? by logicDcoder(op): 8:00am On Sep 14, 2020
valzey:
Malloc does not set the bytes it allocates to zero while calloc does. That is their difference.
Other than this, they are the same, they are all contiguous blocks I think.

If you allocate sizeof(char) * 5, and you will use all of the bytes, malloc is OK, if you may not use up all the bytes, then use calloc so that the unused parts will be zero.
you have a point thanks
ProgrammingRe: When Do I Use Calloc() And Malloc() In C Language? by logicDcoder(op): 9:28pm On Sep 12, 2020
Just look at the second image.
Line 47.
lemme simplify the code for ya.

struct node *new_node = NULL;//Here i created a pointer which is actually pointing to nothing.

new_node = malloc(sizeof(node));//Here the pointer is now pointing to an actual object of type node here.

You saying that malloc initializes an object to zero is something foreign.
My question is when to use malloc() and calloc?
Should I use calloc() only when allocating storage for arrays or other contigous data structures?
ProgrammingRe: When Do I Use Calloc() And Malloc() In C Language? by logicDcoder(op): 9:16pm On Sep 12, 2020
valzey:
I think using malloc, the block of memory you have is uninitialized, i.e: whatever data in that space previously will remain there. while in calloc, it is initialized to zero.
Calloc is like a combination of two functions
Malloc and another used to initialize to zero.

Use malloc if you'll use all the blocks allocated and use calloc if you'll use some of the blocks allocated.
I don't really understand what you mearnt by malloc initializing to zero. I don't really know where you get this. Malloc function is used to allocate storage dynamically for objects. In what I understood malloc() allocates storage uncontigously(malloc returns a pointer to void(generic pointer) which is pointing to a memory block) while calloc() allocates memory contigously.
You aforementioned using malloc() when all the blocks are allocated (which blocks?).
ProgrammingWhen Do I Use Calloc() And Malloc() In C Language? by logicDcoder(op): 12:03pm On Sep 11, 2020
I normally use calloc() (since it allocates memory contiguously which is suitable for arrays) when I want to allocate space/storage for arrays and malloc() when I want to allocate memory space for structures (creating a node for linked list,queues,binary trees etc).
Looking at the implementation of stacks->
Using arrays: each element on the stack is linked with the previous element contiguously.
Using linked list each node(each node is a self referential structure) containing the element are only linked using pointers.
Does it mean that for I to use calloc(), the DS I'm working with must be contiguous in nature.
What happens in the memory when I use calloc() to allocate storage for linked list,queue,tree and other ADTs node.
C++ programmers can also contribute!
Image 1 & 2 -> Implementation of stacks using arrays.
Image 3&4 -> Implementation of stacks using linked list.

Don't mind my English lalasticlala !�

SportsRe: Quim Torra Bids Messi Farewell by logicDcoder(m): 10:03am On Aug 26, 2020
Sanchez01:
Ronaldo left after back-to-back-to-back (3) Champions League trophies while Messi is leaving after a horrible 2-8 show. Messi is good, no doubt but definitely not half the leader Ronaldo or Ramos is.

It is one of the reasons he should leave because he has no business wearing the captain band but the politics won't make anyone admit it.
Make i catch u dia. na messi come tell u naaa. All I know is that messi has a foresight , he has seen this defeat already. He wants changes but the board members where so corrupt.
SportsRe: Lionel Messi Tells Barcelona He Wants To Leave by logicDcoder(m): 12:36am On Aug 26, 2020
Barca meee! He told u guys to make some changes on time but ppl where shouting that he is controllin barca board members. He really wants the best for barca
PhonesRe: "My Sim Has Been Hacked, Someone Is Picking My Calls" A Nairalander Cries Out by logicDcoder(m): 3:52pm On Aug 25, 2020
Cancel all call diverts
SportsRe: Lionel Messi Does NOT Call All The Shots At Barcelona... But Fans Wish He Did. by logicDcoder(op): 1:10pm On Aug 25, 2020
cc: chief lalasticlala
honeric01
semid4lyfe
SportsLionel Messi Does NOT Call All The Shots At Barcelona... But Fans Wish He Did. by logicDcoder(op): 1:05pm On Aug 25, 2020
Lionel Messi was once the quiet kid in the corner of the dressing room who barely made eye contact with team-mates. Now it seems he calls the shots at Barcelona.
As another coach falls and the club's president Josep Bartomeu continues to wobble as elections for the club's most powerful position are brought forward to next March, Sportsmail asks: just how politically powerful is the Barca captain?

https://i.dailymail.co.uk/1s/2020/08/17/12/32043494-8635149-image-m-2_1597663109809.jpg

From timid teenager to boss at Barca... he runs the club doesn't he?
No. And many Barcelona supporters will tell you if he did run the club it wouldn't be in the mess it's in. If Messi really called the shots to the extent that some believe he does then Neymar would never have left, or at least would have been re-signed by now and Antoine Griezmann would probably never have arrived. Ernesto Valverde would not have been sacked in January and replaced by Quique Setien. The list goes on.

https://i.dailymail.co.uk/1s/2020/08/17/12/32043604-8635149-image-a-3_1597663283835.jpg
https://i.dailymail.co.uk/1s/2020/08/17/12/32043616-8635149-image-m-5_1597663361670.jpg

But he has huge influence and he is not afraid to wield it...
Yes that's fair. But this is nothing new. Remember Wayne Rooney handing a transfer request in at Manchester United in 2010 and issuing a statement about the club's failure to match his ambitions and compete in the transfer market? Messi is playing the same game, only now the statements are more likely to be made on Instagram or occasionally through journalist allies.

Why don't the club buy the players he wants?
He asked the club to try to re-sign Neymar last summer. There were a couple of very public flights into Paris that ended, surprise surprise, with PSG telling Eric Abidal: no you can't have Neymar. It wasn't very subtle, it didn't appear to be done with much conviction, and it seemed to be a gesture to Messi: look we're doing our best!

https://i.dailymail.co.uk/1s/2020/08/17/13/32045036-8635149-image-m-25_1597666183594.jpg
Messi wanted to be reunited with Neymar this season but the club were rebuffed by PSG

https://i.dailymail.co.uk/1s/2020/08/17/12/32043772-8635149-image-a-8_1597663752051.jpg
Instead they signed Antoine Griezmann with the Frenchman often not gelling with Messi

https://i.dailymail.co.uk/1s/2020/08/17/12/32043940-8635149-image-a-9_1597663873844.jpg
Neymar is on course for a historic quadruple with PSG in the Champions League semi-finals

So he doesn't pick the signings. Does he pick the team?
No, but he knows what he likes and the coach knew what he likes. New boss Ronaldo Koeman will know too. Arturo Vidal never really fitted the Quique Setien idea of what a Barcelona midfielder should be but Messi valued him and so more often than not - including in the starting line-up against Bayern - Vidal played at Griezmann's expense.

https://i.dailymail.co.uk/1s/2020/08/17/12/32043986-8635149-image-a-11_1597664010387.jpg
Arturo Vidal (right) started for Barca against Bayern - with Messi valuing the Chilean highly

Has Messi made life hard for Griezmann?
No, not hard. The two met up in Ibiza when the players went on their mini-holidays after the league season finished and the Champions League restarted. They get along. But it's no secret that Messi would have preferred the club re-sign Neymar than sign Griezmann.
He has also taken 17-year-old Ansu Fati under his wing. And when training restarted after lockdown but players could only work together in small groups it was notable that Fati and Luis Suarez were in Messi's training group and Griezmann wasn't.

https://i.dailymail.co.uk/1s/2020/08/17/12/32044042-8635149-image-m-13_1597664100359.jpg
Despite their obvious qualities, the Griezmann-Messi experiment is yet to have delivered

https://i.dailymail.co.uk/1s/2020/08/17/12/32044062-8635149-image-a-14_1597664174988.jpg
In contrast, the 33-year-old has taken teenager Ansu Fati under his wing at the Spanish giants

Is all this healthy?
What's healthy for Barcelona is that Messi is happy and playing at his best. These are not power plays for the sake of it; he wants to win. He wants to retire with the biggest trophy haul possible. He only has three Champions Leagues (he doesn't count the win over Arsenal in Paris when he was in the stands) and as far as he is concerned that is not good enough. And his likes and dislikes are often just logical.
It didn't make a lot of sense for Barcelona to sign Zlatan Ibrahimovic in 2009. Messi had just made the false nine position his own. And if he was going to be playing centrally where was Zlatan going to play, on the wing? No chance. Messi knows what works and what doesn't.
When he ceases to be the player who gets Barcelona out of trouble then he will no longer be able to justify having his say but right now he is still their saviour. They were only in Lisbon because he turned on the style against Napoli to put them through.

And what does he want now?
He wants real change at the club and that can only mean a new president. His relationship with Joan Laporta was always excellent and Laporta may well stand in the next election. Another candidate Victor Font seems to have Xavi in the bag as his coach and possibly Carles Puyol lined-up as Sporting Director - that would also be a massive improvement on the current situation.

https://i.dailymail.co.uk/1s/2020/08/17/12/32044102-8635149-image-a-15_1597664276916.jpg
Josep Bartomeu (left) and Eric Abidal (right) are under scrutiny as is the entire Barca board

https://i.dailymail.co.uk/1s/2020/08/17/12/32044132-8635149-image-a-16_1597664343780.jpg
Ex-Barca president Juan Laporta (left) has always enjoyed an excellent relationship with Messi

Is that why he's not denied the story that he is ready to leave the club this summer?
If the fear over him leaving was the factor that forced next year's early elections then it was a masterstroke. Maybe in every bluff there's also small percentage of 'I'll really do this if I have to'. But for now it looks strategic. He believes he can win more before he retires. For all their problems there is still probably more chance of him doing that at Barcelona than elsewhere. But a lot has to change and at 33 he can't really wait around too long for it to happen.

https://i.dailymail.co.uk/1s/2020/08/17/12/32044144-8635149-image-a-17_1597664441002.jpg
Despite an abject season, Messi knows his best chance of winning trophies remains with Barca

source: https://www.dailymail.co.uk/sport/football/article-8635149/PETE-JENSON-Lionel-Messi-does-NOT-call-shots-Barcelona-fans-wish-did.html
SportsRe: Moment Neymar Danced Into The CL Final With His Own Speaker, Only To Lose (Video by logicDcoder(m): 9:23am On Aug 24, 2020
When you win U have Friends but lose they all turn up as fiends! Neymar is a good player whether arrogant or not.
SportsRe: "I Need To Speak To Messi" - Koeman by logicDcoder(m): 6:49pm On Aug 20, 2020
backbone503:
One of Barca's problems is that they've so idolized Messi. Building a team around a single individual is usually very catastrophic. Thats why I so like the Bayern team.
Who told you that they built the team around him... nawa for we nairalanders, we dey talk as if we dey the barca executive seff!!! Messi is just a player and a captain and he doesn't call all the shots.
SportsRe: Lionel Messi ‘isolates’ Himself From Teammates After Barca Defeat by logicDcoder(m): 8:02pm On Aug 17, 2020
FuckThaMod:
Story, no one will like to lose 8-2 compared to lesser loss margins. Stop deceiving yourself okay?
I don hear sir.
SportsRe: Lionel Messi ‘isolates’ Himself From Teammates After Barca Defeat by logicDcoder(m): 10:13am On Aug 16, 2020
FuckThaMod:
You can't win it all but if you wan loose then loose with a lil bit of dignity. Common assist he no even give... Goat ko.
One thing in life is there's no loss with a lil bit of dignity... A loss is a loss.
SportsRe: Lionel Messi ‘isolates’ Himself From Teammates After Barca Defeat by logicDcoder(m): 11:57am On Aug 15, 2020
No matter how huge your are, you can't win it all. Even though messi suffered a huge defeat yesterday that doesn't make him a failure forever. He's still the my GOAT!.
ProgrammingRe: What Was The First Programming Language You Learned And Why? by logicDcoder(op): 5:16pm On Aug 12, 2020
SegFault:
Do you like it?
Yah. After learning C, learning other PL will be a piece of cake.
ProgrammingRe: What Was The First Programming Language You Learned And Why? by logicDcoder(op): 5:13pm On Aug 12, 2020
timmy110:
None! I wanna start now!!! Any help?
I will advice you to learn C|C++ | Java as your first language but I strongly recommend C++ because it has all the features of C and also an OOP. It’s also the best PL for competitve programming which will help you tackle technical interview questions.
ProgrammingRe: What Was The First Programming Language You Learned And Why? by logicDcoder(op): 5:07pm On Aug 12, 2020
SegFault:
Because it was the first a book I bought advised me to learn then I one day asked myself "how are compilers made?" went beating around the bush with a little theory I could not even understand, wrote a little rubbish with C#, but the problem was that I wanted to learn graphics programming and C# was slow and not good enough for that so I had to learn C++ the dreaded ugly language, then I heard of a language faster and "harder" (a lie obviously) and I came to know C and love it.
Wow C language is actually my first PL
ProgrammingRe: What Was The First Programming Language You Learned And Why? by logicDcoder(op): 11:07am On Aug 12, 2020
SegFault:
C#
why c#
ProgrammingWhat Was The First Programming Language You Learned And Why? by logicDcoder(op): 11:33pm On Aug 11, 2020
Over to you the professionals!

ProgrammingRe: Please I Need More Proficient Alternatives C/C++ Coders! by logicDcoder(op):
SegFault:
Get rid of that LINK typedef. Use less of macros/typedefs in the future cause they actually confuse people sometimes, it's stressful going back to check a macro/typedef every single time. You used string as a typedef then used it as a variable in a function. Stop using recursion it is bloodily slow and eats space on the stack (a space for function variables and instruction pointer values for switching between functions) and is prone to segmentation faults, use loops especially for the count function.
Noted boss! but i really love using typedef because it makes me type less. If using for or while loop is better, could you write a function that concatenates two linked lists?
ProgrammingRe: Please I Need More Proficient Alternatives C/C++ Coders! by logicDcoder(op): 10:02pm On Aug 10, 2020
tensazangetsu20:
Check codingschool's youtube channel. Dude is amazing at teaching data structures and algorithms.
Alright thanks
ProgrammingPlease I Need More Proficient Alternatives C/C++ Coders! by logicDcoder(op): 8:30pm On Aug 10, 2020
The code below is an implementation of Linked List using C language. I converted a string of characters to a Linked List. So I need you guys to give me a better alternative here(Check each routine/function and make your changes).

1 2 3 4 5 6 (of 6 pages)