Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,461 members, 7,819,680 topics. Date: Monday, 06 May 2024 at 08:44 PM

Badthinds's Posts

Nairaland Forum / Badthinds's Profile / Badthinds's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (of 14 pages)

Programming / Re: Guys Check Out This Micro-blogging Website by badthinds: 10:21pm On Jun 06, 2017
Not the first shaa. Many have failed. But I hope you'll stand out. Wish you luck.
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 9:21pm On Jun 06, 2017
bjboss is first in Python group



3 lines
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 9:13pm On Jun 06, 2017
TheLordIsGr8:


Is this a kind of competition or something?

I have a one-liner. But I spread it on two lines for ease of understanding for some beginners who may be here.
Also I posted another solution which is not a solution to the problem at all, but for reversing a string, which could be viewed as a subset of a list.

Ok. here is my final solution in one line using python


Given a list, x, the list could be reversed in one line like so

x = [x[len(x)-1-i] for i in range(len(x))]

print(x)

Its a quiz...just for fun.

Great. Your new code is in two lines...but you didn't declare the list in it.
Religion / Is it true that "Heaven" And "Hell" are Parables? by badthinds: 9:04pm On Jun 06, 2017
I've been wondering, the bible, yes, contains many parables.


Is heaven and hell not one of them?
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 9:19am On Jun 06, 2017


Note:

After your answer is posted and result posted, you CAN still make an edit and repost, and results will be reposted .



Python Group

1. logicalhumour - 2 lines (edit)
2. bjboss - 3 lines
3. logicalhumour - 4 lines
4. TheLordIsGr8 - 5 lines

Java Group

Where are you guys?
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 9:10am On Jun 06, 2017
TheLordIsGr8 is currently second in Python group


5 lines
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 9:09am On Jun 06, 2017
TheLordIsGr8:
# Using a recursive algorithm in 4 lines to reverse a string



1. def reverse_string(a_str):
2. if a_str == '':
3. return a_str
4. return a_str[-1] + reverse_string(a_str[:-1])
5. print(reverse_string('nairaland'))


Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 9:09am On Jun 06, 2017
TheLordIsGr8:
# Using python 3 list comprehensions
# you can just copy this post as is into jupyter notebook or any IDE and run it to verify


from random import randint # import random integer generator

ints = [randint(x, 10*x) for x in range(10)] # create a random list of integers

# Two lines for better understanding

k = len(ints)
rev_ints = [ints[k-1-i] for i in range(k)]
print(rev_ints)




# here the same code is as a one-liner. just substitute the value of k directly in the list comprehension


rev_ints = [ints[len(ints)-1-i] for i in range(len(ints))]



# Here it is using a list of strings

animals = ['goat', 'dog', 'cat', 'mouse']
rev_animals = [animals[len(animals)-1-i] for i in range(len(animals))]
print(rev_animals)

# If you need to change the original list all you need to do is to reassign the original list to the value of the reversed list like so

ints = rev_ints
animals = rev_animals

Please. Decide on one solution. Thanks
Programming / Re: Please Guys Advice Needed Urgently by badthinds: 11:17pm On Jun 05, 2017
Wow!!!. Very nice interface, I must say.
May the unseen Energy of the Universe bless your efforts. I wish you well bro. Good work.


First of all:
1. Taking an advice is optional
2. An advice may lead you to trouble
3. An advice may save you from trouble.

Answer these:
1. What features distinguishes snoott.com from twitter.com?

2. Would you be able to take the bulk of nigerian and those they follow already on twitter?

3. What's the aim of twitter.com ...is that your aim? ...would you be able to get nearly all Nigerian celebrities to signup for us to continue the follow?
3i. Would you be able to move the bulk of their tweets to make a comforting snoott?

4. Is it truly a new way to discover?
4i. If yes, how?
4ii. How is it different from twitter.com and the likes

5. Give five reasons why I should signup if I already have a lot of my friends and fans (Nigerian ...and world-wide) following me already

NOTE :
I'm not here to discourage/down grade you...I see the efforts you and you colleague put in the beautiful snoott.com.

Snoott.com is beautiful but NOT creative. (In the way I define creativity)

I'm not here to tell the builder how to build as a fan of a community I advised once told me here on Nairaland.

anyway, the ball is in your court. You can overtake the giant twitter if you work hard!!!

I categorically told a friend of mine. "Don't create a Google, Facebook, or Twitter. Think of anything that would be added as different from the three I listed"

I saw a 'share on twitter' for every post in snoott.com.

Pheew!

Now.

Great work bro.
Signing up didn't take my time.
I wasn't given any feedback for snootting, in as much as I didn't see changes for a while.
I followed easily.
Its fast. Though i'm using a fast network.

Then lastly. The body of the site is excellently attractive but the topmost. Can you add a little work there?

I'll be following you closely ...I may even invite some of my friends to signup there.

Sincerely, me, badthinds. Following.
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 8:25pm On Jun 05, 2017
logicalhumour is winning in Python group


4 lines
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 7:28pm On Jun 05, 2017
Jenifa123:
Php

$preserved = array_reverse($input, true);
Inbuilt methods not allowed
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 7:25pm On Jun 05, 2017
FrankLampard:
In Java

Collections.reverse(list);

FrankLampard, Inbuilt methods NOT allowed.
Above all, you aren't topping in Java...isn't a full program in Java.
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 7:24pm On Jun 05, 2017
TheLordIsGr8:
Is the list you will provide already sorted?

Will there be need to sort the list if it is not already sorted?

In python it's as easy as calling

input_list = sorted(input_list, reverse=False/True)

No no no.
1. No need to sort anything.
2. Do not use inbuilt methods

Just create a list and maybe, use a loop or however to reverse it.
Programming / QUIZ: How Many Lines Of Code Can You Use To Reverse A List by badthinds: 7:53am On Jun 04, 2017
Many languages and nethods can be used.

The aim of this quiz is to write a program that reverses a list eg [1, 2, 3] ==> [3,2,1] with minimal lines of code.

The programmer with the minimal is the winner.
In whatever language you choose, your code shall be compared to those who choose same with you.

NOTE: On reaching a semicolon ( ; ), if no line break, it is considered as line++. (if not, I know guys will use one line. grin))

Start Now. JUST FOR FUN!.

Edit:

Note:
1. Your code should show the declaration of the list
2. Method used in reversing the list.
3. Last line should print the list for confirmation.

Current List


Python Group

1. adejumoadeoluwa - 1 line
1. bjboss
1. Logicalhumour - 1 line
1. TheLordIsGr8 - 1 line (endeavour to add the missing piece)
2. kayoph - 2 lines
2. logicalhumour - 2 lines (edit)
3. bjboss - 3 lines
4. logicalhumour - 4 lines
5. TheLordIsGr8 - 5 lines

JavaScript


1. Kodejuice - 2 lines
2. Kodejuice - 3 lines

Java Group

1. DevDenky - 5 lines
2. Irelokeh - 7 lines
3. Sirnuel - 16 lines

Php Group

1. nsimageorge - 2 lines

C# Group

1. Fedup - 2 lines

2 Likes

Celebrities / Re: Eva Alordiah Confirms Break Up With Fiancé Caeser After 16 Months Of Engagement by badthinds: 10:30pm On Jun 03, 2017
What else? They keep engaging and disenga...I mean breaking up. Das all they know.

Romance / Re: So There Are Still Nice Girls In Nigeria? UNBELIEVABLE!!! by badthinds: 10:07pm On Jun 03, 2017
Sooo MTN-NG is @ Trafford, UK. I-DAN-DIE (God forbid).

1 Like

Education / Re: Nigerian Defence Academy Admission Processes..........68-76RC by badthinds: 9:51pm On Jun 03, 2017
Papacypaul:
67RC AFSB LIST CAME OUT ON MAY 31 2015 NIGHT,ITS SUNDAY THEN...
Source.
Politics / Re: NJC Recalls Six Judges Accused Of Corruption by badthinds: 9:21pm On Jun 03, 2017
Mtcheew...I thought this my post will be at the first page
Family / Re: Would You Marry A Man Like Your Dad? See Replies Girls Gave by badthinds: 9:19pm On Jun 03, 2017
mikezuruki,midehi2:
is your mum's ass not cute enough? lol
I gave you the first 'like' bro

1 Like

Family / Re: Would You Marry A Man Like Your Dad? See Replies Girls Gave by badthinds: 9:18pm On Jun 03, 2017
mikezuruki:
is your mum's ass not cute enough? lol
I gave you the first 'like' bro

1 Like

Forum Games / Re: 95 Percent Of People Failed This Simple Test by badthinds: 9:00pm On Jun 03, 2017
As I've said before. I'm a BIG time genius. (maybe that's why i'm always abstract) grin grin

1. I believe a triangle is independent if and only if its sides does not interfere with anothers'.

With the picture, in its upright form, There are only 6+1 triangles . grin

The big container didnt defile my principle. So it is 6+1 triangles = 7 triangles
grin grin grin.

If 90something percent failed...you should know only this my answer is correct. grin

Paint the 'incomplete' triangles and they background

1 Like

Politics / Re: 16 Reasons why the Planned Fuel Price Hike Doesn't Make Sense by badthinds: 7:34pm On Jun 03, 2017
I can't stop laughing...so before a project be implemented, the only option is to add petrol price.

I have a DREAM. Fuel price would be incremented for every new project: (God, please don't let this dream come true)

if (new_project):
fuel_price ++
if (project_complete):
price = fuel_price
//remains thesame.


grin grin grin

9 Likes 1 Share

Forum Games / Re: For Geniuses Only by badthinds: 8:40pm On Jun 02, 2017
Well, i'm a genius...serious one grin

All examples disagree with maths. Not even metrics.

ANS: 1089

(If you had told us to device the method you used in your calculations...it would have been a different case)
First example: Wrong
Second example: Wrong

...i'm always serious tho grin

10 Likes 2 Shares

Programming / Re: Suggestions Needed by badthinds: 8:27pm On Jun 02, 2017
Muhammedbashir:

Sir!!!
Why did u say so sir?
Don't mind the guy...I got the weed from him.
...and cbrass, when did you become a programmer? grin
Programming / Re: How To Marketize A Website by badthinds: 8:08pm On Jun 01, 2017
Is it a forum-like stuff?
Politics / Re: Shettima Breaks Fast With Messengers And Drivers by badthinds: 7:27pm On May 31, 2017
Did all these men really fast?

2 Likes

Health / Re: My Hen Lays Yolk Seperately From Shell (pictures) by badthinds: 7:21pm On May 31, 2017
And

Health / Re: My Hen Lays Yolk Seperately From Shell (pictures) by badthinds: 7:15pm On May 31, 2017
More

Health / Re: My Hen Lays Yolk Seperately From Shell (pictures) by badthinds: 7:13pm On May 31, 2017
Please someone explain this phenomenon to me.

Here are some pictures of today's own. Just this night

Crime / Re: Police Raid Firearm Manufacturing Factory In Benue,Arrest Suspect With Weapon(pi by badthinds: 6:12pm On May 31, 2017
Paulpaulpaul:
Where is the firearm na?



All I can see is one hunter gun, one toy gun, gen and tools
See it here

Crime / Re: Lagos Jungle, Agbole, Where Men, Women Offer Oral, Anal Sex For Fees by badthinds: 5:31pm On May 31, 2017
joenor:
Then go back. grin
Any thing, I will do Uncle...even to share my biscuit with you.

Programming / Re: Suggestions Needed by badthinds: 5:21pm On May 31, 2017
Muhammedbashir:

Thank you very much sir. I so much appreciate ur advices and I promise to follow d lay down steps and heed to ur instructions.

But it only W3schools I knew, can u help me with any other site dat could actually help sir, more also, I have laptop; any tutorial or apps I need to download in order to learn by it.

Another question, wat best suitable to learn programming; Andriod, Bb, Window or even Java phones coz I so much enjoyed using Java phones back den in learning HTML coz all is d button is wat I learnt by heart!!!

Well, w3school is good for running your codes...but owing to the sandboxing and all, why don't you use your laptop / mobile (to save data used for online learning).

I didn't use w3school you know, just hovered around. Since you have a laptop...you're good to go.
Just download the Python interpreter for your OS at https://www.python.org/downloads/

Then for mobile. I think Android is best.
1. There is QPython for android. Its just great, whenever your off laptop...its just same. Transfer your files and continue work.
2. There is CppDroid for C/C++ compilation on android. There is also C4Droid but preferably CppDroid.

Then, before you download and begin Python. You may need a good text editor which will be most helpful (as your lines of code grow from 2 to 10 to 100ds to thousands...good text editors will be your loyal friends )

Suggestions:

1. WingIDE (Very nice one, but the most coolest features such as powerful debbugin comes with the paid version)

2. Sublime test editor is great and free. (I used it..you can just open a folder as a project and keep working with the files and save yourself the openings)

3. Notepad++ (I used it too...you can even choose the current language of the file, for a special kind of syntax highlighting.
...

So in summary

Forget w3schools, use your laptop and download good ebooks. That's how I learnt (after the basics, you download the more serious ones). Youtube videos may be helpful, but I DIDNT use them...when you need real knowledge ...its in the eBook.
Then Android is best in the absence of your laptop.

I Hope this piece was helpful.

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (of 14 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 - 2024 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.