Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,193 members, 7,822,019 topics. Date: Thursday, 09 May 2024 at 01:50 AM

Naijasensei's Posts

Nairaland Forum / Naijasensei's Profile / Naijasensei's Posts

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

Phones / Re: The Xiaomi Thread. by naijasensei: 11:34am On Dec 02, 2020
genius43:


Una don leave us finish.

Phones / Re: The Xiaomi Thread. by naijasensei: 11:31am On Dec 02, 2020
olaolurhemsy:
RN9 3/64gb or R9 4/64gb? redmi guru which one is more advisable to go for, budgets is not more than 75k, also I heard that most redmi note with 3gb use to hang, pls I need serious explanation. thanks
God bless you

No offense, but you will have to carry out your own investigation. If you can go to a physical shop, please do so, so that you can test those two phones you are interested in personally. You will be able to make a more informed decision.
I currently have a very good Redmi phone I enjoy using, but I have long realised that recommending phones to people based on my personal experience is a very risky business. Happy investigations, thanks.
Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 6:31pm On Nov 28, 2020
syluck:


Bro, there's this python concepts I really need to understand how it works....
I'll list then below:

1: for i in range (2, prompt+1):

Here, I know "prompt" could be a variable where a value is assigned to.....then, (2) is where we want the loop to start from.... My difficulty is understanding what +1 after the prompt stands for....
Like the example above I listed is used when running a code for "divisors of a number*...

2: for i range(1, num+1):
Indent""""""""factorial = factorial * i

Here, the +1 appears again.... But this time around it's the "factorial * i".... Pls I need to understand this concept really good.....

Lastly:

3: for i in range(1, prompt+1):
Indent"""""""""if(prompt %i ==0)
Indent"""""""""s += i

Here, I understand what prompt is, %i is, ==0 is, and s is... The problem is, "+=". I still don't understand vividly what's that all about...in short, u can explain the whole concept "s += i" to me please....

PS: i know that
+ is an addition operator
* Is a multiplication operator
= a equal sign operator ( mostly used to assign values to variables and vice versa)

Q1 - First understand what range() does.
range(start, stop, step). The range function produces values from the start value, upto but NOT INCLUDING the stop value. That is;
for i in range(1,10)
supplies i with values 1,2,3,4,5,6,7,8,9. Assuming prompt = 10, and I want a range of values from 1 to 10 (10 inclusive), instead of range(1, prompt) I would rather use range(1, prompt + 1)

Q2 - factorial = factorial * i is a programming concept you will see a lot of. It means multiply the value referenced by "i" with the current value referenced by "factorial", then let the new value referenced by factorial be (factorial * i)

Q3 - s += i is the same as s = s + i, same explanation as in Q2

s *= i is the same as s = s * i,
s -= i is the same as s = s - i,
and so on.

1 Like

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 5:34pm On Nov 26, 2020
Semtu:


I'll give you hints for number 10, you learn better my figuring things out yourself. You'll need to collect 10 inputs from the user by calling input() through a loop. Outside the loop, create an empty list then append each input to the list while the loop is still valid. Once you've collected the inputs to a list, you can easily play with the python list by calling sorted(). This will sort the list elements in ascending order. Meaning that indexing the first element of the list would be the lowest since the values are sorted while the last would be the highest. To find the average, you can sum the list then divide by the len. Apply similar logic to the rest.

For the second part, this is one way to work through it.
import random
score = [ ]
number=random.randint(1,11)
trials=5
while trials>0:
```indent```guess=int(input('guess the number between 1 to 10: ')
```indent```if guess==number:
```indent``````indent```score.append(10)
```indent```else:
```indent``````indent```score.append(-1)
```indent```trials-=1

print(sum(score))

Nice, great work.

For Q12 though, I believe score shouldn't be a list, rather it should be of type int. So:

score = 0
number = random.randint(1,10)
#different from random.randrange(1,11)

Because of this:
score.append(10) should be score += 10
score.append(-1) should be score -= 1

Thanks.

1 Like

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 8:43am On Nov 22, 2020
syluck:
grin angry grin

Suggest a better one for me please

Think like a computer scientist.
Automate the boring stuff with Python.

Make sure you get the latest editions. Even the one you are using, I suspect there might be a newer version.

5 Likes

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 6:42pm On Nov 21, 2020
syluck:


Thanks bro.

Here is the pdf name

Say what? You're using a 2012 material?

2 Likes

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 6:41pm On Nov 21, 2020
Vecto:


Sorry do you code on mobile?

No, I don't. I just used my mobile to illustrate some stuff. I code on my laptop.
Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 10:38am On Nov 21, 2020
syluck:

Does this automate the 273.15 to -273.15?
Cos that's really my problem. How to run the code inserting the -(minus) operator

My bad, put the negative sign (-) before the number -273.15. (-) is both a unary and binary operator.

1 Like

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 10:15am On Nov 21, 2020
syluck:
Came across this and I tried running the code.

Number 2 and 3 precisely. I'm having problem on both.

In Number 2, I ran the code according to the best of my knowledge but the only issue is having both the Fahrenheit and celcius on both (uppercase, lowercase, first letters both capital and small)

Then for number 3, I just need to understand how to implement the -273.15 when coding.

Thanks

For question 3, you are to use if...elif...else blocks
If you have a variable, temp, pointing to where the temperature in °C is stored. Then:

Point of note, I am only showing this to give you an idea. In practice, in a program, be careful when comparing floating point (decimal) numbers. Floating point arithmetic is not as straightforward as integer arithmetic.

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 10:04am On Nov 21, 2020
syluck:

According to the pdf I'm using to work on, it has eval throughout. I kinda decided to use it though

Drop it, you don't need it.
Try the following for Q2

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 9:33am On Nov 21, 2020
syluck:
Came across this and I tried running the code.

Number 2 and 3 precisely. I'm having problem on both.

In Number 2, I ran the code according to the best of my knowledge but the only issue is having both the Fahrenheit and celcius on both (uppercase, lowercase, first letters both capital and small)

Then for number 3, I just need to understand how to implement the -273.15 when coding.

Thanks

Why are you using the eval function in your code?
Investment / Re: Crowdfunding Investment Platforms And Options (non Agritech Categories) by naijasensei: 8:10pm On Nov 20, 2020
Smartphelz:
I thought I was the only one highly irritated by such an irresponsible comment from the poster you quoted.

The guy had the temerity to put up smileys, mocking people in pains and anxiety, rubbing it in their faces - all because he earlier told them not to invest. I just wonder how pained he is going to be when these people recover their money. Instead of offering encouragement and sound advice, he is busy mocking.
The Bible admonishes to rejoice with people who are rejoicing, and to mourn with those who are mourning. What he did is like rubbing pepper or inflammatory substances in a wound. If he could not offer comfort, he could have just looked away. Anyway, karma will surely visit him in his time of need. May we never associate with people who derive joy and ecstasy in other people's misfortune.

1 Like

Programming / Re: A Thread For Tutorial On Python Programming by naijasensei: 9:39pm On Nov 19, 2020
Missionaire:



Yes I'm trying to run a python script through Sublime TE.

I installed Python from the site. 3.9, the latest version.

I've even edited the new build system in Sublime TE.

First ensure python is working on your system.
1. Go to your list of installed apps, look for Python 3.9 IDLE, launch it. If it opens up go to step 2.
2. Go to your command line, or simply click on Run then type in cmd. At the command line prompt type in python then press enter. If you get an error, type in python3 the press enter. If you get an error again, then it is very likely you did not add your python installation to the Windows PATH variable.

Perform the tasks above, then let me know the outcome.
Programming / Re: Is Https Still Secured As It Used To Be Reliable? by naijasensei: 1:45pm On Nov 19, 2020
Kabiyesi12:
Recently, I beginning to notice some dubious websites that is https which is supposed to be a reliable website but no longer as it used to be.
HYPER TEXT TRANSFER PROTOCURE SECURED
webpage now use for fraud, I don't know if someone else have notice this, for example the

COVID-19 RELIEF FUND

#20,000 each for 1,000,000 Nigeria youths. Disbursement starts December 1st 2020

if you look at the address bar it eventually leads to another webpage.
please, can someone explain what's going on to me.


That a website is using HTTPS by itself doesn't amount to anything. Instead HTTPS ensures your communication with a verified entity is not hijacked.

2 Likes

Investment / Re: Crowdfunding Investment Platforms And Options (non Agritech Categories) by naijasensei: 1:41pm On Nov 19, 2020
enigmatique:

- I have never claimed to be an expert. If I claimed to be or believed that I was an expert, I wouldn't have suggested and agreed with folks like MummyIMadeIt, Pepchizy, Acidosis, benedictuyi etc to create this thread so as to pool our knowledge and experiences and use that to make better investment decisions.
- I refuse to trade words with you. Enough said.

Why are you defensive? Is this your way of resolving an issue? By laughing at people's anxiety? I am not here to banter with you either. Remember, if you can't comfort those that are mourning - don't mock them. I leave you to your conscience, I rest my case.
Programming / Re: A Thread For Tutorial On Python Programming by naijasensei: 1:35pm On Nov 19, 2020
Excallibur:
Please help, I am trying to get a row in this matrix but I keep getting empty as the result of this code

matrix=[
[5, 6, 7],
[8, 3, 1],
[9, 3, 5]
]
for items in matrix:
for rows in items:
if items==items[1]:
print(rows)

I believe you should type the following:

for items in matrix:
for rows in items:
# To print the second row
if items == matrix[1]:
print(rows)

2 Likes

Programming / Re: A Thread For Tutorial On Python Programming by naijasensei: 1:24pm On Nov 19, 2020
Missionaire:
So I tried running "hello world" yesterday night but I keep getting this message:

[WinError 2] The system cannot find the file specified
[cmd: ['python3', '-u', 'C:\\Users\\Okporghe\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\Python3.sublime-build']]
[dir: C:\Users\Okporghe\AppData\Roaming\Sublime Text 3\Packages\User]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Brackets\command;C:\Users\Okporghe\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\Okporghe\AppData\Local\Programs\Python\Python39\;C:\Users\Okporghe\AppData\Local\Programs\Python\Launcher\;C:\Users\Okporghe\AppData\Local\Microsoft\WindowsApps;C:\Users\Okporghe\AppData\Local\Programs\Microsoft VS Code\bin;/opt/node_moduler/bin/]
[Finished]

What could be the problem and possible solutions??

What are you trying to do? Are you trying to run a python script through Sublime text? If yes, how did you install Python on your system?
Programming / Re: I Want To Learn Programming. Which Language Should I Start With? by naijasensei: 1:15pm On Nov 19, 2020
ebunchi:


Can I learn PHP on my own since I already know JavaScript, and is there any PHP frame work ?thanks

Yes you can learn PHP on your own. As an added bonus PHP syntax is very similar to that of JavaScript (both use C based syntax). As JavaScript is used mainly on the frontend ( mostly browsers, with NodeJS being a notable exception used for backend coding), PHP is used (in conjunction with web servers - Nginx, apache, IIS) to code for the backend.
There are many PHP frameworks, some popular ones are: Laravel, Symfony, Slim, Codeigniter, etc.

1 Like

Investment / Re: Crowdfunding Investment Platforms And Options (non Agritech Categories) by naijasensei: 12:41pm On Nov 19, 2020
enigmatique:
grin grin grin
All I can do is to laugh. At least when the dust settles, we will return to reasonably reviewing and investing in companies. Hehehe.

As for anyone that loses money, take your L, move on, and never make this kind of mistake again. Investing is a marathon, not a sprint, and while it's best to learn from data, research and advice, learning from experience can be valuable too, because it makes the lesson visceral, not just vicarious or theoretical. Better to lose 250k now than lose 250 billion later.

Please, continue laughing. It's like some of you get orgasmic whenever other people are facing challenges. If you cannot help in putting out a fire, it will be highly irresponsible to add petrol to said fire. If you cannot add soothing balm to a wound, don't apply an irritant. Just because people didn't accept your "expert" advice doesn't give you the right to lord it over them, or taunt them.
And before you post a holier than thou retort about me being bitter and emotional because I have lost money - I have never, and will probably never invest in themap. Always show emphaty at all times. You are in no way better than those who are agitated and feeling down right now.

7 Likes

Programming / Re: Advantages Of Coding Your Own Website Rather Than Using Wordpress Or Wix by naijasensei: 12:50pm On Nov 17, 2020
Chingle6:
Please guys I really need insight on this topic... Why will I want to go through the stress of HTML CSS JavaScript php and some other language instead of using word press or wix cry

@Karleb and @tak2hb1 have said my mind, however let me add the following:

When you start viewing every problem as a nail, then you will have to solve every problem with a hammer. WordPress lulls developers into a false sense of progress. WordPress is littered with spaghetti code which is horrible to maintain and test. You are forced to solve all your problems from a WordPress viewpoint.

You are held back from using new, recommended coding standards, and new PHP features because WordPress doesn't readily support such features. Talk about living in the past. Also the reason I stopped using the Codeigniter framework (versions 2 and 3), it never pushed you to use useful things like namespaces and composer.

Learning the basic building blocks (HTML, CSS, JavaScript, PHP) will enable you to understand how those technologies work, and how to optimise them. This knowledge will also let you know when to use a particular tech stack to implement a solution; when to use a framework, and when not to use a framework. There is no one size fits all solution.
Phones / Re: The Xiaomi Thread. by naijasensei: 12:24pm On Nov 17, 2020
[quote author=genius43 post=96134726][/quote]

Let's not allow flies to enter the Alfa's mouth, although I know he is shocked.
Phones / Re: The Xiaomi Thread. by naijasensei: 12:16pm On Nov 17, 2020
The crass ignorance and illiteracy displayed by some seemingly educated peeps is nauseous and utterly disgusting.

He that knows not, and knows not that he knows not is a fool, abandon him.

I know that I know nothing (Socratic irony).

5 Likes

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 5:32am On Nov 15, 2020
syluck:

Thanks for this input. I won't lie, it took me a while before understanding this angry

No shame in that. Some of the concepts are a bit abstract, so it might take a while to understand. Whenever you get stuck, just take your time, relax, do something else, then return to the problem.

1 Like

Phones / Re: The Xiaomi Thread. by naijasensei: 12:21pm On Nov 14, 2020
ityP:



Aswear guy. If na note 9s I buy, e for no shack me like this. I'm just surprised a budget phone of 3 years ago can still be this good. I just enter camera app now, and I saw that the interface is changed too. From that minimalistic look to one that has swag. Plus, the update touched on autofocus issues. Before, I had to tap to focus first before taking a shot. Not any longer. The overall output from the camera is better sef. Why e no go shack me grin

I know that feeling. I now know why Xiaomi phones are more expensive than Lenovo phones with similar specs - Xiaomi/Redmi's software support for their phones is way above Lenovo's league.

4 Likes

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 6:39pm On Nov 12, 2020
syluck:


Hello bro, sorry to disturb.

Please I need a better understanding of question number (9). I've tried so hard to understand what's it all about but I just keep getting a blank idea.

Then, number (11) and (14)

Proposed solution to Q9:

1 Like

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 6:07pm On Nov 12, 2020
syluck:


Hello bro, sorry to disturb.

Please I need a better understanding of question number (9). I've tried so hard to understand what's it all about but I just keep getting a blank idea.

Then, number (11) and (14)

Question 11 proposed solution

1 Like

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 5:23pm On Nov 12, 2020
syluck:


Hello bro, sorry to disturb.

Please I need a better understanding of question number (9). I've tried so hard to understand what's it all about but I just keep getting a blank idea.

Then, number (11) and (14)

Question 9 is about a sequence referred to as the fibonacci sequence. It begins with two numbers: 1, 1. Subsequent numbers in the sequence are gotten by adding the two previous numbers together. For example, the third number is: 1 + 1 = 2. The fourth number is: 1 + 2 = 3. The fifth number is 2 + 3 = 5, and so on. Your program should request for the user to input the number of fibonacci numbers they want. E.g. inputting 3 should produce 1,1,2 while inputting 5 should produce 1,1,2,3,5.
One way of solving this problem is by using a loop. You will loop as many times as the user requests for, but for the first and second pass through the loop you will print(1).

Question 11 is about patterns, there are two major string patterns - the one with 19 asterisks and the one with 2 asterisks separated by 17 spaces. From the diagram, the default width is 19 asterisks while the default height is 4 asterisks. If a user requests for a box that is 40 asterisks wide by 6 asterisks high, you would use a for loop to print the asterisks 40 times in 6 passes - a nested for loop.
E.g.
for i in range(1, height+1):
for j in range(1, width+1):

Let me see what you will come up with.

1 Like

Programming / Re: How To Avoid Getting Scammed On Nairaland by naijasensei: 12:14pm On Nov 11, 2020
Karleb:
I really wish to know how a non-dev can test the knowledge of a developer.

How do you ask someone a question you don't understand yourself?

Imagine if you ask me what "encapsulation" mean because you want to make an API call grin, how do you even know if the reply I'd give is the correct one?

Personally, I would network with people knowledgeable in that field, then ask for their assistance. Alternatively, I would probably outsource the recruitment to those with the requisite knowledge.
Programming / Re: Companies Are Wicked O. by naijasensei: 10:23am On Nov 10, 2020
tensazangetsu20:

Extensive tests like this should never be done for free ever. It looks like a free work. Why are they asking for the Github repo? They can download the code, send a regret email and then choose the best from everyone naive enough to do the test.

I am surprised people can't see what you are seeing. This is an attempted code heist, they are trying to get someone to do free work for them. If they cannot browse your already done jobs, they can shove their job offer where the sun don't shine.
Upcoming developers should not allow desperation to get the better of them. There are many unscrupulous employers out there looking to rip off unwary developers.

3 Likes

Programming / Re: Learning Programming. (my Nairaland Journal) by naijasensei: 10:09am On Nov 10, 2020
syluck:


1, Thanks for clarifying me on that. I thought it was a decimal point. Never knew it was a multiplication operator.
2, I will clearly work on it once more. And I really appreciate the advice.
3, A part of me told me that, but I really tried running that code using for loops, while loops, etc, I just couldn't until I came across functions then I decided to give it a try one more time and boom! it kinda gave me a clue of what I was doing. But it was giving me different answers which did not correspond with the proposed answer. Also, thanks for the advice. I will stick to them.
4, Never knew about PEDMAS. But I knew that python work according to precedence. Just that I didn't really know how that works.

I really appreciate your input.

Lastly, do you have a WhatsApp group or telegram channel for beginners so I could link up and be dropping my troubles as well.

Unfortunately, I don't have links for beginners. Just keep on doing what you are doing. May I suggest studying algorithms and data structures, it will help broaden your understanding a bit.
Programming / Re: Why Do You Love Flutter by naijasensei: 10:30pm On Nov 09, 2020
Rareoil:


No vex what did oracle do?

Oracle changed Java's licensing to enterprise licensing. This means firms that rely heavily on Java (e.g. Android) will have to shell out huge amounts of money to Oracle in order to continue developing in Java. Google are having none of it, and have taken Oracle to court.

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 19 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. 80
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.