~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I'm not sure the benefit outweighs the implementation effort. Dani would be doing the
> coding for it though.

Of course, this is all subject to the implementation effort, the other priorities Dani has at present etc. :-)

I just thought I would mention this since the Daniweb we see now is a result of many such continuous improvements over a period of time and if many people see this as a required improvement, it might just get implemented.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I think it would be a handy feature to show the user the offending post he is about to report under the 'Report a bad post' text area. The purpose here would be to let the user know which post exactly he is trying to report [for posts close to each other, many make a mistake of reporting something which they don't want to] and also provide easy means to quote a piece of text in the post as the 'Flag bad post' reason.

What do the other members think about this?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Are you sure you are saving the user preferences i.e. the position of the dragged images, the newly manipulated size etc.? Does this card making activity involve making multiple HTTP requests to the sever or is it a client side activity i.e. no page reloads? If yes, then you can save the user preferences in Javascript variables and use the same settings when displaying the finished product. If you are making multiple requests, storing the preferences in the server session or in cookies would be more like it.

Since you are already done with the product, saving the image/text locations and their new dimensions shouldn't be that tough.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Congratulations on getting a yellow star! May you very soon achieve the same feat in the 'Solved threads' section. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I *love* IE for two reasons:
• It brings out the real human within the developers.
• It makes me realize life is not always a bed of roses.

:-)

Aia commented: Glutton for punishment. ;) +9
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

DaniWeb newbes have asked me to do that lots of times, but I don't have a crystal ball nor is my eyesight good enough to see their monitors from where I am sitting.

You don't need either of them; *ancient dragons* are considered to be choke full of ancient wisdom and users of ancient and powerful magic. ;-P

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IMO, the thread being on the first page has got nothing to do with its solved status; it depends on time the threads were `touched'. And BTW, the thread still isn't marked as solved by any moderator because there were no follow ups from the Original Poster[OP].

Members can contribute to the forum when solved threads are concerned. If you feel that a thread has been solved, you can report the same by using the `Flag Bad Post' link so it can be marked as solved by the moderator in case the OP is unaware of the `Mark As Solved' feature or forgets about it.

Danarchy commented: Gave me some new knowledge and pointed out my error. +5
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I do not really understand why people do not use free available MySQL Community Server

By the way why are you using such an old version of the JDK ???

I can round up all the possible reasons from that in word "IGNORANCE".

Software development is not all roses; there are instances wherein the project mandates you to use / build on the infrastructure they already have. DB2 is not that good, the same with SQL Server 2005. Access doesn't even feel like a real database, but then again, I have worked on migration projects or projects which already had critical data in their legacy databases, migrating which would have cost a *fortune*! So maybe a few more options rather than just *ignorance* would be more like it. :-)

Oh and BTW, when projects related to real money are involved, MySQL isn't even there; the market here is dominated by age old tried and tested database vendors like Oracle, Sybase and DB2. And please let me not hear about how real world high traffic sites like YouTube and message boards use MySQL. No one gives a damn if a few screw ups happen when you are creating a thread, making a post or uploading a video. But when real world money transactions are involved...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> But its up to you which pattern you will take

Even if you know there is a better method out there which doesn't end up reinventing the wheel?

> And as much as possible i always want to provide examples' rather than giving reference
> or any guide related to the issue!

Oh, so you prefer zombie feeding? BTDT. This way of helping not only makes the posters depend on ready solutions but also hinders their thinking process. Nowhere in the entire post the poster has made an attempt to solve the problem at hand but still has got hold of enough code.

IMO, helping out by churning code snippets is easy; forcing the poster to learn and think isn't. Let your answers create people who can pass along the knowledge rather than ready code.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There are better ways of manipulating tables and table data. See the HTMLTable reference at MDC.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If you just want to change the contents of the Text object or replace the given Text object with an entirely new one, the simplest possible way would be:

var e = document.getElementById("yourId");
if(e)  e.innerHTML = "Hi! I am the new text";
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Osama Bin Laden

Dave Sinkula commented: Dead or Alive? +17
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Declare a variable 'test' outside the loop and inside the loop append the value of the selected option along with a '|' to `test'. Try it. Did you get the desired result? If no, then why? What seems to be missing here? What do you think needs to be done to make it work the way you expect?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I would appreciate if someone can please help me eliminate the warnings and tell me where
> I am going wrong.

The solution here (nor the problem) lies with Javascript. You need to make suitable changes to your browser settings [firewall settings, anti-virus settings etc.] to make those pop ups go away. I am pretty sure you can understand the grave implications of disabling such security related checks from Javascript against the users' permissions.

If using IE, make sure your site is in 'Trusted Zone' along with changes made to the various other settings [Tools -> Internet Options -> Advanced / Security / Privacy].

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Reading the JSAPI user guide and following up on the Mozilla forums might just solve your problem.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Haven't you received enough replies here? Please refrain from double posting or at least let us know you have posted somewhere else so that multiple people don't end up wasting their time for coming up with the solution of a same problem.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It doesn't matter if the string is escaped in one function and unescaped in another. Plus, using sever side code makes it impossible for us to reproduce the problem at our end. The only thing left for you is to use Firebug to debug your javascript code.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Have you tried a standalone test case to make sure the problem is really with escape/unescape?

var escaped = escape("Advance to others");
var unescaped = unescape(escaped);
window.alert("Escaped: " + escaped + "\nUnescaped: " + unescaped);

Oh and BTW, use encodeURI / encodeURIComponent instead of escape since escape doesn't work well with non-ascii characters. MDC Reference.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The only useful thing I can do in kitchen is boiling water, so oh yes, its boiled water for my sore throat for me. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Don't use document.all.

Also, the markup in the original post is thoroughly broken with the tag attribute values not quoted. Make sure you validate your markup using W3C validator to avoid browsers to correct your errors in their own way which may differ across browsers.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The term 'best' would be relative in the context you mention. There is no single 'do-it-all' library out there. For e.g. Ogre is a pretty good game engine but the most complicated all of them out there. Irrlicht is pretty much easier to pick up but doesn't provide the fine grained control that Ogre does.

The only option is to patiently click through all those links, go through the details, get a feel of the community and user base and decide for yourself which library is worth working with.

Ezzaral commented: Reality is so complicated. +12
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Solution (simple as always):

Oh yes, the KISS paradigm.

> Thanks for your support ~s.o.s~ !

You are of course welcome. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> The author claims that personal training and experience is far better than simply reading
> a book.

Of course; the point everyone tries to put across is though reading is an essential part of learning, without doing things one is useless. No matter how many books I read, unless I apply the knowledge to real life situations, my bookish knowledge is useless.

> I suppose this is an "Eye of the beholder" opinion,

Oh no, it's just youth. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Could a counselor substitute for a mentor?
Don't think so. AFAIK, counselors work for money while mentor is someone you know. A mentor can be your someone very close to you like your brother, sister, father, mother etc. Plus it is a high probability that your mentor is someone who has known you for some time and can guide you accordingly. On the downside, you might find a mentor who you think knows his stuff but in actuality he doesn't. Counselors don't have this issue since you get what you pay for. ;-)

>Yep just spotted it there ... I've been through that thread quite a few times ... don't know
>how could I have missed it.

:-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Anyway ... for educational purposes it's good to know, where IE stores reference to this
> Button1

Not sure if I understand this correctly, but there is no reference stored, only the default action executed when the RETURN key is pressed inside the INPUT field which is submitting the form. Same happens when you have a text field along with a SUBMIT button.

>I try to fit my current working W3C standards project to IE standards.

Tough luck I guess. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, there does seem to be some weird mumbo jumbo going on there. It seems that pressing the RETURN key causes the button to be pressed and hence the x=0&y=0 values in the querystring. One solution I can think here is to enclose the entire thing in a FORM tag (the way it actually should be; form elements like text fields ought to go inside a FORM tag). This makes sure you don't fire off fake onclick when a return key is pressed in the text field.

I guess a better solution here would be to try to approach the problem from a different perspective and to use normal IMG tags with an onclick attribute rather than using an INPUT tag with type image . Maybe using some simple Javascript library like DOM assist for dynamically adding elements and event handling would simplify your task a lot.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Nice read, another article I really liked linked with developing skills in the programming field is Peter Norvig's Teach Yourself Programming in Ten Years

That is definitely a must read for all those aspiring to be programmers and is the very reason is included in the 'On programming and hackers' section of the Java forum sticky along with many of its ilk. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Why are you encoding textual data? Base64 is primarily meant to encode binary data.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Learning the craft; though a nice article on learning the crafts of programming, it draws on some of the finer points like needing a mentor and reading good books. Even though the article is about software development, the concept more or less applies to almost all professions out there.

Reading the article brings back memories of the time when I first started programming (not too long back) without a formal computer science teaching and with bills to pay. It sure was tough without having someone with a similar interest set in my vicinity or someone to turn to in case of queries. Having a mentor helps you understand things really fast; things which would have taken us hours to understand and grasp completely. It's not that I am against reinvention of the wheel, it's just that nothing beats having expert, professional and sound advice when you need.

I am sure there are many out there who irrespective of their profession can pretty much relate to the philosophy of the article.

Nick Evan commented: Good article! +9
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This sure is a weird problem; without looking at the code, it would be kind of difficult to arrive at a solution. BTW, how are you attaching event listeners to your components? Are you using attachEvent / addEventListener or the plain old way of attaching events?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The only valid solution to this problem of yours is to set proper response headers related to caching. For e.g. to make images uncacheable, serve them with a response header Expires: some past date . Google for caching headers.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

1. People seem to think that there is a cold war going on between Adobe's Flash, Microsoft's Silverlight, and JavaScript. With all the new JavaScript Libraries coming out like DOJO, JQuery, Mootools and others; JavaScript is becoming pretty powerful and animations are becoming easier. So my first question is.. How come there are not any JavaScript animation Studios? Like Flash and Silverlight.

Not sure what exactly you mean by Javascript *studios* but there are many noticeable differences between Javascript and Flash. Flash is an entire development platform in the sense that it comes packaged with a language to drive the processing (Actionscript) along with the nice ability to drag and drop and many other niceties. Javascript is just a programming language and creating complex animations requires a good mathematical know how and is definitely more difficult, time consuming when compared to Javascript. Now think about it, if you were asked to create a simple user driven animation on a web page, which would be your first choice?

2. Is it JavaScript that is displayed differently in every browser? or is it the CSS? because when I play with JQuery, certain animations will look different depending on which browser I'm using. I have Google Chrome, IE6, and FireFox.

Different browsers have different rendering engines, for e.g. Firefox uses Gecko, Chrome uses Webkit etc. Hence if a same piece of code looks different of different browsers, it is because of the difference in rendering capabilities, Javascript has got nothing to …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> That's really not real Chinese, isn't it?
Wrong use of question tag methinks. ;-)

Oh, and yes, it really isn't Chinese, just using some random language for familiar English words.

Has your flight been delayed? - Hao Long Wei Ting? - How long waiting
I got this for free - Ai No Pei - I no pay
I bumped into a coffee table - Ai Bang Mai Ni - I bang my knee
Please, stay a while longer - Wai Go Nao? - Why go now?
They have arrived - Hia Dei Kum - Have they come
He is a fat man - Wun Fat Gai - One fat guy
It's very dark in here - Wai So Dim? - Why so dim?
See me A.S.A.P. - Kum Hia Nao - Come here now
Stupid Man - Dum Gai - Dumb guy

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Mineral water.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> here's the way to send your encrypted password to server [ snip ]

Which of course fails if Javascript is disabled on the clients' computer. And of course, using a Javascript equivalent of the hashing algorithm exposes your entire hashing logic. A better way would be to use a secure connection to send/receive critical user information like https.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I am trying to have 2 columns in one form and third in the other form. Is it possible.

Yes, very much possible. Make sure you have different request handlers defined for each form by using the 'action' attribute of form if you expect selective processing. But your requirement suggests that there is something definitely wrong with your design. Why do you need two forms for a single table anyways?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Of course, then we'd also have to deal with the people who mistake the "report PM" button
> for a "reply" button.

...which is what we still do sometimes in the Reported posts forum. :-)

BTW, this sounds like a good addition to the current spam handling system as long as moderators don't get *personal* notifications of such things are they are processed in the same way normal spam gets processed.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> What I'm doing is, triggering two requests before page is redirected, which means their
> destination is not undefined. When request is triggered, the page actually exists.

Of course the destination exists and so does the source when making the request, but clicking on the link loads a new page and hence the context in which the request was made is destroyed. Remember, Javascript is a client side scripting language in this case and hence its lifetime is the lifetime of the client session.

> What's more; if I wait for the request in hover phase to be completed and then I click, it
> certainly works without any error.

Because enough time is given for the request to complete and to process the response when you hover on the link. This isn't the case when you *click* on it since the browser attempts to load a new context.

> Moreover, the code I've posted here works perfectly in IE as it is.

Because what FF is showing in the Error console is not an error at all. Think about it, if you plan on ignoring the return status of your Ajax request, should it even matter to any browser? Does the same code run fine in Opera? Is this so called error hampering your functionality.

> About your suggestions; the reason why I wouldn't do either of these solutions was I
> didn't want to interfere the current principles …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Note to all: For *gawd's* sake, live and let live. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The error makes proper sense; think about it, the page which made an Ajax request in the first place is no longer there and hence a NS_ERROR_NOT_AVAILABLE. You have two options here:

• Redirect the user to the Google home page once the Ajax request is complete and you have the status with you; analyze the status and redirect accordingly based on whether the async request was success or a failure.
• On the link click, navigate the user to another page on your domain, e.g. handleThis.php which performs the same job as that performed by the async request and navigates the user to Google home page. Pretty simple, no Ajax needed.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Something like this maybe:

<!--
    Replace special characters in a string.
    Copyright (C) 2008  sos aka Sanjay

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Script-Content-Type" content="text/javascript">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Example</title>
    <script type="text/javascript">
    // Error checking omitted for brevity
    function doIt() {
      var special = "@#$%^&";
      var str = "@Hello @How@ $Do %You $Do?";
      var strArr = str.split(''); // Convert string to an array
      for(var i = 0, maxI = strArr.length; i < maxI; ++i) {
        var ch = strArr[i];
        // If the current character is one among the special characters,
        // replace it with its character code.
        if(special.indexOf(ch) > -1) {
          strArr[i] = str.charCodeAt(i);
        }
      }
      var modifiedStr = strArr.join('');
      alert("Orig String: " + str + "\nModified String: " + modifiedStr);
    }
    doIt();
    </script>
</head>
<body id="bdy">
  <p>A test page</p>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe this library will help you in dynamically attaching tooltips to your RSS links.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Fiesta online also seems to be a good one.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> but I pretty much forgot this is the Javascript forum

Bah, I rest my case. :-P

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I disagree, this could certainly be used as an effective one-way sanitization technique

Sanitization by converting special characters to their numeric equivalents rather than escaping them? When talking about web applications, the majority of escaping which happens is to prevent arbitrary input from messing up manual form submissions / asynchronous submits for which encodeURIComponent works nice enough. So I still don't see any real need to roll something custom unless of course the exercise is for learning purpose.

> Probably. Certainly if you ever want to unescape.

At least in J2EE, the unescaping is automatic so

And as far as the complexity analysis is concerned, one should rather use tried and tested library / proven methods than worrying oneself with premature optimization. Don't optimize unless you have benchmarked and it really is slow in the context of your requirements / application design. And BTW, regular expression engines nowadays are super optimized state machines which can almost come close to the manual search and replace when used with care. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> If you're doing this for the purpose of input sanitizing

That doesn't seem to be the case here since converting special / blacklisted characters to their equivalent codes doesn't serve any purpose. Also, encodeURIComponent(string) seems to be a more appropriate escaping function than manually doing so.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Thought it would be easier if we all chipped in and helped you out but it would beat the actual purpose of learning things.

If you are still in the stages of developing your programs in a text editor, litter your program with log statements at appropriate places and find the point wherein the program starts behaving in an unexpected manner. If using an IDE like Eclipse, debug your application and inspect the variables at run time. Guesswork should not be the approach here...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Take a look at the generated source code, try to analyze it and you would know the answer to all your questions.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Use the replace function iteratively as long as given character occurs in the target string (can be found out using indexOf ). Post your code so that we can suggest possible modifications.


Another complicated, but elegant solution would be to use the replace function which uses a Regular Expression along with the g(global) modifier, substitution variable and anonymous functions. Something like:

// 'b' here contains the matched character.
"!AB#CD%EF@".replace
   (/([!#%$@])/g,
   function(a, b) {
     return(b.charCodeAt(0));
   });