Young Employees – Broke, busted and reluctant

Allow me to rant a little about a topic that is very dear to me. Being young, diligent, and poor. One specific post by Salary.com recently fueled my interest to blog about this and below you’ll see what I mean


There’s something this is lacking.. Maybe it’s that our generation is more reluctant and independent? Many of us have dreams and we’re very driven, but we won’t let the fact that we’re poor bring us down.

One of the ways I can show an example of this is that when a good friend of mine saw that I was making no money, but I still devoted $100+ to my 401k each paycheck, he was impressed.

How though? For one, if you shop right, you can spend $150 for food a month. Staying inside for 3 weeks out of the month can really save up some money. Think about how much money you’re spending on beer, shots, food before and after you’ve went out with your friends, and then think about how much it costs to sit inside a couple extra days a week and enjoy a couple of movies and maybe get a few things done around the apartment/house.

Simply put, we have more options today to keep us occupied. Xbox live, Wii, Playstation, texting, and millions of websites to keep us amused. Our parents didn’t even know what texting was at our age, let alone all of these devices.

Moral of the story and this rant?

With technology growing exponentially, we’re not just going to see a different world, we’re going to see different types of people emerge. If I have kids, I can’t even imagine what they’ll be doing in their teens. Whatever happened to sneaking out, drinking 2 beers with 50 friends in the woods and then talking about that for an entire week at school?

The fact of the matter is, I’m part of the new generation and I can honestly tell each and every person out there to watch out now. If anyone is having a hard time understanding or tolerating us now, you’re in for a world of stress.

To all of the employers out there, if you get an energetic and young employee, go all in, put your money on them and see what happens. You just might be surprised.

Tags: ,
Posted in Management by Michael Stone. No Comments

Transparent PNG images in IE 7 and IE 8 not rendering transparent with jquery cycle

I ran into a problem where I wasn’t able to get my PNG images to properly render in Internet Explorer 7 or 8. I was using the jquery cycle plugin, jquery.malsup.com/cycle/, and I was trying to display the images on an already transparent background, but little did I know, it was an option in the plugin.

 

The plugin’s option page clearly shows this, but I was unable to see where it was documented to make it easier for people with this problem. The jquery cycle options shows that it has many different features. One of which either applies the background to the PNG images or removes it.

 

Just apply this option to where you are referencng the plugin:

 
cleartypeNoBg:true

This should instantly resolve your problem.

 

Note: This isn’t a fix for Internet Explorer 6.

Visual Editor java.lang.NullPointerException Fix

While continuing development of a Java application, I tried opening my GUI classes and I couldn’t get either of them to open up correcty with the Visual Editor. After a few times of restarting Eclipse, nothing was working so I did some exploring on the web and found some forums. A lot of which were not helpful, but I did manage to find the fix within one. Now, I do not know what caused my error, there seems to be nothing wrong with my code and it’s never behaved like this before, but for some odd reason today, the product of attempting to do some Java development was an error, Visual Editor java.lang.NullPointerException

and the by-product was knowing the fix and having the opportunity to share it with others.

 

Now I did see in some cases that this didn’t work as the fix, but for my project, it worked perfectly and very fast!

 

The Eclipse version I’m using is:

  • Eclipse IDE for Java EE Developers: 1.2.2.20100217-2310
  • Visual Editor: 1.4.0.v20090826-1446-57F-9xKEUXK5__GAVDlmFRiymDdO

 

To fix this error follow these steps:
Read the rest of Visual Editor java.lang.NullPointerException Fix »

Posted in Java by Michael Stone. 7 Comments

Animate Scroll and Change Position with Jquery

After taking a look at David Walsh’s persistent header post, http://davidwalsh.name/persistent-header-opacity, I decided to change it up a bit. Now I probably won’t use this anytime soon in a big project or a smaller more personal one, but it’s still convenient technique to know, just in case I ever need to perform something to this sort.

 

Update: Tested in FireFox and works perfectly. IE, not so much. I’ll look into later and make additional edits where they need be.  Tested successfully in:

FireFox Icon

 

I like the idea of a persistent top menu bar, but the way I read most material online is from top to bottom and then left to right. Taking that into consideration, I decided I would need that top, stationary menu bar to move to the bottom.

 

Let’s take a look at the CSS and HTML.


 

     <div id="topbar">

 

        <a href="#top" class="link">Top of Page</a>

        <a href="#bottom" class="bottom">Bottom of Page</a>

</div>

 

 

    <div id="top">

<p>filler content should go in here.. just use lipsum.org</p>

        </div>

        <p id="bottom"></p>

<style type="text/css">

#topbar    {

border-bottom:1px solid #eb7429;

background:#F90;

padding:10px 20px;

position:fixed;

left:0;

z-index:2000;

width:100%;

}

.top{

top:0;

}

.notop{

bottom:0;

}

#top{

width:700px;

float:left;

}

</style>

 

Now the jQuery / JavsScript:

Keep in mind I am using the code from David’s tutorial also in mine, but I just made some changes to make it my own.

Also, you have to have the jQuery framework included too. If you get that little error saying “$ is undefined.”, you’re not including jQuery.

To start, here is David’s code for the fade in and fade out of the bar:

 

$(document).ready(function() {

(function() {

//settings

var fadeSpeed = 200, fadeTo = 0.5, topDistance = 30;

var topbarME = function() { $(‘#topbar’).fadeTo(fadeSpeed,3); }, topbarML = function() { $(‘#topbar’).fadeTo(fadeSpeed,fadeTo); };

var inside = false;

 

        $(window).scroll(function() {

position = $(window).scrollTop();

if(position > topDistance && !inside) {

//add events

topbarML();

$(‘#topbar’).bind(‘mouseenter’,topbarME);

$(‘#topbar’).bind(‘mouseleave’,topbarML);

inside = true;

}

else if (position < topDistance){

topbarME();

$(‘#topbar’).unbind(‘mouseenter’,topbarME);

$(‘#topbar’).unbind(‘mouseleave’,topbarML);

inside = false;

}

});

 

You’ll see that with only this, it performs with just the fade out if you’re not at the top.

Next we’re going to have to setup cookies using JavaScript to store the positions values of the bar.

I took examples from w3schools.com and altered them.

 

        //function to create a new cookie

function setCookie(name,position,expires){

var date=new Date();

date.setDate(date.getDate()+expires);

document.cookie=name+ “=” +escape(position)+ ((expires==null) ? “” : “;expires=”+date.toGMTString());

}

//function to get the cookie

function getCookie(cookie_name){

if (document.cookie) {

index = document.cookie.indexOf(cookie_name);

if (index != -1) {

namestart = (document.cookie.indexOf(“=”, index) + 1);

nameend = document.cookie.indexOf(‘;’, index);

if (nameend == -1) {

nameend = 0;

}

YouWrote = document.cookie.substring(namestart, nameend);

return YouWrote;

}

}

}

The function setCookie creates a new cookie with the name, position would be the value, and the time to expire as parameters. The getCookie function gets the value of the cookie from the cookie name. This may need to be altered in some cases where you aren’t storing any other cookies.

 

Next will be the click events for the links. These will ultimately create the basis for the cookies and animation and positioning.

        //click event to go to the top

$(‘.link’).click(function(){

$(‘html, body’).animate({scrollTop:$(‘#top’).offset().top}, 1500);

$(‘#topbar’).removeClass(‘notop’).addClass(‘top’);

setCookie(‘position’,’top’,2);

var newCookie = getCookie(‘position’);

});

//click event to go the bottom

$(‘.bottom’).click(function(){

$(‘html, body’).animate({scrollTop:$(‘#bottom’).offset().top}, 1500);

$(‘#topbar’).removeClass(‘top’).addClass(‘notop’);

setCookie(‘position’,’bottom’,2);

var newCookie = getCookie(‘position’);

});

 

The events and methods that are taking place are pretty much self explanatory, with the console.log() for error checking.

 

Finally, we have to check the value of the cookie on page load/refresh and perform the needed code.

 

        //for refreshing of the page, check to see if the cookie is set

var Cookie = getCookie(‘position’);

if(Cookie==’top’){

$(‘#topbar’).removeClass(‘notop’).addClass(‘top’);

}

else if(Cookie==’bottom’){

$(‘#topbar’).removeClass(‘top’).addClass(‘notop’);

$(‘html, body’).animate({scrollTop:$(‘#bottom’).offset().top}, 1500);

}

if(typeof(Cookie)==”undefined”){

$(‘#topbar’).removeClass(‘notop’).addClass(‘top’);

}

 

Again, pretty basic events occuring here. With mine, if the cooke equals bottom, I’m actually scrolling to the bottom of the page.

 

If you’re wondering what you could use this for, I’ve come up with a couple of good examples.

  • Smooth scrolling through long content documents. This could be really useful and creative for an online resume. You could have the topics on the toolbar and just click to go to that topic.
  • The same could go for a small community where you can loop through the unique members or data and display them as links on the toolbar. Then you could use those ids from the db and throw them in the id of the div and you’ve got yourself an extra DHTML feature.

It’s also not necessary to change the position of the toolbar from top to bottom, so if you like it just on the top, keep it on the top.

 

You can see the live demo here:

 

jquery-animate-demo2.png

Tags: , , ,
Posted in jQuery by Michael Stone. No Comments

Switch to our mobile site