I just released an update to MrD.'s iplog plugin for MyBB 1.4.x. Its actually a complete rewrite. The big difference between the old one and this one is that the admin side now has searching and pagination capabilities.
I will do my best to keep it maintained. If not someone else should take over it. Just contact me if you would like any features or bug fixes.
Download the plugin: http://mods.mybboard.net/view/user-ip-log
Thursday, December 17, 2009
Thursday, June 18, 2009
jQuery form input helper text function
We started using jQuery at work a few months ago and we began to analyze the JavaScript we were writing. We found that we were using some code over and over and one was a few lines that handled adding some helper text to an input on page load and removing it when a user clicks the input to type some text. It also handles when a form is submitted removing the helper text before it is sent to the server for processing (no server side checks for the helper text).
Here is the code for a universal function in handling form input helper text. The last value will default to 'default'. This was a class name we chose to allow us to lighten the color of the helper text only.
Here is the code for a universal function in handling form input helper text. The last value will default to 'default'. This was a class name we chose to allow us to lighten the color of the helper text only.
/**
* Handles add/removing helper text for form input fields
*
* @param selector Jquery selector value of element to add helper to
* @param helperText Text to be placed in the input if input has no value
* @param css Css class to be added when helper text is set
*/
function form_helper_text( selector, helperText, css ) {
$(document).ready(function(){
// set css default value if none provided
css = typeof( css ) != 'undefined' ? css : 'default';
// select form element and if helper text is submitted replace with ''
var form = $( selector ).parents( 'form:first' );
$( form ).submit(function(){
if( $( selector ).val() == helperText ) {
$( selector ).val( '' );
}
});
// set action when field is not selected (add helper text)
$( selector ).blur(function(){
if( $(this).val() == '' ) {
$(this).addClass( css );
$(this).val( helperText );
}
});
// set action when field is selected (remove helper text)
$( selector ).focus(function(){
if( $(this).val() == helperText ) {
$(this).val( '' );
$(this).removeClass( css );
}
});
// trigger blue action to add helper text
$( selector ).trigger( 'blur' );
});
}
Tuesday, November 11, 2008
Mac Dashboard Stock Widget DST bug
So I discovered this year that there is a minor bug that when your are on standard time the daily stock chart is +1 hour running Mac OS 10.5.5. Now its not a big deal but its just annoying but I decided to fix it until DST begins where I will have to get in and undo what I did until I figure out a real fix instead of a work around.
Workaround
Edit: /Library/Widgets/Stocks.wdgt/Stocks.js
Goto Line: 1932 "var utcOffset = 13;"
Change to: "var utcOffset = 14;"
If I knew javascript better I might have had a solution but till then this will work out just fine.
Workaround
Edit: /Library/Widgets/Stocks.wdgt/Stocks.js
Goto Line: 1932 "var utcOffset = 13;"
Change to: "var utcOffset = 14;"
If I knew javascript better I might have had a solution but till then this will work out just fine.
Wednesday, October 29, 2008
SphinxSearch Experience
At work I have been investigating alternative search engines to manage our class schedule needs. Currently our credit schedule is 8 years old in design and requires file query caching to keep it running properly. We are wanting to get more information out of the database to make it easier for students to find classes they want to take that fits in their schedule. One options is to have filtering options like on many ecommerce sites.So I heard about SphinxSearch and how fast it indexes and produces query results. So this is great. Well it hasn't been as great of an experience trying to get it integrated into our non-credit system.
Problems:
1) Documentation is lacking. More detailed examples of many of the advanced features would be helpful.
2) PHP API is extremely slow.
3) It only deals with numbers (makes more work on me)
But after learning the system figuring out its quirks. Working around some bugs (might be solaris or sparc related) I am beginning to be more confident. I have also just started investigating the Sphinx PECL extention to see about speed improvements for parsing of the server response. During an initial test (FreeBSD Dual Dual Core Xeon 2.8Ghz 2GB Ram Server) a response using the PHP API cost 0.1 sec whereas the PECL version only cost 0.003 sec. Now these numbers are different than I was receiving on our solaris server but non the less its a huge improvement. I need to refine my testing to verify my results and I will post more details about them when I am more comfortable with what I have.
Saturday, September 27, 2008
NewEgg Egg Saver Shipping SUCKS!!!
So I have ordered several parts from newegg over the past 4 years and I have only had a couple problems.
1) Ordered computer parts with my parents credit card (graduation gift) and shipped to my house. This caused several problems and took me 3 days to resolve by getting my address as a shipping address and then threatening to cancel the order because they wanted to start a problem because of a phone number.
2) Egg Saver Shipping (3-7 business days).... OH MY GOD WHAT A LOW CLASS SHIPPING METHOD THIS IS. Yeah I know I could have paid $10 for UPS 3 day shipping but I figured it doesn't have to go far my stuff usually ships out of the NJ warehouse. So it was picked up on 9/11 in the evening and made it to IL 2 days later (note this is going to southern MI). Ok I can buy that its cheapo shipping. So on 9/15 it finally makes it to MI but changes carriers (USPS). Well it sits in Allen Park for 7 DAYS! and leaves Detroit on the 8th day. Ok so how did it get from Allen Park to Detroit? Who knows because USPS has the worst tracking system ever.
So after waiting two weeks from shipping date I emailed newegg customer support and they surprisingly said the shipment must have gotten lost in transit and that they would either refund me my money or send me out a new product. So trying to give the postal system the benefit of the doubt I decided to wait to respond for another day to see if it arrived that night or the next (friday). But still no RAM.
But oh wait... after I ask for a replacement (good thing on a weekend) the package finally shows up almost 2.5 weeks after shipment. The package was a little bit abused but at least RAM from Kingston is packaged very well. The best part about the package was the "Time Sensitive Material" text on the USPS sticker. I guess "time sensitive" is a relative term and USPS figures eh... anytime in the next month would be great.
1) Ordered computer parts with my parents credit card (graduation gift) and shipped to my house. This caused several problems and took me 3 days to resolve by getting my address as a shipping address and then threatening to cancel the order because they wanted to start a problem because of a phone number.
2) Egg Saver Shipping (3-7 business days).... OH MY GOD WHAT A LOW CLASS SHIPPING METHOD THIS IS. Yeah I know I could have paid $10 for UPS 3 day shipping but I figured it doesn't have to go far my stuff usually ships out of the NJ warehouse. So it was picked up on 9/11 in the evening and made it to IL 2 days later (note this is going to southern MI). Ok I can buy that its cheapo shipping. So on 9/15 it finally makes it to MI but changes carriers (USPS). Well it sits in Allen Park for 7 DAYS! and leaves Detroit on the 8th day. Ok so how did it get from Allen Park to Detroit? Who knows because USPS has the worst tracking system ever.
So after waiting two weeks from shipping date I emailed newegg customer support and they surprisingly said the shipment must have gotten lost in transit and that they would either refund me my money or send me out a new product. So trying to give the postal system the benefit of the doubt I decided to wait to respond for another day to see if it arrived that night or the next (friday). But still no RAM.
But oh wait... after I ask for a replacement (good thing on a weekend) the package finally shows up almost 2.5 weeks after shipment. The package was a little bit abused but at least RAM from Kingston is packaged very well. The best part about the package was the "Time Sensitive Material" text on the USPS sticker. I guess "time sensitive" is a relative term and USPS figures eh... anytime in the next month would be great.
Friday, September 26, 2008
Mac OSX Bluetooth Keyboard & Mouse Bug
So I have had a iMac for a week now and have come across a bug that was happening at random (actually it wasn't). So when I put my computer to screen saver mode (it just powers down the screen after a bit) I would turn the mouse off (keyboard i just let go to sleep). So a few hours later I would come back turn the mouse on and try to login. Well sometimes the mouse would work and other times just the keyboard would work. I was about to take the keyboard to the apple store and demand my $30 back and the regular keyboard. Fortunately I ended up finding a repeatable pattern to cause one input to not respond and a repeatable solution.My Setup:
1) Silver 20" iMac Core2 Duo 2.66Ghz
2) Apple slim silver bluetooth keyboard
3) Logitech Bluetooth notebook travel mouse
Problem:
1) iMac is in sleepish mode
2) both keyboard and mac off
3) wake up computer using mouse first then try to use keyboard
Doing this will cause the mouse to not respond yet the keyboard will
Solution:
1) Wake up computer fully with keyboard
2) Turn the mouse on and wait for it to respond
Both of these should take less than 5 seconds each to happen (usually faster).
If you find yourself in a situation where one input is not responding (even if the computer says its connected to it) simply turn off both inputs and turn the keyboard on first make sure the computer is responding to it (Command + Tab is a great test) then turn the mouse on.
Thursday, September 25, 2008
Pronouncable Password Generator
I have to periodically make passwords for others that I want to be secure but memorable so I found this CLI app called GPW. So I have created a Mac App to interface with it and to hopefully in the future provide more options for possible passwords configurations.Download the GPW app
Subscribe to:
Posts (Atom)