Jump to content


Check out our Community Blogs

toto_7's Content

There have been 80 items by toto_7 (Search limited from 05-March 20)



Sort by                Order  

#631859 Problem With Css And Firefox

Posted by toto_7 on 16 June 2012 - 01:13 AM in HTML, CSS and Javascript

Hello,

I am relatively new on CSS stuff and for this reason I have some problems in order to make my webpage to looks the same to most browsers. I was testing my web page with use of Google Chrome and looks perfect on it. However, when I have tried to test it to other browsers, Safari was OK as well BUT on Firefox is completely mess! Below I have my CSS file. You can have a look on www.cyprusvenue.com and understand what I mean by mess on Firefox.

Thanks in advance,
toto_7

html, body{
background: #3d4a6a url({T_THEME_PATH}/images/outerbg.gif) top left repeat;
height: 100%;
margin: 0px;
}
.header {
	margin: 35px 80px -20px;
	padding: 0;
float: right;
	min-height: 98px;
	padding-bottom: 5px;
	background: url({T_THEME_PATH}/images/header_g1.png) top left repeat-x;
	background: url({T_THEME_PATH}/images/header_g2.png) top center repeat-y, url({T_THEME_PATH}/images/header_g1.png) top left repeat-x;
}
#wrapper {
min-height: 67%;
width: 0;
}
#page-header {
	clear: both;
	margin: 0 20px;
padding-bottom: 4px;
	min-height: 98px;
	background: url({T_THEME_PATH}/images/hdr_tr.gif) top right no-repeat, url({T_THEME_PATH}/images/hdr_tl.gif) top left no-repeat, url({T_THEME_PATH}/images/hdr_l.gif) top left repeat-y, url({T_THEME_PATH}/images/hdr_r.gif) top right repeat-y, url({T_THEME_PATH}/images/hdr_t.gif) top left repeat-x, #dadada url({T_THEME_PATH}/images/innerbg.gif) top left repeat;
}
#contact{
display: block;
position: relative;
margin: 0px 30px;
}
#logo, #website{
display:block;
position:relative;
float: left;
margin: -15px 30px;
padding:0;
top: 50px;
}
#footer{
text-align: center;
	vertical-align: bottom;
	line-height: 1.3em;
	margin: 0 10px;
	padding: 8px;
	padding-top: 15px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.3);
	background: url({T_THEME_PATH}/images/hdr_br.gif) top right no-repeat, url({T_THEME_PATH}/images/hdr_bl.gif) 0 0 no-repeat, url({T_THEME_PATH}/images/hdr_b.gif) 0 0 repeat-x;
}



#624368 Encrypt large SealedObject

Posted by toto_7 on 20 March 2012 - 03:48 AM in Java

Here is the Exception:
Exception in thread "main" javax.crypto.IllegalBlockSizeException: Data must not be longer than 245 bytes
	at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:337)
	at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:382)
	at javax.crypto.Cipher.doFinal(Cipher.java:2086)
	at javax.crypto.SealedObject.<init>(SealedObject.java:172)
	at AuctionSecurity.encryptMessage(AuctionSecurity.java:71)
	at AuctionImpl.authUser(AuctionImpl.java:91)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
	at sun.rmi.transport.Transport$1.run(Transport.java:177)
	at sun.rmi.transport.Transport$1.run(Transport.java:174)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
	at $Proxy0.authUser(Unknown Source)
	at ClientSeller.main(ClientSeller.java:61)

Here what Server is trying to do:

Key secretKey = ausec.generateDES();
		int rndNum = new Random().nextInt(90000);
		ausec.sendMessage(username);
		SealedObject reply_obj = ausec.encryptMessage(new UserAuthorisation(userRnd, rndNum, secretKey));

and here is my encryption/decryption class:

public void sendMessage(String to) throws IOException, NoSuchAlgorithmException, 
	InvalidKeySpecException{
		File f = new File("keys//"+to+"_public.key");
		FileInputStream fis = new FileInputStream(f);
		byte[] enpubK = new byte[(int)f.length()];
		fis.read(enpubK);
		fis.close();

		KeyFactory keyFactory = KeyFactory.getInstance("RSA");
		X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(enpubK);
		pubkey = keyFactory.generatePublic(publicKeySpec);
	}


public SealedObject encryptMessage(Serializable message) throws InvalidKeyException, NoSuchAlgorithmException, 
	NoSuchPaddingException, IllegalBlockSizeException{
		try{
			Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
			cipher.init(Cipher.ENCRYPT_MODE, pubkey);
			Key secretKey = generateDES();
			SealedObject so;
			so = new SealedObject(secretKey, cipher);
			return so;
		}
		catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

//next decryption

**Please ignore previous version



#624366 Encrypt large SealedObject

Posted by toto_7 on 20 March 2012 - 02:55 AM in Java

Hello,

I'm trying to create a SealedObject that contains a Serializable object and a cipher that initialise with RSA. I want to create a pair of keys for each user, so that's why I'm using RSA. I'm getting an Exception when trying to encrypt this object and I know that the reason is because key's size. My question is how I can create a SealedObject that will contains an Object[] (with two integers and a SecretKey) and encrypt it using user's public key?

Thanks in advance,
toto_7



#624280 Achieve authentication using public keys

Posted by toto_7 on 19 March 2012 - 06:53 AM in Java

wim DC thanks for quick response. I think your answer is not what I'm looking for and that's my fault. My project is based on Java RMI so now I'm trying to implement a kind of security between server and clients. So I'm generating a pair of keys for each and now I'm looking a way to confirm that this client is who



#624271 Achieve authentication using public keys

Posted by toto_7 on 19 March 2012 - 06:05 AM in Java

Hello,

I would like to ask how I can achieve an authentication for user to the server in Java, using user's username.

Thanks in advance,
toto_7



#624159 RMI Security

Posted by toto_7 on 17 March 2012 - 08:14 AM in Java

Hello,

I'm trying to create a simpe auction program with lil bit security. At the moment I have Server side and Client side. Client side splitted to Seller and Buyer. Seller can add new auction, and close an existed, and Buyer to browse auctions and bid on an auction. Until now, I am generating a pair of keys for each (Server, Seller, Buyer) using KeyPairGenerator("RSA"). My problem now is:

I'm trying to send a message from Client to Server to tell it that I want to login or something. I'm looking for a way to encrypt the message using Client's private key and then encrypt this encrypted message and username, using Server's public key. So at the end, Server will receive this encrypted "object", will use it's private key to get client's username and then will retrieve client's public key from the database to decrypt client's message.

I don't know if my problem is clear,

Thanks in advance,
toto_7



#622004 Retrieve values for a complicate XML file

Posted by toto_7 on 16 February 2012 - 04:56 PM in HTML, CSS and Javascript

Hello,

I didn't use XML files for a very long time and I have forgot how to interact with complicate files. Need to retrieve the value of an Element in an XML file that is sitting too deep in that. For example:

I want to retrieve the latitude value that appears here: DirectionsResponse/route/leg/step/start_location/lat. Need to do the same for Longitude and latitude/Longitude for the end_location. "leg" contains more elements but I want just "step". Also, "step" elements are not always the same quantity, so need to check the size of the "leg" or how many "step" contains. I made some tries but all have failed! Please anybody knows how my for loop should be in order to getting correctly all "start_location" and "end_location" from all "step"?


Thanks in advance,
toto_7



#621675 couldn't get connection factory client

Posted by toto_7 on 12 February 2012 - 02:32 PM in Mobile Development

Hello,

I'm new on Android and I'm trying to understand how Maps working. So I'm following this tutorial link but when I'm trying to Run it with emulator doesn't show any map, just empty grid with +/- zoom options. After some search I did, everyone talking for wrong key. So when I tried to generate my key, cmd gave a key with 20 pairs of alphanumeric values. So when I tried to paste it here server said invalid key, please try again. So noticed that other keys were just 16 pairs so remove the last 4 pairs and server accept it. However, now I have this problem with maps. Anyone any idea how to solve it?

Thanks in advance



#620303 Same objects' position on all screen resolutions

Posted by toto_7 on 24 January 2012 - 04:13 PM in HTML, CSS and Javascript

Hi there,

I am wondering how is possible to build up an HTML page and to be sure that the position that your images etc. have to be the same on every resolution. More specific my machine's resolution is 1280 x 800 how I can be 100% sure that the image I have in my code will placed at the same place on every user's screen?

Thanks in advance,
toto_7



#619507 Can't find any logical explanation (JSP online store)

Posted by toto_7 on 14 January 2012 - 05:30 AM in HTML, CSS and Javascript

Hello,

I'm trying to re-work my last year's project about an online store. My project last year was working perfectly on university's labs but now I'm trying to run it on my machine and I have problems. Download and install Tomcat 6.0. My first JSP page loaded and presented fine but when I'm trying to move on to another page that using a JAVA class I have exceptions.

This is the error I have when I'm clicking on link for next page
An error occurred at line: 18 in the generated java file
Only a type can be imported. purchase.PurchaseManager resolves to a package

An error occurred at line: 19 in the generated java file
Only a type can be imported. purchase.Purchases resolves to a package

An error occurred at line: 29 in the jsp file: /Milestones/goodsList.jsp
PurchaseManager cannot be resolved to a type
26: NodeList nodeLogo = (NodeList) resultLogo;
27: String logoPath = nodeLogo.item(0).getTextContent();
28: 
[COLOR="#FF0000"]29[/COLOR]: PurchaseManager purchaseManager = new PurchaseManager("H:\\MadshopUsers\\purchase_"+session.getAttribute("Username")+".obj");
30: %>
31: 
32: <html>


An error occurred at line: 29 in the jsp file: /Milestones/goodsList.jsp
PurchaseManager cannot be resolved to a type
26: NodeList nodeLogo = (NodeList) resultLogo;
27: String logoPath = nodeLogo.item(0).getTextContent();
28: 
[COLOR="#FF0000"]29[/COLOR]: PurchaseManager purchaseManager = new PurchaseManager("H:\\MadshopUsers\\purchase_"+session.getAttribute("Username")+".obj");
30: %>
31: 
32: <html>

Now, when I'm trying to compile those classes, purchaseManager pointing errors where Purchases referred. First compiling the Purchases.java and I don't have problem, but when I'm compiling the purchaseManager.java I have "error:cannot find symbol" on 12 lines inside purchaseManager where Purchases element is created or Vector<Purchases>. At the end when I'm trying to compile them together "javac purchaseManager.java Purchases.java" I have no errors but these warnings,
Note: purchaseManager.java uses unchecked or not safe operations
Note: Recompile with -Xlint:unchecked for details

Can anyone tell me what's going wrong? I'm 100% sure that last year was working.

Thanks in advance,
toto_7

P.S. Tell me if you want and specific part of my code



#618146 Help with a definition

Posted by toto_7 on 26 December 2011 - 05:04 AM in C and C++

Hello,

Merry Christmas everyone.

I know is not the right place for this question, but couldn't find any better place.

Need help with definition for connection-oriented network. Cause my first language is not the English, struggle on this. I understand that connection-oriented is when, in order to transfer data from one point to other, three steps are necessary, establish connection, transfer data, terminate connection. There is any more formal way to describe it or I'm missing something from my above explanation?

Thanks in advance,
toto_7



#616939 Acknowledgement between client/server - C

Posted by toto_7 on 13 December 2011 - 10:34 AM in C and C++

Hello fayyazlodhi ,

Thanks for response. You are right I'm not good on this :( . Basically I have a .c file that contains main method and creates two threads. Client and Server. I have access just on those two files. Those files have three methods each and with a way I have to create a code that when Client request a connection, server answer back if connection established in order to move on or to try again. If connection established client should send three data packets that server should take and answer for each one back to the client, received or not received in order client re-transmit it . At the end when all three packets received from server, client need to send a final ("end") packet that notifying server to close the connection. Server response back that got the data, close the socket and client when received server's confirmation close its socket.

Is more clear now?



#616913 Acknowledgement between client/server - C

Posted by toto_7 on 13 December 2011 - 06:20 AM in C and C++

Hello,

Trying to build a simple client/server program. Until know I achieved, connect client and server, sendto()-client and recvfrom()-server and disconnect them close(socket); My problem now is how I can make those sites to know each other if for example, connection established, server accept the connection or not and client know it and send data or trying to connect again. Here is my code in client -Connection() and server - Accept():

int Connect( char *IPaddress ){
	if((sockt = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1){
		isConnect = -1;
		close(sockt);
		return -1;
	}
	else{
		memset((char *) &servAddr, 0, sizeof(servAddr));
		servAddr.sin_family = AF_INET;
		servAddr.sin_port = htons(PORT);
		inet_aton(IPaddress, &servAddr.sin_addr);
		isConnect = 0;
		byt_read = 0;
		addr_size = sizeof(struct sockaddr);
		
		return 0;
	}
}

int Accept( void ){
	if((sockt = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1){
		isAccept = -1;
		close(sockt);
		return -1;
	}
	else{
		
			memset((char *) &servAddr, 0, sizeof(servAddr));
			servAddr.sin_family = AF_INET;
			servAddr.sin_port = htons(PORT);
			servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
			if (bind(sockt,(struct sockaddr *)&servAddr, sizeof(servAddr)) == -1){
				isAccept = -1;
				close(sockt);
				return -1;
			}
			else{
					isAccept = 0;
					return 0;
				
			}
		
	}
}



#616852 Simple UDP client/server program

Posted by toto_7 on 12 December 2011 - 12:52 PM in C and C++

Hello,

I'm trying to create a simple client/server program using UDP on C. I achieved to connect the client with the server and send and recover the data. My question now is how to disconnect the client from server and how server will wait and handle the closing of the connection? I have two methods, Disconnect() on client and Close() on server. In addition, I have a standard output path that need to follow. For example at the beginning need to have :

[Server] - Waiting for connection...[Client] - Opening connection OK

I don't have this result all the time, basically have random place. For example

[Client] - Opening connection [Server] - Waiting for connection...OK

How can I handle this too?

Thanks in advance,
toto_7



#615987 Struggle with Runnable(AGAIN)

Posted by toto_7 on 04 December 2011 - 05:30 AM in Java

Hello,

I'm having trouble with Runnable :crying: one more time. I have this piece of code in my class:

if(success){
	SwingUtilities.invokeLater(new Runnable() {
	     public void run() {
	           Congratulation congratulation = new Congratulation();
	            congratulation.setVisible(true);
	            /*try {
			Thread.sleep(3000);
			congratulation.dispose();
		       } catch (InterruptedException e) {}*/
        }
});

As it is (Thread.sleep() commented) working fine. But when trying to have 3 sec and after this dispose() my image on congratulation Frame not displayed, :confused: but I can see the Frame that created.

Please help

Thank you,
toto7



#615974 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 07:59 PM in Java

Oh sorry, I thought you were saying something about my last question :)



#615971 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 07:46 PM in Java

Removed, what?



#615969 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 07:41 PM in Java

Is not my code, got it from the tutorial

import java.awt.*;
import javax.swing.*;
import static java.awt.GraphicsDevice.WindowTranslucency.*;

public class TranslucentWindow extends JFrame {
    public TranslucentWindow() {
        super("TranslucentWindow");
        setLayout(new GridBagLayout());

        setSize(300,200);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Add a sample button.
        add(new JButton("I am a Button"));
    }

    public static void main(String[] args) {
        // Determine if the GraphicsDevice supports translucency.
        GraphicsEnvironment ge = 
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice gd = ge.getDefaultScreenDevice();

        //If translucent windows aren't supported, exit.
        if (!gd.isWindowTranslucencySupported(TRANSLUCENT)) {
            System.err.println(
                "Translucency is not supported");
                System.exit(0);
        }

        // Create the GUI on the event-dispatching thread
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                TranslucentWindow tw = new TranslucentWindow();

                // Set the window to 55% opaque (45% translucent).
                tw.setOpacity(0.55f);

                // Display the window.
                tw.setVisible(true);
            }
        });
    }
}


---------- Post added at 03:37 AM ---------- Previous post was at 03:34 AM ----------

****!!! Can't understand why...Restarted, refreshed still nothing...

---------- Post added at 03:41 AM ---------- Previous post was at 03:37 AM ----------

Sorry guys. I think understand what is happening, copy and paste the code in an already exist project, so may that project created with 1.6 . Made new project and is working fine :mad: finally. Sorry again. How I can fix that issue?



#615966 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 07:29 PM in Java

Sure:

For this line
if (!gd.isWindowTranslucencySupported(TRANSLUCENT)) {
TRANSLUCENT cannot be resolved to a variable

For this line
[COLOR="#FF0000"]TranslucentWindow [/COLOR]tw = new [COLOR="#FF0000"]TranslucentWindow[/COLOR]();
TranslucentWindow cannot be resolved to a type



#615962 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 07:17 PM in Java

Very Strange :confused: .. Used your code ttax (Thanks by the way) and told me that switch using String is not compatible with Java under 1.7 . Had as a solution to turn my project to 1.7, did it and fixed. Ran the program and was fine. Now trying with tutorial, and still has the same errors :mad:


*Opened Build Path and I have just this Library "JRE System Library [JavaSE-1.7]"



#615959 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 07:00 PM in Java

Yes I copies and paste the code from tutorial. Well, can you support me with a small piece of code for Java 7, please



#615957 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 06:51 PM in Java

My version is Version: 3.7.1



#615954 Problem with Aero Window

Posted by toto_7 on 03 December 2011 - 06:35 PM in Java

Hello,

I'm trying to create a Frame with Aero vision. Found this linkHow to Create Translucent and Shaped Windows (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features). Also, downloaded the SDK 7. Problem is that Eclipse not recognise lines such as
TranslucentWindow tw = new TranslucentWindow();
underline TranslucentWindow -> "TranslucentWindow cannot be resolved to a type". The same message have it and for this line
if (!gd.isWindowTranslucencySupported([U][COLOR="#FF0000"]TRANSLUCENT[/COLOR][/U])) {
. Inside Eclipse's settings I have 1.7 level for Compiler. Any idea why I have this? Need to do something more? Still Eclipse running SDK 6?

Thank you,
toto7



#615953 Java Components doing whatever they want !

Posted by toto_7 on 03 December 2011 - 06:29 PM in Java

That's great :) Thank you wim DC change to WEST and EAST



#615880 Java Components doing whatever they want !

Posted by toto_7 on 02 December 2011 - 03:39 PM in Java

Hello,

I have really stuck at this point. I have the code below:
mainBoard = new JPanel(new BorderLayout());
board = new JPanel(new BorderLayout());

for(int i=0; i<4; i++){
			
			if(i==0){
				JPanel arrowPanel = new JPanel();
				arrowPanel.setLayout(new FlowLayout());
				for(int k =0; k<4; k++){
					arrows[i][k] = new JCoordButton(up);
					arrows[i][k].setPreferredSize(new Dimension(40,40));
					arrowPanel.add(arrows[i][k]);
				}
				board.add(arrowPanel, BorderLayout.NORTH);
			}
			else if(i==1){
				JPanel	arrowPanel = new JPanel();
				arrowPanel.setLayout(new FlowLayout());
				for(int k =0; k<4; k++){
					arrows[i][k] = new JCoordButton(right);
					arrows[i][k].setPreferredSize(new Dimension(40,40));
					arrowPanel.add(arrows[i][k]);
				}
				board.add(arrowPanel, BorderLayout.PAGE_END);
			}
			else if(i==2){
				JPanel	arrowPanel = new JPanel();
				arrowPanel.setLayout(new FlowLayout());
				for(int k =0; k<4; k++){
					arrows[i][k] = new JCoordButton(down);
					arrows[i][k].setPreferredSize(new Dimension(40,40));
					arrowPanel.add(arrows[i][k]);
				}
				board.add(arrowPanel, BorderLayout.SOUTH);
			}
			else if(i==3){
				JPanel arrowPanel = new JPanel();
				arrowPanel.setLayout(new FlowLayout());
				for(int k =0; k<4; k++){
					arrows[i][k] = new JCoordButton(left);
					arrows[i][k].setPreferredSize(new Dimension(40,40));
					arrowPanel.add(arrows[i][k]);
				}
				board.add(arrowPanel, BorderLayout.PAGE_START);
			}
		}

board.add(colourBoard, BorderLayout.CENTER);
mainBoard.add(board, BorderLayout.CENTER);

The output is as shown below :
Untitled.png

You can imagine from my code that is not the result I want! So, what I'm doing wrong? Any idea?

Thank you,
toto_7




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download