XMarks Smarter Search feature on IE8 produces mixed content warning
I just installed XMarks to see if I can start synchronizing my bookmarks between all of my various locations and all the browsers installed. However soon after installing, I noticed that I would get the mixed content warning (the one telling you are downloading unsecure content from a secure page) every time I would go to our company portal page, which is always secured via SSL.
I double checked the sites using Firefox, and even IE 7 from another machine, and the warning did not appear. I disabled the Smarter Search feature in XMarks and the warning went away.
I have only installed XMarks on IE 8 so I don’t know if it is specific to IE 8 or is a problem with other browsers in general.
Update: As per Colin below this issue has been fixed with version 1.0.7. I installed this version and the warning no longer appears. It is refreshing to have such a quick response.
The Four Pillars of ASP.NET
Paul Litwin posted an interesting article that discusses the four pillars of ASP.NET (Web Forms, MVC, AJAX, and Dynamic Data).
He said: “Microsoft used to present ASP.NET Web Forms vs. MVC as a choice between a car and a motorcycle. Both will get you to your job , but some (the majority of the population, I might add) prefer driving a car, while a sizable minority love their motorcycles which give you better gas mileage and independence, but don’t protect you in the rain. To stretch this analogy to its breaking point, let me suggest that ASP.NET AJAX is like riding a bicycle to work (lean and mean, best gas mileage, but it requires you to exercise for your commute and exposes you to the elements like the motorcycle) while Dynamic Data is like taking the bus to work (let metro do the driving for you.)”
You can read his blog entry here:
Calling Oracle Stored Procedure from Hibernate
While calling Oracle stored procedure from Hibernate there is couple of rules that we need to follow. There can be only one return value and this must be a reference cursor. This return reference cusor must be the first and only out value for the stored procedure. It is required that stored procedure must return a reference cursor to be used from Hibernate.
Here is my stored procedure which return book name and ISBN number for a given branch and for a given author
CREATE OR REPLACE PROCEDURE SP_LIB_DTL(p_cursor out sys_refcursor,
in_brnch_cd in number,
in_auth_cd in number)
as
bookName varchar2(8);
ISBN number;
begin
bookName := null;
ISBN := 0;
open p_cursor for
select l.book_name, l.isbn_nbr
into bookName, ISBN
from LIB_BRNCH_DTL l
where l.branch_code = in_brnch_cd
and l.auth_code = in_auth_cd;
end;
HIbernate Mapping for return class and Named Query:
<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE hibernate-mapping PUBLIC “-//Hibernate/Hibernate Mapping DTD 3.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd“>
<hibernate-mapping>
<class name=”com.org.lib.LibraryDetails”>
<id name=”ISBN” type=”long” />
<property name=”bookName” type=”string” />
</class>
<sql-query name=”LIB_SP” callable=”true”>
<return class=”com.org.lib.LibraryDetails”>
<return-property name=”ISBN” column=”isbn_nbr” />
<return-property name=”bookName” column=”book_name” />
</return>
{ call SP_LIB_DTL(? , :branchCD ,:authorCD) }
</sql-query>
</hibernate-mapping>
Make sure you have used the correct database field name value for the column attribute for the return property mapping. You will get the following error if you don’t map the correct databse field name
could not execute query; bad SQL grammar [{ call SP_LIB_DTL(? , ?) }];
nested exception is java.sql.SQLException: Invalid column name
Here is the DAO implementation for executing query and to set the bind parameter values.
public List selectBooks(final BigDecimal branchCode,final BigDecimal authorCode){
return (List) getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException, SQLException
{
Query q = session.getNamedQuery(“LIB_SP”);
q.setLong(“branchCD”, branchCode.longValue());
q.setLong(“authorCD”, authorCode.longValue());
return q.list();
}
});
}
Unidev Awarded Microsoft Gold Certified Partner
Unidev has achieved Gold Certified Partner status with Microsoft along with 4 competencies. (Custom Development Solutions, Business Intelligence, ISV/Software Solutions, Data Management Solutions).
New CEO SEO Blog!
The Net Impact, a division of Unidev, specializes in search engine optimization, web design and web marketing. In order to share some of our experiences and expertise in this space, our CEO, Greg Alexander, has created a new blog covering SEO and marketing topics: www.searchengineoptimizationstlouis.com. Greg’s goal for the blog goal is to examine the technical issues surrounding web marketing in detail. Be sure to add this blog to your reader so you don’t miss any of the interesting posts to come.
VS2008 Tips & Tricks
As a .NET developer, I’m sure you have your own tricks to make your life easy. But you may still like to know more tricks on Visual Studio. Read this article to see if you know all of them…
Essential Visual Studio Tips & Tricks that Every Developer Should Know
Math Error in JavaScript
Believe it or not, if you do this in JavaScript: 103 x 67.12, you will get 6913.360000000001. This happens on both Microsoft Internet Explorer and Firefox. Try this your self.
Basic Math Errors in JavaScript
In terms of mathematical accuracy, 81.66 times 15 unequivocally equals 1224.9, as any sixth grader with a pencil and a piece of paper can demonstrate. But computer is in binary world. it has to convert decimal to binary number before calculation and there may be a problem to convert floating point decimal to binary. This is same for all computer languages. To avoid this, you need to know the scale (the number of decimal positions). Then you can convert the floating point decimal to an integer and scale it back at the end. i.e. (67.12 * 100) * 103 / 100. In Java, BigDecimal can be used to setup the scale.
JavaScript has a built-in method – toFixed, can be used to fix this issue easily as well.
amount = 103 * 67.12;
result = amount.toFixed(2);
So don’t forget this when you deal with a floating point decimal even for addition or multiplication.
The custom tool ‘MSLinqToSQLGenerator’ failed. Unspecified error
There is an issue in Microsoft’s latest SP1 for Visual Studio 2008. If you have a partial class with Using statement at the top of the file for a Linq-To-SQL Data Classes context object. You will get above error. Visual Studio will delete the corresponding “.designer.cs” file for your data context and nothing will be compiled.
To solve this issue, you may have to move “Using” statements inside namespace declaration. This is a workaround provided by Microsoft.
A circular reference was detected while serializing an object of type …
I ran into an issue earlier when trying to serialize an object return by LINQ. After Googling it, I found following blog which is very helpful.
I believe this is a common issue for LINQ objects and hope this blog can save time for somebody.
I cannot login to my SQL Server database anymore!
When you attempt to login to your database using SQL Server Authentication and you get an error message that says:
Cannot open user default database. Login failed. Login failed for user ‘usrLogin’. (Microsoft SQL Server, Error: 4064)
It might possibly be due to the fact that the database that was set up to be the default for that specific login has been deleted.
What you need to do is update the login to have a default database that you know exists. Here’s how to fix it. Open a command prompt and type the following:
For SQL 2005:
osql -S SQL01 -d master -U usrlogin -P usrpassword
ALTER LOGIN usrlogin WITH DEFAULT_DATABASE=new_default_db
For SQL 2000:
isql -S SQL01 -d master -U usrlogin -P usrpassword
(opens query analyzer, type the next line in there)
sp_defaultdb ‘usrlogin’, ‘ new_default_db’
If this didn’t fix the problem… try this link:
http://benharrell.wordpress.com/2007/01/15/cannot-open-user-default-database-login-failed-login-failed-for-user-username-microsoft-sql-server-error-4064/