TECHiE TALKS

Just another techie stuff

The floating message goes here

Simple PHP Date Function

PHP has a function date where you can specify different ways on how to display the date.  How do you generate current date and display only month and date like ‘September 2010′.  Here is a simple php howto,

function curDate() {
return date("Y-m-d",mktime(date("h")+8, date("i"), date("s"), date("m")  , date("d"), date("Y")));
}
$now = substr(curDate(),0,7);
echo date("F Y", strtotime($now));
?>

The code above will simply output September 2010, a simple code that will surely help you especially when coding PHP from scratch.

Did find the post very useful? Maybe you want to buy me a glass of beer!

No Comments

Media Player On Tray

If you already have a validated Windows Media Player then you can use this software.  Those that are not validate can still use this software as long as you won’t update you OS or even your media player.

Media Player on tray is an alternative of what windows has provided windows xp users which can be found on this link.  Most of windows users work while listening to music, especially when you are working in an office.  Some problems that we encounter is that when opening more than 1 application such as adobe photoshop, MS Excel, MS Word and many more, media player is somewhat bothersome to see on the task bar.  Sometimes we even accidentally close media player and tend to re open it again and reselect the music files again.  As a solution I will provide you a portable application which hides your media player on the tray icon, see image below to have an idea what I am talking about: Read the rest…

Did find the post very useful? Maybe you want to buy me a glass of beer!

No Comments

Application Always On Top

always on top

 

So many times that I have been needing this software in doing my daily tasks, having my application always on top of the other.  This is very useful especially when you are doing a data entry job, wherein a notepad is always needed on top of an excel file or in an openoffice calc file.  This software very easy to use, all you need to do is open up the software you want to be on top always and just press ctrl + spacebar and thats it, that software will remain on top unless you press ctrl + spacebar again.  If you want the software you can download it here for free, click this link.  As a summary to get the software always on top press ctrl + spacebar and to deactivate press the 2 keys again(ctrl + spacebar).  Hope this also helps you in doing your jobs.

Did find the post very useful? Maybe you want to buy me a glass of beer!

2 Comments

Windows 7 SciTE on Context Menu

Its been a while that I used Scite as my default source code editor.  It has been my default IDE for 2 years and now I am trying to use Notepad++, eclipse and RapidPHP but I am so uncomfortable using them.  Now, I am running windows 7 ultimate 32 bit on my machine and installed Scite but can’t get it to be on the default programs because windows 7 treats Scite and notepad as one.  To solve my problem I tweaked my registry and added scite to my context menu instead so every time I want to open a PHP file I always have the choice to open it on my favorite source code editor which is Scite.  What I did was a simple tweak on the registry, its simple and straight. 

scite on registry

  1. Open Regedit by typing Regedit on the search box in windows 7
  2. Navigate to HKEY_CLASSES_ROOT\*\shell
  3. Create a new Key(Right click on shell > new > Key) and name it “Open with Scite”
  4. Create a new key under the folder “Open with Scite” and name it command
  5. On the right pane you can edit default by double clicking it and add the value C:\Program Files\SciTE Source Code Editor\SciTE.exe %1 or you can have the path to where you installed scite and just add %1 to get it working. 
  6. Click ok and everything is ready.

Below is what I had after doing the tweak:

context menu

Hope this helped you in using scite on widows 7 platform.

Technorati Tags:

Did find the post very useful? Maybe you want to buy me a glass of beer!

2 Comments

Slackware Net Configuration

nic

 

This workaround assumes that you have already installed a driver for your Network Interface Card (NIC).  First you’ll need to check the information of your network devices.  It can be obtained with a ifconfig –a command

root@icpep:~# ifconfig –a

eth1  Link encap:Ethernet  HWaddr 00:11:5b:fc:b9:f0
         UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:110081 errors:1 dropped:0 overruns:0 frame:0
         TX packets:84931 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:100
         RX bytes:114824506 (109.5 Mb) TX bytes:9337924 (8.9 Mb)
         Interrupt:10 Base address:0xc000

lo       Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3162 (3.0 KiB)  TX bytes:3162 (3.0 KiB)

If you typed ifconfig or /sbin/ifconfig without the –a suffix you won’t be able to see eth1 interface as your network card does not yet have a valid IP address or route.   First setup is when you want to automatically obtain an IP address from your DHCP(or Dynamic Host Configuration Protocol) server.

Read the rest…

Did find the post very useful? Maybe you want to buy me a glass of beer!

No Comments

Bubble Sort and Graphics.h in Dev C++

dev c++

Lately I have been searching  this post on the net about graphics.h in dev c++ and found few resources about it .  So I decided to write how to use graphics.h in dev-c++.  I am expecting that you have already installed bloodshed dev-cpp on your machine.  Graphics.h is a header file found in borlan c but because of its late development devcpp is now the mostly used IDE and compiler in programming c++.

Below are the steps on how to get graphics.h running on your machine,

  1. download graphics.h and save it to the include folder where you installed dev-cpp (C:\Dev-Cpp\include)
  2. Download libbgi.a and save it in the lib folder where you installed dev-cpp (C:\Dev-Cpp\lib)
  3. So when you have to create a program that needs the use of graphics.h  you must instruct the linker to link in certain libraries by going to projects > project options > parameters tab > linker column copy the lines below and paste it on that column.
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32

By then you should be able to use graphics.h. As a sample I created this bubble sort algorithm as an example on how to use graphics.h in c++. Read the rest…

Did find the post very useful? Maybe you want to buy me a glass of beer!

2 Comments

Saving .ico in Photoshop

Photoshop

Adobe Photoshop is one of the most advance tools in digital image editing and for developments as well such as icons and some other stuff.  Photoshop now is on CS5 which handles several new features and one is Content-Aware Fill where you can magically fill in spaces on digital images matching the tones, lightning and noise of the images making it as if it existed on the image.  You can find more of the new features on their site. Read the rest…

Did find the post very useful? Maybe you want to buy me a glass of beer!

2 Comments

« Previous Entries

Rss Feeds