₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,013 members, 8,419,946 topics. Date: Thursday, 04 June 2026 at 08:04 AM

Toggle theme

ToheebDOTcom's Posts

Nairaland ForumToheebDOTcom's ProfileToheebDOTcom's Posts

1 2 3 4 5 (of 5 pages)

ProgrammingRe: Can You Solve PHP Problems? Let's Find Out.. by toheebDOTcom(m): 1:32pm On Oct 08, 2016
I'm enjoying your questions.

But I need to do something now. I will be back to answer those not yet answered. For the sake of knowledge!

Nice one!
ProgrammingRe: Can You Solve PHP Problems? Let's Find Out.. by toheebDOTcom(m): 1:25pm On Oct 08, 2016
DanielTheGeek:
What boolean exactly does it return? True or False? And most importantly, why?
I modified my answer. I will explain now
ProgrammingRe: Can You Solve PHP Problems? Let's Find Out.. by toheebDOTcom(m):
DanielTheGeek:
So ToheebDOTcom has 5 points.

Next question:

What will be the outcome of:


And why?
var_dump returns bool.


Modify your question correctly.
Did you mean...
$foo = 'true and false';

or

$foo = true;

$foo = false;

If it is the first case

var_dump returns string



Answer to your modified question..
it returns false..

since it is not in quotes, then 'and'is evaluated as a logical operator. by truth table, truth and false results to false...

Chikena!
ProgrammingRe: Can You Solve PHP Problems? Let's Find Out.. by toheebDOTcom(m): 12:58pm On Oct 08, 2016
I don put code oo danielthegeek.


@franklampard Yea!. That is the only reason
ProgrammingRe: Can You Solve PHP Problems? Let's Find Out.. by toheebDOTcom(m): 12:52pm On Oct 08, 2016
Where is my 5 points danielthegeek?
ProgrammingRe: Can You Solve PHP Problems? Let's Find Out.. by toheebDOTcom(m):
@danielthegeek

Its because the return value is 0 which is interpreted as false by the if condition. To correct that, you will check the TYPE as well using ===

if (strpos(...) !== false) {
echo 'contain'
;
} else {
echo 'does not contain'
;
}
ProgrammingRe: What Is The Difference Between Runtimeexception And Exception Classes? by toheebDOTcom(m): 8:25pm On Oct 07, 2016
paranorman:
you did a good job explaining. Thanks.
How long have you been programming and what languages are you pro in?
PHP. Some months now...
ProgrammingRe: Hello PHP Dev, If You're To Dump PHP What Language Will You Adopt? by toheebDOTcom(m): 5:11pm On Oct 07, 2016
@DanielTheGeek,

If I dump PHP now, I will be almost practically useless. So don't let me dump it.

However, I use python for data analysis, same as JaqL, pig, hive but there's a level of proficiency.

I intend on learning Java in a month or two from now. I should grab it easily based on my knowledge of OOP and design patterns if that's enough. I guess am not dull, am Ihuh

Hearing scaler, and Co ehn, una wan lost me...
ProgrammingRe: What Is The Difference Between Runtimeexception And Exception Classes? by toheebDOTcom(m): 3:56pm On Oct 07, 2016
No major answer here, so I will post this..

In some language, exceptions are errors you can catch. it means they won't halt the execution of your script.

Errors can happen at different stages, during compilation (eg when you forget a ';') or Runtime (eg when you call an undefined function or you require a non existing file) .

Such errors that happen at Runtime triggers a RuntimeException Class. This class generates the appropriate exception be it a memory, underflow, overflow, range ET cetera...


tag: paranorman
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 3:40pm On Oct 07, 2016
directonpc:
From the first post they seem to be an answer already na. That 90 something percent go with. But anyway this is a good discussion to burn time on. I refuse to turn on the circuit in my brain that works on mathematics. I turned it off the day I finished my BSc. Una think say na difference between 1.0 and 1 Google take beat AOL, bing, yahoo and co?
Yea, I tend to have my answer but I wanted to see other people's view.

I dey feel you. But you no fit owe Google, Bing or any of them #0.1 or 10kobo sha
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 3:35pm On Oct 07, 2016
paranorman:
thanks. I think you're right on the programming aspect.
as for the statistics, we shall come to that another day..
Hehehehehe
I feel you bro!
As for the statistics, hala me anytime.
Thanks for contributing..
ProgrammingRe: How Many Lines Of Code Is Your Largest Work So Far? by toheebDOTcom(m): 3:31pm On Oct 07, 2016
DanielTheGeek:
To be honest, I don't write more than 1k lines of code per file except if I'm writing a JS library or something that strictly requires me to write more (maybe a sexy language).
Even those that use MVC or HMVC frameworks like laravel (PHP) or Play (Scala) may not even have to write more than 200 lines of code throughout a project because of the pattern and ready-made libraries.

.
Combining all the lines of code in all the files of a single enterprise project will be numbering up to 50-100k depending on how large the project is and it doesn't stop there, every new update = more/lesser lines of code.
If you were to go by the SOLID principles, you wouldn't write up to that per file gansef
ProgrammingRe: How Many Lines Of Code Is Your Largest Work So Far? by toheebDOTcom(m): 3:31pm On Oct 07, 2016
DanielTheGeek:
To be honest, I don't write more than 1k lines of code per file except if I'm writing a JS library or something that strictly requires me to write more (maybe a sexy language).
Even those that use MVC or HMVC frameworks like laravel (PHP) or Play (Scala) may not even have to write more than 200 lines of code throughout a project because of the pattern and ready-made libraries.

Combining all the lines of code in all the files of a single enterprise project will be numbering up to 50-100k depending on how large the project is and it doesn't stop there, every new update = more/lesser lines of code.
If you were to go by the SOLID principles, you wouldn't write up to that per file gansef
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 3:20pm On Oct 07, 2016
directonpc:
Like making a square wheel will make cars travel faster and consume less energy?
grin na you know oo.
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 3:19pm On Oct 07, 2016
@danielthegeek, @seunthomas

In addition to what you've said, coming from php
var_dump(1.0) //float
var_dump(1) // int

No args about the above!

When it comes to validation, depending on which function you used, if it were to be php's

filter_var(1.0, FILTER_VALIDATE_INT) // true

but
var_dump(1.0) // float

So it is Validated as int, which is mathematically right.

However,

filter_var('1.1‘, FILTER_VALIDATE_INT) // false



Did you notice that interesting part?
I know there is probably no HOLY GRAIL answer, and I know you might not want to use that validation in all cases, but it's one of those moment you laugh over how a programming language might not be perfect or accurate at all cost.


Like I said, the question popd up and I think it will be interesting to talk about it.

Thanks for your input..
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 3:00pm On Oct 07, 2016
directonpc:
Who this thing help?
A programmer dealing with money.
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 2:50pm On Oct 07, 2016
paranorman:
Seriously, "assumption is the major backbone of Statistics"? Forgiveable, you studied Maths.
Hehehe... 

**one of those moments you will be happy you used the right word**

I quote myself again... 
toheebDOTcom:
...Assumption is a major backbone of Statistics.
Notice the 'a' not 'the' as you wrote... 


Programmatically, 1.0 is evaluated to be 1, an integer.
Coming from PHP, not really php alone since all programming Langs tend to use the same binary computation when comparing number. 

I agree with you on "by evaluation", but on comparison, Programmatically 1.0 !== 1.  It won't! because computers sees decimal numbers as an approximate number. For such comparison,  PHP has this function called bccomp that can be used in such case. Again it is not a bug but how it works... 

you can read more at floating-point-gui.de (I'm not sure if I get the address correctly, just google it). 

So is 1.00000000. So I say 1.0,  tecnically, is a float.



Here's a case: 1.2 is approximately 1. So is 1.2333399999 - given that we want a whole number. This numbers satisfy some condition for approximation; the number proceeding that the last digit we want to approximate to should be 5 or more. Condition can be thrown away, as in case of 1.25666 approximated to 1.2, programmatically.

Now Imagine the condition is based on a base 2 scale?!

Mathematically, 1.0 = 1 = 1.01 approximated to 1 dec. place. (given it satisfy what our initial condition for approx.).

Conclusively, 1.0, programatically is evaluated as/to 1, except we 'state' otherwise.  '0' after the dec point justs increases accuracy/precision in cases where our possible value(s)  belong to a set of real numbers. So, you actually determine what the number is, given you 'created' it; as 1.0 can be 1 or 1.0112 if you don't know how it came to be.

Mathematically, we can prove this by induction.
If 1 * a = a,
and 1.0 * a = a.0 = a,
where a€R,
then 1.0 = 1.
Hmm, Oga, Calm down! Mbanu! *what that means?*
He no reach this level na... You dey confuse yourself gansef...

Anyways, commenting on what makes sense to me,
Programmatically, as you mostly saidgrin ,1.0 is not evaluated as 1.0. Computers compares numbers in a different way than we were both taught.



As for you basing my dear Statistics on Assumption, what if I told you that randomization is not random? Please sir, don't eever say such besides we 'gods' of Statistics, it makes us pity your ignorance/navity in a disconcerting way. Seriously is worrying. That's another topic for another day. Let's not derail.
I get you, blindly defending your course. Yes, Randomization is not random. And let me tell you, Randomization is a major topic under Optimisation Theory. As Changes is to Calculus.

Are you calling yourself 'gods'? And you are such adamant? Have you done statistical inference? statistical hypothesis? Normal Distribution,...? Those are core of statistics, and if you are telling me there is no big deal of assumption, go and revisit your course again.

Okay, lemme come straight to you, whenever you are told to take a sample distribution, study it and come up with a conclusion to summarise the whole distribution, then you've made an assumption based on a little distribution. I hope that is clear?






Computer Science might have been drafted out of mathematics but it doesn't always work like it does in mathematics.

Thank you for your contribution though.
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 11:44am On Oct 07, 2016
seunthomas:
1.0 is a floating point number or a double. Its not an integer. The difference is in the degree of accuracy provided by the decimal after the whole number.
I am not a mathematician but i assume it would be a decimal number also.
Once you have a dot(.) after the whole number it cant be called and integer or whole number anymore.
Nice assumption!!
But you do agree with me that 1 is an integer, right?

and 1.0 = 1

So are we in the position to validate 1.0 as an integer?

*************

Concerning your statement about having a '.' implies it is not a whole number or integer is NOT really true.

The simple answer is
1.0 = 1 + 0× 1/10 = 1 + 0 = 1

Which is a whole number.
I know we were taught that when we see a point, then it is a decimal number. na na because of the point above.
ProgrammingRe: What Is 1.0? by toheebDOTcom(op): 11:33am On Oct 07, 2016
talk2hb1:
2% is not enough bro (Statistically speaking) its only in medicine that 1% marginal error is permissible but yours is about 98%
I know where you are going to... grin
Good to hear you say Statistically, Assumption is a major backbone of Statistics.

This time around, statistics can't be used because we don't want an assumption but fact! Real analysis comes in here... grin
ProgrammingWhat Is 1.0? by toheebDOTcom(op):
As a programmer, is 1.0
- an integer?
- a float?
- both integer and float?

As a mathematician, is 1.0
- An integer?
- A whole number?
- A decimal number?
- or a combination of what and what?



I came by this question some minutes ago, I studied mathematics as a course, now in a programming field and I must confess, it took some reasonings before I made a conclusion. 98% of Google Searches doesn't support my assertion, but the 2% is enough to back me up, at least some people reason like I did.

Without influencing your own thoughts, I won't say my own conclusion yet...

I'm not going to mention some gurus in the section, it's for everyone to answer.

So, What is really 1.0?
ProgrammingRe: How Many Lines Of Code Is Your Largest Work So Far? by toheebDOTcom(m): 3:34am On Oct 07, 2016
To those looking at the last line, remember that the lines of the docblock of a getter/setter method is at least times two of the method itself! grin

Diaries God ooo.

Anyways, for me, I sha know that it is 'something' thaaasand. 1 or 999, stories that touch. I remember that night, feeling like say I be one guru... E red for me when d tin no gree work
ProgrammingRe: Dhtmlframework Is Going Open-Source! by toheebDOTcom(m): 3:21am On Oct 07, 2016
Open source, Shey? No need for the 'secret' repo.
If it's in interest of any developer, sure, contributions will come forth.

Could you prep us with what makes it different to other frameworks? I can't wrap my head around that from the threads you've already talked about it. grin
WebmastersRe: When You Build Websites For N12,000 by toheebDOTcom(m): 10:28am On Oct 06, 2016
Another Reasonable Thread (A.R.T)


Nicely said. It happens not just here only. I'm also surprised when I see some gigs on some freelancing sites.
ProgrammingRe: Let's Be Honest Php Sucks When Building Enterprise Applications by toheebDOTcom(m): 9:23pm On Oct 04, 2016
You have your points. However, you should know php did not start out as a programming language. It was just for Personal Home Page.

It wasn't planned to be a programming language, hence some inconsistency.

To add more salt,
$_SERVER['HTTP_REFERER']

did you noticed referer? Instead of the correct spelling of referrer.

What about HELO in smtp?

Those are not php. While the first was certainly an error but people are already used to it for it to be changed. So, yes, shit happens.

I read a quote of Rasmus Lerdorf where he confessed of being a coder that poorly writes code that works perfectly.

Bottom line, php has come to stay. With php 7, it is the fastest scripting language. I don't need to tell you that you can harness it for a world class app.

Php may suck to you but that doesn't mean a language that sucks!
Christianity EtcRe: Atheism And Logical Fallacies : Here Are 10 Logical Fallacies Atheists Commit by toheebDOTcom(m): 10:41am On Oct 02, 2016
ireneony:
There are better things to discuss about other than all these gibberish. Op i sense you still live under a comfortable roof..cos you have time to analyse everything huh huh
You said it all! No pressing issues...
ProgrammingRe: Friendosphere.com is there for you, developer-inclined website by toheebDOTcom(m): 10:48pm On Sep 30, 2016
Registered... Nice job
ProgrammingRe: Lessons In How Not To Implement Application Security by toheebDOTcom(m): 10:03pm On Sep 28, 2016
Nice job here...

A few contributions...
The developer should as well identify where data flows in and out of his app.
- data going into / out of the db
- data from external source like url
- data going to the ui as well

*validate against what you need; NOT what you do not need.
*treat every data not coming from you as invalid, sanitize and validate as appropriate...

hope this helps as well
PhonesRe: What Is The Worst Phone You Ever Used? by toheebDOTcom(m): 11:49am On Sep 27, 2016
Bold 5.

I can bank on my former Nokia 6070 than that pretty looking phone.
IslamRe: Interactions with non-mahram|Etiquettes of online and offline interactions by toheebDOTcom(m): 10:39pm On Sep 17, 2016
@ Abdelkabir, Contact17
Thank You, Best replies to clear most of my doubts.
If it's okay, can I make one or two comments?
IslamRe: Interactions with non-mahram|Etiquettes of online and offline interactions by toheebDOTcom(m):
May the peace and blessings of God be upon us all.

I will like to air my view on this topic, and, of course, you can correct me if I am wrong but try to understand the angle I am coming from...

My main point of comment will be centered on intention, and logic

I believe one of the greatest tool we have is our sense of reasoning, logic, to understand what has been written.

.
.
.

One thing is certain here, for the fact that both genders are on this planet earth, there will always be an interaction.

We were given the sense of reasoning to differentiate Black from White... That's easy. But the degree of Grey is what we have to be cautious of... Because it is hard to say visually, not only by Color experts nor her teachers.

What are we left to do? Thread carefully!


Contact17: 2. There should be no softening of the voice by either party.
I agree that most times this is done to the opposite sex as a means to flirt around the her.
But not all times!

Psychologically, I guess, we tend to soften our voice when making a request.

Shouldn't this be normal?
A student-lectural conversation will not be same as that of your peers...

Softening of the voice can also be an act of respect, especially from the Yoruba tradition.

3. Lowering of the gaze
...
“Tell the believing men to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts). That is purer for them. Verily, Allaah is All‑Aware of what they do. [al-Noor 24:30].
Hence, men should avoid staring and try hard to lower the gaze as much as possible.
On reading the above I asked myself
Is a girl's face forbidden? My answer is No.

Looking with lustful desires? My answer is morally, it is not right. So yes, IT IS WRONG, so as to help ourselves.

So, I am throwing this question to ourselves, is AVOID the best way to explain this? Lower doesn't mean take away (I'm Not a linguistic but does it?)

These days, the girl's face seems to be the only thing you look at to avoid looking her body exposure especially during conversation.

And again, I ask myself, how do I marry someone of my choice is if I don't get to look at her couple of times? I think I read somewhere that "marrying a beautiful lady is part of choosing a wife religiously". Just quote me wrong only if you know better.

The truth is, as a guy/girl, there's a significant part of consideration,if not the first, on the beauty /handsomeness of a girl/boy when we opt for marriage, This may be overpowered by morals, brilliance of the girl/guy.
Is AVOID not too big of a word to use?

Moreover, I am guy, a bachelor, I do have lustful desires not because of looking at a girl, it also happens when you even decide not to look at her. Acting on them should be the sin here.

it's more like this idiom, "when you fail to learn, you learn to fail". Either way, you are LEARNING.
So not looking at the opposite sex doesn't guarantee you not having lustful desires. Either way you will.
Let's ask ourselves of the truth.

We should only pray and thread carefully to avoid the sins behind it.




4. Avoiding joking and laughing as it is not part of etiquette and dignity.
Laughing and joking also tends to make the conversation flirtatious and unserious.
Not part of etiquette? Dignity?
I will only agree if it's an expensive joke.

A joke can ease sadness. It's normal. Don't tell me you and I doesn't like to smile or laugh. Medically and Religiously, we should smile, be happy. A joke can solve some problems...

My point here, AVOIDING is too big of a word to use here...


6. Not going to extremes in embellishing one’s speech.

Some people use their skills in communication with others by movements of the hand or face or by quoting poetry or proverbs or romantic phrases. This is a means that the Shaytaan uses to open the door to haraam attraction between the sexes, so it should be avoided.
Movements of the hand, face or poetry, proverbs are ways to express your opinions. Quoting a scripture is also a way of expressing the word of God for someone to understand better..

Please, aren't you reasoning with me that we take this too far?

The context of use is what we should preach against!



Online interactions

Even the use of smileys should be avoided when interacting with the opposite gender even on a public forum. This is because these faces are used to express a woman’s feeling, so it is as if she is smiling...

Side Note: It is not permissible to use some emoticons are or emojis when chatting with anyone. For example, the emoticons representing angels, devils and prayer (with closed hands)...
Like I said, Smiley, emoji can be a way of expressing one self. Have I committed a son using this grin or huh. Ask yourself, what do you think those Smiley were? 'laughing' and 'question'... isn't it? Answer me please because it's confusing me that someone could advocate to avoid it when it's not an actor committing a sin.

Is there something I am not thinking about here? come forth with an open mind, reader.

...These concepts are specific to other religions and using them would be imitating

those concepts
Is that the reason why we shouldn't use them? If that is, I am sorry that it is not a good reason from my perspective and I think someone else's too.

I once argued about having 'Obama style haircut' with a friend from the opposite religion. He was saying it is not morally right to have such cut because it does not portray you as a good 'so so so' religion.

Is that true? Maybe. What about 'gallas hairstyle'? Probably bad from a tradition perspective as well. I won't advocate for that but I won't preach against it because it can be the hairstyle of anybody. good / rugged/bad/evil/i-dont-care people.

What if those set of people start having 'low cut'. Will you say low cut is a bad hairstyle as well? Please answer me!

Because the 'bad' people are doing 'this' doesn't mean 'this' is bad and the good people shouldn't do 'this' anymore.

Let's preach for the correct usage not avoidance. If we keep on avoiding harmless or sinless things because they are used by 'bad' people, am sorry, it will get to a stage that there will be nothing to avoid! nothing to preach against.

It is more like avoiding people of the opposite religion because you think they are people of hellfire. How will you help them if not by getting close to them?





I believe that RELIGION is too big of a concept to express as Black / White, Yes / No, Good / Bad.

God guide us all.
ProgrammingRe: Data Scientists In Nigeria, Lets Talk by toheebDOTcom(m): 6:21pm On Sep 11, 2016
Hey guys, I'm an IBM certified data analyst. I'v worked with Hadoop, hive, bigsql, pig, jaql... And that was with the virtual servers they provided for us while studying. Ever since then, I haven't worked on those languages because of the environment.

I taught IBM will be recruiting us after the exam, I did pretty well as far as my own school is concerned, 2nd best actually with 80% to 81% (of the first ). I did had some interviews with IBM HR department while I was serving from UAE, Nigeria, and Egypt... But my NYSC certificate delayed me (or I taught). Anyways, I was told by my handler that the cert is required and I should forward it when available. I guess when it was available, the position wasn't available any longer. still waiting, still hoping, though.



Recently, with my leisure time, I use python for data science.

I fell in love with data science when it was introduced to us a year ago. I just wish there are places around to exercise these disciplines. I do enjoy it probably because I studied mathematics.

1 2 3 4 5 (of 5 pages)