Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,243,097 members, 8,123,474 topics. Date: Thursday, 03 April 2025 at 06:36 AM

LogicDcoder's Posts

Nairaland Forum / LogicDcoder's Profile / LogicDcoder's Posts

(1) (2) (3) (4) (5) (6) (of 6 pages)

Programming / Re: A Thread For Competitive Programming by logicDcoder(m): 6:02pm On Jan 29, 2021
Grandlord:


Make we reason time complexity for we solutions? If na so abeg indicate the big O wey our solution suppose run. I know say na mostly O(N) sha.


Abeg wey you get the questions from?

You don't need to know any of this when solving this kind of problem here in nairaland. CP sites like Topcoder, CodeSignal , Hackerrank etc requires the knowledge of time complexity. Bro just study each problem and try and solve 'em.(Here you don't have any time or memory limit).

I got it from CodeSignal

1 Like

Programming / Re: A Thread For Competitive Programming by logicDcoder(m): 10:42pm On Jan 28, 2021
tensazangetsu20:
This is for the gods of programming. I don japa grin grin.

Where you dey go?... Relax and learn

2 Likes

Programming / Re: A Thread For Competitive Programming by logicDcoder(m): 10:41pm On Jan 28, 2021
Problem 1 Solution:

PL used: Java

The approach was quite easy.
Pseudo Code
[1] Iterate the array and multiply the adjacent elements and then compare the product with the variable containing the max product.
[2]If the product of the adjacent element is greater than that of the variable containing the max product then assign the value of the product of the adjacent element to the variable containing the max product.

1 Like

Programming / Re: A Thread For Competitive Programming by logicDcoder(m): 10:18pm On Jan 28, 2021
WEEK 1:
Well will start from the easy ones:

1 Like

Programming / A Thread For Competitive Programming by logicDcoder(m): 10:00pm On Jan 28, 2021
Good Morning NL!

This thread is meant for programmers [noob] that want to sharpen their problem solving skills using any programming language. The OP of the thread will be posting two/three algorithmic problems here every week.

READ ME: Anybody can contribute his/her own solution but make sure to provide the pseudo code. You can use any programming language of your choice. To submit your solution screenshot your IDE and post the resulting image here(A well commented code don't need a pseudo code). Scroll Down To See Week 2 Questions.

Thread Official Languages: English/Pidgin English

NB: Try and solve the problems first before consulting Mr Stackoverflow.

Ogah Seun, Mukina2 and lalasticlala let's give this thread a chance *smiles*

Thanks
Okeke Enoch Chibuzo

2 Likes

Programming / Re: Programmers Are Good In Mathematics by logicDcoder(m): 9:33pm On Jan 28, 2021
Programmers make use of a branch of mathematics known as discrete math. You don't have to be guru at math to learn how to program. It also depends on the level you're operating on.
Programming / Re: I Need Focused People To Join A Whatsapp Group For Learning Java by logicDcoder(m): 9:01pm On Jan 27, 2021
let's go! +2349033629167
Health / Re: Weird: As A Baby On A Flight To Pakistan Swallowed An AAA Battery. by logicDcoder(m): 1:49pm On Jan 24, 2021
wow
Programming / Re: The Best Way To Understand Multithreading In Java -> I Need Help! by logicDcoder(m): 2:21am On Jan 22, 2021
parkervero:

Since you said @bold then, get Java Concurrency book, it is the best book that explains java multithreading, it's a 400+ pages. Funny enough I have worked on threads today. I won't rush to say you're experiencing deadlock but get that book.

Thanks
Programming / Re: Is Using VPN A Crime? by logicDcoder(m): 11:19am On Jan 15, 2021
Using vpn in some countries like north Korea(You don't even have access to foreign OS), China and Russia is illegal. But it's only illegal when you use it to access illegal/restricted websites.
Programming / The Best Way To Understand Multithreading In Java -> I Need Help! by logicDcoder(m): 10:51am On Jan 15, 2021
Good Morning Guys. Multithreading is one the most complicated topics that I have ever faced in java (esp. synchronization methods and interthread communication). I understood all the theoretical concepts but my problem is implementation. Can someone also explain Producer-Consumer Problem using threads?

ps: You can refer me to any pdfs, Youtube video or web pages.

Programming / A List Of The Weirdest Programming Languages... With Examples! by logicDcoder(m): 10:07pm On Jan 11, 2021
Hey people. I hope you are having a fantastic day.

Lately I have been having loads of fun with esolang related things. I decided to share some of the weirdest and coolest programming languages I have used.


ArnoldC - programming language based on the one-liners of Arnold Schwarzenegger.

AsciiDots - a programming language based entirely on ascii art.

Cheese++ - a programming language based almost entirely on the operational working principles of cheese.

Chef - a stack-based language where programs look like cooking recipes.

Cow - programming language was designed with the bovine in mind.

Emojicode - a open-source, full-blown programming language consisting of emojis.

FALSE - a programming language built to confuse everyone with an obfuscated syntax.

Folders - a language where the code is written with folders.

LOLCODE - a programming language inspired by lolspeak, the language expressed in examples of the lolcat Internet meme.

Malbolge - a programming language named after the eighth circle of hell in Dante's Inferno, the Malebolge, designed to be impossible to use.

Ook! - a programming language designed for orangutans.

reMorse - a programming language made to look like Morse code.

Rockstar - a programming language designed for creating programs that are song lyrics.

Omgrofl - a programming language where all commands are made up of internet acronyms, such as lol, wtf, brb, stfu, and more.

Shakespeare - A programming language created with the design goal to make the source code resemble Shakespeare plays.

Thue - a language of symbols.

TrumpScript - make python great again.

Whitespace - A programming language composed entirely of whitespace.

You can find a hello world example for all of these languages in this github https://github.com/gadhagod/Wierd-Languages repository. If you want a language added to the list, comment or open a pull request!

Thanks for reading. Definitely try out some of these.
Sports / Laliga: Barcelona Dressing Room Tears Apart As Messi And Ter Stegen Fight. by logicDcoder(m): 8:44pm On Jan 03, 2021
[img]https://img./hsi/aHR0cHM6Ly9kYWlseXBvc3Qubmcvd3AtY29udGVudC91cGxvYWRzLzIwMjEvMDEvdGVyc3RlZ2VuLWxlb21lc3NpLmpwZWc=/images/terstegen-leomessi.jpeg[/img]

Barcelona king, Lionel Messi, has reportedly clashed with goalkeeper, Marc-Andre ter Stegen as the crisis in the club's dressing room reaches a boiling point, according to Diaro Gol.

This is not the first time Messi and the German shot-stopper have fallen out at Barcelona as they have had issues in the past as well.

According to the newspaper, the Argentine superstar and the goalkeeper have had a massive bust-up that has seen their relationship falling out completely.

The Spanish newspaper said that the reason for their fight is because Messi had opted for Keylor Navas as his first choice during the voting for the FIFA The Best awards.

Messi went on to choose Bayern Munich's Manuel Neuer and Atletico Madrid's Jan Oblak as his second and third choices.

This was rather seen as quite a shocking choice of votes from the South American superstar who generally always voted for his teammates.

And his decision of snubbing Marc-Andre ter has not gone down well with the goalkeeper.

Diaro Gol reports that Ter Stegen has even reconsidered his future at the club despite renewing his contract with the club recently.

Ter Stegen has now reportedly put a hold on his autobiography movie, with the reason being that he wants his movie to be made next season when Messi is expected to leave Camp Nou.

It is certain that Messi will leave the club next summer, however, as of now, there seems to be no offer.
European Football (EPL, UEFA, La Liga) / Re: Fc Barcelona Fan Thread: "més Que Un Club" by logicDcoder(m): 1:19am On Dec 08, 2020
Godx:


In the last 3 matches without Messi, the whole team was flying.
All players moved around a field freely and passed freely. They had several passing options.
When Messi is on a field, our players turn into braindead zombies who are afraid of him, who can't pass freely anymore. Messi takes every ball, slows down and plays some stupid hero balls. Messi is a huge reason why we are slow in a build up and attack and why teams are parking a bus.

Imagine a match without Messi:
= if Coutinho has a counter, he will release a pass fast to Braith or Griezz.
And we will shoot 10 seconds later.

The same action with Messi on a field: Cou can't play a fast pass. He needs to slow down and pass to Messi. Braith and Griezz won't get the ball behind the defence in a counterattack.
Messi will slow down, dwell on a ball, wait until the opponent parks the bus and then he'll try a hero looped through ball to Alba or some weird, illogical shit. Once out of 10 attempts, that pass will work and some fans will say: but but but he had 2 key passes. Yes, he did.
But he lost like 18 other balls, killed counters, killed the movement from our attackers etc.

He is ruining majority of actions and his decisions are quite dumb lately.

People laughed at Kiev and Ferenc.
We could have scored 10+ easy goals in 2 matches without Messi.

But when Messi returned against a mighty Cadiz, we play worse and slower than ever.

You don't need to be a Sherlock to figure out why.

Very soon him go live barca go else where make i see who una go blam

1 Like

Crime / Re: Thieves Steal Condoms And Viagra From A Pharmacy In Port Harcourt by logicDcoder(m): 7:54pm On Dec 07, 2020
Those guys are po*n actors. They wan use am minimize expenditure. Better drugs wey dey expensive full there why qumdoms n viagra.

Politics / Re: Youths Destroy Abba Yaro's House, Cars Over Death Of Domestic Worker by logicDcoder(m): 7:44pm On Dec 07, 2020
Make I reserve my comment

1 Like

Programming / Re: What Programming Language Did You Learn First? by logicDcoder(m): 9:57am On Dec 07, 2020
C-lang
Programming / Re: We Need Algorithms And Data Structure Section In Nairaland! by logicDcoder(m): 2:10pm On Dec 05, 2020
Karleb:


Well, every programming is real programming. I suppose.


So what's your favorite data structure?
For now LL and Q
Programming / Re: We Need Algorithms And Data Structure Section In Nairaland! by logicDcoder(m): 6:35pm On Dec 04, 2020
Karleb:
No need. Most people aren't interested anyways.
But that's the real programming!
Programming / Re: When Does A Beginner Become A Programmer, And Should Start Applying For Jobs? by logicDcoder(m): 10:18am On Dec 04, 2020
cixak95211:


shocked shocked shocked

Hmmmm
Programming / Re: Just For Fun: Check Out An ATM I Created With Java by logicDcoder(m): 11:38pm On Dec 03, 2020
salvationproject:
tnk u sir

Never really used methods cuz it was no real reusability of codes needed but just as u said, the code would have been neater
okay
Programming / We Need Algorithms And Data Structure Section In Nairaland! by logicDcoder(m): 10:54pm On Dec 03, 2020
Please mods we really need a section in nairaland dedicated for DSA. What Do You Guys Think?
DSA is very important in the life of every programmer and we need a section here where programmers can meet up and solve DSA problems.

1 Like

Programming / Re: When Does A Beginner Become A Programmer, And Should Start Applying For Jobs? by logicDcoder(m): 10:53pm On Dec 03, 2020
Guys I need someone who will explain what time complexity(Linear time, quadratic time, logarithmic time etc.). It has been holding me back since. Learning data structures and its implementations + Algorithms are very easy.
Programming / Re: Just For Fun: Check Out An ATM I Created With Java by logicDcoder(m): 10:42pm On Dec 03, 2020
Your code would be cleaner if you break common operations there into classes and methods.
Programming / Re: Funny Mistakes You Normally Make While Writing Programs by logicDcoder(m): 10:30pm On Dec 03, 2020
parkervero:
If you code in java your IDE should warn you na. All the 3 major java IDEs will warn you of missing semi colon(wink
IDE reports common syntax errors but not all ooo
Programming / Re: Funny Mistakes You Normally Make While Writing Programs by logicDcoder(m): 10:27pm On Dec 03, 2020
cixak95211:
lol . . funny but you should learn to use a debugger
instead of having to manually screen every line trying to find where you did a typo or didn't add a terminator . . .

I don't know how to use debuggers
European Football (EPL, UEFA, La Liga) / Re: R36L Madrid - Most Successful & Greatest Champ15ns of Spain, Europe & W9rld by logicDcoder(m): 10:25pm On Dec 03, 2020
TheHulk616:
messi is overrated angry

Hmmm You're right
Programming / Funny Mistakes You Normally Make While Writing Programs by logicDcoder(m): 2:50pm On Dec 03, 2020
Mine is that I normally forget to terminate some statements (I use syntactically written languages(Java, C++ etc.) not dynamically written ones(Python, kotlin etc.)) and also if I want to compile a program using PowerShell I often use backward slashes instead of forward slashes while inputting the program's directory. The latter made me debug a bugless code for over one hour *laughs* trying to find something that's not there. I later found out that I used backward slashes (Even though I was facially happy but deep inside I was filled with anger).

Share Yours!

1 Like

European Football (EPL, UEFA, La Liga) / Re: R36L Madrid - Most Successful & Greatest Champ15ns of Spain, Europe & W9rld by logicDcoder(m): 2:32pm On Dec 03, 2020
TheHulk616:
[s][/s] we don't want another overrated player like hazard.

LOL! Messi is not Overrated bro... It's just that this season no favor am. The guy is really good.
European Football (EPL, UEFA, La Liga) / Re: R36L Madrid - Most Successful & Greatest Champ15ns of Spain, Europe & W9rld by logicDcoder(m): 11:24am On Dec 03, 2020
Real Madrid need to sign Lord Messi at the Moment. #HalaMadrid

3 Likes

European Football (EPL, UEFA, La Liga) / Re: Fc Barcelona Fan Thread: "més Que Un Club" by logicDcoder(m): 11:08am On Dec 03, 2020
M
E
S
S
I
-
G
O
A
T

Whether Messi is playing or not!

8 Likes

Programming / Re: The Hardest Topic You Encountered While Learning Any Programming Language? by logicDcoder(m): 8:47pm On Nov 28, 2020
Etinosa1234:


I think according to Java... Global variables are the ones that can be used by every thing in the class and local variables are variables that can be used only in a method ,inner class or code block that it was created

Example:
Public class MyClass{
public int variable:// this is a global variables
}

Public void VariMethod(int a){
//a is a local variable
}


Accept my humble explanation bro

I nor too sabi
cc peacettw

Bro global variables have different meanings, it depends on language that you're using. how that language defines it determines its characteristics.
for example a global variable in C language is different from that in java(Technically java doesn't support global variable). lemme use C to describe it first.
A global variable in C is a variable declared outside the main function/subroutine /method or other functions. The variable is static in nature this means that it can be accessed by any part of the program(that is other .c files created for that particular project) and it's independent of any block. But a local variable is a variable declared inside a block only the code inside the block have access to this variable. It can't be accessed by codes outside the block. The life time of the variables is one of factors that differentiate the two variable; the life time of global variables end when the program execution end while the life time of a local variable ends when the program control exits the block it is defined in.
C Code snippet
inside main.c file:
#include <stdio.h>
#include <stdlib.h>
//this is a global variable
int myvar;

int main(){
int myvar2;//a local variable since it's in the main block and not modified by static.
static int myvar3;//Another global variable.
//myvar can be accessed here.
}

Now in java people often say that global variable is declared using the the modifier public. Now let me ask you what about the modifier static.
Like I said initially that global variable is independent of any block but in the simple program you wrote the variable depends on the class block which makes the instance variable a local one.
Java doesn't support global variable since using public to define a variable in a class will only make that variable accessible through the object of the class the variable is defined in. Mind you that what you declared in that MyClass Class is an instance variable.
In java to achieve something that is similar to a global variable but not a GV o! Declare a variable using public static modifier.

Look at this code snippet:

class MyClass{
public static int myvar;

//Accesing myvar3
Main.myvar3 = 3;

//myvar2 is invisible here.
}

class Main{
public static void main(Strng[] args){
int myvar2;
static myvar3;
//myvar is visible here
MyClass.myvar=10;
}
}

The code snippet above has shown you the actual thing these modifiers do. Notice that I initialized myvar in Main class using MyClass.myvar. The static modifier made this variable to act like a global variable. The static made the variable independent of the object of MyClass, that's we can access it from the class directly without creating an object of MyClass. So as myvar3 which we accessed in MyClass using Main.myvar3. Also notice that I didn't put public there because all the variable declared inside a class is a public modified variable as far as it's not modified with "private".

These might be confusing but with constant practicing you will scale through.

1 Like

(1) (2) (3) (4) (5) (6) (of 6 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2025 Oluwaseun Osewa. All rights reserved. See How To Advertise. 50
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.