₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,153 members, 8,420,584 topics. Date: Friday, 05 June 2026 at 04:39 AM

Toggle theme

Teampregar's Posts

Nairaland ForumTeampregar's ProfileTeampregar's Posts

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

ProgrammingRe: Simple Algorithm Challenge by teampregar(m): 6:13pm On May 19, 2016
larisoft:
My dear, your algorithm will be correct only if the number of 'hads' increases arithmetically after each correction. Unfortunately, it doesnt. the first no of 'had' occured once. The second twice. The third 10. The fourth 11. The fourth 38. Find the constant between these numbers and the algorithm is solved.

And there are great coders in Nigeria(though very few) . But algorithms are not just about rushing to your keyboard to type. Its about
1. Understanding the problem (so that you can solve it if you had all the time and no computer)
2. Understanding its domain (what other problems like this have already been solved?)
3. implementing a solution

Source (Skienna, the Algorithm Designs Manual).

The major obstacle in solving this is the first step. which is not even computer-science based - not whether we have great coders or not.

@Op, can you please explain the grammar rule here?
Nice advice i will check awt that Skienna Design Stuff
Dnt blame me tho i am just a 16 year old developer with 1 year php experience
ProgrammingRe: PHP Code To Insert And Retrieve Images From Mysql Server by teampregar(m): 5:47pm On May 19, 2016
See them nairaland programmers, just discouraging someone because they cannot offer help, instead of referring him to an e-commerce web app, while not teach him what those e-commerce apps uses..* this is why stackoverflow i better than nairaland programmers section always discouraging peoples ideas*

Bro,
MySQL supports a data type to store stuffs like images,videos,audios,pdf etc.

it is called BLOB(Binary Large Object)
if u use windows OS just right click on any image on your library and click on edit with notepad, you will see that a simple photo will turn into a very long text comprised with different syntax , letters and numbers*these are BLOBS*

u can create a table like these

CREATE TABLE IF NOT EXISTS images(
id INT UNSIGNED AUTO_INCREMENT,
image_name VARCHAR(any length u like) NOT NULL,
image BLOB NOT NULL,
PRIMARY KEY(id)
)

u can use BLOB, MEDIUMBLOB or LONGBLOB depending on the file size of the files u want to accept

then when u want to output the file to html use the following code
//do mysql conections before the following
$sql = 'SELECT image FROM images ';
$results = //query your mysql server fetch the results as an associative array

//then output to browser with
header('Content-Type://mime-type of ur image');
echo //the image u retrieved

i could not write the full stuff cause i post with a mobile phone mha hand dey pain

bt i advice u store the location of the images instead then on request u link to the location with html img element

this will be faster on a shared host except u are using a dedicated server or a cloud system
ProgrammingRe: How Do I Extract Data From Online Websites? by teampregar(m): 5:21pm On May 19, 2016
Sugarhugs:
Simple.
Learn SQL injection
This is what happens when selfie babes visits nairaland programming section
ProgrammingRe: How Do I Extract Data From Online Websites? by teampregar(m): 5:20pm On May 19, 2016
Sugarhugs:
Simple.
Learn SQL injection
This is what happens when instagram babes visits nairaland programming section
ProgrammingRe: Simple Algorithm Challenge by teampregar(m): 8:20pm On May 17, 2016
Ah ah nobody fit contribute again, we really have programmers in nigeria indeed
ProgrammingRe: Simple Algorithm Challenge by teampregar(m): 6:02pm On May 17, 2016
Slyr0x:
Taye and Kenny were in class. They both tried to describe a man that was once sick. Taye said "The man had a cold." Kenny said "The man had had a cold." According to English grammar, Kenny was correct.

Now imagine their two teachers, Seun and Tony: Tony was a little off, and said that "Taye, while Kenny had had 'had had', had had 'had'; 'had' had had the better grammar." Seun corrected him, saying "Kenny, while Taye had had 'had', had had 'had had'; 'had had' had had the better grammar."

Continuing this pattern, the knowledgeable supervisor would note that "Seun, while Tony had had 'had had had had had had had had had had', had had 'had had had had had had had had had had had'; 'had had had had had had had had had had had' had had the better grammar."

Continuing this, how many 'had's would be in the incorrect 100th iteration?
With want i understood by your story this is the number of
hads:

<?php
$txt = 'Seun, while Tony had had blah blah ...';
//split txt into and array
$sHADS = split($txt," " );

//remove the first three words to get number of hads

$num = count($sHADs) - 3;
$getHads = 1;

//start loop condition from the last HAD word

while($num <= 100)
$getHads += $num++;

//when loop is complete
echo "Number of Had's is : " . $getHads - 1 ;

?>
WebmastersWhat Is The Default Mysql Server Username And Password For My Webhost by teampregar(op): 1:23pm On May 15, 2016
I would like to know what will be d default
servername, username and password to connect to mysql database when i buy a webhosting plan..
I have used a local server and there it is always localhost, user, then password is empty
WebmastersWho Does Hosts With Whogohost?? by teampregar(op): 4:56pm On May 12, 2016
I need enlighthenment on their performance especially their shared hosting plan. Bandwidth dey quick finish
Tech JobsRe: Technical Co-founder by teampregar(m): 8:45pm On May 09, 2016
dat is why he is looking for a co-founder someone who will take risk with him in the startup and when profit comes they enjoy it
CrimeRe: Thief "Emma-B" Burnt Alive In Warri (Graphic Photos, Video) by teampregar(m): 6:52pm On May 09, 2016
Stealing no go sha
ProgrammingRe: A New Search Engine by teampregar(m): 5:04pm On May 08, 2016
U wanna launch a search engine on nairaland?? Y u no tell linda ikeji to blog ur shit since na??
ProgrammingRe: A New Search Engine by teampregar(m): 5:03pm On May 08, 2016
U wanna launch a search engine on nairaland??
WebmastersRe: How Do I Install Rocketeer Or Any Web Deployment System On Windows OS by teampregar(op): 4:19pm On Apr 29, 2016
emillionaire:
op you mean, local serverhuh
Yes, i mean like am i supposed to install rocketeer on my laptop or on my shared web host
WebmastersHow Do I Install Rocketeer Or Any Web Deployment System On Windows OS by teampregar(op): 1:24pm On Apr 27, 2016
How do i install rocketeer or any system that deploys php files to web on windows in order to connect to my web server, or where am i supposed to install the web deployment system, is it in my local computer or in my webhost
cPanel
WebmastersHow To Setup A Website by teampregar(op): 8:25pm On Apr 18, 2016
Plz i need you guys to tell me:
-If i can buy a domain name and a shared webhost space with vougepay(or any payment system)

-how do i point my domain name to my web server

-how to upload my website to the web server(icons,php,js,css files)

-how to update codes or files on the website without disturbing the end users.
Thanks
WebmastersHow To Setup A Website by teampregar(op): 8:16pm On Apr 18, 2016
Plz i need you guys to tell me:
-If i can buy a domain name and a shared webhost space with vougepay(or any payment system)
-how do i point my domain name to my web server
-how to upload my website to the web server(icons,php,js,css files)
-how to update codes or files on the website without disturbing the end users.
Thanks
WebmastersRe: Padypady.com The Nigeria Website That Have Attracted Facebook And Google by teampregar(m): 9:40am On Mar 25, 2016
padypadyng:
The site can be used to store and share your music online

It can also be used to showcase your products and services online

And you can search for any video and download it directly
And what is your mission?
WebmastersMost Secure African Webhost by teampregar(op): 9:12am On Mar 23, 2016
I need a secure webhost to host my web app on..Plz I don't need webhost agents to kme here and be referring der companies to me.. I nid honest suggestions cause I don't want my web app to be attacked or hacked easily
WebmastersRe: Padypady.com The Nigeria Website That Have Attracted Facebook And Google by teampregar(m): 8:56am On Mar 23, 2016
nice website but I don't really understand its main use tho
Nairaland GeneralRe: How Do I Embed Youtube Video On Nairaland by teampregar(m): 7:11pm On Mar 18, 2016
how does the thumbnail of the video show?
WebmastersRefer Me To A Cheap Dedicated Hosting Provider by teampregar(op): 12:51pm On Mar 14, 2016
I need to host my web application on a dedicated server but i dont have 200,000 to be paid yearly. I you guys could refer me to a 60,000/year host that would be great. Thanks
ProgrammingPHP: When To Use Procedural Programming Or OOP by teampregar(op): 2:29pm On Mar 07, 2016
This two really gat me confused.. As i like PHP OOP alot, bt i normally read developers at stackoverflow write dat OOP is used for specific purpose as well as procedural.. Plz guyz differienciate their uses
ProgrammingRe: Any Female Python Programmer Here?? by teampregar(op): 9:16pm On Mar 04, 2016
NL Female programmers come and defend urselves oh
ProgrammingRe: Any Female Python Programmer Here?? by teampregar(op): 9:16pm On Mar 04, 2016
Female programmers come and defend urselves oh
ProgrammingRe: Any Female Python Programmer Here?? by teampregar(op): 8:16pm On Mar 03, 2016
Dekatron:
so you can't study a guy and build a team with him??
grin grin why the extreme interest in the female?


Fulaman198, you smell something fishy, didn't you?? grin grin grin
Guys always want their opinion to be established with each other in stuffs..
BT u can just tell a female I want this website or app to be like this and its done
ProgrammingRe: Any Female Python Programmer Here?? by teampregar(op): 7:00pm On Mar 03, 2016
Fulaman198:
Lol bro something tells me you need a female programmer for other reasons.
No I jast wanna get to interact and understand her personally before the project.. A team is supposed to understand each oda. u can't build a team of people who don't trust nd understand each other
ProgrammingAny Female Python Programmer Here?? by teampregar(op): 5:59pm On Mar 03, 2016
There's this project I want to work on,I need a female python developer.. If any pls drop your WhatsApp contact let me add u, to knw u better... p.s. I am a male, my stack is java, JavaScript, php and mysql(learner tho).
ProgrammingRe: How Was Nairaland Able To Achieve Its Speed by teampregar(m): 5:22pm On Mar 03, 2016
LordRahl001:
Seun should please talk to us nao!! Guys @ quora and stackoverflow share tips o their tech and servers. It would also help so folks here!!
It is only in Africa DAT developers don't help each other oh.. the teams at Facebook,Instagram, Twitter give out information on what they use and how they use it to scale their companies.. Facebook has even open sourced everything it uses.. go to code.facebook.com
ProgrammingRe: What Softwares Are Used To Push Codes To A Live Website by teampregar(op): 7:10am On Feb 17, 2016
dhtml18:
It is just a crude and dirty technique and it does work with PHP.
can u recomend me to any useful version control tutorial?
ProgrammingRe: What Softwares Are Used To Push Codes To A Live Website by teampregar(op): 7:09am On Feb 17, 2016
Djade007:
There are also tools like Capistrano https://github.com/capistrano/capistrano which can help easily reverse from one version of your code to another. But I'm yet to look at it, I just prefer git alone
is like this capistrano is written in ruby oh, and i dont understand ruby
ProgrammingRe: What Softwares Are Used To Push Codes To A Live Website by teampregar(op): 9:28pm On Feb 16, 2016
dhtml18:
Let me now answer the thread, the first thing to know is that the task at hand can be accomplished in so many ways but i shall keep it simple:

Objective: You have a website that uses images, javascript and css lots of it.

If you know that you are going to be updating your images very often, then you version them.

Let me explain what i call the versioning technique:
If for example your logo url is example.com/images/logo.png and you want to be able to update your logo like every minute or hour without changing the url. If you upload a new logo to overwrite the former one, browsers that have visited the site recently will take sometime to update their browser cache, so your logo update may not be seen immediately.
So to solve that problem easily, you can add a profix like this: example.com/images/logo.png?ver=1 so that when you update the logo, you increment the version inside your html output to say example.com/images/logo.png?ver=2 (this way browsers will automatically know they have to redownload immediately they see this - so cache is bursted).

This versioning technique also works for javaScript and Css. You first upload the media file to replace the old one in the case of css, js, images and other similar ones. Then you update their versions in your html source code and finally update your html source code.

Now to prevent a breakdown of service, do not use ftp to make these changes because FTP thrashes old files before replacing them, if your website is a very active one, people might experience breakdown of service while ftp is replacing core files.
You can use a zip upload to upload, works best because the old files are replaced very fast and efficiently.


It is possible for you to write a script to automate this kind of task. I had a site that needs constant update like that. Whenever i make those changes, i run a script on my localhost which connects to an api on the live website and uses that API to publish the changes.
I create a zip file containing the folder structure with the file updates, so all my script does is to upload the zip online and extract it.

Any questions? I have tried to summarize it as best as i can.
Can this versioning work with php ??

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