hasan's blog (বল্গ)

work for fun!!!

Archive for the ‘bug’ Category

internet explorer expected identifier, string or number

with 6 comments

huh, IE is one of those curses which came down to earth from the hell.
anyway if you face such problem you should check the following stuffs -

1. this guy described about the first problem
2. here is what i have faced and resolved,

i had a javascript code like this -

var element = new Element(“a”, {class: “keyboard_option_link”, href: “javascript: void(0)”});

so IE minds, because i have used “class” the fix i have used -

var element = new Element(“a”, {“class”: “keyboard_option_link”, href: “javascript: void(0)”});

this things now working fine,
best wishes,

Written by nhm tanveer hossain khan

May 25, 2008 at 11:14 pm

rails plugin symlinked broken on 1.2.5, fixed from 2.0

with one comment

i was trying to build a rails plugin. my project was in different directory so i symlinked the directory under “vendor/plugins/..”. but i couldn’t find it working.

so after passing few times, i could successfully run my plugin under rails 2.0-RC2. so later i compared lookup.rb file from the 1.5 and 2.0-RC2 release.

the defecting code was the following lines – (1.5)

def use_component_sources!
# ….
sources < < PathSource.new(:lib, “#{::RAILS_ROOT}/lib/generators”)
sources << PathSource.new(:vendor, “#{::RAILS_ROOT}/vendor/generators”)
sources << PathSource.new(:plugins, “#{::RAILS_ROOT}/vendor/plugins/**/generators”)
# ….
end

the fixed version – (2.0-RC2)

def use_component_sources!
# …

sources < < PathSource.new(:lib, “#{::RAILS_ROOT}/lib/generators”)
sources << PathSource.new(:vendor, “#{::RAILS_ROOT}/vendor/generators”)
sources << PathSource.new(:plugins, “#{::RAILS_ROOT}/vendor/plugins/*/**/generators”)
sources << PathSource.new(:plugins, “#{::RAILS_ROOT}/vendor/plugins/*/**/rails_generators”)
end
# …
end

i also checked out rails bug tracker i found a bug was pointed to this issue and apparently which was fixed on the following change set.
http://dev.rubyonrails.org/changeset/6101

Written by nhm tanveer hossain khan

November 29, 2007 at 1:27 pm

attributes: rails reserved variable :(

with one comment

yesterday, i had a pretty rough working day, i was stucked (along with my team) with some simple joining. we had the following models -

Attribute
———–
class Attribute < AR:B
belongs_to :category
end

class AttributeValue < AR:B
belongs_to :item
belongs_to :attribute
end

class Item :attribute_values
end

rails wasn’t giving much better error message, instead it was saying, “invalid type, String to Integer..”, so far i understood ActiveRecord stuff was trying to cast a string to integer.

we even didn’t know which field was doing this stupidity and so on…
so later we dug down to the rails scripts, we added few debug messages. we found “[]” was invoked to set “id” string value.

anyway, after digging more into to this issue, today i gave another try after 7 hours of nice sleep. it was about rails reserve words.

though i heard something from the rails community, but i was expecting some message or  errors which explain this issue.

anyway, i always like fail first approach. if something is not possible it should fail first. at least it should return a meaningful exception.

i believe Active Record should be patched with more clear warning or exception, if any reserved word is used for model or controller or others it should let us inform :) .

Written by nhm tanveer hossain khan

October 20, 2007 at 2:36 pm

Firefox 1.5 with ajax sync request.

with one comment

This post is to remind myself about a bug on Firefox 1.5.

bug details:

Http ajax request doesn’t invoke “onstatechange” handler if ajax request type is set to sync.

how to resolve this problem:

invoke “onstatechange” function manually.

Written by nhm tanveer hossain khan

April 26, 2007 at 2:15 am

Kudos hasin bhai

with 2 comments

I was stuck with few CSS related bugs, which were related only with M$ IE.

Credits goes to  hasin bhai who resolved those M$ IE related bugs.

Scenario 1:

Everything was loading fine on most of the browsers except IE 6, it was not render the <h2/> background, which was placed inside a div.
i.e: <div><h2>title</h2><p>some content</p></div>

Solution: use (position: relative)

Scenario: 2

Rectangle border was not rendering properly on IE.
i.e: <div class=”borderDiv”>some content, contains lot of floating div as well</div>

Solution: use (background: #fff);

Written by nhm tanveer hossain khan

September 1, 2006 at 11:39 am

Posted in CSS, HTML, bug

Buggy Google code

without comments

i was trying to create a project for more than 30 minutes… but could not get it done…
it was again and again returning the same error page…

Buggy google code...

** Last update: i could make it ;)

Written by nhm tanveer hossain khan

August 28, 2006 at 10:02 am

Posted in bug