31 January 2016

Can You Fix a Dry Ink Cartridge?


Although inkjet printers are widely used and appreciated for their high print quality and low cost, their fast-drying ink can pose a problem if the printer isn't used regularly. A cartridge will seldom dry up completely, but it's not uncommon for the print nozzles to become blocked by plugs of dried ink. Sometimes you'll need to buy a new ink cartridge as a result, but first it's worth trying to restore your existing cartridge to usability.

The Self-Cleaning Routine

Your printer's own print-head cleaning routine should be your starting point. It's usually included as part of your printer driver or control program, although some printers have a button for it on their control panel. This prints a test pattern with heavy ink use, and running the self-clean a few times will often dissolve and dislodge the dried ink.

Manual Cleaning
Most inks are water-soluble, so if the self-clean routine doesn't unclog your nozzles, you can try hot water instead. Set the cartridge in a shallow cup or bowl of hot water for five to 10 minutes, then let it rest on damp paper towels for at least two hours or, preferably, overnight. When fully dry, put it back into the printer and try the self-cleaning process again. If this doesn't work, remove the cartridge again and swab the nozzles gently with a cotton swab or soft cloth dipped in rubbing alcohol. If another round of self-cleaning doesn't restore the cartridge, replace it.

22 January 2016

CAP theorem

In theoretical computer science, the CAP theorem, also known as Brewer's theorem, states that it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: Consistency Availability Partition tolerance In 2012 Brewer clarified some of his positions, including why the oft-used "two out of three" concept can be misleading or misapplied, and the different definition of consistency used in CAP relative to the one used in ACID.


  1. Consistency : all nodes see the same data at the same time
  2. Availability : a guarantee that every request receives a response about whether it succeeded or failed
  3. Partition tolerance : the system continues to operate despite arbitrary partitioning due to network failures



All about of ACID (Atomicity, Consistency, Isolation, Durability)

Core concepts of Database Management is ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee that database transactions are processed reliably. In the context of databases, a single logical operation on the data is called a transaction.
  1. Atomicity states that database modifications must follow an “all or nothing” rule. Each transaction is said to be “atomic.” If one part of the transaction fails, the entire transaction fails. It is critical that the database management system maintain the atomic nature of transactions in spite of any DBMS, operating system or hardware failure.
  2. Consistency states that only valid data will be written to the database. If, for some reason, a transaction is executed that violates the database’s consistency rules, the entire transaction will be rolled back and the database will be restored to a state consistent with those rules. On the other hand, if a transaction successfully executes, it will take the database from one state that is consistent with the rules to another state that is also consistent with the rules.
  3. Isolation requires that multiple transactions occurring at the same time not impact each other’s execution. For example, if Joe issues a transaction against a database at the same time that Mary issues a different transaction, both transactions should operate on the database in an isolated manner. The database should either perform Joe’s entire transaction before executing Mary’s or vice-versa. This prevents Joe’s transaction from reading intermediate data produced as a side effect of part of Mary’s transaction that will not eventually be committed to the database. Note that the isolation property does not ensure which transaction will execute first, merely that they will not interfere with each other.
  4. Durability ensures that any transaction committed to the database will not be lost. Durability is ensured through the use of database backups and transaction logs that facilitate the restoration of committed transactions in spite of any subsequent software or hardware failures.

21 January 2016

All about MS Excel MONTH function

Microsoft Excel provides a special MONTH function to extract a month from date, which returns the month number ranging from 1 (January) to 12 (December).

The MONTH function can be used in all versions of Excel 2013 - 2000 and its syntax is as simple as it can possibly be:
MONTH(serial_number)

Where serial_number is any valid date of the month you are trying to find.

For the correct work of Excel MONTH formulas, a date should be entered by using the DATE(year, month, day) function. For example, the formula =MONTH(DATE(2015,3,1)) returns 3 since DATE represents the 1st day of March, 2015.

Formulas like =MONTH("1-Mar-2015") also work fine, though problems may occur in more complex scenarios if dates are entered as text.

In practice, instead of specifying a date within the MONTH function, it's more convenient to refer to a cell with a date or supply a date returned by some other function. For example:

=MONTH(A1) - returns the month of a date in cell A1.

=MONTH(TODAY()) - returns the number of the current month.

At first sight, the Excel MONTH function may look plain. But look through the below examples and you will be amazed to know how many useful things it can actually do.
How to get month number from date in Excel

There are several ways to get month from date in Excel. Which one to choose depends on exactly what result you are trying to achieve.

1. MONTH function in Excel - get month number from date.

This is the most obvious and easiest way to convert date to month in Excel. For example:
=MONTH(A2) - returns the month of a date in cell A2.
=MONTH(DATE(2015,4,15)) - returns 4 corresponding to April.
=MONTH("15-Apr-2015") - obviously, returns number 4 too.

2. TEXT function in Excel - extract month as a text string.

An alternative way to get a month number from an Excel date is using the TEXT function:
=TEXT(A2, "m") - returns a month number without a leading zero, as 1 - 12.
=TEXT(A2,"mm") - returns a month number with a leading zero, as 01 - 12.

Please be very careful when using TEXT formulas, because they always return month numbers as text strings. So, if you plan to perform some further calculations or use the returned numbers in other formulas, you'd better stick with the Excel MONTH function.

The following screenshot demonstrates the results returned by all of the above formulas. Please notice the right alignment of numbers returned by the MONTH function (cells C2 and C3) as opposed to left-aligned text values returned by the TEXT functions (cells C4 and C5).
How to extract month name from date in Excel

In case you want to get a month name rather than a number, you use the TEXT function again, but with a different date code:
=TEXT(A2, "mmm") - returns an abbreviated month name, as Jan - Dec.
=TEXT(A2,"mmmm") - returns a full month name, as January - December.


If you don't actually want to convert date to month in your Excel worksheet, you are just wish todisplay a month name only instead of the full date, then you don't want any formulas.

Select a cell(s) with dates, press Ctrl+1 to opent the Format Cells dialog. On the Number tab, selectCustom and type either "mmm" or "mmmm" in the Type box to display abbreviated or full month names, respectively. In this case, your entries will remain fully functional Excel dates that you can use in calculations and other formulas. For more details about changing the date format, please see Creating a custom date format in Excel.


How to convert month number to month name in Excel

Suppose, you have a list of numbers (1 through 12) in your Excel worksheet that you want to convert to month names. To do this, you can use any of the following formulas:

1. To return an abbreviated month name (Jan - Dec).

=TEXT(A2*28, "mmm")

=TEXT(DATE(2015, A2, 1), "mmm")

2. To return a full month name (January - December).

=TEXT(A2*28, "mmmm")

=TEXT(DATE(2015, A2, 1), "mmmm")

In all of the above formulas, A2 is a cell with a month number. And the only real difference between the formulas is the month codes:
"mmm" - 3-letter abbreviation of the month, such as Jan - Dec
"mmmm" - month spelled out completely
"mmmmm" - the first letter of the month name
How to convert month name to number in Excel

There are two Excel functions that can help you convert month names to numbers - DATEVALUE and MONTH. Excel's DATEVALUE function converts a date stored as text to a serial number that Microsoft Excel recognizes as a date. And then, the MONTH function extracts a month number from that date.

The complete formula is as follows:

=MONTH(DATEVALUE(A2 & "1"))

Where A2 in a cell containing the month name you want to turn into a number (&"1" is added for the DATEVALUE function to understand it's a date).



How to get the last day of month in Excel (EOMONTH function)

The EOMONTH function in Excel is used to return the last day of the month based on the specified start date. It has the following arguments, both of which are required:
EOMONTH(start_date, months)
Start_date - the starting date or a reference to a cell with the start date.
Months - the number of months before or after the start date. Use a positive value for future dates and negative value for past dates.

Here are a few EOMONTH formula examples:

=EOMONTH(A2, 1) - returns the last day of the month, one month after the date in cell A2.

=EOMONTH(A2, -1) - returns the last day of the month, one month before the date in cell A2.

Instead of a cell reference, you can hardcode a date in your EOMONTH formula. For example, both of the below formulas return the last day in April.

=EOMONTH("15-Apr-2015", 0)

=EOMONTH(DATE(2015,4,15), 0)

To return the last day of the current month, you use the TODAY() function in the first argument of your EOMONTH formula so that today's date is taken as the start date. And, you put 0 in the months argument because you don't want to change the month either way.

=EOMONTH(TODAY(), 0)
Note. Since the Excel EOMONTH function returns the serial number representing the date, you have to apply the date format to a cell(s) with your formulas. Please see How to change date format in Excel for the detailed steps.

And here are the results returned by the Excel EOMONTH formulas discussed above:

If you want to calculate how many days are left till the end of the current month, you simply subtract the date returned by TODAY() from the date returned by EOMONTH and apply the General format to a cell:

=EOMONTH(TODAY(), 0)-TODAY()
How to find the first day of month in Excel

As you already know, Microsoft Excel provides just one function to return the last day of the month (EOMONTH). When it comes to the first day of the month, there is more than one way to get it.
Example 1. Get the 1st day of month by the month number

If you have the month number, then use a simple DATE formula like this:
=DATE(year, month number, 1)

For example, =DATE(2015, 4, 1) will return 1-Apr-15.

If your numbers are located in a certain column, say in column A, you can add a cell reference directly in the formula:

=DATE(2015, B2, 1)


Example 2. Get the 1st day of month from a date

If you want to calculate the first day of the month based on a date, you can use the Excel DATE function again, but this time you will also need the MONTH function to extract the month number:
=DATE(year, MONTH(cell with the date), 1)

For example, the following formula will return the first day of the month based on the date in cell A2:

=DATE(2015,MONTH(A2),1)



Example 3. Find the first day of month based on the current date

When your calculations are based on today's date, use a liaison of the Excel EOMONTH and TODAY functions:

=EOMONTH(TODAY(),0) +1 - returns the 1st day of the following month.

As you remember, we already used a similar EOMONTH formula to get the last day of the current month. And now, you simply add 1 to that formula to get the first day of the next month.

In a similar manner, you can get the first day of the previous and current month:

=EOMONTH(TODAY(),-2) +1 - returns the 1st day of the previous month.

=EOMONTH(TODAY(),-1) +1 - returns the 1st day of the current month.

You could also use the Excel DATE function to handle this task, though the formulas would be a bit longer. For example, guess what the following formula does?

=DATE(YEAR(TODAY()), MONTH(TODAY()), 1)

Yep, it returns the first day of the current month.

And how do you force it to return the first day of the following or previous month? Hands down :) Just add or subtract 1 to/from the current month:

To return the first day of the following month:

=DATE(YEAR(TODAY()), MONTH(TODAY())+1, 1)

To return the first day of the previous month:

=DATE(YEAR(TODAY()), MONTH(TODAY())-1, 1)
How to calculate the number of days in a month

In Microsoft Excel, there exist a variety of functions to work with dates and times. However, it lacks a function for calculating the number of days in a given month. So, we'll need to make up for that omission with our own formulas.
Example 1. To get the number of days based on the month number

If you know the month number, the following DAY / DATE formula will return the number of days in that month:
=DAY(DATE(year, month number + 1, 1) -1)

In the above formula, the DATE function returns the first day of the following month, from which you subtract 1 to get the last day of the month you want. And then, the DAY function converts the date to a day number.

For example, the following formula returns the number of days in April (the 4th month in the year).

=DAY(DATE(2015, 4 +1, 1) -1)
Example 2. To get the number of days in a month based on date

If you don't know a month number but have any date within that month, you can use the YEAR and MONTH functions to extract the year and month number from the date. Just embed them in the DAY / DATE formula discussed in the above example, and it will tell you how many days a given month contains:

=DAY(DATE(YEAR(A2), MONTH(A2) +1, 1) -1)

Where A2 is cell with a date.

Alternatively, you can use a much simpler DAY / EOMONTH formula. As you remember, the Excel EOMONTH function returns the last day of the month, so you don't need any additional calculations:

=DAY(EOMONTH(A1, 0))

The following screenshot demonstrates the results returned by all of the formulas, and as you see they are identical:

How to sum data by month in Excel

In a large table with lots of data, you may often need to get a sum of values for a given month. And this might be a problem if the data was not entered in chronological order.

The easiest solution is to add a helper column with a simple Excel MONTH formula that will convert dates to month numbers. Say, if your dates are in column A, you use =MONTH(A2).

And now, write down a list of numbers (from 1 to 12, or only those month numbers that are of interest to you) in an empty column, and sum values for each month using a SUMIF formula similar to this:

=SUMIF(C2:C15, E2, B2:B15)

Where E2 is the month number.

The following screenshot shows the result of the calculations:

If you'd rather not add a helper column to your Excel sheet, no problem, you can do without it. A bit more trickier SUMPRODUCT function will work a treat:

=SUMPRODUCT((MONTH($A$2:$A$15)=$E2) * ($B$2:$B$15))

Where column A contains dates, column B contains the values to sum and E2 is the month number.
Note. Please keep in mind that both of the above solutions add up all values for a given month regardless of the year. So, if your Excel worksheet contains data for several years, all of it will be summed.
How to conditionally format dates based on month

Now that you know how to use the Excel MONTH and EOMONTH functions to perform various calculations in your worksheets, you may take a step further and improve the visual presentation. For this, we are going to use the capabilities of Excel conditional formatting for dates.

In addition to the examples provided in the above mentioned article, now I will show you how you can quickly highlight all cells or entire rows related to a certain month.
Example 1. Highlight dates within the current month

In the table from the previous example, suppose you want to highlight all rows with the current month dates.

First off, you extract the month numbers from dates in column A using the simplest =MONTH($A2) formula. And then, you compare those numbers with the current month returned by =MONTH(TODAY()). As a result, you have the following formula which returns TRUE if the months' numbers match, FALSE otherwise:

=MONTH($A2)=MONTH(TODAY())

Create an Excel conditional formatting rule based on this formula, and your result may resemble the screenshot below (the article was written in April, so all April dates are highlighted).
Example 2. Highlighting dates by month and day

And here's another challenge. Suppose you want to highlight the major holidays in your worksheet regardless of the year. Let's say Christmas and New Year days. How would you approach this task?

Simply use the Excel DAY function to extract the day of the month (1 - 31) and the MONTH function to get the month number, and then check if the DAY is equal to either 25 or 31, and if the MONTH is equal to 12:

=AND(OR(DAY($A2)=25, DAY($A2)=31), MONTH(A2)=12)

Source : https://www.ablebits.com/office-addins-blog/2015/04/22/excel-month-eomonth-functions/

16 January 2016

How can I export or extract pictures from an iPhoto library to files and folders?

Select "Photos" in the Library (left column), but don't select any single photo -- leave all unselected. Then choose File>Export. The number of "items" (photos and video clips) appears in the dialog in the lower left corner, so you know how many you are exporting. You can then specify the format (JPEG, TIFF, PNG, Original). You can then pick (or add) a folder for all the files. After doing this, you'll have all the files in one folder.

You can also Control-click the iPhoto Library file, which is actually a package, and choose Show Package Contents. Then click the Masters folder to open it, and you'll see folders organized by year; inside are more folders organized by date and album, and inside them are photos in JPG format and video clips.

As per Apple, the proper way to back up an iPhoto library is to copy the entire iPhoto Library package file to another hard drive. That's the only way to copy the photos and the database, which includes albums, keywords, and all other iPhoto metadata.

15 January 2016

Jdev 11g Installation on Mac

Jdev 11g Installation

1) Download jdev installation from Oracle (generic )
2) Install JDK 1.6 version if it is not installed

JDK 1.6.0 path is  /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home 

3) In order for the installer to see JKD 1.6 on your Mac, you need to create a symbol link for 
classes.jar:
cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
sudo mkdir jre
cd jre
sudo mkdir lib
cd lib
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/classes/classes.jar rt.jar





Run the following command to install 


/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -jar /Users//Downloads/jdevstudio11117install.jar


Make sure JDK Path set properly after installation

/Users//Oracle11g/Middleware11g/jdeveloper/jdev/bin/jdev.conf

if not change it properly,
SetJavaHome /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home



Short Cut or alias for Jdev

Update the .profile or .bash_profile file with following

alias startjdev="/Users//Oracle11g/Middleware11g/jdeveloper/jdev/bin/jdev




Oracle blog : http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/Mobile_Mac_Install/Mobile_Mac_Install.html


Set $JAVA_HOME environment variable on Mac OS X

$ vi .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)

$ source .bash_profile

$ echo $JAVA_HOME

/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

Why /usr/libexec/java_home?
This java_home can return the Java version specified in Java Preferences for the current user. For examples,

/usr/libexec/java_home -V

Matching Java Virtual Machines (3):

1.7.0_05, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

1.6.0_41-b02-445, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_41-b02-445, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

macbook - Word and Excel Short Cuts

In Word
= fn + right or left arrow keys only take me to the "home" or "end of the particular line I'm on.
= fn + up or down do the same as the MS "pg up" or "pg dn"
= fn + command + (arrow keys) take me to the very beginning or end of the document (Word or Excel).

In Excel
= command + right or left jumps to the next cell that has info in it (skips empty cells)
= command + up or down jumps to the beginning or end of adjacent cells with info in them.
= fn + right doesn't do anything
= fn + left takes me to the beginning of whatever row I'm in.
= fn + up and down are the same as pg up and pg dn. So is command + up or down arrow.
= fn + command + left arrow takes you to the beginning of the document (same as "Cntrl + Home")

MacBook keyboard -shortcut for HOME and END function on the keyboard

Fn-left arrow does HOME, fn-right arrow does END, fn-up arrow does PAGE UP, and fn-down arrow does PAGE DOWN.

12 January 2016

Mac: How to Customize your Terminal Prompt

The default command line prompt in Mac OS X is something like:

ComputerName:CurrentDirectory User$

That would look something like this when the Terminal has been launched:

MacBook:~/Desktop Admin$

Not too bad, but kind of boring, and not the best, right? It’s quite easy to change though, and you can really customize your bash Terminal prompt to look like almost anything you want.

We’re going to assume you use the default bash shell, so you’ll be editing either the file .bashrc, .bash_profile, or .profile if you installed fink.

Thus, to start customizing the bash prompt, at your current Terminal prompt, type the following to load the appropriate profile into nano text editor:

nano .bashrc

Yes, you can change that to .bash_profile or .profile depending on your specifics:

nano .bash_profile

You’ll probably be presented with a plain file, so type the following onto a line in the terminal to get started:

export PS1=" "

It’s between those quotation marks that your bash prompt customization occurs.

Between the quotation marks of export PS1=” “, you can add the following lines to customize your Terminal prompt:
\d – Current date
\t – Current time
\h – Host name
\# – Command number
\u – User name
\W – Current working directory (ie: Desktop/)
\w – Current working directory with full path (ie: /Users/Admin/Desktop/)

(Note if you just want to use a custom bash prompt one-off or to test out the appearance of changes before setting them in the bash profile, you can simply use the export commands, the change will take effect immediately with the export command but will be abandoned when that Terminal session is ended.)

So, let’s take a few examples. Perhaps you want your Terminal prompt to display the User, followed by the hostname, followed by the directory, then the appropriate .bashrc entry would be:

export PS1="\u@\h\w $ "

which will look like the following when rendered at the actual bash prompt:

Admin@MacBook~Desktop/ $

Cool huh? You can also change the prompt itself to anything, it doesn’t have to be the $ sign, simply replace it with whatever else you’d like to use, : for example would be:

export PS1="\u@\h\w: "

which is the same as above, but : instead of $

Admin@MacBook~Desktop/: "

So, play around and see what you prefer. My personal favorite is the following:

export PS1="\W @ \h [\u] $ "

This renders looking the currently active directory (PWD), the hostname of the computer, and the username of the current user, looking like the following:

/System @ MacBookPro [Paul] $