Friday, February 25, 2011

Hidden new line in string PHP


I guess you seen the problem, or maybe facing with it at the moment. So if you echo the string with pre tags, it will show normally. But without pre tags, it shows ugly... just like a plain text.

The problem is that there is hidden new lines symbols like /r or /n and so on...

Just by replacing the with str_replace is not enough. So here solution for it:

$value = preg_replace('/[\r\n]+/', '\n', $value);
echo htmlentities($value);

Tuesday, February 22, 2011

Real Megatron Tank from Transformers 2

Can you believe it? Real replica of Megatron Tank from Transformers 2 was made by one chinese metal artist. Full weight of the tank is more than 5000 kg.

Here is image of megatron tank made by fan


And here photos from real life
















Monday, February 21, 2011

Do you need to close apps in your multitasking bar?

No you don't says website - http://www.tipb.com/.

I was wondering about this too and i always close applications in my multitasking desk of my ipod touch 2generation.


Thursday, February 17, 2011

How to test your hardware for problems

To find problem in your hardware you need to test everything... But you need to think... I mean, if windows loads up it means that video card, hard disk, rams, and so on works... Possible case - they works not good as "good", but they still works.

Anyways..

Here is some list of programs and other tricks i found while searching internet how to test your hardware parts.

Ram ( Random Access Memory ):
To test your RAM, you can do just by checking your Task Manager ( Performance tab ). Also you can see how many rums installed by going to "my computer"'s properties.
In harder cases people recommend to download these programs:
Most of the information was fount on ehow.com

Hard Disk ( Hard Drive ):
Most of test which you can do for your hard drive is installed in windows. It called "checkdisk" or chkdsk.exe, you can run it from command line. In other case you can do that from your file explorer:
  1. Go to computer, 
  2. Select hard drive
  3. Open properties
  4. Choose tools tab
  5. Press "Check Now" button, in "Error-checking" section
  6. In showed up windows check all possible check boxes and press Start.
  7. Wait until finishes and press Done. 
Also you can test your hard drive with SeaGate tool ( http://www.seagate.com/www/en-us/support/downloads/seatools ). 16,7 MB

Funny part of this, is that you can listen for sounds which hard drives are making ( in case if it is still working ), and check if it matches one of these ones: http://datacent.com/ . If it does,... i guess you need to change it.

More useful freewares such as "Hitachi Drive Fitness Test" or "Samsung HUTIL" and so on... can be fount here: http://pcsupport.about.com/

GPU ( Graphic Process Unit ):
First of all windows has included tool for this - dxdiag . You can run it from Command line.
  1. Press Start 
  2. Run 
  3. Cmd.exe 
  4. dxdiag 
  5. hit Enter
  6. check Dispay tab, for video card information.
Most popular method to test your video card is to install and run one of Benchmarks product 3DMark. http://www.futuremark.com/

Motherboard:
If motherboard is not working properly you will notice it. Some of these facts says about it:
  • Computer does not boot, and instead gives beep sounds.
  • Computer random crashes.
  • Computer randomly reboots.
and so on..


One of great software to test motherboard is Hot CPU Tester.

Sunday, February 6, 2011

Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error. [Solved]


I got the error after, updating my chrome to 9 version. I appeared few times, and i decided to fix it. So here is solution for the error:

Chrome:
1. Open Options
2. Choose Under the Hood tab in options
3. Press Reset to Defaults
4. Done.

Common tags for the article: chrome, problem, mistake, bug, error, how to

Wednesday, January 12, 2011

PHP export mysql table to text file


Here is simple script which will help you a bit, to export all fields of your database table to text file. It will not be same as export of MyAdmin, but its better than nothing... at least you will have data.
$sql_export = "SELECT * INTO OUTFILE 'tables.txt' FROM `table_name` ";
//var_dump($sql_export);
if($result = mysql_query($sql_export))
echo "Recorded";
else echo "Not recorded";

Sunday, January 9, 2011

Joomla Error loading feed data



The error occurs after installing joomla.

So fix the thing all you need to do is:
1. go to administrator panels
2. Extensions -> Module Manager -> Administrator tab
3. Find "Joomla! Security Newsfeed"
4. Disable it
5. Done
If you have the “yoo_tweet module” installed, disable this module as well.  This module is known to display this error message.

Why:
Because this module load feed data with link http://feeds.joomla.org/JoomlaSecurityNews, this link is broken, so it pop up a error loading feed data error.

Have fun!

Thursday, January 6, 2011

Finding time difference in seconds between 2 dates ( timestamps )


In my situation i needed query to find time difference in seconds between current time and field's value.
SELECT TIME_TO_SEC(TIMEDIFF(NOW(),`field_name`));
between 2 mysql fields can look like this:
 SELECT TIME_TO_SEC(TIMEDIFF(`field_name1`,`field_name2`));

httpd.exe apache cpu 100% load


I had the problem today. When i started Apache from Xampp control panel, CPU usage became 100%. Nothing changed after apache restart and PC restart. Same.. - 100%.

So to understand what is happening you need to 
1. go to: C:\xampp\apache\logs
2. open  access.log with text editor

if file is too big to open ( bigger than 5 mb ) do this:
1. just delete access.log and error.log
2. start apache and stop it after it will start loading your CPU to 100%.

In access.log, you will be able to figure out what is happening with your apache ( httpd ).

In my situation was some kind of apache virus ( which affects my files with new scripts called webdav and webalizer ).
So if you have the folders in your xampp folder, that means you have same problem..

i solved it by this way:
1. -> Control Panel\Network and Internet\Network and Sharing Center
2. -> Windows Firewall
3. -> Allow programs to communicate through Windows Firewall
4. Removed Apache HTTP Server with checked under Public ( To do that press Change settings button on top )
5. Close everything.

It might not help you. So here is one more idea what you could do in the situation:
After finding out what IP requested execution of the script in part with error.log just Block it! Google for answer..

Tuesday, January 4, 2011

Facebook smiles


Here is collection of all smiles which are possible in facebook.


Happy emote: :) or :-)
facebook smiley happy
Really happy emote: :D or :-D
facebook smiley sad
Sad: :( or :-(
facebook smiley crying
Crying emote: :’(

facebook smiley wink
Wink emote: ;) or ;-)
facebook smiley happy eyes
Happy eyes: ^_^
facebook smiley laughing eyes
Laughing eyes: >:o
facebook smiley cat smile
Cat smile: :3
facebook smiley grumpy
Grumpy: >:-(
facebook smiley shocked
Shocked emote: :o or :-o
facebook smiley glasses
Glasses emote: 8) or 8-)
facebook smiley cool shades
Cool shades: 8-|
facebook smiley rude
Rude: :p or :-p
facebook smiley woot
Woot?!: O.o
facebook smiley dork
Dork emote: -_-
facebook smiley duhhh
Duhhh emote: :/ or :\
facebook smiley devil
Devil emote: 3:)
facebook smiley angel
Angel emote: O:)
facebook smiley kiss
Kiss emote: :-* or :*
facebook smiley love
Love emote: <3
facebook smiley pacman
Pacman: :v
facebook smiley shark
Shark: (^^^)
facebook smiley robot
Robot: :|]
facebook smiley weird face putnam
Weird guy’s face: :putnam:

Other symbols which also can be "copy-pasted" into facebook


¢ – cent
£ – pound
¤ – currency
¥ – yen
€ – euro sign
§ – section
© – copyright
® – registered trademark
™ – trademark
° – degree – e.g. 45°
¹ – superscript 1
² – superscript 2
³ – superscript 3
· – middle dot
¸ – spacing cedilla
¼ – fraction 1/4
½ – fraction 1/2
¾ – fraction 3/4
¿ – inverted question mark
× – multiplication
÷ – division
• – bullet = black small circle
◊ – lozenge
℠ – Service Mark
✓ – check mark
✔ – heavy check mark
✕ – multiplication sign
✖ – heavy multiplication sign
✗ – ballot
✘ – heavy ballot
✝ – Latin Roman Cross
✞ – Latin Cross 3D shadow
✟ – Latin Cross outline
✠ – Maltese Cross
✡ – Star of David
❛ – quotation mark single turned comma
❜ – quotation mark single comma
❝ – quotation mark double turned comma
❞ – quotation mark double comma
℃ – Celsius
℅ – care of
℉ – Farenheit
№ – numero symbol – number sign
℗ – Sound Recording Copyright
℞ – Prescription Take pharmaceutical symbol
Ω – Ohm
℧ – Inverted Ohm
☀ – sunshine – sun
☁ – cloudy – cloud – dark cloud
☂ – raining – rain – umbrella
☃ – snow – snowman
☄ – shooting star
★ – star solid
☆ – star outline
☇ – lightning
☈ – thunderstorm
☉ – sun
☊ – ascending node
☋ – descending node
☌ – conjunction
☍ – opposition
☎ – phone
☏ – phone symbol outline
☐ – check box
☑ – check box check mark
☒ – ballot box with X
☓ – St. Andrew’s Cross
♔ – White King
♕ – White Queen
♖ – White Rook
♗ – White Bishop
♘ – White Knight
♙ – White Pawn
♚ – Black King
♛ – Black Queen
♜ – Black Rook
♝ – Black Bishop
♞ – Black Knight
♟ – Black Pawn
☚ – left-pointing index finger
☛ – right-pointing index finger
☜ – left-pointing index finger
☝ – upwards pointing index finger
☞ – right pointing index finger
☟ – downwards pointing index finger
☠ – skull & crossbones
☡ – caution sign
☢ – radioactive sign
☣ – biohazard sign
☮ – peace sign
☯ – yin & yang
☹ – frowning face
☺ – smiley face
☻ – black smiley face
☽ – waxing crescent moon
☾ – waning crescent moon
♈ – Aries
♉ – Taurus
♊ – Gemini
♋ – Cancer
♌ – Leo
♍ – Virgo
♎ – Libra
♏ – Scorpio
♐ – Sagitarius
♑ – Capricorn
♒ – Aquarius
♓ – Pisces
♠ – black spade suit
♢ – red diamond suit
♣ – black club suit = shamrock
♤ – red spade suit
♥ – black heart suit = valentine ( <3 )
♦ – black diamond suit
♧ – red club suit
♨ – hot springs
♩ – musical quarter note
♪ – musical eighth note
♫ – musical single bar note
♬ – musical double bar note
♭ – flat note
♮ – natural note
♯ – sharp note
✁ – cut above
✂ – cut here
✃ – cut below
✄ – scissors
✆ – public pay phone
✇ – film reel – tape spool
✈ – airport jet airplane
✉ – envelope mail email
✌ – victory sign
✍ – signature – sign here
✎ – pencil diagonal down
✏ – pencil
✐ – pencil diagonal up
✈♬☑ ☎ ☒ ☻ ♤ ☤☹♀ ✩✉ ✇♺✖♨ ❦☁ ✌♛ ❁☪ ☂✏♝ ❀ ☭☃☛♞ ✿ ☚ ♘✾ ☯☾☝♖✽ ✝☄☟♟✺ ☥✂ ✍♕✵ ☮☠ ❤☆ ★ ♫ ✔ ► Ω ッ ● ♣ ♪ ☼ ◄ ❥ ♂♀ ♪◘♠☻♣ ♦☺○ ¿ ❤ ☆ ★

Also meaning of the article could be like this:
Facebook smile, Facebook smileys, Facebook, Smileys, Facebook Smiles

Thursday, December 30, 2010

How to delete facebook page


To detele facebook page you need to do this:
1. login into your facebook account in which you want to delete facebook page.
2. click "Adverts & Pages".
3. choose desired Page, which you want to delete and press "Edit Page"
4. on left side, choose "Manage Permission".
5. finally in delete section press "Permanently delete this Page"
6. in popup windows once again press "delete" to confirm that you want to delete it.
7. done

Monday, December 20, 2010

PHP goto error - syntax error, unexpected T_STRING

If you getting the "syntax error, unexpected T_STRING" , that means the server which you are using at the moment has php version lower than 5.3 . So to solve the problem, the only method is to install newer version than 5.3. Else you need to change server or to use another method than "goto".

Good luck!