tuse 22 Junior Poster

Hi Folks - back on DaniWeb after a long time. I used to be an active developer a few years back - now I am leading a team that needs some help. So here goes:

We need to create a dynamic menu - (dynamic in the sense that the values are fetched from the database) and apply HTML / CSS / jQuery styles to these menu 'items'. There is a UI designer in the team who has been able to make the designs for a HTML list i.e. the ul, li tags - however, the developers are fetching the menu items as a list of RadioButtons. How can I get the UI designer and the developers to work out the desired feature - the desired feature being a dynamic menu with styles applied to it.

The implementation is flexible from the .NET perspective i.e. the components need not be RadioButtons specifically. However the designer is only able to 'style' the ul, li HTML tags.

tuse 22 Junior Poster

Hey All,

I am looking to develop a web application on the Java platform with Oracle 11g database. I asked one of the dealers for a quote & the quote is for "20 users".

I don't really know how this works, but will I be requiring a license for 20 users when all the database activity will be done through the Java application?

Any help would be highly appreciated!

tuse 22 Junior Poster

What's wrong with script?

If I use the 'script' command inside a shell script, it does not work as intended.

Executing the shell script, I get

Script started, output file is tmpfile.txt
bash-3.2$
tuse 22 Junior Poster

In a shell script, I want to 'spool' (record) the shell prompt & command typed alongwith its output into a file.

eg:

In the script, if I give a 'ls' command, the file should contain:

<<root@server ~>>$ ls
a
b
c.txt
<<root@server ~>>$

i.e. the command as if issued on the shell followed by its output.

Any ideas on how to accomplish this? Tried using the 'script' command but to no use.

tuse 22 Junior Poster

Hi,

I just installed Tomcat 5.5 and could see the default index page (with images missing)

Upon running the sample JSPs, I get the following-

HTTP Status 404 - Servlet default is not available

In the logs, I can see a Root Cause saying something like- "java.lang.NoClassDefFoundError: org/apache/naming/resources/Resource"

Basically, I get a 404 whenever I try to access any JSP or even an image (this I could gather from the fact that the images on the default index page)

Where am I going wrong? I am new to JSP

tuse 22 Junior Poster

1. Keep an array to hold the random numbers

2. In order to add an element to this array, generate a random number in the required range, and check the array to see if the generated number is already a part of the array (using foreach)

3. If the generated random number is not a part of the array, append it to the array, else goto step 2.

4. Finish the algorithm when the array holds 15 elements

----

Alternatively, you can use 'in_array()' to check if a value exists in an array

http://www.w3schools.com/PHP/func_array_in_array.asp

tuse 22 Junior Poster

Also, are you running any applications on your system that is not on any of the other systems?? Had a little dig into the error and it seems that certain applications were either not updated to properly work with the newer Winsock /2 builds introduced in Vista, or require available patches. Access conflicts can also cause the lock-up.


Really, without more info, there are just too many possibilities to give you more specific guidance

This is quite possible. How should I troubleshoot this?

What other info should I supply?

Thanks for help, and sorry for the delayed response

tuse 22 Junior Poster

Check my blog post- http://dotnet.tekyt.info/?p=27

If you still have any doubts, feel free to ask

tuse 22 Junior Poster

Check with your network administrator if there is a mail server on your network. If you are running the website on your own server, you might have to configure your mail settings on the localhost

tuse 22 Junior Poster

*problem*
How to exit this program when the user assigned k to 1 ?

Use exit() function

http://www.cprogramming.com/fod/exit.html

tuse 22 Junior Poster

did you try debugging using gdb?

tuse 22 Junior Poster

I think there's only one reason why your code will never work as you expected: you declare read-only strings. Although you didn't declare it with the const keyword, declaring string that way makes your string variable untouchable.

Its possible that what the original thread starter meant by 'swap' was to actually interchange the pointers to the read-only strings as Dave and Dream2Code have suggested.

tuse 22 Junior Poster

That is just the reverse of the aforementioned algorithm.

Explanation- Scan the input string from left to right. Whenever you see an operand, just push it onto a stack. When you encounter an operator, pop two elements and concatenate the operator between the two operands and push it back to the stack. Perform this till the input string is fully parsed. The only element left in the stack (if the postfix expression is valid) will be the required infix expression.

eg- AB+

1. push A to stack
2. push B to stack
3. Next element is '+'. pop two elements, B and A apply the operator (A+B) and push it back to stack
4. Since you have fully examined the input string, the element left in the stack is the required expression.

This is just a very basic explanation, google for a more precise technique

ps- the thread name says 'postfix' but in your post, you have given a prefix string (+AB). In such a case just parse the input dtring from R->L in the algorithm.

Hope this helps

jephthah commented: good answer: accurate, but without solving it for them. +12
tuse 22 Junior Poster

Sample question:- Wat will the expression ABC AB AC will become after postfix operation??

The expression contains only operands. Where are the operators?

If you have a string in infix, ie. in form A+B, and you wish to have it in the form AB+, you can use the Shunting Yard Algorithm

tuse 22 Junior Poster

printf("Trip Summary");

You are missing the semicolon here

and here

printf("Enter Total amount of fuel required");

and why do you have the return statement outside the main function?

tuse 22 Junior Poster

Hi,

I am running Windows Vista. Sometimes my browsers will abruptly stop displaying webpages. The error on Mozilla says- Unable to Connect, on Safari - Winsock Error 10013

I am able to ping, my DNS servers are working (so its not a connectivity problem- other computers on the same network are able to access the internet), and the hosts file is in order. When I reboot, all works well for sometime before this problem strikes again.

The error reported by Safari seemed to suggest a WinSock problem. So I even re-installed TCP/IP by cleaning up the registry entries for WinSock and Winsock2 and putting in fresh copies. The problem still persists.

I used a port scanner program to see what apps are running on them, and several report- "An attempt was made to access a socket in a way forbidden by its access permissions".

My checks with ESET A/V and Spybot suggest that the system is clean.

How can I troubleshoot?

Thanks for your help, this problem is really irritating me.

tuse 22 Junior Poster

Hi,

I was reading the book "Fundamentals of Database Systems" by Elmasri and Navathe. In that it is given that for a relation to be in 2nd NF, every non prime attribute (attribute which is not a part of any candidate key) should be fully functionally dependent on any candidate key.

Also a relation is given as

EMP_DEPT(ENAME,SSN,BDATE,ADDRESS,DNUMBER,DNAME)

where,
EMP_DEPT- Employee Department
ENAME- Employee Name
SSN-Social Security Number
BDATE-Birthdate
DNUMBER- Dept Number
DNAME- Dept Name

This is said to be in 2NF.

However if you see the DNAME attribute which is non prime (not a part of candidate key), it is not functionally dependent on any candidate key (SSN in this case).

So is it correct that the relation is in 2NF or is there something that I have missed?

Thanks

tuse 22 Junior Poster

I am sorry, I have not phrased my question correctly.

The thing is that I have two navigational paths to the same page as described in the first post.

So, these two pages will link in a different manner (due to the breadcrumb structure) to the same page.

This will give rise to link churn, so how can I prevent this?

tuse 22 Junior Poster

Hi,

On my website, I am using breadcrumb links-

A->B->P

X->Y->P (same P)

The breadcrumbs and other links change depending upon whether a spider visits P from B or Y.

So what is the solution to this?

tuse 22 Junior Poster


To tuse, I got your point ... I must create a form to allow the user to choose another port if there is a BindException.

Yeah, using the try-catch

tuse 22 Junior Poster

Hi,

  • There are 65536 ports (TCP) i.e 0-65535
  • Port No 0 to 1023 are reserved for well known services (http, ftp, telnet)
  • If you try to use a port already in use, you will get a BindException
  • You can run a port scanner program to check what your ports are doing
tuse 22 Junior Poster

Hi,

What is the conversion character for long double in gcc?

tuse 22 Junior Poster

In a application for online test, the rank list is computed as follows-

select * from test order by marks DESC

How can we make sure that the first record gets rank1, second rank2 and so on... I want to add the field to the table.

Can this be done using a single pass? As in,a workaround is to create a temp table using the query and then process each record using a script to assign the rank. Is it possible without the script?

tuse 22 Junior Poster

Hi,

I am trying to implement a client server wherein the client must be able to download a requested file off the server and upload a file onto the server. I have implemented the download part of the code using TCP Sockets.

In the upload part from the client to the server, the problem stated says that the client must be able to request the server to create a new directory on the server and then upload it there.

How can the creation of the new directory on the server be handled?

tuse 22 Junior Poster

Hi,

I am involved in a project which requires our team to build a web portal for our college. We have gone about the collection of requirements.

Hereafter, I need to know which is the best software development model to follow for the creation of a web portal. We tried the OO class approach, but somehow it seemed as though we were missing something.

tuse 22 Junior Poster

Then I guess you should have sent her a PM instead of posting a thread on a public forum... FACE.

- Have done that quite some days back, no reply

@Narue- You sure are a meanie

tuse 22 Junior Poster

Awaiting Dani's take on this....

tuse 22 Junior Poster

Or so you think. :-)

> I was wondering if we could have new forums on DaniWeb,
> especially for RIA's like Flex, JavaFx etc..

Forums or more specifically sub-forums are created only if a given technology generates enough traffic each day. Creating forums otherwise leads to "dead" forums which have little or no activity whatsoever e.g. Ruby forums. For the time being if you have any query, try posting the same in Web Design forum.

How exactly do you calculate the traffic?

Don't you think RIA's are picking up these days and Dani should have a forum meant for that?

Maybe some other forums such as Assembly (last activity 9 days ago) can be done away with.....

tuse 22 Junior Poster

Hi !

I really don't know where to put this thread up, so this might be a misfit.

I was wondering if we could have new forums on DaniWeb, especially for RIA's like Flex, JavaFx etc..

I guess that would help DaniWeb to scale greater heights.

tuse 22 Junior Poster

Yeah that was the problem, the code was not flushing the stream.

I flushed the write stream and it started to work, thanks a lot for your reply.

tuse 22 Junior Poster

Hi!

I am trying to initiate a client-server talk but for some reason it is not working. The server starts running, but when I start the client nothing happens. Please point out the mistake in my code-

Server-

import java.io.*;
import java.net.*;


public class MyServer
{
     public static void main(String[] args) throws Throwable {
            
            //Listen for incoming Connections
         ServerSocket s1=new ServerSocket(12345);
         System.out.println("Server Running");
         Socket s;
		 int i=1;
		 String op;
         while(true)
         {
             s=s1.accept();
			 BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));
			 PrintWriter out=new PrintWriter(s.getOutputStream());
           
		     out.println("Hello Client");
                         
             while(in.readLine()!=null)
			 {
				//Conversation is still on
				op="Arbit Line - Number "+i;
				out.println(op);
				i++;
				if(i==5)
				{
				out.println("Bye");
				break;
				}
			 }
         }
         
       
    }

}

Client-

import java.io.*;
import java.net.*;


public class MyClient
{
     public static void main(String[] args) {
        
         try
         {
             Socket mySocket=new Socket("127.0.0.1",12345);
             
             //If successful, we have the socket running
             
             //Set up read and write
              BufferedReader in=new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
			  PrintWriter out=new PrintWriter(mySocket.getOutputStream());
			  BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));

             String fromServer,fromUser,op;
			 int i=1;
			 
			 while((fromServer = in.readLine()) != null)
			 {
				
				 System.out.println("Server: " + fromServer);
            if (fromServer.equals("Bye."))
                break;

				//Conversation is still on
				 fromUser = stdIn.readLine();
	       if (fromUser != null) {
                System.out.println("Client: " + fromUser);
                out.println(fromUser);

							 }
         }
		 }
         catch(Exception e)
         {
             System.out.println(e.toString());
         }
    }

}
tuse 22 Junior Poster

Or you could see youtube video tutorials by Mike Lively, those are good to get started.

tuse 22 Junior Poster

Thank you for your reply, but I have read that GMail will just strip off whatever is in the head if the email.

Anyways I found a work around by using inline styling.

tuse 22 Junior Poster

Hi!

Sometimes while browsing, suddenly I stop getting sites, but I am able to ping sites. If I reboot, it starts working correctly again.

Here is my HJT log-

Logfile of Trend Micro HijackThis v2.0.2
Scan saved at 15:12:52, on 18-10-2008
Platform: Windows Vista (WinNT 6.00.1904)
MSIE: Internet Explorer v7.00 (7.00.6000.16711)
Boot mode: Normal

Running processes:
C:\Windows\system32\Dwm.exe
C:\Windows\Explorer.EXE
C:\Program Files\Avira\AntiVir PersonalEdition Premium\avgnt.exe
C:\Windows\system32\taskeng.exe
C:\Users\tuse\AppData\Roaming\Google\Google Talk\googletalk.exe
C:\Program Files\DC++\DCPlusPlus.exe
C:\Program Files\Mozilla Firefox\firefox.exe
C:\Program Files\Trend Micro\HijackThis\HijackThis.exe

R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Page = http://go.microsoft.com/fwlink/?LinkId=54896
R0 - HKCU\Software\Microsoft\Internet Explorer\Main,Start Page = http://ie.redirect.hp.com/svs/rdr?TYPE=3&tp=iehome&locale=EN_IN&c=71&bd=Pavilion&pf=laptop
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://ie.redirect.hp.com/svs/rdr?TYPE=3&tp=iehome&locale=EN_IN&c=71&bd=Pavilion&pf=laptop
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Search_URL = http://go.microsoft.com/fwlink/?LinkId=54896
R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Search Page = http://go.microsoft.com/fwlink/?LinkId=54896
R0 - HKLM\Software\Microsoft\Internet Explorer\Main,Start Page = http://ie.redirect.hp.com/svs/rdr?TYPE=3&tp=iehome&locale=EN_IN&c=71&bd=Pavilion&pf=laptop
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,SearchAssistant =
R0 - HKLM\Software\Microsoft\Internet Explorer\Search,CustomizeSearch =
R0 - HKCU\Software\Microsoft\Internet Explorer\Toolbar,LinksFolderName =
O1 - Hosts: :::1 localhost
O2 - BHO: Adobe PDF Reader Link Helper - {06849E9F-C8D7-4D59-B87D-784B7D6BE0B3} - C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\AcroIEHelper.dll
O2 - BHO: BitComet ClickCapture - {39F7E362-828A-4B5A-BCAF-5B79BFDFEA60} - C:\Program Files\BitComet\tools\BitCometBHO.dll
O2 - BHO: Spybot-S&D IE Protection - {53707962-6F74-2D53-2644-206D7942484F} - C:\Program Files\Spybot - Search & Destroy\SDHelper.dll
O2 - BHO: SSVHelper Class - {761497BB-D6F0-462C-B6EB-D4DAF1D92D43} - C:\Program Files\Java\jre1.6.0_03\bin\ssv.dll
O2 - BHO: Google Toolbar Helper - {AA58ED58-01DD-4d91-8333-CF10577473F7} - c:\program files\google\googletoolbar2.dll
O3 - Toolbar: &Google - {2318C2B1-4965-11d4-9B18-009027A5CD4F} - c:\program files\google\googletoolbar2.dll
O4 - HKLM\..\Run: …

tuse 22 Junior Poster

Hi!

How can I include CSS styles in a PHP HTML Email?

This is what I have so far-

<?php


$msg='<html>This is a <em>test</em> message</html>';

mail('a@b.com', 'Test HTML Mail',$msg,"From: Santa Claus <santa@gmail.com>\n" .
    "MIME-Version: 1.0\n" .
    "Content-type: text/html; charset=iso-8859-1");
?>
tuse 22 Junior Poster

Thank you for your reply, jermaghs07

Unfortunately, my HP warranty has expired. I have heard that normal battery life is around 12-18 months after which you would need to get a new one. Isn't that true?

tuse 22 Junior Poster

Maybe you can try something like an automated payroll system?

tuse 22 Junior Poster

Hi all!

I have a HP dv6000 laptop, bought it around 18 months back.

The laptop battery has fallen to 10% of origin capacity.

I'm trying to buy a new battery, but the HP battery costs a bit too high...

Has anybody used a battery on the HP 6000 series which is non-HP?

Is it safe to do this?

tuse 22 Junior Poster

What I can gather from your post is-

1. When you try to connect your computer using wireless, your router is detected. Are the other computers on the network (probably your old computer) also detected? You can try by pinging by the IP of the other computer(s).
Also does your wireless network need authentication? Maybe you did not supply the credentials.

2. When you try and connect using an ethernet cable, no network is detected. Do the lights on the Network card glow when you plug in the ethernet cable? It might just be a faulty cable problem.

Also try connecting by disabling all the firewalls/anti virus programs

tuse 22 Junior Poster

Check your ethernet connected computer, does it also use automatic IP? Or are the IP settings manually entered there?

tuse 22 Junior Poster

try this-

<?php

$name="foo";
$age="bar";
header("Location: print.php?name=".$name."&&age=".$age);

?>
tuse 22 Junior Poster

try this connection string-

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
tuse 22 Junior Poster

Hi!

Just verify these-

Do you have the MySQL Connector installed?

Are you sure your connection string is correct?

tuse 22 Junior Poster

Thanks for your reply.

Thats a really good idea!

tuse 22 Junior Poster

Ok, I googled a bit, I guess I can use the split() function for the purpose.

Thanks for your help!

tuse 22 Junior Poster

Thanks for your reply.

Can you please tell me how to do that?

I'm not well versed with javascript.

tuse 22 Junior Poster

Hi!

I am using a code to echo a row in a database table using ajax with PHP.

The code is working correctly.

The ajax will send the response text as follows-

document.getElementById('outputText').innerHTML = httpObject.responseText;

My question is how can I retrieve individual fields into separate Id's?

tuse 22 Junior Poster

Hi!

I am using a code to echo a row in a database table using ajax.

The code is working correctly.

The ajax will send the response text as follows-

document.getElementById('outputText').innerHTML = httpObject.responseText;

My question is how can I retrieve individual fields into separate Id's?

tuse 22 Junior Poster

No luck with port 2525 either, have disabled my firewall too.

Any other troubleshooting steps?

Thanks a lot for your ideas.

tuse 22 Junior Poster

I guess I've specifically used this-

http://www.systemwebmail.com/faq/3.8.aspx

The server requires authentication.