If you are as unlucky as I am, and your iPhone or iPad was freeze and you are unable you can resolve this by holding down the “Power button” and “Home button” for 5-10 sec to turn off and shows Apple logo.
here after your unit running again.
If you are as unlucky as I am, and your iPhone or iPad was freeze and you are unable you can resolve this by holding down the “Power button” and “Home button” for 5-10 sec to turn off and shows Apple logo.
here after your unit running again.
After I have worked hard with the language management into my OS X I tried to resolve some issues the first issue is the OS X should running English instead of Danish, this resolved I do that go into the (System Preferences -> Language & Text) here inside click (Edit list …) and remove all the languages you not want be listed, remember if you run more than one language so dreg’n'drop your language up to the top.
Followed you must restart your Mac after you have restarted your Mac, you will discover the login display is still appears on your first language that your Mac are installed from the beginning in my case Danish, that we would not therefore log in and open up your terminal can be found in the folder (Applications -> Utilies) now open the “terminal” write follow and be sure you have adminsitartor promissons.
sudo languagesetup
Here after you will be ask for your super administrator password that you need write, then it tells your now it all as it should be and you may now reboot your Mac before you do anything else.
Good luck with this small tip.
If you use jQuery for everyday, it might be wonderful to learn how you can do an “append” for your tablet without your lines goes amork.
Even I have started using a very smart method which makes I can remove tr’s without my rows / fields breaks down.
Start to create your table so it looks like this
<table> <thead> <tr> <th>Titel</th> </tr></thead> <tbody id="test"> </tbody> </table>
Now you have made your javascript to execute an append to your table’s tbody
function testAppend() { var contentData = ''; contentData += '<tr>'; contentData += '<td></td>'; contentData += '</tr>'; $('#test').append( contentData ); }
After you have created this JavaScript function, you now just lie it on a button with an onclick and so it seems.
To change the IP address in CentOS you need to edit 2 files, start to correct your address information in 2 files
sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0 sudo nano /etc/sysconfig/network
When these two files are modified correctly for your network, you must restart the network servicesen.
service network restart
Maybe you are more into the GUI interface in the terminal, it can also be used by using this command.
system-config-network-tui
If you just installed OS X Lion or upgraded from Snow Leopard to Lion and want to use it as a developer web-server so it is possible.
This guide will help you get Apache2, MySQL5.5 and PHP5.3 to work on your machine so you are ready to develop without internet.
What you are installing when you follow this guide:
- Apache 2.2
- PHP 5.3
- MySQL 5.5
PHP modules are also being installed:
- php5_xdebug
- php5_mysql
Why I have chose PHP 5.3 instead of PHP 5.2 or older version of PHP:
This is due to PHP 5.3 allows me to use the namespace which only come in PHP 5.3, with the namespace I muglihed to bursting with my code even better.
Not only that I have personally afferet that with namespaces involved, I have the opportunity to wrong my files into very small bites are also known from C # when this is a natural thing for many developers.
Before you install:
The first thing you should do is to download and install MacPorts from their website MacPorts remember to have our latest Xcode installed to suit OS X Lion
Once installed, you can now open your terminal and install both Apache, PHP and MySQL
Start you basic setup:
Open your terminal and type the following lines
sudo port install apache2 sudo port install php5-devel sudo port install mysql5-server-devel
It may take a little time, so take it one cup of coffee, cola or tea.
Now you are ready to install the following PHP modules which now must be on your system in my personal opinion, you can obviously do without the modules you do not want to install.
sudo port install php5-gd sudo port install php5-imagick sudo port install php5-memcache sudo port install php5-memcached sudo port install php5-mysql sudo port install php5-openssl sudo port install php5-soap sudo port install php5-xdebug sudo port install php5-curl sudo port install php5-gettext
Once all your models are installed for PHP, we now config your MySQL database, it is done by us to install mysql’s database and then set the password for the root user.
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
For Apache and MySQL to even start up, you then use these 2 command lines!
sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
Now go into the Apache config file and paste the following 2 lines, search for AddType and LoadModule when you insert each simple line, it is very nemer, you use “nano” as a terminal editor, press the button (ctrl + w) to search
LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php
Search DirectoryIndex and add filename “index.php” and then you save again by pressing ( CTRL + O ) and then ( Y )
To start Apache and MySQL up without having to reboot your machine, type 2 command lines.
sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start
Are you unlucky as I was that Apache gives this error message “httpd: Could not reliably Determine the server’s Fully Qualified Domain name, med Pariss-MacBook-Air.local for server name” you need to find ServerName in the httpd.conf file as you continue to have open and write your hostname as you can see the error message, what you write may look like this.
ServerName Pariss-MacBook-Air.local:80 Now you can save the file and pressing ( CTRL + O ), followed by "Y"
To create shortcuts to both MySQL and Apache which makes it faster for the restart, stop and start if someone were to go wrong can be done by writing these 2 lines.
alias apache2ctl='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper' alias mysql5='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper'
Good luck and happy development
If you are one of the persons there can rip your hair of your head when customers asking you to adding a lot of rows from your MySQL table to another table based on certain requirements.
Then take this little tip possibly helping you to a fun business day
INSERT INTO table1 (field1,field2) SELECT t2.field1, t2.field2 FROM table2 t2;
I hope you enjoyed this little tip to make your workday more fun.
In PHP, there are many different ways to create XML, but the absolut easiest way is by using DomDocument.
Start with create a new DomDocument object
$doc = new DomDocument('1.0', 'UTF-8');
Please indicate this it is to be XML version 1 and our charset are set to UTF-8
Now you need to make our root channel where all our elemeneter to be in.
$root = $doc->createElement('root'); $root = $doc->createElement('root'); $root = $doc->appendChild($root);
Now it’s time to add our first elements eg customers
foreach( $customerArray AS $key => $value ) { $occ = $doc->createElement('customer'); $occ = $root->appendChild($occ); foreach( $value AS $secoundKey => $secoundValue ) { $child = $doc->createElement( $secoundKey ); $child = $occ->appendChild($child); $value = $doc->createCDATASection($secoundValue); $value = $child->appendChild($value); } }
Finally, we would save our XML document and print our output to a browser.
$xml_string = $doc->saveXML(); echo $xml_string;
Er du lige som jeg og benytter TextMate, så er der her et rigtig dejligt Addon til programmet “Zen-Coding” det vil spare dig for utrolig meget tid hvor du før brugt tiden på de normale HTML tags.
Med Zen-coding vil du kunne lave dine HTML tags meget hurtiger eks.
div#page>div.logo+ul#navigation>li*5>a
Bliver oversat til følge HTML kode:
<div id="page">
<div class="logo"></div>
<ul id="navigation">
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</div>Det skal siges at Zen-Coding også findes til andre editor end TextMate.
Efter at have brugt hover effekten i jQquery ( $(this).hover(over,out); ) har det skabt et enklet problem som virket meget underligt, nermlig i Chrome hvor der bliver brugt et div tag til login boks med input felter.
Chrome mener åbenbart at hvis du har input felter i dit div tag så er du uden for boksen hvis du rammer et input felt, dette problem opstår ikke i andre browser ( Internet Explore, Safarie og Firefox ) men netop i Chrome gør den.
Jeg søgte rundt på nettet for at se hvad der kunne gøres, jeg fandt så ud af der var flere med netop samme problem, den måde det kan løses på er at bruge mouseover og mouseout isted for.
Jeg har her under vedlagt min tilrattet kode så du kan se hvad jeg har gjort for at løse netop dette problem.
Orginal kode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | $(".topnav").mouseover(function(){ $(this).find("div.subnav").show(); $(this).find("input").keypress(function(e) { if(e.which == 13) { $(this).find("form").submit(); } }); }).mouseout( function(){ $(this).find("div.subnav").hide(); }); |