₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,327,145 members, 8,429,520 topics. Date: Friday, 19 June 2026 at 04:28 AM

Toggle theme

DharkPoet's Posts

Nairaland ForumDharkPoet's ProfileDharkPoet's Posts

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

PhonesRe: Xiaomi Redmi Note 7 Official Discussion Thread by DharkPoet(m): 5:14pm On May 08, 2019
I just got the Redmi Note 7 4GB/128GB and I noticed that my Glo 4g doesn't work on it. Please, who else is experiencing this? Also, I realized that after installing the latest update, I realized that my Wi-Fi connection fluctuates. On the same floor, my Camon CX connects seamlessly to the Wi-Fi network and remains stable, but my RN7 keeps fluctuating (going on and off) unless I change location e.g I move upstairs. Anyone else having similar issues?

Asides the issues above, the RN7 is a great phone, looks and feels really premium. With GCam installed, I just took the camera to a whole 'nother level.
ProgrammingRe: Challenge Me by DharkPoet(m): 9:46pm On Oct 26, 2017
bolkay47:
This thread has finally degenerated into 'clash of egos'?
I was about saying the same thing, and I think this is why Seun doesn't take this board seriously. A meaningful topic would most likely degrade into a battlefield for the bosses. Some of us just want to learn.
ProgrammingRe: Best responsive website design #2017 by DharkPoet(m): 1:28pm On Oct 26, 2017
Davidlollipop:
Appreciate ur review @darkpoet could you be more specific as to which area.
There are a couple of instances, but I'd lost the prominent ones.
1) Icons and Typography.
2) Your slider, found it hard assimilating the content.
3) Your contact form, mba nu, that's a no no.

Just clean it up, take a cue from similar sites. Adjust your color scheme.
ProgrammingRe: Best responsive website design #2017 by DharkPoet(m): 4:06am On Oct 26, 2017
I would say your contents are laid out fine, but you need to choose a color scheme for your website, there were more than a dozen colors there.
ProgrammingRe: Challenge Me by DharkPoet(m): 11:24am On Oct 22, 2017
dhtml118:
See them bad guys, I no even fit read these codes, they be like magic to me (maybe I need e-glasses as old e-age don set in).
That's how you will be yabbing somebody grin grin
ProgrammingRe: Challenge Me by DharkPoet(m): 11:15am On Oct 22, 2017
bolkay47:
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n
which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.
The number 1 is considered to be relatively prime to every positive number, so φ(1)=1.
Interestingly, φ(87109)=79180, and it can be seen that 87109 is a permutation of 79180.
Find the value of n, 1 n 107, for which φ(n) is a permutation of n and the ratio n/φ(n) produces a minimum.
Here you go @bolkay47 done in PHP


<?php
// Find the GCD between two numbers
function getGCD($num1, $num2) {
while ($num2 != 0){
$t = $num1 % $num2;
$num1 = $num2;
$num2 = $t;
}
return $num1;
}

function PHIfunction($n) {
if ($n == 1) {
return 1;
}
$count = 0;
for ($i=1; $i < $n; $i++) {
if (getGCD($i, $n) === 1) {
$count++;
}
}
return $count;
}

echo PHIfunction(9);
// returns 6

echo PHIfunction(20);
// returns 8

echo PHIfunction(87109)
// returns 79180

?>
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 2:34pm On Oct 18, 2017
HottestFire:

Lol, I once had problem with javascript for a payment gateway, I went as far as talking/sharing my code with a professional developer in europe and the embarassing response I got from him made me sit up...

Sometimes being naughty has a way of passing the right knowledge. grin

I wish I could get people to review my codes.
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 2:33pm On Oct 18, 2017
HottestFire:

Lol, you must be joking about your not too interested in OOP, well never too late to develop frameworks or work with over the shelves.

You don't want your codebase to be problematic for others to understand.
You misunderstood me, I didn't imply I am/was never interested in OOP, in fact I wish I could be seamlessly integrate into my work/thought process. I just need to get out of this comfort zone of procedural programming.
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 2:28pm On Oct 18, 2017
bearnana:
Well, it seems the OP has learnt enough to last him a year. If there are any specifics, please ask, I'd be more than glad to give my input.
On the contrary I've not learnt enough, can someone really learn enough?
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 11:13pm On Oct 16, 2017
I was beginning to lose hope, when I saw the views without the replies. Y'all remain blessed!!! Thanks Fam.
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 11:13pm On Oct 16, 2017
simiolu1:
First off, scaling is majorly about 3 things

1. Your codebase.

Is your software efficient? Can you squeeze a little more juice out of it by refactoring? Are you using queues in the right places? Anything that can be delayed until a later time should be queued. Examples include transactional e-mails like Password resets, invoice recepits etc. If you are transcoding audio files or video files; abeg use a queue to do that then send notifications to the user when it is done (Facebook does this when you upload videos). If your users are uploading files and you are storing those files in the cloud using Dropbox, S3, G Cloud, Cloudinary etc, find a way to make sure those files are being uploaded to the cloud straight away instead of them being stored on your server first before being moved to the cloud. If you are using an MVC framework or architecture, make sure your controllers are not doing too much or everything. Make use of traits and services.

2. Your infrastructure. I don't think you would want to build a software and scale it using a shared hosting solution. Get a cloud service for your infrastructure. DanielTheGeek has talked about that.
However, from my experience using AWS Elastic Load Balancers, you can configure an auto-scaling group that would scale your servers based on traffic. You can configure your group to have at least 2 servers running (the best configuration) and the load balancer routes requests to each one simultaneously in such a way that one server is not overworked at the expense of another.

3. Your database. I would not like to go into database engines and the best one for your software but to scale your DB, cache the most frequent queries your users have. Memcached and Redis are the best in this category. Caching reduces the number of queries hitting your database and allows your DB to rest a little. Then have more than one DB server running. You would then set a time of the day when you generally have reduced traffic that these DBs would sync.
Quick question, how does one implement queues say in PHP?
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 11:06pm On Oct 16, 2017
bearnana:
I don't think scalability of applications is much about performance.

Its more about how to manage, if a lot of hands were to get on deck.

To explain my point I'd share a personal experience since you are talking PHP:
I worked on an application where the devs who handled the code before used procedural and the client wanted to build a Software Department to manage the application. It was difficult to understand the application and the variable types the devs before had done. So we were tasked to build the application from ground up in a very short space of time.

Some rules I have learnt in my short time on this coded planet.

1: Your application won't scale if it wasn't designed to scale. i.e. Don't use procedural if your application would one day have a very large number of users and would have a software department.

2: Simple Architecture is good if you are starting i.e Try to optimize your code base for speed (this is different fro performance; your code performs and your code performs fast are two different things. Every codebase is designed to perform, not all codebase is designed to perform fast...)

3: Think about database type. Since you mentioned LAMPP, I am assuming that you are using MYSQL for backend. It may not be as important as the first two rules when starting out but you would have to consider database engine type ISAM, MyISAM, InnoDB.

These are the ones I can think off the top of my head. The other ones are when you have reached about 500k users. You might want to think of load balancers and redundant firewalls, maybe more webservers for performance. By then you would also have to factor splitting your database read and writes. Before you get to this stage, there should be enough money to hire me grin grin to help you out...

But first off, if you are thinking of scaling at this early stage, THINK OF YOUR CODEBASE!!!
grin grin Lol!!! Who knows, I could have been the one who wrote it in procedural. Well, for sometime now, I've been battling picking up OOP as a concept, don't get me wrong, I understand the fundamentals but I've not been able to implement them, I think one of the reasons is due to the fact that I've not really embarked on any project that would make me use OOP (or maybe I'm just comfortable of this status quo).

This has made me not to pick up any PHP framework, a part of me feels I need to master OOP to an extent I'm order to start using any Framework. (Correct me if I'm wrong.)

Maybe one day I'd hire you, though I'd like to work with you. (Yeah, nobody wants to work with a rookie, I get)
ProgrammingRe: Scaling PHP Apps, How To? by DharkPoet(op): 10:59pm On Oct 16, 2017
DanielTheGeek:
It depends on budget and time, if you're building an app that needs to get to the market as quickly as possible, then it's okay to leave scalability till when it is needed but however your code base should be optimized, you should move to a VPS and fine tune your application so you can be certain you've done everything app wise to make sure your application is a bit scalable, then you'd want to enable caching for static pages on your web app and also serve static pages via an Nginx server (its faster cor static pages) and also add a simple load balancer in front of your Servers... This little technique I stated can help your app survive it's first few thousand users...when you get to the next slow point you'd know what to do...
You may want to consider a separate database for reading data and another database for writing data, a data recycle action will be performed by your database platform..this technique can buy you some more breathing space...

Next you may consider either horizontal or vertical scaling...
Vertical scaling is simply adding more powerful hardware resources as the need to scale increases. This seems like the way to go for the lazy and rich programmer who doesn't want anything too complicated. Simply upgrade your resources and the app scales well.
Imagine having a server serving the web app in question. The server has 4GB of RAM, an i5 CPU, and a 1TB HDD. It performs its function well, but to better tolerate a higher influx of traffic, you decide to replace the 4GB of RAM with 16GB, you put in an i7 CPU, and you add a PCIe SSD/HDD Hybrid drive. The server is now much more powerful and can handle a higher load. This is known as vertical scaling

Horizontal scaling means adding more zombie servers and distributing requests through those servers, the server with lesser load receives the next request and once it can no longer handle any more requests another server picks up... This option is the go to option for the developer that can't afford to horizontally scale his app or thinks he'll benefit more from vertical scaling.

However, the best thing is to scale both Horizontally and Vertically. The need for your app to scale means that you have lots of users which means you're making money and so affording to scale shouldn't be a problem. The problem is people try to scale apps that may not even last two years on the internet.
Actually, @DanielTheGeek your post on one of the threads here made me check out scaling. It was one where you were talking about MySQL data replication. I've also read about the two scaling types, Vertical and Horizontal.

But just like you rightly pointed out, the user base factor ought to be considered before even contemplating scaling, although code-bases need to be efficient too.

Thanks for your input.
ProgrammingRe: Serious Php/go/scala/python/javascript Developers Needed To Join A Start Up. by DharkPoet(m): 10:36am On Oct 16, 2017
DanielTheGeek:
We already have over 11 devs signed up...

Will be closing today by 6:00pm

However we are now looking for programmers that like to talk, more of project managers that will code once in a while but help move projects forward.
I wouldn't mind, I would just love to learn.
ProgrammingScaling PHP Apps, How To? by DharkPoet(op): 8:49am On Oct 14, 2017
Hi fellow devs, so I've been coding for sometime now, and one thing I've always failed to cater for was consideration for scaling. How to set up infrastructure for scaling.

Should one consider scaling from the onset, or should one start thinking of scaling only when the requests grow to (tens of)thousands of req/sec.

What are the best ways to effectively achieve scaling a PHP app on a LAMP infrastructure?

I would really love to get your feedback.

Thanks.
ProgrammingRe: Serious Php/go/scala/python/javascript Developers Needed To Join A Start Up. by DharkPoet(m): 11:44pm On Oct 13, 2017
I wouldn't mind joining if there are still open slots.
RomanceRe: Want To Stop Porn And Masturbation? Get In Here by DharkPoet(m): 8:56am On Sep 18, 2017
I used to be a chronic masturbator, but over the years, I've been able to condition myself, I could go weeks/months without masturbating. But then, the triggers come, and when they do, it's seems like a drug addict going throw some withdrawal. I could masturbate for once every 3-5 days up to a week. Then I go back to not masturbating again. That has been a cycle for me. I'm trying to fight responding to these triggers. For everyone here, stay strong.
ProgrammingRe: Young Nairalander Just Created An Android App For Making Prank Calls In Nigeria by DharkPoet(m): 9:48am On Sep 11, 2017
Do you know you could create threads without adding the phrase ‘Young Nairalander' to the title? You're welcome.
ProgrammingRe: Web Design Is Technically Not Programming by DharkPoet(m): 2:48pm On Sep 09, 2017
Your title suggests an assertion, while your post is seeking opinions. They don't pass the same message.
ProgrammingRe: 10 Nights Of Cloning Nairaland With PHP by DharkPoet(m): 8:23am On Aug 22, 2017
This looks really nice, but I'd like to talk about the margin on the right and left side, is it necessary? It makes the content look a bit narrow on mobile to me.
ProgrammingRe: I Will Officially Quit Visiting This Section by DharkPoet(m): 1:49am On Jul 27, 2017
This used to be my one stop point to anything Tech in Nigeria. I fancied this board a lot, because I always looked up to the intelligence members on this board. Dhtml, pcguru, Fulaman, oh where's Javanian? I've never been much of a poster, but I was the proverbial dog waiting at the corner waiting to devour the scraps of knowledge falling from the intellectual table. I revered a lot of individuals here. I remember trying to implement the ‘99 bottles' problem posted by Javanian with my long if statements back then �.

It was always fun hanging around. Now, the condition of the board is just deplorable, losing intellectual contents to threads promoting Ponzi scripts and Web design bundles. I mean, how would you allow one person to create a thread and continue to spam that thread?

And to think that Seun too is/was a programmer? I mean, even owners of Quora and Stackoverflow make contributions on their own platforms, hell, even Mark Zuckerberg posts and replies to comments.

Well, wish us all the best!!! Shalom!!!
ProgrammingRe: How Do I Become A Programmer After Learning The Basics by DharkPoet(m): 6:04pm On Jul 21, 2017
holuphisayor:
https://github.com/kamranahmedse/developer-roadmap
OP follow this guide posted in the link, then build stuff, build a hell lot of stuff, but make sure you understand what you're doing, when you don't research. Know how to research. It would help you a lot.
ProgrammingRe: Had Any Very Successful App Being Built By Nigerian Programmers? by DharkPoet(m): 5:57pm On Jul 21, 2017
Yes, there are, they might not be the owners of these apps, but Nigerian devs have built, managed, co-owned or even held strategic positions such as (CTO) in companies that own these apps.
Now when you talk about apps, I'm including Web/Mobile/Desktop Apps plus Games too.
ProgrammingRe: I Need A Smart Programmer To Solve This Logic? by DharkPoet(m): 2:09am On Jul 13, 2017
Just use utm codes.
HealthRe: World Sickle Cell Day by DharkPoet(m): 5:37pm On Jun 19, 2017
Since I've met her, I've always celebrated today for her, I always remember what today is. I try to see through her pain because I know she'd get stronger every day. She's a survivor. Keep being strong, babe. I heart you!!!

ProgrammingRe: How Will You Grab Content From Another Website Using Php Curl by DharkPoet(m): 7:32pm On Jun 08, 2017
cbrass:
OK guys am trying to grab some specific data from another website using curl but the problem I have is I want to grab specific texts not just some bunch of random nonsense the thing throws me. How wi I go about it

Thanks
I just did this yesterday using http://simplehtmldom.sourceforge.net you might need to do some modifications using Regex on your final results, if needed.
ProgrammingRe: How Do I Automatically Modify A Row In Mysql After A Set Time Using PHP? by DharkPoet(op): 7:37am On May 18, 2017
dhtml18:
Since you are going for a VPS, well, I guess you should have cron on that, or the ability to setup a cron. And also you might be able to run CLI via SSH in which case you have the following options:
1. Setup cron there via something like - $ crontab -e
2. Setup cron using your control panel
3. Setup a task schedular DAEMON via CLI interface (SSH)

More generic ways:
4. Use remote services to setup cron jobs
5. Use poor man's cron

If you look at this link:
http://stackoverflow.com/questions/1857741/how-to-run-a-php-script-in-every-5-10-minutes-without-cron-perl-etc
One dude with solution #15 suggested a poor man's cron (my solution #5 which i described earlier and can work in every known programming languages with/without a scheduler - that is what i normally use, cant remember last time i setup cron job sef)

On the same link another guy suggested a DAEMON(that is my 4th solution):
ini_set('max_execution_time', 'sometime');
while(1){
//do something
sleep(sometime);
}


While yet someone suggested my solution #4:
I'm sure this tools can help you with your request:

SetCronJob - www.setcronjob.com

Cronless - cronless.com

EasyCron - www.easycron.com

Online Cron Jobs - www.onlinecronjobs.com

Corntab - www.corntab.com

getCron - www.getcron.com



For the record, I have used all the above method for many jobs that I have done in the past, and all of them have their advantages and disadvantages.
For sites that have traffick, I always use the poor man's cron technique - because it can never fail, and it is easy to test it on your developmental and live server. And you do not need to start worrying yourself about cron jobs or not.
If you use this technique, and you just want to be sure that it runs, you can use cron job as a backup to make sure the site loads every 5 minutes
in that case, you will need a cron command like:
*/5 * * * * wget http://example.com/check

You can see that here - http://www.thegeekstuff.com/2011/07/cron-every-5-minutes/

Again, everything I have mentioned on this thread are what I have actually used in time past.
Why I'd always respect you. A lot to read up on and learn, thanks for coming through boss. Respect.
ProgrammingRe: How Do I Automatically Modify A Row In Mysql After A Set Time Using PHP? by DharkPoet(op): 10:01pm On May 17, 2017
dhtml18:
There is a technique you can use too - to make the task run every 5 minutes so far as the site is accessed (by anyone). This will depend on site traffick rather than cron jobs. There are servers that cannot run cron jobs.
In drupal, we call this poor man cron!
Boss dhtml, how does this work? How do I go implementing it? I'm migrating to DigitalOcean, do I think I should be able to run CRON based tasks (My first time ever using DO or a VPS).

Which method would you suggest I go for? Thanks
ProgrammingRe: How Do I Automatically Modify A Row In Mysql After A Set Time Using PHP? by DharkPoet(op): 7:30pm On May 17, 2017
spikesC:
You need to setup a Cron job/task scheduler script that runs at an interval (every 5 minutes)
Thank you very much, I appreciate. But is there any difference between setting up a Cron Job and using a MYSQL event scheduler?
Just asking, thanks a lot.
ProgrammingHow Do I Automatically Modify A Row In Mysql After A Set Time Using PHP? by DharkPoet(op): 4:50pm On May 17, 2017
Hi fellow programmers, how do I run automated updates on a MySQL row? eg Check the row after 5 minutes, if the timestamp has been exceeded, it updates that particular row from pending to expired. I wanted to include a global php file that would be included/called on each page load to check the timestamp after every 5 minutes. Next, I read up on MYSQL Triggers and Event Scheduling but I found out that this might accrue overhead server issues as traffic increases.

What would you suggest as an effective measure to fix this?

Thanks.
EducationCamptra (camptra.com.ng) - Classifieds Ads Platform For Nigerian Campuses by DharkPoet(op): 10:05am On Dec 18, 2016
Camptra is a web based platform, one that solves an actual real life problem – it is a platform for Nigerian students to buy and sell or swap anything, from books to electronics, clothes, accommodation and, of course, phones and it’s accessories, anytime and across any university campus in the country.

Do you want to sell? Make a swap/exchange? Looking to get the best deals? Do you offer services in campus? Are you a designer, do you sell shoes, are you looking to buy a phone charger, do you need to swap your current phone for another or perhaps you need accommodation or you simply just need a roommate to split that humongous house rent. Well, post an ad on Camptra! It is absolutely easy to use, all you need do is take a picture of what you’re selling, upload it, set the price, the deal type, the condition of the product – because no one wants to buy rubbish, then a brief description, your campus and then post it!

You can do all these in under 10 minutes from the comfort of your room. No need printing on paper and looking for space on an already full notice board to post it or defacing an innocent wall with your ad, just post on Camptra!

Visit http://camptra.com.ng
Phone/Internet MarketRe: . by DharkPoet(m): 5:54pm On Dec 14, 2016
Around a campus? Why not post it on http://camptra.com.ng

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