~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
Ezzaral commented: Good link. I've recommended that one several times for Java game programming questions. +11
~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

> I still have the screenshot somewhere from my 666th

Hope it still gives off an evil aura. ;-)

BTW, congratulations 'Ene'! :-)

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

i don't understand how byte stream could read images. does it need help of applets or else.

Since you seem to be thoroughly confused here, I will just post a minimalistic non-working snippet and allow you to fill the gaps. Anything more and I might be forced to give up my Moderator title for breaking the rules. :-)

try {
      URL url = new URL(SAMPLE_URL);
      // 'in' and 'out' declaration goes here
      try {
        byte buf[] = new byte[4 * 1024];  // 4kb buffer
        int read = -1;
        in = url.openStream();
        // create a new File 'f' which the output stream will write to.
        // Create it at a location of your choice with name as that of the image
        out = new FileOutputStream(f);
        while((read = in.read(buf)) != -1) {
          out.write(buf, 0, read);
        }
        out.flush();
      } finally {
        if(in != null)  in.close();
        if(out != null) out.close();
      }
    } catch(IOException ioe) {
      ioe.printStackTrace();
    }
Alex Edwards commented: =P +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Though this approach leads to compact code, it's not really necessary since it performs a lot of voodoo like image encoding under the hood. Plus, you can be rest assured that the ImageIO approach will always be slower than pulling raw bytes over the wire and directly writing them to disk.

If performance is not a concern, the ImageIO approach seems good enough.

sciwizeh commented: true engough +1
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It simply means that an element with an ID having the value contained in the variable 'f' at that point in time doesn't exist. Try alerting the value of 'f' inside the loop and search for an element with that ID in your markup. Like I said in my previous post, the way you are generating your markup holds the key to the problem.

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

If you know JSF, it shouldn't be that difficult. You just need to bind a list to the DataTable component and the JSF lifecycle will make sure that you get the updated values (the changes a user has made) in your list. For more reference see this and this.

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

Instead of specifying an URI to a HTML page, specify a image URL, something like http://www.google.co.in/logos/closing_ceremonies.gif ; use a byte oriented stream for reading data instead of using a text oriented one like BufferedReader.

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

No, IMO no such thing exists, at least not in terms of code. No matter how hard you try, anyone can copy your layout, design, Javascript etc. of your site and use them. Maybe some other legal alternatives?

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

What does the Firefox Error Console say? Post a complete snippet which doesn't work so that we can try it in our browsers rather than posting chunks.

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

Are you sure you want to dynamically generate those fields? If you run your code in Firefox, what do you see in the Error Console? Post a non-working example of what actually you intend to do.

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

IMO 'JSF in Action' seems to be a good book because:
• Its foreword is written by the JSF specification lead himself.
• The author walks through the JSF concepts by creating an almost real life application
• Since it's a good 1000 page book, you should be able to find almost everything in it.

Then again, practice and googling is what you will additionally require to complete your project.

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

Without any exception messages / stack traces or logs it would be difficult for us to help you out.

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

That's why I pointed to a similar library so that you can take a peek at the source code and try to modify it according to your needs. Maybe looking at some other full fledged Javascript libraries like Prototype etc. (or their source code if libraries are not allowed) will help you.

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

There is no concept of an actual clipboard in web applications; in standalone applications, sure, but in browser based applications. If you want to persist state across pages, there are two ways. One would be to set the value as a HttpServletRequest attribute with key as "key" and then retrieve it on the next page using request.getAttribute("key"). Another way would be to use sessions to persist user data.

Since you are using JSF things should be pretty easy. Just use your backing bean methods to retrieve the desired value from the current page, set it in session, let the navigation handler decide which page to next go to using the return value of the backing bean method and in the backing bean of that page retrieve the session stored value and then remove it from the session.

All the above has been explained assuming you know JSF, if you don't it's about time you started reading some good books. Actually, what you ask for here encompasses the complete technical architecture of your application, so it's kind of hard to explain it. Good books / tutorials and trial and error are your way to go.

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

Yes, you can send more than one variables to your PHP script residing on the server. Just append the start and end points as request parameters to the query string which you would be using to make an Ajax request. Something like /php/process.php/?start=0&end=10 . Also make sure you encode the URL before making an Ajax request for proper encoding of special characters (like space for instance). And in process.php, you can retrieve the variables from the request object. In J2EE, it would be something like request.getParameter("start") .

Assuming this isn't your first stint with Ajax, you can easily process the response using either the responseText or responseXML attribute of XMLHttpRequest object.

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

I don't know PHP so I won't be making any erroneous assumptions here but achieving this depends on how you are pulling the data irrespective of the server side language used. Are you pulling the *entire* data in a single request and toggling the SELECT boxes using Javascript or are you fetching the neighborhood data *on demand*.

No matter the approach, it should be pretty easy if you pass the data from PHP to Javscript in JSON format. Here is a pure Javascript implementation which should push you in the right direction.

<!--
    Dynamic drop downs using Javascript
    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="Content-Type" content="text/html; charset=UTF-8">
    <title>Select Example</title>
    <script type="text/javascript">
    function fillSelBox(srcElem, destName) {
      var selOne = srcElem;
      var frm = srcElem.form;
      var selTwo = frm.elements[destName];
      var map = 
      {"fruit": 
        {"default": "- Select …
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Using the Math javascript object (esp the random() function) along with this tutorial should get you going.

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

Using a drag and drop library along with a simple Javascript logic should get you going.

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

Surely you must have kept some sort of exception handling / logging in your code to help you pinpoint the error/fault? Also, since the code was previously working, it has surely got something to do with your configuration.

Which type of database driver are you using? Type 1 which uses DSN or Type 4 type pure driver? If Type 1 then you need to create a DSN again on the new machine. Also, checking the error logs of your Application Server / Servlet Container might further clarify the issue.

~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

Maybe this might get you working in the right direction:

<!--
    Calculate the difference between the two dates.
    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>Date examples</title>
  <script type="text/javascript">
  // Error checking kept to a minimum for brevity
  
  function setDifference(frm) {
    var dtElem1 = frm.elements['dtTxt1'];
    var dtElem2 = frm.elements['dtTxt2'];
    var resultElem = frm.elements['resultTxt'];
    
    // Return if no such element exists
    if(!dtElem1 || !dtElem2 || !resultElem) {
      return;
    }
    
    //assuming that the delimiter for dt time picker is a '/'.
    var x = dtElem1.value;
    var y = dtElem2.value;
    var arr1 = x.split('/');
    var arr2 = y.split('/');
    
    // If any problem with input exists, return with an error msg
    if(!arr1 || !arr2 || arr1.length != 3 || arr2.length != 3) {
      resultElem.value = "Invalid Input";
      return;
    }

    var dt1 = new Date(); …
Kusno commented: Thanks a lot !!! +2
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

How about showing what you have attempted so far?

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

Grab hold of the Firebug(a Firefox plugin) and restart Firefox to enable it. Open the website in Firefox, click on the Firebug icon at the right corner of your browser status bar, go to the "Net" tab and monitor the traffic there. If the site makes use of Ajax, any changes to the page state without a page reload will be displayed in the "Net" tab.

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

Maybe reading the GSVideoBar reference can help you in properly customizing your video bar. As for your problem, you can decrease the size of thumbnails or increase the dimensions of your DIV to get more than 4 videos per strip. For further tweaking please refer the official documentation and in case of queries post in the Google Ajax Search API user group to get a quick response.

Here is a sample snippet:

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>GSvideoBar Sample</title>
  <script src="http://www.google.com/uds/api?file=uds.js&v=1.0"
    type="text/javascript"></script>
  <link href="http://www.google.com/uds/css/gsearch.css" rel="stylesheet"
    type="text/css"/>
  <script src="http://www.google.com/uds/solutions/videobar/gsvideobar.js"
    type="text/javascript"></script>
  <link href="http://www.google.com/uds/solutions/videobar/gsvideobar.css"
    rel="stylesheet" type="text/css"/>

  <style type="text/css">
    body, table, p{
      background-color: white;
      font-family: Arial, sans-serif;
      font-size: 13px;
    }

    td { vertical-align : top; }

    #videoBar {
      width : 100%;
      margin-right: 5px;
      margin-left: 5px;
      padding-top : 4px;
      padding-right : 4px;
      padding-left : 4px;
      padding-bottom : 0px;
    }
  </style>
  <script type="text/javascript">
    function LoadVideoBar() {
      var videoBar;
      var barContainer = document.getElementById("videoBar");

      var options = {
        largeResultSet : true,
        horizontal: true,
        thumbnailSize : GSvideoBar.THUMBNAILS_LARGE,
        autoExecuteList : {
          cycleTime : GSvideoBar.CYCLE_TIME_MEDIUM,
          cycleMode : GSvideoBar.CYCLE_MODE_LINEAR,
          executeList : [ "ytfeed:most_viewed.this_week", "bud light",
                          "ytchannel:fordmodels", "vw gti" ]
        }
      }

      videoBar = new GSvideoBar(barContainer, GSvideoBar.PLAYER_ROOT_FLOATING, options);
    }
    GSearch.setOnLoadCallback(LoadVideoBar);
  </script>
</head>
<body>
    <div id="videoBar">Loading...</div>
</body>
</html>
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Ok Avenged Sevenfold is good and I love the drum solos, but if you really want a good heavy band, you should look at UnderOath or All That Remains. Two extremely good bands. And if you're into amazing drumming like me listen to the song "My Fears Have Become Fobias" by As Blood Runs Black. It's Insane!

A few songs with good drumming IMO

• System Of A Down - Snowblind
• Slayer - Seasons in the Abbys
• Iced Earth - The Setian Massacre
• Avenged Sevenfold - Blinded In Chains
• Avenged Sevenfold - We Come Out at Night
• Megadeth - Fight For Freedom (FFF)
• Haste The Day - If I could see
murderotica commented: These are awsome bands. :) +1
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

But I am pretty sure everyone here realizes that there is *no* generic solution. How can one go about applying the same set of rules to the C and the Ruby forums? So no, if what we require is a generic solution, parsing the post contents is not the way to go. If specific solutions for each language forums are welcome, then yes, parsing makes it possible though it would still lend to a brittle solution (in braceless languages what would we search for? def? do? while?).

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

What I have done before is just pull a timestamp and innitially add it to session and database record. The the next page request I pull the timestamp record from the database, compare it with the session, if the two match, pull the most current timestamp, replace the session timestamp and the database timestamp with the most current and allow access. If they don't compare I force a login for that user.

Though it means that for *every* request you end up making an extra database read and write call. Though it might be a really good solution for normal sites, high traffic sites can't afford this overhead. Yes, there has to be a better way of doing it. :-)

The distinct advantage of using mature technologies is that you don't have to worry about such details, you pay for it and you get the service. For e.g. when developing a J2EE application using the IBM stack, a few configuration changes here and there using the administrative console of the Application Server and you are good to go with Single Sign On, Session management and the likes.

scru commented: High traffic sites shouldn't use shared hosting. +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Just grab hold of the field values using either document.getElementById('elementId') or document.forms['frmName'].elements['elementName'] , store it in variables and compare the characters at the first index of both the strings (make sure you use trim).

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

> A way to work around this is to store the IP address of the user at login, and keep checking
> it on every page.

And what are you going to do about users who are behind a common proxy which is almost the case with all corporate organizations. Employees never directly connect to the internet, it's always done via a proxy, so a IP address based solution is as brittle as it gets.

Kavitha Butchi commented: sure, i shall take care of that now +1
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If I remember correctly, many such alternatives have been suggested previously (like detecting curly braces) but I guess Dani is against any such 'in your face' messages.

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

The DataTable component of YUI might just solve the issue for you. Planning on doing it without any library support might be *difficult*. If using YUI for datatables, make sure you redirect your further queries to the YUI mailing list.

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

appendChild requires a DOM element, not a string. The Firefox error console would have pointed out the problem much earlier. Other than that, using elem.setXXX / elem.getXXX rather than elem.XXX = YYY might cause failures in some browsers.

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

Your quoting seems to be off. Try something like:

<script type="text/javascript">
function redirectUser() {
  var url = '<%= response.encodeURL("http://www.mysite/index.jsp?switch="+ intvariable) %>';
  window.location.href = url;
}
</script>

<!-- more code -->
<input type="button" value="Copy" onclick="redirectUser();">
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You can either use the RESTful approach for creating webservices or just use the SOAP stack.

RESTful approach shouldn't require anything more than a server side language along with a container (Tomcat and the likes if using Java) while using the SOAP approach would require you to use something along the lines of Apache AXIS.

When it comes to learning web services, either get a good book or be prepared to spend sleepless nights.

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

Does a minimalistic servlet example work in your case i.e. one which just outputs 'Hello world' to console? How are you deploying your applications? What is the directory structure of your web application? Are you overriding any classpath settings? Does your environment variable contain any entry other than JAVA_HOME?

Without knowing the answers to these questions, troubleshooting would be a bit difficult.

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

> My Apologies. didnt mean for this to happen. reading my posts sounds a bit creepy. sorry
> though cheers

Though this won't change the fact that you still love cracked software? Would any of the rantings here make you change it?

Right and wrong are relative. What might be right for you might be wrong for someone else. I wonder if people still think software crackers are someone who sit in their basement hacking away. No, they are not. They are software developers like you, me and the many out there. So why do they do it? Money, fame, ulterior motives? We might never know.

Point in case: Do whatever you feel like doing, we anyways can't do anything about it. Wrong or right doesn't matter if you have no regrets about it; just don't try to justify it when someone disagrees with you.

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

That post was from September last year, almost a year back. Plus Dani promised something like that won't happen again. Maybe this needs to be brought to her notice since this might be the same problem or something new.

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

> More like my tenth.

See! And you wonder why the quality of Daniweb threads is declining these days. Oh and BTW, in reply to the previous reputation comment, I really think you are 10. Sheesh, cocky kids...

John A commented: Ban him, BAN HIM! :icon_biggrin: +15
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Since the data is already stored in session, why get JSP's involved with the mailing process. If your site is authenticated, you already would have the user credentials when processing the request. The only task which remains is the formatting of the content. Also, when sending plain text mail, you don't have a lot of formatting options.

One option would be to tab delimit the data but then again it ends up screwing up with the layout since the width of each column would be unknown. A professional way of doing it would be to use a Reporting tool to create a template, hook a stored procedure to your template and control the report generation based on some input parameters. This report template would then be used to generated PDF reports which can be sent as attachments to the client. Another way would be to mail a link to your user which would direct him to a page which displays properly formatted data pulled from the database.

Of the above three, the third one is by far the easiest since it delegates the responsibility of data formatting to a markup language like HTML, something which it was meant for. But then again, if the requirements mandate that the table based data be passed as mail body, you are out of luck.

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

> Why not just stop worrying about it?

Why? Because it ends up wasting precious time of all the people involved in the process; precious time which could have been otherwise used to help out people.

Leaving those things apart you would be surprised at the number of repeat offenders. I can understand people new to forums getting things wrong on their first attempt but repeating the same mistake after being nicely pointed in the right direction is insanity.

> So just get rid of it all, and we can just go back to yelling at them when they screw up.

Please don't; it feels bad to yell at someone only to be ignored. ;-)

> Heck, I stopped regularly visiting there months ago

I guess the same is the case with Java, or I should say the most active programming sub-forums out there. Why? Because most of them are the ones who end up multi posting their queries in hope of getting an answer from at least one of them.

peter_budo commented: I agree, to go through unformated code is difficult. +10
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Google for 'google search api'. You would also require the help of some server-side language along with Javascript to achieve this task.

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

A simple google search should get you going.

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

I've been here for 2 years, and the last year daniweb has gone downhill. the blogs quality decreased, a lot of good people left, and new retards came, it's been horrible.

And you blame this thread for that? Plus I have been here for more time than you have and in some cases actually happen to know *why* or under what circumstances people left rather than just *knowing* that they left.

Oh and BTW, you have started crossing your limits by calling Daniweb members as retards; there is a limit to which we can kid you along. Play time's over kiddo. Consider this as your first informal warning.

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

> I highly doubt all the 6,500 financial institutions they support have API's to access.

Why so? Considering it's money business, I wouldn't be too surprised if mint.com has a way of talking with all of them and that too legally, of course under a sound contract. Anyways, how do you propose to access the account statistics of a bank without the bank knowing about it?

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

Generation D was not in the list.

There is no compulsion of selecting one from the list.

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

De-generated all the way. ;-)

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

You need to take a look at CSS pseudo classes. BTW, this question belongs to the CSS section if this task needs to be achieved only using CSS.

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

Daniweb has really lost quality in the last couple years.

Take a hint! Start posting something constructive for a change. :-)

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

> All the tutorials and articles I've found so far about ADDING nodes -- not clearing text from
> a node.
Maybe something along the lines of:

<!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 replaceWith(elemId, content) {
      if(!elemId) {
        return;
      }
      var elem = document.getElementById(elemId);
      var newElem = document.createElement("PRE");
      newElem.id = elem.id;
      newElem.appendChild(document.createTextNode(content));
      elem.parentNode.replaceChild(newElem, elem);
    }
    </script>
</head>
<body id="bdy">
  <form id="frm" name="frm" action="#">
    <div>
    <pre id="myPre">SOME CONTENT TO BE REPLACED USING DOM</pre>
    <br><br>
    <input type="button" value="Do it!" onclick="replaceWith('myPre', '');">
    </div>
  </form>
</body>
</html>