I have a database in data center, which is running MySQL, and I want to change the database from data center to host in my company. At that time, I don't want to stop the data base in the data center, is there anyway to this kind of integeration? Thank you...
I am using JBoss 4.2.
Long stack traces are useless to me most of the time. Is there a way to only show the error message? Can stack traces be disabled or trimmed for normal java programs also?
The windows service I am writing will need to run some processor intensive operations once in a while (sound encoding wav - mp3) on a machine that takes part in real time voice communication (so I cannot just run them any-time).
What would you check (what counters maybe) before running such operation?
Can you point me to any good articles?
I am newer to ejb and hibernate and don't have any idea to how to link or connect those technologies mentioned above.
I have just created individual module for ejb, hibernate and servlet.
but I need to pass the data from servlet to ejb and then ejb to hibernate and store into MySql database.
Problem for me, how to connect ejb to hibernate.
I tried some ways and it couldn't work for me.
Please someone help me.
Thank you
If you're trying to build an application that needs to have the highest possible sustained network bandwidth, for multiple and repetitive file transfers (not for streaming media), will having 2 or more NICs be beneficial?
Hello,
just logged onto http://www.ezsvn.com they host SVN repository. I have a repository which I have been paying monthly for with hundreds of commits.
there support is non existent.
can I get a backup of my repository from my machine ??
I’m using windows
any help is most appreciated
Truegilly
hi all,
I'm trying to understand some of the basics of web servers/html/javasacript etc. I'm not interested in any of the various frameworks like php/asp, i'm just trying to get a low level look at things (for now).
At the moment I'm trying to understand how data can be sent to/saved on the backend, but i must admit that i'm getting a bit lost under the various specs/technical stuff on w3 at the moment!
If I have some data, say xml, that I want to save on the backend how do I go about it?
I assume that I would have to use something like an HTTP PUT or POST Request to an html doc that contains some javascript that in turn would process the data, e.g. save it somewhere. Now from googling around I can see that this doesn't seem to be the case, so my assumptions are completely wrong!
So how is it done? Can it be done, or do I have to use something like php or asp?
TIA.
bg
During a normal browsing session I want to edit a specific javascript file before the browser receives since once it gets there it's impossible to edit. Is there are any tool for this? For what I need it I can't just save it and edit it on my disk.
I'm ready to learn how to program it myself but if anyone can point out more or less what I have to do I'd be very grateful. I'd have to intercept the packets until I have the whole file while blocking the browser from receiving it any part of it, then edit it manually and forward it to the same port.
I don't think I can do this by just using pcap, I've read a bit about scapy but I'm not sure if it can help me either.
Thanks in advance.
I am building a custom master page type control i.e. sort of like a datagrid but should be easier to add custom functionality into it. It's going great but part of the desired functionality is to have a paging control that switches on and off and part of that control would be a textbox that displays the current page number and on TextChanged redirects to the new page of the dataset.
The problem I'm having is that technically the textbox which has its event fired is embedded in a control that is embedded in the control you actually put on the page sort of like
Page
|
Display Control
|
Paging Control
|
Textbox
Buried all the way down there the event is not firing. Worse the postback javascript isn't even being written onto the page (Nothing on the page posts back so far this is the only bit that really needs to).
I've been trawling around Google for quite a while now and picked up that I need to implement INamingContainer (done) and I need to add the control into the page's control tree (is Pre_Init too late for that? When's a good time to Add the Control to the page?) then the event should fire, apparently. But I've been unable to find an example of best practice on this there are quite a few near misses where people are having button angst but this isn't a button.
So can anyone point me in the direction of getting a control embedded in a control embedded in a control added to a page to behave properly?
If someone knew the link of one of my page or simply they made an assumption like http://ww.yourweb.com/index.php, this is a general assumption and if you put this link on DAP or other donwload manager, it will download file, with source code inside.
I want to stop other from stealing my code on this manner, is there a way for this?
I have a table created in drupal with the edit link pointing to the input form. But the problem is, it only displays the last row values in the $email and $comment variables. Can anyone suggest how to modify the table display to have the edit link to the corresponding records?
function _MYMODULE_sql_to_table($sql) {
$html = "";
// execute sql
$resource = db_query($sql);
// fetch database results in an array
$results = array();
while ($row = db_fetch_array($resource)) {
$results[] = $row;
$email = $row['email'];
$comment = $row['comment'];
drupal_set_message('Email: '.$email. ' comment: '.$comment);
}
// ensure results exist
if (!count($results)) {
$html .= "Sorry, no results could be found.";
return $html;
}
// create an array to contain all table rows
$rows = array();
// get a list of column headers
$columnNames = array_keys($results[0]);
// loop through results and create table rows
foreach ($results as $key => $data) {
// create row data
$row = array(
'edit' => l(t('Edit'),"admin/content/test/$email/$comment/ContactUs", $options=array()),);
// loop through column names
foreach ($columnNames as $c) {
$row[] = array(
'data' => $data[$c],
'class' => strtolower(str_replace(' ', '-', $c)),
);
}
// add row to rows array
$rows[] = $row;
}
// loop through column names and create headers
$header = array();
foreach ($columnNames as $c) {
$header[] = array(
'data' = $c,
'class' = strtolower(str_replace(' ', '-', $c)),
);
}
// generate table html
$html .= theme('table', $header, $rows);
return $html;
}
// then you can call it in your code...
function _MYMODULE_some_page_callback() {
$html = "";
$sql = "select * from {contactus}";
$html .= _MYMODULE_sql_to_table($sql);
return $html;
}
what im trying to archive is to load some images from external servers flickr, but i want to re-size the image before rendering, i want to know if there is any way to load that external image check the size and if its too big then with some c# code do the resizing and then send it to the client?
Thx in advance.
I am trying to use Hibernate pagination for my query (PostgreSQL )
i set setFirstResult(0), setMaxResults(20) for my sql query. My code like below:
Session session = getSessionFactory().getCurrentSession();
session.beginTransaction();
Query query = session.createQuery("select id , customer_name , address from tbl_customers ");
query.setFirstResult(0);
query.setMaxResults(20);
List<T> entities = query.list();
session.getTransaction().commit();
but when viewing SQL hibernate log, i still see full sql query:
Hibernate: select customer0_.id as id9_, customer0_.customer_name as dst2_9_, customer0_.addres as dst3_9_ from tbl_customers customer0_
Why there is no LIMIT OFFSET in query of Hibernate pagination SQL log?
Does anyone know about Hibernate pagination mechanism?
I guess that Hibernate will select all data, put data into Resultset, and then paging in Resultset, right?
I have sql query statement which used to display the contents in the table.The sql statement consist of a where clause which is to be appended with numeric value as 1 ,2 3 etc depends upon the previously selected content.I am having the numeric value as int and i want it to append to sql statement which is const char.how can i append both the values.Please help me out.
My query is == select * from Book where id=1;
i have the id value is integer
Thanks.
hello
is there any way that when i user send an email to [email protected] the php script reads the email's information and replay to the user automatically ?
Cheer
I`m currently working with an arduino trying to build an adhoc network to which a device can connect to and send web request to. The problem I am currently having is that I can only set up one connection and then when that connection is terminated (client.stop()) all subsequent connections are not picked up by the server, even a curl command just sits there spinning. The first connection I start when I reset the server works fine and I am able to talk to the server; but after that, the arduino can no longer find new clients (even though it's trying with the library given).
I`m using the sparkfun library for the wifly shield cloned from github, along with an Arduino Uno.
My current code is based off their default example 'WiFly_AdHoc_Example' but I had to remove a few things to get the network to start up which might be the cause of this problem.
Here is the .ino file that I am running.
#include <SPI.h>
#include <WiFly.h>
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial( 5, 4); //Part from example not used(see below)
WiFlyServer server(80);
void setup()
{
Serial.begin(9600);
//The code below is from the example but when I run it the WiFly will hang
// on Wifly.begin(). Without it the WiFly starts up fine but only works for
// one request.
//mySerial.begin(9600);
//WiFly.setUart(&mySerial); // Tell the WiFly library that we are not
//using the SPIUart
Serial.println("**************Starting WiFly**************");
// Enable Adhoc mod
WiFly.begin(true);
Serial.println("WiFly started, creating network.");
if (!WiFly.createAdHocNetwork("wifly"))
{
Serial.print("Failed to create ad hoc network.");
while (1)
{
// Hang on failure.
}
}
Serial.println("Network created");
Serial.print("IP: ");
Serial.println(WiFly.ip());
Serial.println("Starting Server...");
server.begin();
Serial.print("Server started, waiting for client.");
}
void loop()
{
delay(200);
WiFlyClient client = server.available();
if (client)
{
Serial.println("Client Found.");
// a string to store received commands
String current_command = "";
while (client.connected())
{
if (client.available())
{
//Gets a character from the sent request.
char c = client.read();
if (c=='#' || c=='\n') //End of extraneous output
{
current_command = "";
}
else if(c!= '\n')
{
current_command+=c;
}
if (current_command== "get")
{
// output the value of each analog input pin
for (int i = 0; i < 6; i++)
{
client.print("analog input ");
client.print(i);
client.print(" is ");
client.print(analogRead(i));
client.println("<br />");
}
}
else if(current_command== "hello")
{
client.println("Hello there, I'm still here.");
}
else if (current_command== "quit")
{
client.println("Goodbye...");
client.stop();
current_command == "";
break;
}
else if (current_command == "*OPEN*")
{
current_command == "";
}
}
}
// give the web browser time to receive the data
delay(200);
// close the connection
client.stop();
}
}
If anyone understands this better then I (I`m new to arduino) please leave some helpful comments. Or just help me out on getting this little web server up and running so that I can hit it with more then one request.
If there is any other helpful information I can provide please let me know.
Thanks for reading and hope you can help.
EDIT: Using telnet I can successfully connect (the first time) and send commands to the arduino including one to terminate the connection (calls the client.stop() method). But when I try to reconnect though telnet, it says the connection was successful but on the arduino it's still looping thinking the client is still false. WHAT??? I know right, I'm getting mixed messages from telnet vs arduino. None of the commands work obviously since the ardunio is still looping waiting for a client that evaluates to true. I'm gonna take a look at WiFlyServer from the library I imported and see if I can dig up the problem because somehow that server.available() method isn't finding new clients.
Noticing a lot of TODO's in the library code....
EDIT: So I found the reason for the problem, it was in WiFlyServer.cpp file from the sparkfun library. The code that was causing the reconnect issue was infact in the server.availible() method. Right at the top of the method, there is a check:
// TODO: Ensure no active non-server client connection.
if (!WiFly.serverConnectionActive) {
activeClient._port = 0;
}
For some reason when I comment this out, I can reconnect fine and everything works as it should. I will now dive into the library and see if I can fix this, I'm not exactly sure what this is doing but it gets called when the server connection is not active and is somehow blocking subsequent connections. Does anyone have any ideas how I might get to the root of this problem without using this commenting hack? Please help, no-one has commented or answered yet!
Don't you want to join in on the fun???
Sometimes I get the following error (in apache's error.log) when viewing my site over https:
(502)Unknown error 502: proxy: pass request body failed to xxx.xxx.xxx.xxx:443
I'm not entirely sure what this is and why it happens, it's also not consistent.
The request route is:
Browser
Proxy server (apache with mod_proxy + mod_ssl)
Load balancer (aws)
Web server (apache with mod_ssl)
The configuration on the proxy server is as follows:
<VirtualHost *:443>
ProxyRequests Off
ProxyVia On
ServerName www.xxx.co.uk
ServerAlias xxx.co.uk
<Directory proxy:*>
Order deny,allow
Allow from all
</Directory>
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / balancer://cluster:443/ lbmethod=byrequests
ProxyPassReverse / balancer://cluster:443/
ProxyPreserveHost off
SSLProxyEngine On
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /var/www/vhosts/xxx/ssl/www.xxx.co.uk.cert
SSLCertificateKeyFile /var/www/vhosts/xxx/ssl/www.xxx.co.uk.key
<Proxy balancer://cluster>
BalancerMember https://xxx.eu-west-1.elb.amazonaws.com
</Proxy>
</VirtualHost>
Any idea what the issue might be?
I have a machine, which is the Host and has HAProxy installed in it and working. Then I have a Guest KVM virtual machine running inside the Host with an IP 192.168.122.152. I installed an FTP server in the Guest machine with VSFTPD.
From the Host, if I try the command $ ftp -p 192.168.122.152, works perfectly and I can connect to the Guest FTP. I need to remark that this FTP is configured as passive, but both passive and active connections are working from the Host.
This is an extract of part of /etc/vsftpd.conf in the Guest:
# Passive mode
connect_from_port_20=NO
tcp_wrappers=YES
listen_address=192.168.122.152
pasv_enable=YES
pasv_promiscuous=NO
port_enable=YES
port_promiscuous=NO
pasv_max_port=10000
pasv_min_port=10250
Now it's time to make it accessible from outside, so I configure /etc/haproxy/haproxy.cfg like this:
listen FTP_Default *:21
server ftp01 192.168.122.152 check port 21 inter 10s rise 1 fall 2
listen FTP_Range *:10000-10250
server ftp01 192.168.122.152 check port 21 inter 10s rise 1 fall 2
But if I try to connect from other machine in internet $ ftp -p $PUBLICIP, it only responds: Connected to <PUBLICIP>, but it doesn't ask for the login and password.
Something in the HAProxy config must be wrong, because it's the only point where it fails. By the way, I tried to adapt my configuration to this one in this blog.
Thanks.