Group multiple values into one row in a mysql database
http://stackoverflow.com/questions/276927/can-i-concatenate-multiple-mysql-rows-into-one-field
Monday, December 15, 2014
Tuesday, December 2, 2014
Thursday, November 13, 2014
Tuesday, November 11, 2014
Tuesday, September 9, 2014
Wednesday, August 13, 2014
Tuesday, August 12, 2014
Why you should use <colgroup> to assign classes to columns
I recently stumbled upon a bug that had me baffled for a while. I had a simple label input table with the labels set to 15% width and the inputs set to 85% width. I added a class to each <td> to set the width. Everything was working great. Until it wasn't.
I noticed the columns were both at 50%. The css was still set correctly. So I started undoing my changes one by one to see what the affecting code was.
Turns out I had added a <tr> to the top of the table with colspan="2" not knowing that would affect the width of each column.
I wanted to keep that column at the top so I added a <colgroup> with the classes on each <col> instead of each <td> and voilà. Everything went back to normal.
Conclusion: When setting column classes on a table use <colgroup>
UPDATE:
I found out that only certain css properties work on <colgroups>
http://stackoverflow.com/questions/1238115/using-text-align-center-in-colgroup
So my solution is to use classes on <colgroup>s and <td>s
I noticed the columns were both at 50%. The css was still set correctly. So I started undoing my changes one by one to see what the affecting code was.
Turns out I had added a <tr> to the top of the table with colspan="2" not knowing that would affect the width of each column.
I wanted to keep that column at the top so I added a <colgroup> with the classes on each <col> instead of each <td> and voilà. Everything went back to normal.
Conclusion: When setting column classes on a table use <colgroup>
UPDATE:
I found out that only certain css properties work on <colgroups>
http://stackoverflow.com/questions/1238115/using-text-align-center-in-colgroup
So my solution is to use classes on <colgroup>s and <td>s
Friday, July 18, 2014
<colgroup>
in HTML you can specify a colgroup element to style each column instead of setting a class for each cell
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup
Sunday, June 29, 2014
How to unicycle
I think I can officially say that I can ride a unicycle. I have been practicing on a unicycle for a couple weeks here and there. I finally got to the point where I can ride comfortably for a while. It requires A LOT more leg strength than a bicycle, so right now my longest is about 200 meters, just because my legs started to give out.
Thursday, June 26, 2014
Use bin2hex and unhex as simple sql injection prevention
When it comes to sql injection prevention prepared statement is definitely the correct solution but if you find yourself in a predicament that prevents you from using one hexing and unhexing works.
Use a query like this:
$query = "SELECT * FROM table WHERE column = UNHEX(".bin2hex($userInput).")";
http://stackoverflow.com/questions/22567944/is-hexing-input-sufficient-to-sanitize-sql-queries
Use a query like this:
$query = "SELECT * FROM table WHERE column = UNHEX(".bin2hex($userInput).")";
http://stackoverflow.com/questions/22567944/is-hexing-input-sufficient-to-sanitize-sql-queries
Friday, May 23, 2014
Recycling electronics
Lots of companies will recycle their old electronics for free
http://recode.net/2014/05/22/go-green-a-guide-to-recycling-old-electronics/
Tuesday, May 13, 2014
Chinese url are usually just numbers
Chinese companies usually use numbers for their url instead of letters because Chinese people can remember them easier
Monday, May 12, 2014
Search for vendor based on mac address
While trying to fix a duplicate IP address problem on a network I learned that you can search for a vendor given the MAC address.1 Also that Roku devices do not broadcast a net bios name.
1http://www.macvendorlookup.com/
1http://www.macvendorlookup.com/
Thursday, May 8, 2014
4D printing
4D printing is printing a 3D object that moves on its own. http://ted.us1.list-manage.com/track/click?u=07487d1456302a286cf9c4ccc&id=78921e5f31&e=190572444c
Tuesday, May 6, 2014
Change oil in a boat motor
I was helping my dad get his boat ready for fishing opener and he showed me how to change the oil.
- Find the two screws on the side of the motor.
- Unscrew the top screw.
- Unscrew the bottom screw and stick the new oil tube into the bottom hole fast to prevent oil from spilling out of the bottom hole.
- Squeeze the tube until oil comes out of the top hole (water might come out first.)
- Take the new oil tube out of the bottom hole and screw in the bottom screw fast to prevent oil from spilling out of the bottom hole.
- Top off the oil through the top hole.
- Screw in the top screw.
- Clean up.
- Party!
Subscribe to:
Posts (Atom)