Alejandro Escamilla macbook

How to print triangle shape asterisk using for loop?

This is my first exercises on computer programming 2. To triangle shape asterisk or echo out triangle asterisk in a for loop sequence.

----*
---***
--*****
-*******
*********

Analyzing the output?

It could be 5 line break and so on
The number sequence of the asterisk is x = x+2

Here is the code for the number sequence.

$s=""; // initial variable
$b=9; // base number of the triangle
// execute loop if true
for($i=1;$i< =$b;$i+=2){
// make a line break
$s.=$i."
";
}
echo $s;

The output number sequences we get from the for loop

1
3
5
7
9

We already got the number of asterisk on each row.
Now we can print the asterisk accordingly.

$s=""; // initial variable
$b=9; // base number of the triangle
// execute loop if true
for($i=1;$i< =$b;$i+=2){
// store the string value of $s while the asterisk count is true
for($j=0;$j<$i;$j++){
$s .="*";
}
// make a line break
$s.=$i."
";
}
echo $s;

The output of triangle asterisk using for loop.

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

We add dash to indent the asterisk to center for the final code.

$s=""; // initial variable
$b=9; // base number of the triangle
// execute loop if true
for($i=1;$i< =$b;$i+=2){
// store and add dash on the string value of $s while it is true
// or $k is less than $b-$i
for ($k=0;$k<($b-$i); $k+=2){
$s .="-";
}
// store the string value of $s while the asterisk count is true
// or $j less than $i
for($j=0;$j<$i;$j++){
$s .="*";
}
// make a line break
$s.=$i."
";
}
echo $s;

The output of triangle asterisk using for loop with indention.

----*
---***
--*****
-*******
*********
DNS Error Resolution

Clear the local DNS Cache in OSX 10.10 Yosemite, Linux and Windows

When you see something wrong on your website, like getting worry if server not found or the site isn’t loading the way it is. This is happening when Domain Name Server is changed or by connecting into network that has DNS management system. It is time to clear your DNS Cache.

The DNS store domain and IP address on your local network cached and you can refresh it by flushing the cache.

How to clear the local DNS cache on terminal or command line?

OSX 10.10

sudo discoveryutil udnsflushcaches

OSX 10.9

dscacheutil -flushcache; sudo killall -HUP mDNSResponder

OSX 10.7 – 10.8

sudo killall -HUP mDNSResponder

OSX 10.5 – 10.6

sudo dscacheutil -flushcache

Windows

ipconfig /flushdns

Linux (depending on what you’re running)

/etc/init.d/named restart
/etc/init.d/nscd restart

DNS cache is periodically flushing but it depends on how it is configure in network settings. You can use this command if you want to flush it now!

I experience this when I transfer hosting and the dns change, while my local dns cache are still having the old data, it could load the page or the url can’t be resolve. I have to ask my chat make to check if the website is online and yes it was. So its time to flush my local dns to resolve the url.

You can also flush dns in this kind of errors!

Error 1001 Ray ID: 1d74987af9ca122b • 2015-04-15 03:35:50 UTC

DNS resolution error

What happened?

You've requested a page on a website (www.yourwebsite.com) that is on the CloudFlare network. CloudFlare is currently unable to resolve your requested domain (www.advanceidea.org). There are two potential causes of this:

  • Most likely: if the owner just signed up for CloudFlare it can take a few minutes for the website's information to be distributed to our global network.
  • Less likely: something is wrong with this site's configuration. Usually this happens when accounts have been signed up with a partner organization (e.g., a hosting provider) and the provider's DNS fails.

DNS Error Resolution

How to update your WordPress on XAMPP running on Mac OSX?

You might have been frustrated on updating your WordPress by entering FTP information that doesn’t work. The real problem here is the system credential on the Apache httpd.conf must be correct. The default user information on the httpd.conf on the line is:

User nobody
Group nogroup

This line must be change to:

User admin username
Group staff

This will allow the file permission to write on the disk and can update your WordPress automatically. Having the correct admin user on the httpd.conf configuration will make the WordPress installation and update to run without asking the FTP information.

You may find the file to edit on this directory /Applications/XAMPP/etc/httpd.conf

Edit the file on your favorite text editor and update it. Save the file and restart XAMPP Apache server and check if it is working.

WordPress permission must be set.

The permission must be set in order to run update. You might also need to change the folder rights of the users to make it writable. An update cannot be process if the folder is not writable or the user has no rights.

Enjoy your WordPress Update

You can now update your WordPress on your dashboard and it will go to the process.

how to add email on outlook mac 2013

How to add email account on Mac Outlook 2013 for Non-Secure Connection?

I will give you example how to add email account on your Mac Outlook 2013. This connection does not require extra certificate authentication from the server. It will connect with the basic authentication with your given username and password.

Here are step-by-step screen shot guidelines how to add email account on Mac Outlook 2013 version.

Assuming that you have the given information. Your web admin or email hosting provider usually provides it.

Email: user@yourdomain.com
Password: ******
Connection Type: IMAP or POP3, I recommend IMAP for better synchronizing.
Incoming Mail Server: mail.yourdomain.com
Incoming Mail Server Port: 143
Outgoing Mail Server: mail.yourdomain.com
Outgoing Mail Server Port: 25

Step One: Click on Tools and Accounts
Step Two: Click + symbol on the Bottom left corner and click Other Emails
Step Three: Enter your email address and password.
Step Four: Continue to fill up the mail server information and click Add Account

Your email address is completely setup once you see the account appear on the left box. You can now close the dialog box and let your email synchronize and it is now ready to use.

Follow the Snap shots images for visual aids.

 

how to add email account on outlook mac 2013

how to add email account on outlook mac 2013

DHCP Server IP Addressing on Device and Printers.

When you are using DHCP to manage the IP address of your devices, then the settings of the devices must be on DHCP and not on Static IP.

DHCP is use to manage all IP address under its network. On the DHCP Server Settings you can assign or reserved IP Address on specific devices and constantly leases only for that machine address. It is the same goal with Static IP address to maintain its address without changing.

Network printers must have fixed IP Address and to achieve that, we usually make the network configuration of the printer in Static IP. All computers on the network can easily connect and remember the IP address of the printer.

I chose to set my printer on Dynamic IP address and let the DCHP Server leases the reserved IP on that printer constantly. This is likely same as having Static IP on that devices but this time it is being manage by DHCP server.

What is the advantage of setting your printer to be managed by DHCP?

DHCP is always the default network settings of the printer and it is easy as plug and play. It can easily join the network when you plug the cable or connect with the wifi.

Setting Static IP requires you to encode it manually in the setting and you have to know all the network details. It is not very efficient if you are setting on many devices. In a worst case you have to press the button to set it manually and cannot be done remotely. I am here in Philippines and I need to be in Singapore to set all the preferences. I don’t have to do that if it is auto configure by DHCP.

DHCP server cannot assigning dynamic IP to the device it the setting on the devices is set to static. It is important that the devices network configuration is set to DHCP.

There should be no problem in adding network printer with Dynamic IP address because the DHCP server is leasing reserved IP address for them.

You don’t need to configure all devices one by one to assign IP Address. Let the DHCP Server do all this work because it is built and design for that task.

How to Enable Manual Assignment or Reserve Dynamic IP address on Asus AC66U Router?

Log in to your router admin and go to LAN Settings

On DCHP Servers, you can see bellow Enable Manual Assignment and select Yes.

Add the Mac Address of the devices and put the IP address that you want to assign for them.

Save or apply the settings and  reboot the devices to refresh and get its new IP address.

 

HTML5 Is My New Baby

WordStar

What is about HTML5? Back when I was using WordStar for DOS. WordStar give me the idea how code tags works. WordStar was the first text editing software I used to print my documents. That text editor helps me to understand Hyper Text Markup Language quickly.

I learn the basic html at the age of 16 and then I knew to myself that I love it. My first website is uploaded on GeoCities and the others from homestead. I can’t ignore that there is always something new to learn. Now that all major browsers are supporting it, I will definitely place my attention to play with the codes and start to use it.

The code is more descriptive and very structure oriented. It will be easier to learn than previous version of html. HTML5 will surely help the loading speed and more search engine friendly because of the simplified codes.

HTML5 Logo

Why should I study HTML5?

I will consider HTML5 even if old browser can't display it properly. I know that people are more willing to upgrade their browser soon because they don’t want to miss the excitement.

What did you learn?

  • WordStar is a rich text editor that use code tag to format the text. It runs on DOS floppy disk drive.
  • Geocites hosting is very popular free hosting in the 90’s as well as Homestead.
  • Old browser does not support HTML5.