What was I up to lately….
Right now, I’m working on a Custom RSS Feed Agreggator (CRFA). The final website will be in Serbian language and it will aggregate Serbian blogs and news. I didn’t want to do it in English, because there’s too much similar websites out there.
I will write CRFA in PHP, and I will use the following third party components:
1) MagPieRSS Feed reader (written in PHP)
2) DOJO - a great Javascript/DHTML library with Ajax support. It has some really cool visual effects such as Fisheye, Modal dialog windows etc.
The progress:
- design GUI prototype using DOJO and written the basic requirements.
- get MagpieRSS to work. (It was straight forward and the only problem was tweaking parameters in Snoopy.class.inc file.)
- complete a database layout.
- figure out serbian character encoding when a RSS feed is read (currently weird characters are displayed)
- create DB access PHP classes/files
- create a script to go through all RSS providers, reads all feeds created after the last run, and then saves them into a database table (i.e. refresh feeds repository).
- Cron job in PHP to refresh feeds repository
- Display data from Feeds repository on the webpage.
This post will be updated frequently.
Session Facade - separating client side from business logic
If you ever compiled and run a Java program (i.e. invoked java ClassName.java, or javac ClassName), you used Session Facade Pattern.
If you ever used EJBs, you probably implemented Session Facade pattern.
Here’s a definition from Sun’s website:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html
The SessionFacade is implemented as a session bean. The SessionFacade manages the relationships between numerous BusinessObjects and provides a higher level abstraction to the client. The SessionFacade offers coarse-grained access to the participating BusinessObject represented by the Invoke invocation to the session bean.
Basically, you use Stateless Session EJBs to implement Session Facade pattern which separates client side of the application from business logic.
When using Session Facade pattern, your architecture usually consists of these layers:
Struts <-> Delegate <-> Facade <-> Business Rules Layer<-> DAO Layer<-> Database. All data between layers is passed via serializable ValueObjects.
How to run your S-corp
In previous article, I discussed all steps I had to take to register a S-Corporation in Pennsylvania. These are steps I needed to do to run my S-corp.
1) Get a business bank account.
I use Citizens bank, and they offer free small business accounts for their customers. So far it worked very well. You also get the ATM debit card for this account. Having a separate bank account makes your accounting simpler, and separates your personal finances from your S-corp finances.
2) Get a payroll service.
Trust me, it will make your life much easier. I use Paycycle.com and I pay $40/month, it’s a little bit pricey, but it’s worth it.
There is a lot of paperwork that you have to fill when you run your S-corp, and this website will do that for you. Beside taking care of your payroll needs, Paycycle.com auto-fills and allows you to e-file all of the following forms:
- Quarterly Forms:
PA UC-2 - Pennsylvania Quarterly Reconciliation Form for Unemployment Compensation
PA W3 - Pennsylvania Quarterly Reconciliation Form (WH)
941 - Employer’s Quarterly Tax Return
- Annual Forms:
940 - Employer’s Annual Federal Unemployment Tax Return
944 - Employer’s Annual Tax Return
W-2, Copies A & D - Employer Copies: Form W-2
W-2, Copies B,C & 2 - Printable Employee Copies: Form W-2
PA 1667 - Pennsylvania Annual Reconciliation
- Employee and Contractor Setup:
PA New Hire - Pennsylvania New Hire Form
Form W-9 - Request for Taxpayer Identification Number and Certification
Bank Verification - Authorization for Direct Deposit (Employees or contractors who will be paid by direct deposit should complete this form and provide a voided check.)
PA REV-420 NR - Employee’s Statement of Nonresidence in Pennsylvania
I-9 - Employment Eligibility Verification (Use this form to determine an employee’s eligibility to work in the US.)
W-4 - Employee’s Withholding Allowance Certificate (Employees should complete Form W-4 to determine filing status and allowances for income tax withholding. Record in the employee’s tax information.)
- Employer Setup:
SS-4 Application for Employer Identification Number
PA-100 - Pennsylvania Employer Registration Form
3) Track your expenses.
Keep track of your expenses in a log. This can be as simple as keeping a Google spreadsheet with itemized expenses.
4) Save your receipts.
I usually keep a big envelope on my desk, and I just keep stuffing it with receipts. I usually organize them at the time when I do taxes at the end of the year. Also, I print out my credit card statements at the end of the month, and keep them together with these receipts, just in case I lose a receipt.
I will keep adding more info to this article as I go along…..
Register your S-corporation in 6 easy steps
I registered an S-Corporation last year in Pennsylvania, and I must say that running a company is a great learning experience…
I will have two installments. In this installment, I will take you through the steps on how to register an S-corp. In the second installment I will share my experience of runnning an S-corporation.
If you ask me now, was it worth it registering an S-corporation, I’d probably say yes, because I’m dealing with some critical applications which , and I’d like to limit my liability to corporation’s assets if something goes horribly wrong. Therefore, for me, it is worth having an S-corp because of this one client only. Otherwise, I have several other smaller clients, and if I were to deal only with them, registering a corporation would be too much overhead.
The cost of registering an S-corp in PA is fairly low, about $220. You don’t need an accountant or a lawyer, and you can do it yourself in these 6 easy steps.
Step 1
The very first thing you should do is filing of Articles Of Incorporating for your S-corporation. Use an online service to register your S-corp. I did it for $25 at http://www.smallbizincorporator.com/. The state of Pennsylvania charges you a registration fee ($125), so the registration costs $150 total.
This website offers a lot of stuff (some useful, some not), and I only used the bare minimum: select only “Preparation & Filing of Your Articles” and “State Fees” checkboxes. Everything else, you probably don’t need or you can do it yourself for free.
Now, you should wait a week or so, and http://www.smallbizincorporator.com/ will send you a package with all the stuff that they filed to IRS for you. In about 2-3 weeks, you should receive a welcome package from IRS, and now you’re ready to do the rest of the steps.
Step 2
You need to get your EIN number. It’s free and quick. You can do it online on this IRS’s website.
EIN is for your S-corp what your SSN is to you. You will use it a lot in the future (issuing invoices to your client, doing your taxes etc.), so always keep it handy.
Step 3
Reserve your company’s fictitious name in your state. For PA, go to:
http://www.paopen4business.state.pa.us/paofb/site/default.asp . This will cost you $70.
Check availability of your company’s name in PA at: http://www.corporations.state.pa.us/corp/soskb/csearch.asp?corpsNav=|
Step 4
You must elect to be taxed under Subchapter S of the Internal Revenue Code. This is also easy to do (given that your corporation qualifies), just fill out this simple form, and send it to IRS: http://www.irs.gov/pub/irs-pdf/f2553.pdf Here are the insturctions: http://www.irs.gov/pub/irs-pdf/i2553.pdf
In a week or two, you will receive a letter from IRS, stating that you selected to be an S-corp. That means that you’re officially an S-corp now.
Step 5
Register your business with your state. I did only in PA, and my experience wasn’t that bad. You can do this online for free:
http://www.pa100.state.pa.us/
Do not forget to chose both “Unemployment Compensation” and “Employer Withholding Tax” (you will get two separate account numbers, you will need them later for payroll and tax purposes!)
Step 6
Open a small business bank account for your company. In order to do so, you will have to have all documentation that you will get in steps 1) & 2). This is not a necessary step to register your corporation, but it’s something you should probably do as soon as possible.
Congratulations, you completed all steps!
I think that’s all! Seems like a lot of work, but it’s not. I think I was able to complete the process in 5-6 weeks. Registering a company is a fairly easy process (once you know what to do - it took me a decent amount of trial and error to do so).
401K questions you were afraid to ask
This post will answer all you wanted to know about your company’s 401K plan, but you were afraid to ask .
If you were like me and most of my peers, and you were just fresh out of college you probably didn’t care when your employer offered you a 401K plan. If I was smarter, and I participated in 401K plan from the day one of my first job, I’d have almost 30K more in my retirement plan now!
I couldn’t emphasize more: if your company has a matching 401K plan, it’s a no brainer: SIGN UP ASAP!!!!!!
Here’s a few questions I wish I knew how to answer back then:
What’s 401K?
401K plan is one way to invest for your retirement. When you sign up for it, a certain percentage of your *before* tax pay is deducted from your paycheck, and company buys mutual funds for that money in your name (you select which mutual funds to invest in when you sign up for the plan).
What’s a mutual fund?
A mutual fund is a diversified stock portfolio, and many of them have a rate of return of around 8%-10% yearly. Some perform better, but in the long run, you can expect 8%-10%.
What does it mean being “vested”?
Usually you have to work a certain number of years for an employer before that employer’s contributions are “vested”. Being vested simply means that those funds now belong to you and you can do with them as you please. For example, being 100% vested in 3 years means that 100% of company’s contribution will be completely yours in 3 years. All this means is that the company matches your contribution from day one, but the money is not “officially” yours until you are vested.
What are advantages of 401K?
1) Your investent grows tax free. You do not pay any taxes on money in your 401K plan until you decide to pull money out of it. I will write a separate post on this calculations.
2) Company matching is free money! Companies usually match 50%-100% of your investment up to a certain percentage. For example, most of the companies I worked for match 100% of up to 6% of your yearly salary. So, for every dollar I put in, the company will add additional $1 to my paycheck. I.e. this translates in 6% of my salary being given to me for free!
3) Power of compounding of your investment (i.e. the money made by investment keeps making money as well).
What are disadvantages of 401K?
1) You cannot touch this money until 59.5 years of age without a hefty penalty (10%). And, of course you will have to pay the taxes on that money as soon as you withdraw it.
2) Some companies require you to be vested to take their contribution money with you after you terminate your employment. That means that you will have to stay with them to get the amount they contributed for a certain period of time. (A side note: yes, you can transfer 401K to a new employer without a penalty).
Is 401K really worth it?
Yes, yes, yes! Company matching + tax deferred investment + compounding = lots of money for your retirement!
5-Minutes Tutorial: Integrating Quartz in a J2EE application
This tutorial will show you how to integrate Quartz scheduling in your J2EE applications. Usually, we want to schedule a process as soon as the application server restarts. In this example, we will schedule a SimpleTrigger project that fires every 10 seconds. You should use CronTrigger when you need some more complex schedule (for example, run this thread every Sunday at 5pm). This is as equally easy to use as SimpleTrigger (once you learn the scheduling syntax).
1) Download Quartz from OpenSymphony’s website.
2) Extract quartz-all-1.6.0.jar and jta.jar from the zip file you just downloaded, and put it in your applications WEB-INF/lib directory.
3) Create a new package and create a new Java class. This class is a really simple Quartz Job (it prints “Hello World!”). Here is the code:
package com.startup;
import org.quartz.*;public class SimpleQuartzJob implements Job{
/** Creates a new instance of SimpleQuartzJob */
public SimpleQuartzJob() {
}
//execute() method must be implemented
public void execute(JobExecutionContext context) throws JobExecutionException {
System.out.println(”Hellooooo World!”);
}
}
4) Create an Application Startup Listener (this class can execute an action whenever you start or stop your application server). This class will do all work to create, schedule and start a Quartz Scheduler. Please observe the code, and try to play with it once you have this example running:
package com.startup;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.quartz.JobDetail;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import java.util.Date;public class ApplicationStartup implements ServletContextListener
{
/**
* @see javax.servlet.ServletContextListener#void (javax.servlet.ServletContextEvent)
*/
public void contextDestroyed(ServletContextEvent arg0)
{
System.out.println(”THE APPLICATION STOPPED”);
}/**
* @see javax.servlet.ServletContextListener#void (javax.servlet.ServletContextEvent)
*/
public void contextInitialized(ServletContextEvent arg0)
{
System.out.println(”THE APPLICATION STARTED”);
try{
// Initiate a Schedule Factory
SchedulerFactory schedulerFactory = new StdSchedulerFactory();
// Retrieve a scheduler from schedule factory
Scheduler scheduler = schedulerFactory.getScheduler();
// current time
long ctime = System.currentTimeMillis();
// Initiate JobDetail with job name, job group, and executable job class
JobDetail jobDetail =
new JobDetail(”jobDetail-s1″, “jobDetailGroup-s1″, SimpleQuartzJob.class);
// Initiate SimpleTrigger with its name and group name
SimpleTrigger simpleTrigger =
new SimpleTrigger(”simpleTrigger”, “triggerGroup-s1″);
// set its start up time
simpleTrigger.setStartTime(new Date());
// set the interval, how often the job should run (10 seconds here)
simpleTrigger.setRepeatInterval(10000);
// set the number of execution of this job, set to 10 times.
// It will run 10 time and exhaust.
simpleTrigger.setRepeatCount(100);
// set the ending time of this job.
// We set it for 60 seconds from its startup time here
// Even if we set its repeat count to 10,
// this will stop its process after 6 repeats as it gets it endtime by then.
//simpleTrigger.setEndTime(new Date(ctime + 60000L));
// set priority of trigger. If not set, the default is 5
//simpleTrigger.setPriority(10);
// schedule a job with JobDetail and Trigger
scheduler.scheduleJob(jobDetail, simpleTrigger);
// start the scheduler
scheduler.start();
}catch (SchedulerException se) {
System.out.println(se);
}catch (Exception e) {
System.out.println(e);
}
}
}
5) Change the web.xml file to add this listener to your application:
<listener>
<listener-class>com.startup.ApplicationStartup</listener-class>
</listener>
6) Done! Start your application server, and you should see text: “Hello World!” in your console/log file being printed out every 10 seconds. Let it run for a minute or so, and after you stop the app server, you will see the output similar to this:
THE APPLICATION STARTED
Hellooooo World!
Hellooooo World!
Hellooooo World!
Hellooooo World!
Hellooooo World!
Hellooooo World!
THE APPLICATION STOPPED
Here’s another great Quartz tutorial from IBM: http://www-128.ibm.com/developerworks/library/j-quartz/index.html
Survivorship Bias Scam
Survivorship Bias is an interesting concept, and it’s usually related to investing in mutual funds. There is a very clever type of scam exploiting survivorship bias.
Let me start by defining ”Survivorship Bias” first. This is a definition from InvestorWords.com:
“Survivorship Bias is the tendency for failed companies to be excluded from performance studies due to the fact that they no longer exist. Survivorship bias causes the results of some studies to skew higher because only companies which were successful enough to survive until the end of the period are included. Similarly, mutual funds performance may be misleading due to survivorship bias if the fund family tends to merge or discontinue underperforming funds. “
Patri Friedman wrote about survivorship bias scam in sports betting in his blog:
“Get a list of email addresses of people interested in sports betting. Say you have 32,000. Email 16,000 of them to say that the home team will win this week’s big team, and 16,000 to say the home team will lose. Now, half of the people will have gotten the correct prediction, and the next week, you do the same thing with them. After 5 weeks, you’ll have 1,000 email addresses of people who have seen you pick the winner five times in a row!. Now you pitch your 1-900 number or paid email list subscription to this amazed group.”
Criminal minds can be brilliant, huh? This is an elegant example of social engineering scheme wrapped around a binary search algorithm ….
Some of “employers” on Guru.com make me upset….
I am a member of Guru.com, and from time to time I look for freelancing opportunities on this website. I met many of my clients this way, and I only had positive experience so far.
95% of employers on Guru.com are professionals and it’s a pleasure to work with them. But, there is a lot of projects where ignorant employers are disrespecting people to whom they are offering projects. For example, their tone is rude, and some of them are looking for a clone of MySpace or Craigslist for “under $250″. Some of these employers show really negative attitude toward programmers in their ads. This is business, you’re not doing us a favor by posting your project here. We complete work for you for a certain price, and you are a businessman who will make even bigger profit out of it. Programmers are people who went to school for years, and worked our asses off. We deserved to be respected.
Here are some of my “favorite” ignorant project descriptions from Guru.com:
Project Description: “Similar to Myspace but a tad different”
Price: $500-$1,000
Looking for: “Be proficient, fast, and knowledgeable ALL ins and OUTS of programming. A CODING GURU.”
Favorite quote: “Do not negotiate pricing with me as I will ignore your bid and move onto another person who wants to work for that price.”
My comment: Assume that he finds someone who is willing to work on this for $500. Let’s assume that that person can finish this for him in one man-month (160 hours). That’s about $3/hour….Common, dude, at least offer the minimum wage for that “coding guru” that you need!
Project description: “Database Work for Dating website”
Price: $500 - $1,000
Favorite quote: “I am on a budget since I am small business, so please take note of my listed budget.”
My comment: Here’s a news flash for this guy: Everyone has a budget! If you’re a small company, medium company, or a housewife going grocery shopping, you have a budget. This “budgeting issue” is another recurring theme that I hate. It’s the lamest of all ways to emphasize that you are cheap.
I will be posting more of these as they come along…..
Become a “Smart PC Shopper”
| You don’t need to be a “computer expert” to make educated decisions when shopping for a new personal computer. The purpose of this post is to give the consumer the tools needed to shop online and get good deals on PC’s.Ok, let us start out simple. I do not know what level you are coming from, or your knowledge of computers, but let’s review what every computer has… | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| These are the basic elements found in most computers sold today. What can be confusing is when sales people begin speaking in the language of hardware measurements. If you are not use to talking in measurements, it can become a headache. My favorite catch phrase is “Repetition is the best teacher”. The more you talk about computers, the more easily the language will flow. And if you want to learn the language fast, teach someone else how to speak it. Remember, it’s a language of measurements. | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Now you are an “smart pc shopper” !! | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Let’s go shopping… Direct your web browser to: http://www.pricewatch.com | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Under the heading “Computer / Servers” click on “PC – Windows”. This means PC’s with Windows installed. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| I have not covered CPU manufacture models. These include: Sempron, Pentium, Celeron, and Athlon. Everyone has their recommended favorite, based on experience. Mine is “Pentium 4”. All the computers in my house, every computer I’ve built in the last 3 years has been a “Pentium 4”. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Back to the web page, let us look at how to read a single item. | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Another secret to web shopping: When you want to know what your over all price will be, click on buy, or checkout continue all the way to the point where it asks for your Credit Card information, then either close the web browser, or hit the back button several times. You should never feel obligated to make a purchase, and I’d recommend shopping around. The nice thing about pricewatch.com is that Distributors are competing against each other to make your sale. The prices change Everyday, and sometimes hourly if your browsing during the day.I did not want to overload you with lots of details, just enough to make you a “Smart PC Shopper”.
~JoJo |
|||||||||||||||||||||||||||||||||||||||||||||||||||
PAR: A simple technique to organize an answer to most of interview questions
Even if you went to a single interview in your life, you were probably a subject to a behavioral interview. This is type of an interview where they ask you to describe your previous experience.
Some of these questions are helpful to the interviewer and allow you to showcase your skills. For example, I like questions such as: “Tell me about a project that you think it’s your biggest accomplishment”.
Obviously, you cannot anticipate every possible question, and you don’t want to spend hours thinking about preparing an answer to every single question. One strategy for preparing for behavioral interviews is to use the PAR Technique(or STAR Technique, as some people call it).
Problem/Situation/Task you faced
Always start by describing a specific event or situation, not a generalized description of what you have done in the past. If you’re fresh from school, just name one of your many projects you’ve done for one of your classes.
Action you took
Describe the action you took and be sure to keep the focus on you. Even if you are discussing a group project or effort, describe what you did — not the efforts of the team. Don’t tell what you might do, tell what you did.
Results you achieved
What happened? How did the event end? What did you accomplish? What did you learn?